diff --git a/tests/library/inspector/pause.spec.ts b/tests/library/inspector/pause.spec.ts
index b287c1acdf..3ced5dfa78 100644
--- a/tests/library/inspector/pause.spec.ts
+++ b/tests/library/inspector/pause.spec.ts
@@ -415,29 +415,19 @@ it.describe('pause', () => {
});
it('should highlight locators with custom testId', async ({ page, playwright, recorderPageGetter }) => {
- await page.setContent('
click me
and me
');
+ await page.setContent('and me
');
const scriptPromise = (async () => {
await page.pause();
- await page.getByText('click me').click();
playwright.selectors.setTestIdAttribute('data-custom-id');
await page.getByTestId('foo').click();
})();
const recorderPage = await recorderPageGetter();
+ const box1Promise = waitForTestLog(page, 'Highlight box for test: ');
await recorderPage.click('[title="Step over (F10)"]');
- const div1Box1 = roundBox(await page.locator('x-pw-highlight').boundingBox());
- const div1Box2 = roundBox(await page.locator('#target1').boundingBox());
- expect(div1Box1).toEqual(div1Box2);
-
- await recorderPage.click('[title="Step over (F10)"]');
- let div2Box1: Box;
- await expect.poll(async () => {
- div2Box1 = await page.locator('x-pw-highlight').boundingBox();
- return div2Box1;
- }).toBeTruthy();
- div2Box1 = roundBox(div2Box1);
- const div2Box2 = roundBox(await page.locator('#target2').boundingBox());
- expect(div2Box1).toEqual(div2Box2);
+ const box2 = roundBox(await page.locator('#target').boundingBox());
+ const box1 = roundBox(await box1Promise);
+ expect(box1).toEqual(box2);
await recorderPage.click('[title="Resume (F8)"]');
await scriptPromise;