test: attempt to unflake inspector tests (#19845)

On headed bots, we might get `locator('body')` from initial mouse
position.
This commit is contained in:
Dmitry Gozman 2023-01-03 16:26:21 -08:00 committed by GitHub
parent 599ae30313
commit f58015281a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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