Skip to content

Commit

Permalink
fixed #4523
Browse files Browse the repository at this point in the history
  • Loading branch information
DavertMik committed Oct 26, 2024
1 parent e3ffa9b commit 04c970b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/helper/Playwright.js
Original file line number Diff line number Diff line change
Expand Up @@ -2843,7 +2843,10 @@ class Playwright extends Helper {
const _contextObject = this.frame ? this.frame : contextObject
let count = 0
do {
waiter = await _contextObject.locator(`:has-text("${text}")`).first().isVisible()
waiter = await _contextObject
.locator(`:has-text(${JSON.stringify(text)})`)
.first()
.isVisible()
if (waiter) break
await this.wait(1)
count += 1000
Expand Down
5 changes: 5 additions & 0 deletions test/helper/webapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -1007,6 +1007,11 @@ module.exports.tests = function () {
await I.waitForText('Dynamic text', 5, '//div[@id="text"]')
})

it('should wait for text with double quotes', async () => {
await I.amOnPage('/')
await I.waitForText('said: "debug!"', 5)
})

it('should throw error when text not found', async () => {
await I.amOnPage('/dynamic')
await I.dontSee('Dynamic text')
Expand Down

0 comments on commit 04c970b

Please sign in to comment.