Skip to content

Commit ba4aa1b

Browse files
author
wwanarif
committed
update
1 parent 9bb8bf9 commit ba4aa1b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/playwright/utils.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ import { expect } from '@playwright/test';
33
export async function waitForStatusText(page: any, selector: string, statusText: string, maxAttempts: number = 5, intervalTimeout: number = 60000) {
44
for (let i = 0; i < maxAttempts; i++) {
55
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+
}
610
await expect(page.locator(selector).first()).toHaveText(statusText, { timeout: intervalTimeout });
711
return;
812
} catch (error) {

0 commit comments

Comments
 (0)