chore: enable PuppeteerUtil test for BiDi (#10686)

This commit is contained in:
Nikolay Vitkov 2023-08-04 13:02:30 +02:00 committed by GitHub
parent 64a3b04b7a
commit 4a0a2bb2db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -3964,5 +3964,11 @@
"platforms": ["darwin", "linux", "win32"],
"parameters": ["cdp", "chrome", "headless"],
"expectations": ["FAIL", "PASS"]
},
{
"testIdPattern": "[injected.spec] PuppeteerUtil tests *",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"],
"expectations": ["PASS"]
}
]

View File

@ -15,7 +15,6 @@
*/
import expect from 'expect';
import {PUPPETEER_WORLD} from 'puppeteer-core/internal/common/IsolatedWorlds.js';
import {LazyArg} from 'puppeteer-core/internal/common/LazyArg.js';
import {getTestState, setupTestBrowserHooks} from './mocha-utils.js';
@ -26,7 +25,7 @@ describe('PuppeteerUtil tests', function () {
it('should work', async () => {
const {page} = await getTestState();
const world = page.mainFrame().worlds[PUPPETEER_WORLD];
const world = page.mainFrame().isolatedRealm();
const value = await world.evaluate(
PuppeteerUtil => {
return typeof PuppeteerUtil === 'object';
@ -42,7 +41,7 @@ describe('PuppeteerUtil tests', function () {
it('should work', async () => {
const {page} = await getTestState();
const world = page.mainFrame().worlds[PUPPETEER_WORLD];
const world = page.mainFrame().isolatedRealm();
const value = await world.evaluate(
({createFunction}, fnString) => {
return createFunction(fnString)(4);