Skip to content

Commit 292a788

Browse files
author
DavertMik
committed
fixed retries for PW waitForText test
1 parent 6c88758 commit 292a788

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/helper/Playwright.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2796,12 +2796,14 @@ class Playwright extends Helper {
27962796
}),
27972797
this.page.waitForFunction(text => document.body && document.body.innerText.indexOf(text) > -1, text, { timeout: timeoutGap }),
27982798
promiseRetry(
2799-
async () =>
2800-
contextObject
2799+
async retry => {
2800+
const textPresent = await contextObject
28012801
.locator(`:has-text(${JSON.stringify(text)})`)
28022802
.first()
2803-
.isVisible(),
2804-
{ retries: timeoutGap / 500, minTimeout: 500, factor: 1 },
2803+
.isVisible()
2804+
if (!textPresent) retry(errorMessage)
2805+
},
2806+
{ retries: 1000, minTimeout: 500, maxTimeout: 500, factor: 1 },
28052807
),
28062808
])
28072809
}

0 commit comments

Comments
 (0)