We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9bb8bf9 commit ba4aa1bCopy full SHA for ba4aa1b
tests/playwright/utils.ts
@@ -3,6 +3,10 @@ import { expect } from '@playwright/test';
3
export async function waitForStatusText(page: any, selector: string, statusText: string, maxAttempts: number = 5, intervalTimeout: number = 60000) {
4
for (let i = 0; i < maxAttempts; i++) {
5
try {
6
+ const text = await page.locator(selector).first().innerText();
7
+ if (text === 'Error') {
8
+ throw new Error(`Encountered unwanted status text "Error" in element "${selector}"`);
9
+ }
10
await expect(page.locator(selector).first()).toHaveText(statusText, { timeout: intervalTimeout });
11
return;
12
} catch (error) {
0 commit comments