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 codegen tests waiting for highlight (#18518)

Dmitry Gozman20f2e0049cb0
diff --git a/tests/library/inspector/inspectorTest.ts b/tests/library/inspector/inspectorTest.ts
index 94ebd16dc2..d6577b1594 100644
--- a/tests/library/inspector/inspectorTest.ts
+++ b/tests/library/inspector/inspectorTest.ts
@@ -149,6 +149,8 @@ class Recorder {
}
async waitForHighlight(action: () => Promise<void>): Promise<string> {
+ await this.page.$$eval('x-pw-highlight', els => els.forEach(e => e.remove()));
+ await this.page.$$eval('x-pw-tooltip', els => els.forEach(e => e.remove()));
await action();
await this.page.locator('x-pw-highlight').waitFor();
await this.page.locator('x-pw-tooltip').waitFor();