test: fix console-api tests when tracing was enabled (#10782)

This commit is contained in:
Max Schmitt 2021-12-08 15:44:07 -08:00 committed by GitHub
parent 05719dc24d
commit a4e68dbac1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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<string, HTMLBodyElement>((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('<div>Hello<div>');
const handle = await page.evaluateHandle(`playwright.locator('div').withText('Hello').element`);
expect(handle.toString()).toBe('JSHandle@node');
expect(await handle.evaluate<string, HTMLDivElement>((node: HTMLDivElement) => node.nodeName)).toBe('DIV');
});
it('should support playwright.locator.values', async ({ page }) => {