Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

test: unflake html reporter test that uses non-strict locator (#38049)

Dmitry Gozman7856af490f67
diff --git a/tests/playwright-test/reporter-html.spec.ts b/tests/playwright-test/reporter-html.spec.ts
index aeedd14124..18492a4d52 100644
--- a/tests/playwright-test/reporter-html.spec.ts
+++ b/tests/playwright-test/reporter-html.spec.ts
@@ -739,7 +739,7 @@ for (const useIntermediateMergeReport of [true, false] as const) {
await test.step('view via server', async () => {
await showReport();
await page.getByRole('link', { name: 'View Trace' }).click();
- await expect(page.locator('dialog')).toBeHidden();
+ await expect(page.locator('#fallback-error')).toBeHidden();
});
await test.step('view via local file://', async () => {
@@ -747,7 +747,7 @@ for (const useIntermediateMergeReport of [true, false] as const) {
await page.goto(url.pathToFileURL(path.join(reportFolder, 'index.html')).toString());
await page.getByRole('link', { name: 'View Trace' }).click();
await expect(page.locator('dialog')).toBeVisible();
- await expect(page.locator('dialog')).toContainText('must be loaded over');
+ await expect(page.locator('#fallback-error')).toContainText('must be loaded over');
});
});