File tree 2 files changed +9
-1
lines changed
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -2843,7 +2843,10 @@ class Playwright extends Helper {
2843
2843
const _contextObject = this . frame ? this . frame : contextObject
2844
2844
let count = 0
2845
2845
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 ( )
2847
2850
if ( waiter ) break
2848
2851
await this . wait ( 1 )
2849
2852
count += 1000
Original file line number Diff line number Diff line change @@ -1007,6 +1007,11 @@ module.exports.tests = function () {
1007
1007
await I . waitForText ( 'Dynamic text' , 5 , '//div[@id="text"]' )
1008
1008
} )
1009
1009
1010
+ it ( 'should wait for text with double quotes' , async ( ) => {
1011
+ await I . amOnPage ( '/' )
1012
+ await I . waitForText ( 'said: "debug!"' , 5 )
1013
+ } )
1014
+
1010
1015
it ( 'should throw error when text not found' , async ( ) => {
1011
1016
await I . amOnPage ( '/dynamic' )
1012
1017
await I . dontSee ( 'Dynamic text' )
You can’t perform that action at this time.
0 commit comments