@@ -484,7 +477,7 @@ describe('Accessibility', function () {
describe('root option', function () {
it('should work a button', async () => {
- const {page} = getTestState();
+ const {page} = await getTestState();
await page.setContent(`
`);
@@ -495,7 +488,7 @@ describe('Accessibility', function () {
});
});
it('should work an input', async () => {
- const {page} = getTestState();
+ const {page} = await getTestState();
await page.setContent(`
`);
@@ -507,7 +500,7 @@ describe('Accessibility', function () {
});
});
it('should work a menu', async () => {
- const {page} = getTestState();
+ const {page} = await getTestState();
await page.setContent(`
@@ -530,7 +523,7 @@ describe('Accessibility', function () {
});
});
it('should return null when the element is no longer in DOM', async () => {
- const {page} = getTestState();
+ const {page} = await getTestState();
await page.setContent(`
My Button `);
const button = (await page.$('button'))!;
@@ -540,7 +533,7 @@ describe('Accessibility', function () {
expect(await page.accessibility.snapshot({root: button})).toEqual(null);
});
it('should support the interestingOnly option', async () => {
- const {page} = getTestState();
+ const {page} = await getTestState();
await page.setContent(`
My Button
`);
const div = (await page.$('div'))!;
diff --git a/test/src/ariaqueryhandler.spec.ts b/test/src/ariaqueryhandler.spec.ts
index 8197e0bec6e..46f65703f17 100644
--- a/test/src/ariaqueryhandler.spec.ts
+++ b/test/src/ariaqueryhandler.spec.ts
@@ -20,26 +20,16 @@ import expect from 'expect';
import {TimeoutError} from 'puppeteer';
import type {ElementHandle} from 'puppeteer-core/internal/api/ElementHandle.js';
-import {
- getTestState,
- setupTestBrowserHooks,
- setupTestPageAndContextHooks,
-} from './mocha-utils.js';
+import {getTestState} from './mocha-utils.js';
import {attachFrame, detachFrame} from './utils.js';
describe('AriaQueryHandler', () => {
- setupTestBrowserHooks();
- setupTestPageAndContextHooks();
-
describe('parseAriaSelector', () => {
- beforeEach(async () => {
- const {page} = getTestState();
+ it('should find button', async () => {
+ const {page} = await getTestState();
await page.setContent(
'
Submit button and some spaces '
);
- });
- it('should find button', async () => {
- const {page} = getTestState();
const expectFound = async (button: ElementHandle | null) => {
assert(button);
const id = await button.evaluate((button: Element) => {
@@ -95,7 +85,7 @@ describe('AriaQueryHandler', () => {
describe('queryOne', () => {
it('should find button by role', async () => {
- const {page} = getTestState();
+ const {page} = await getTestState();
await page.setContent(
'
Submit
'
);
@@ -109,7 +99,7 @@ describe('AriaQueryHandler', () => {
});
it('should find button by name and role', async () => {
- const {page} = getTestState();
+ const {page} = await getTestState();
await page.setContent(
'
Submit
'
);
@@ -123,7 +113,7 @@ describe('AriaQueryHandler', () => {
});
it('should find first matching element', async () => {
- const {page} = getTestState();
+ const {page} = await getTestState();
await page.setContent(
`
@@ -140,7 +130,7 @@ describe('AriaQueryHandler', () => {
});
it('should find by name', async () => {
- const {page} = getTestState();
+ const {page} = await getTestState();
await page.setContent(
`
menu div
@@ -157,7 +147,7 @@ describe('AriaQueryHandler', () => {
});
it('should find by name', async () => {
- const {page} = getTestState();
+ const {page} = await getTestState();
await page.setContent(
`
menu div
@@ -176,7 +166,7 @@ describe('AriaQueryHandler', () => {
describe('queryAll', () => {
it('should find menu by name', async () => {
- const {page} = getTestState();
+ const {page} = await getTestState();
await page.setContent(
`
@@ -200,7 +190,7 @@ describe('AriaQueryHandler', () => {
it('$$eval should handle many elements', async function () {
this.timeout(25_000);
- const {page} = getTestState();
+ const {page} = await getTestState();
await page.setContent('');
await page.evaluate(
`
@@ -226,14 +216,14 @@ describe('AriaQueryHandler', () => {
};
it('should immediately resolve promise if node exists', async () => {
- const {page, server} = getTestState();
+ const {page, server} = await getTestState();
await page.goto(server.EMPTY_PAGE);
await page.evaluate(addElement, 'button');
await page.waitForSelector('aria/[role="button"]');
});
it('should work for ElementHandle.waitForSelector', async () => {
- const {page, server} = getTestState();
+ const {page, server} = await getTestState();
await page.goto(server.EMPTY_PAGE);
await page.evaluate(() => {
return (document.body.innerHTML = `
test
`);
@@ -243,7 +233,7 @@ describe('AriaQueryHandler', () => {
});
it('should persist query handler bindings across reloads', async () => {
- const {page, server} = getTestState();
+ const {page, server} = await getTestState();
await page.goto(server.EMPTY_PAGE);
await page.evaluate(addElement, 'button');
await page.waitForSelector('aria/[role="button"]');
@@ -253,7 +243,7 @@ describe('AriaQueryHandler', () => {
});
it('should persist query handler bindings across navigations', async () => {
- const {page, server} = getTestState();
+ const {page, server} = await getTestState();
// Reset page but make sure that execution context ids start with 1.
await page.goto('data:text/html,');
@@ -269,7 +259,7 @@ describe('AriaQueryHandler', () => {
});
it('should work independently of `exposeFunction`', async () => {
- const {page, server} = getTestState();
+ const {page, server} = await getTestState();
await page.goto(server.EMPTY_PAGE);
await page.exposeFunction('ariaQuerySelector', (a: number, b: number) => {
return a + b;
@@ -281,7 +271,7 @@ describe('AriaQueryHandler', () => {
});
it('should work with removed MutationObserver', async () => {
- const {page} = getTestState();
+ const {page} = await getTestState();
await page.evaluate(() => {
// @ts-expect-error This is the point of the test.
@@ -300,7 +290,7 @@ describe('AriaQueryHandler', () => {
});
it('should resolve promise when node is added', async () => {
- const {page, server} = getTestState();
+ const {page, server} = await getTestState();
await page.goto(server.EMPTY_PAGE);
const frame = page.mainFrame();
@@ -315,7 +305,7 @@ describe('AriaQueryHandler', () => {
});
it('should work when node is added through innerHTML', async () => {
- const {page, server} = getTestState();
+ const {page, server} = await getTestState();
await page.goto(server.EMPTY_PAGE);
const watchdog = page.waitForSelector('aria/name');
@@ -328,7 +318,7 @@ describe('AriaQueryHandler', () => {
});
it('Page.waitForSelector is shortcut for main frame', async () => {
- const {page, server} = getTestState();
+ const {page, server} = await getTestState();
await page.goto(server.EMPTY_PAGE);
await attachFrame(page, 'frame1', server.EMPTY_PAGE);
@@ -341,7 +331,7 @@ describe('AriaQueryHandler', () => {
});
it('should run in specified frame', async () => {
- const {page, server} = getTestState();
+ const {page, server} = await getTestState();
await attachFrame(page, 'frame1', server.EMPTY_PAGE);
await attachFrame(page, 'frame2', server.EMPTY_PAGE);
@@ -357,7 +347,7 @@ describe('AriaQueryHandler', () => {
});
it('should throw when frame is detached', async () => {
- const {page, server} = getTestState();
+ const {page, server} = await getTestState();
await attachFrame(page, 'frame1', server.EMPTY_PAGE);
const frame = page.frames()[1];
@@ -376,7 +366,7 @@ describe('AriaQueryHandler', () => {
});
it('should survive cross-process navigation', async () => {
- const {page, server} = getTestState();
+ const {page, server} = await getTestState();
let imgFound = false;
const waitForSelector = page
@@ -394,7 +384,7 @@ describe('AriaQueryHandler', () => {
});
it('should wait for visible', async () => {
- const {page} = getTestState();
+ const {page} = await getTestState();
let divFound = false;
const waitForSelector = page
@@ -420,7 +410,7 @@ describe('AriaQueryHandler', () => {
});
it('should wait for visible recursively', async () => {
- const {page} = getTestState();
+ const {page} = await getTestState();
let divVisible = false;
const waitForSelector = page
@@ -449,7 +439,7 @@ describe('AriaQueryHandler', () => {
});
it('hidden should wait for visibility: hidden', async () => {
- const {page} = getTestState();
+ const {page} = await getTestState();
let divHidden = false;
await page.setContent(
@@ -475,7 +465,7 @@ describe('AriaQueryHandler', () => {
});
it('hidden should wait for display: none', async () => {
- const {page} = getTestState();
+ const {page} = await getTestState();
let divHidden = false;
await page.setContent(
@@ -501,7 +491,7 @@ describe('AriaQueryHandler', () => {
});
it('hidden should wait for removal', async () => {
- const {page} = getTestState();
+ const {page} = await getTestState();
await page.setContent(`
text
`);
let divRemoved = false;
@@ -523,7 +513,7 @@ describe('AriaQueryHandler', () => {
});
it('should return null if waiting to hide non-existing element', async () => {
- const {page} = getTestState();
+ const {page} = await getTestState();
const handle = await page.waitForSelector('aria/non-existing', {
hidden: true,
@@ -532,7 +522,7 @@ describe('AriaQueryHandler', () => {
});
it('should respect timeout', async () => {
- const {page} = getTestState();
+ const {page} = await getTestState();
const error = await page
.waitForSelector('aria/[role="button"]', {
@@ -548,7 +538,7 @@ describe('AriaQueryHandler', () => {
});
it('should have an error message specifically for awaiting an element to be hidden', async () => {
- const {page} = getTestState();
+ const {page} = await getTestState();
await page.setContent(`
text
`);
const promise = page.waitForSelector('aria/[role="main"]', {
@@ -562,7 +552,7 @@ describe('AriaQueryHandler', () => {
});
it('should respond to node attribute mutation', async () => {
- const {page} = getTestState();
+ const {page} = await getTestState();
let divFound = false;
const waitForSelector = page
@@ -584,7 +574,7 @@ describe('AriaQueryHandler', () => {
});
it('should return the element handle', async () => {
- const {page} = getTestState();
+ const {page} = await getTestState();
const waitForSelector = page.waitForSelector('aria/zombo').catch(err => {
return err;
@@ -598,7 +588,7 @@ describe('AriaQueryHandler', () => {
});
it('should have correct stack trace for timeout', async () => {
- const {page} = getTestState();
+ const {page} = await getTestState();
let error!: Error;
await page.waitForSelector('aria/zombo', {timeout: 10}).catch(error_ => {
@@ -611,9 +601,9 @@ describe('AriaQueryHandler', () => {
});
describe('queryOne (Chromium web test)', () => {
- beforeEach(async () => {
- const {page} = getTestState();
- await page.setContent(
+ async function setupPage(): ReturnType
{
+ const state = await getTestState();
+ await state.page.setContent(
`
title
title
@@ -658,7 +648,8 @@ describe('AriaQueryHandler', () => {
`
);
- });
+ return state;
+ }
const getIds = async (elements: ElementHandle[]) => {
return Promise.all(
elements.map(element => {
@@ -669,25 +660,25 @@ describe('AriaQueryHandler', () => {
);
};
it('should find by name "foo"', async () => {
- const {page} = getTestState();
+ const {page} = await setupPage();
const found = await page.$$('aria/foo');
const ids = await getIds(found);
expect(ids).toEqual(['node3', 'node5', 'node6']);
});
it('should find by name "bar"', async () => {
- const {page} = getTestState();
+ const {page} = await setupPage();
const found = await page.$$('aria/bar');
const ids = await getIds(found);
expect(ids).toEqual(['node1', 'node2', 'node8']);
});
it('should find treeitem by name', async () => {
- const {page} = getTestState();
+ const {page} = await setupPage();
const found = await page.$$('aria/item1 item2 item3');
const ids = await getIds(found);
expect(ids).toEqual(['node30']);
});
it('should find by role "button"', async () => {
- const {page} = getTestState();
+ const {page} = await setupPage();
const found = (await page.$$('aria/[role="button"]')) as Array<
ElementHandle
>;
@@ -702,13 +693,13 @@ describe('AriaQueryHandler', () => {
]);
});
it('should find by role "heading"', async () => {
- const {page} = getTestState();
+ const {page} = await setupPage();
const found = await page.$$('aria/[role="heading"]');
const ids = await getIds(found);
expect(ids).toEqual(['shown', 'hidden', 'node11', 'node13']);
});
it('should find both ignored and unignored', async () => {
- const {page} = getTestState();
+ const {page} = await setupPage();
const found = await page.$$('aria/title');
const ids = await getIds(found);
expect(ids).toEqual(['shown']);
diff --git a/test/src/browser.spec.ts b/test/src/browser.spec.ts
index dd9700bfe5a..26b445b243c 100644
--- a/test/src/browser.spec.ts
+++ b/test/src/browser.spec.ts
@@ -16,14 +16,12 @@
import expect from 'expect';
-import {getTestState, setupTestBrowserHooks} from './mocha-utils.js';
+import {getTestState} from './mocha-utils.js';
describe('Browser specs', function () {
- setupTestBrowserHooks();
-
describe('Browser.version', function () {
it('should return version', async () => {
- const {browser} = getTestState();
+ const {browser} = await getTestState();
const version = await browser.version();
expect(version.length).toBeGreaterThan(0);
@@ -33,7 +31,7 @@ describe('Browser specs', function () {
describe('Browser.userAgent', function () {
it('should include WebKit', async () => {
- const {browser, isChrome} = getTestState();
+ const {browser, isChrome} = await getTestState();
const userAgent = await browser.userAgent();
expect(userAgent.length).toBeGreaterThan(0);
@@ -47,7 +45,7 @@ describe('Browser specs', function () {
describe('Browser.target', function () {
it('should return browser target', async () => {
- const {browser} = getTestState();
+ const {browser} = await getTestState();
const target = browser.target();
expect(target.type()).toBe('browser');
@@ -56,13 +54,13 @@ describe('Browser specs', function () {
describe('Browser.process', function () {
it('should return child_process instance', async () => {
- const {browser} = getTestState();
+ const {browser} = await getTestState();
const process = await browser.process();
expect(process!.pid).toBeGreaterThan(0);
});
it('should not return child_process for remote browser', async () => {
- const {browser, puppeteer} = getTestState();
+ const {browser, puppeteer} = await getTestState();
const browserWSEndpoint = browser.wsEndpoint();
const remoteBrowser = await puppeteer.connect({
@@ -75,7 +73,7 @@ describe('Browser specs', function () {
describe('Browser.isConnected', () => {
it('should set the browser connected state', async () => {
- const {browser, puppeteer} = getTestState();
+ const {browser, puppeteer} = await getTestState();
const browserWSEndpoint = browser.wsEndpoint();
const newBrowser = await puppeteer.connect({
diff --git a/test/src/browsercontext.spec.ts b/test/src/browsercontext.spec.ts
index d17d77457eb..fb4e79ef29d 100644
--- a/test/src/browsercontext.spec.ts
+++ b/test/src/browsercontext.spec.ts
@@ -17,13 +17,14 @@
import expect from 'expect';
import {TimeoutError} from 'puppeteer';
-import {getTestState, setupTestBrowserHooks} from './mocha-utils.js';
+import {getTestState} from './mocha-utils.js';
import {waitEvent} from './utils.js';
describe('BrowserContext', function () {
- setupTestBrowserHooks();
it('should have default context', async () => {
- const {browser} = getTestState();
+ const {browser} = await getTestState({
+ skipContextCreation: true,
+ });
expect(browser.browserContexts()).toHaveLength(1);
const defaultContext = browser.browserContexts()[0]!;
expect(defaultContext!.isIncognito()).toBe(false);
@@ -35,7 +36,9 @@ describe('BrowserContext', function () {
expect(error.message).toContain('cannot be closed');
});
it('should create new incognito context', async () => {
- const {browser} = getTestState();
+ const {browser} = await getTestState({
+ skipContextCreation: true,
+ });
expect(browser.browserContexts()).toHaveLength(1);
const context = await browser.createIncognitoBrowserContext();
@@ -46,7 +49,9 @@ describe('BrowserContext', function () {
expect(browser.browserContexts()).toHaveLength(1);
});
it('should close all belonging targets once closing context', async () => {
- const {browser} = getTestState();
+ const {browser} = await getTestState({
+ skipContextCreation: true,
+ });
expect(await browser.pages()).toHaveLength(1);
@@ -59,10 +64,8 @@ describe('BrowserContext', function () {
expect(await browser.pages()).toHaveLength(1);
});
it('window.open should use parent tab context', async () => {
- const {browser, server} = getTestState();
+ const {browser, server, page, context} = await getTestState();
- const context = await browser.createIncognitoBrowserContext();
- const page = await context.newPage();
await page.goto(server.EMPTY_PAGE);
const [popupTarget] = await Promise.all([
waitEvent(browser, 'targetcreated'),
@@ -71,12 +74,10 @@ describe('BrowserContext', function () {
}, server.EMPTY_PAGE),
]);
expect(popupTarget.browserContext()).toBe(context);
- await context.close();
});
it('should fire target events', async () => {
- const {browser, server} = getTestState();
+ const {server, context} = await getTestState();
- const context = await browser.createIncognitoBrowserContext();
const events: any[] = [];
context.on('targetcreated', target => {
return events.push('CREATED: ' + target.url());
@@ -95,12 +96,10 @@ describe('BrowserContext', function () {
`CHANGED: ${server.EMPTY_PAGE}`,
`DESTROYED: ${server.EMPTY_PAGE}`,
]);
- await context.close();
});
it('should wait for a target', async () => {
- const {browser, server} = getTestState();
+ const {server, context} = await getTestState();
- const context = await browser.createIncognitoBrowserContext();
let resolved = false;
const targetPromise = context.waitForTarget(target => {
@@ -131,11 +130,10 @@ describe('BrowserContext', function () {
throw error;
}
}
- await context.close();
});
it('should timeout waiting for a non-existent target', async () => {
- const {browser, server} = getTestState();
+ const {browser, server} = await getTestState();
const context = await browser.createIncognitoBrowserContext();
const error = await context
@@ -155,7 +153,9 @@ describe('BrowserContext', function () {
});
it('should isolate localStorage and cookies', async () => {
- const {browser, server} = getTestState();
+ const {browser, server} = await getTestState({
+ skipContextCreation: true,
+ });
// Create two incognito contexts.
const context1 = await browser.createIncognitoBrowserContext();
@@ -215,7 +215,9 @@ describe('BrowserContext', function () {
});
it('should work across sessions', async () => {
- const {browser, puppeteer} = getTestState();
+ const {browser, puppeteer} = await getTestState({
+ skipContextCreation: true,
+ });
expect(browser.browserContexts()).toHaveLength(1);
const context = await browser.createIncognitoBrowserContext();
@@ -230,12 +232,15 @@ describe('BrowserContext', function () {
});
it('should provide a context id', async () => {
- const {browser} = getTestState();
+ const {browser} = await getTestState({
+ skipContextCreation: true,
+ });
expect(browser.browserContexts()).toHaveLength(1);
expect(browser.browserContexts()[0]!.id).toBeUndefined();
const context = await browser.createIncognitoBrowserContext();
+ console.log('2');
expect(browser.browserContexts()).toHaveLength(2);
expect(browser.browserContexts()[1]!.id).toBeDefined();
await context.close();
diff --git a/test/src/chromiumonly.spec.ts b/test/src/chromiumonly.spec.ts
index 3831bd727fc..caeecf51fce 100644
--- a/test/src/chromiumonly.spec.ts
+++ b/test/src/chromiumonly.spec.ts
@@ -17,12 +17,7 @@ import {IncomingMessage} from 'http';
import expect from 'expect';
-import {
- getTestState,
- launch,
- setupTestBrowserHooks,
- setupTestPageAndContextHooks,
-} from './mocha-utils.js';
+import {getTestState, launch} from './mocha-utils.js';
import {waitEvent} from './utils.js';
// TODO: rename this test suite to launch/connect test suite as it actually
@@ -30,13 +25,9 @@ import {waitEvent} from './utils.js';
describe('Chromium-Specific Launcher tests', function () {
describe('Puppeteer.launch |browserURL| option', function () {
it('should be able to connect using browserUrl, with and without trailing slash', async () => {
- const {defaultBrowserOptions, puppeteer} = getTestState();
-
- const {close} = await launch(
- Object.assign({}, defaultBrowserOptions, {
- args: ['--remote-debugging-port=21222'],
- })
- );
+ const {close, puppeteer} = await launch({
+ args: ['--remote-debugging-port=21222'],
+ });
try {
const browserURL = 'http://127.0.0.1:21222';
@@ -64,13 +55,9 @@ describe('Chromium-Specific Launcher tests', function () {
}
});
it('should throw when using both browserWSEndpoint and browserURL', async () => {
- const {defaultBrowserOptions, puppeteer} = getTestState();
-
- const {browser, close} = await launch(
- Object.assign({}, defaultBrowserOptions, {
- args: ['--remote-debugging-port=21222'],
- })
- );
+ const {browser, close, puppeteer} = await launch({
+ args: ['--remote-debugging-port=21222'],
+ });
try {
const browserURL = 'http://127.0.0.1:21222';
@@ -91,13 +78,9 @@ describe('Chromium-Specific Launcher tests', function () {
}
});
it('should throw when trying to connect to non-existing browser', async () => {
- const {defaultBrowserOptions, puppeteer} = getTestState();
-
- const {close} = await launch(
- Object.assign({}, defaultBrowserOptions, {
- args: ['--remote-debugging-port=21222'],
- })
- );
+ const {close, puppeteer} = await launch({
+ args: ['--remote-debugging-port=21222'],
+ });
try {
const browserURL = 'http://127.0.0.1:32333';
@@ -116,9 +99,7 @@ describe('Chromium-Specific Launcher tests', function () {
describe('Puppeteer.launch |pipe| option', function () {
it('should support the pipe option', async () => {
- const {defaultBrowserOptions} = getTestState();
- const options = Object.assign({pipe: true}, defaultBrowserOptions);
- const {browser, close} = await launch(options, {createPage: false});
+ const {browser, close} = await launch({pipe: true}, {createPage: false});
try {
expect(await browser.pages()).toHaveLength(1);
expect(browser.wsEndpoint()).toBe('');
@@ -130,7 +111,7 @@ describe('Chromium-Specific Launcher tests', function () {
}
});
it('should support the pipe argument', async () => {
- const {defaultBrowserOptions} = getTestState();
+ const {defaultBrowserOptions} = await getTestState({skipLaunch: true});
const options = Object.assign({}, defaultBrowserOptions);
options.args = ['--remote-debugging-pipe'].concat(options.args || []);
const {browser, close} = await launch(options);
@@ -144,9 +125,7 @@ describe('Chromium-Specific Launcher tests', function () {
}
});
it('should fire "disconnected" when closing with pipe', async () => {
- const {defaultBrowserOptions} = getTestState();
- const options = Object.assign({pipe: true}, defaultBrowserOptions);
- const {browser, close} = await launch(options);
+ const {browser, close} = await launch({pipe: true});
try {
const disconnectedEventPromise = waitEvent(browser, 'disconnected');
// Emulate user exiting browser.
@@ -160,10 +139,8 @@ describe('Chromium-Specific Launcher tests', function () {
});
describe('Chromium-Specific Page Tests', function () {
- setupTestBrowserHooks();
- setupTestPageAndContextHooks();
it('Page.setRequestInterception should work with intervention headers', async () => {
- const {server, page} = getTestState();
+ const {server, page} = await getTestState();
server.setRoute('/intervention', (_req, res) => {
return res.end(`
diff --git a/test/src/click.spec.ts b/test/src/click.spec.ts
index 8e253f30857..fead209e8d2 100644
--- a/test/src/click.spec.ts
+++ b/test/src/click.spec.ts
@@ -17,18 +17,12 @@
import expect from 'expect';
import {KnownDevices} from 'puppeteer';
-import {
- getTestState,
- setupTestBrowserHooks,
- setupTestPageAndContextHooks,
-} from './mocha-utils.js';
+import {getTestState} from './mocha-utils.js';
import {attachFrame} from './utils.js';
describe('Page.click', function () {
- setupTestBrowserHooks();
- setupTestPageAndContextHooks();
it('should click the button', async () => {
- const {page, server} = getTestState();
+ const {page, server} = await getTestState();
await page.goto(server.PREFIX + '/input/button.html');
await page.click('button');
@@ -39,7 +33,7 @@ describe('Page.click', function () {
).toBe('Clicked');
});
it('should click svg', async () => {
- const {page} = getTestState();
+ const {page} = await getTestState();
await page.setContent(`
@@ -54,7 +48,7 @@ describe('Page.click', function () {
).toBe(42);
});
it('should click the button if window.Node is removed', async () => {
- const {page, server} = getTestState();
+ const {page, server} = await getTestState();
await page.goto(server.PREFIX + '/input/button.html');
await page.evaluate(() => {
@@ -70,7 +64,7 @@ describe('Page.click', function () {
});
// @see https://github.com/puppeteer/puppeteer/issues/4281
it('should click on a span with an inline element inside', async () => {
- const {page} = getTestState();
+ const {page} = await getTestState();
await page.setContent(`