diff --git a/test/TestExpectations.json b/test/TestExpectations.json index 161e1a69406..f4b1e0a780f 100644 --- a/test/TestExpectations.json +++ b/test/TestExpectations.json @@ -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"] } ] diff --git a/test/src/injected.spec.ts b/test/src/injected.spec.ts index e3b60cc4d96..ed89b99ae4a 100644 --- a/test/src/injected.spec.ts +++ b/test/src/injected.spec.ts @@ -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);