test: fix headless-shell tests

This commit is contained in:
Max Schmitt 2024-10-29 16:18:11 +01:00
parent 0221f15f4f
commit e91c041b79
2 changed files with 5 additions and 4 deletions

View file

@ -169,8 +169,9 @@ for (const kind of ['launchServer', 'run-server'] as const) {
await browser.close();
});
test('should ignore page.pause when headed', async ({ connect, startRemoteServer, browserType }) => {
const headless = (browserType as any)._defaultLaunchOptions.headless;
test('should ignore page.pause when headed', async ({ connect, startRemoteServer, browserType, headless }) => {
test.skip(headless, 'This test is only relevant in headed mode');
const originalHeadlessValue = (browserType as any)._defaultLaunchOptions.headless;
(browserType as any)._defaultLaunchOptions.headless = false;
const remoteServer = await startRemoteServer(kind);
const browser = await connect(remoteServer.wsEndpoint());
@ -178,7 +179,7 @@ for (const kind of ['launchServer', 'run-server'] as const) {
const page = await browserContext.newPage();
await page.pause();
await browser.close();
(browserType as any)._defaultLaunchOptions.headless = headless;
(browserType as any)._defaultLaunchOptions.headless = originalHeadlessValue;
});
test('should be able to visit ipv6 through localhost', async ({ connect, startRemoteServer, ipV6ServerPort }) => {

View file

@ -235,7 +235,7 @@ it('should click a button when it overlays oopif', async function({ page, browse
it('should report google.com frame with headed', async ({ browserType, server }) => {
// @see https://github.com/GoogleChrome/puppeteer/issues/2548
// https://google.com is isolated by default in Chromium embedder.
const browser = await browserType.launch({ headless: false });
const browser = await browserType.launch();
const page = await browser.newPage();
await page.goto(server.EMPTY_PAGE);
await page.route('**/*', route => {