Skip to content

Commit e21abea

Browse files
authored
fixed #4523 (#4528)
1 parent 0b517f3 commit e21abea

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

lib/helper/Playwright.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -2843,7 +2843,10 @@ class Playwright extends Helper {
28432843
const _contextObject = this.frame ? this.frame : contextObject
28442844
let count = 0
28452845
do {
2846-
waiter = await _contextObject.locator(`:has-text("${text}")`).first().isVisible()
2846+
waiter = await _contextObject
2847+
.locator(`:has-text(${JSON.stringify(text)})`)
2848+
.first()
2849+
.isVisible()
28472850
if (waiter) break
28482851
await this.wait(1)
28492852
count += 1000

test/helper/webapi.js

+5
Original file line numberDiff line numberDiff line change
@@ -1007,6 +1007,11 @@ module.exports.tests = function () {
10071007
await I.waitForText('Dynamic text', 5, '//div[@id="text"]')
10081008
})
10091009

1010+
it('should wait for text with double quotes', async () => {
1011+
await I.amOnPage('/')
1012+
await I.waitForText('said: "debug!"', 5)
1013+
})
1014+
10101015
it('should throw error when text not found', async () => {
10111016
await I.amOnPage('/dynamic')
10121017
await I.dontSee('Dynamic text')

0 commit comments

Comments
 (0)