Skip to content

Commit

Permalink
fix: failed acceptance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kobenguyent committed Sep 30, 2023
1 parent 9a2e3ba commit d067ae7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/helper/Playwright.js
Original file line number Diff line number Diff line change
Expand Up @@ -2481,6 +2481,14 @@ class Playwright extends Helper {
}, [locator.value, text, $XPath.toString()], { timeout: waitTimeout });
}
} else {
// we have this as https://github.com/microsoft/playwright/issues/26829 is not yet implemented
if (this.frame) {
const { setTimeout } = require('timers/promises');
await setTimeout(waitTimeout);
waiter = await this.frame.locator(`:has-text('${text}')`).first().isVisible();
if (!waiter) throw new Error(`Text "${text}" was not found on page after ${waitTimeout / 1000} sec`);
return;
}
waiter = contextObject.waitForFunction(text => document.body && document.body.innerText.indexOf(text) > -1, text, { timeout: waitTimeout });
}
return waiter.catch((err) => {
Expand Down

0 comments on commit d067ae7

Please sign in to comment.