From 20f2e0049cb0c13823f360c0b972ee440ff295f7 Mon Sep 17 00:00:00 2001 From: Dmitry Gozman Date: Wed, 2 Nov 2022 17:00:33 -0700 Subject: [PATCH] test: unflake codegen tests waiting for highlight (#18518) Clear existing highlights to avoid resolving with the old highlight value. --- tests/library/inspector/inspectorTest.ts | 2 ++ 1 file changed, 2 insertions(+) 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): Promise { + 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();