Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading