diff --git a/tests/inspector/console-api.spec.ts b/tests/inspector/console-api.spec.ts index 02148a43de..1e04ad4897 100644 --- a/tests/inspector/console-api.spec.ts +++ b/tests/inspector/console-api.spec.ts @@ -36,7 +36,7 @@ it.afterEach(async ({ recorderPageGetter }) => { it('should support playwright.$, playwright.$$', async ({ page }) => { const body = await page.evaluateHandle('playwright.$("body")'); - expect(body.toString()).toBe('JSHandle@node'); + expect(await body.evaluate((node: HTMLBodyElement) => node.nodeName)).toBe('BODY'); const length = await page.evaluate('playwright.$$("body").length'); expect(length).toBe(1); }); @@ -49,7 +49,7 @@ it('should support playwright.selector', async ({ page }) => { it('should support playwright.locator.value', async ({ page }) => { await page.setContent('
Hello
'); const handle = await page.evaluateHandle(`playwright.locator('div').withText('Hello').element`); - expect(handle.toString()).toBe('JSHandle@node'); + expect(await handle.evaluate((node: HTMLDivElement) => node.nodeName)).toBe('DIV'); }); it('should support playwright.locator.values', async ({ page }) => {