test: unflake codegen tests waiting for highlight (#18518)

Clear existing highlights to avoid resolving with the old highlight
value.
This commit is contained in:
Dmitry Gozman 2022-11-02 17:00:33 -07:00 committed by GitHub
parent c3cff485d1
commit 20f2e0049c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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();