From f58015281abdcd0f55212c5892fa667e3ad603ec Mon Sep 17 00:00:00 2001 From: Dmitry Gozman Date: Tue, 3 Jan 2023 16:26:21 -0800 Subject: [PATCH] test: attempt to unflake inspector tests (#19845) On headed bots, we might get `locator('body')` from initial mouse position. --- tests/library/inspector/inspectorTest.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/library/inspector/inspectorTest.ts b/tests/library/inspector/inspectorTest.ts index 62cd6b51dd..0b12686468 100644 --- a/tests/library/inspector/inspectorTest.ts +++ b/tests/library/inspector/inspectorTest.ts @@ -19,6 +19,7 @@ import type { Page } from 'playwright-core'; import * as path from 'path'; import type { Source } from '../../../packages/recorder/src/recorderTypes'; import type { CommonFixtures, TestChildProcess } from '../../config/commonFixtures'; +import { expect } from '@playwright/test'; export { expect } from '@playwright/test'; type CLITestArgs = { @@ -154,6 +155,8 @@ class Recorder { await action(); await this.page.locator('x-pw-highlight').waitFor(); await this.page.locator('x-pw-tooltip').waitFor(); + await expect(this.page.locator('x-pw-tooltip')).not.toHaveText(''); + await expect(this.page.locator('x-pw-tooltip')).not.toHaveText(`locator('body')`); return this.page.locator('x-pw-tooltip').textContent(); }