test: fix headless-shell tests
This commit is contained in:
parent
0221f15f4f
commit
e91c041b79
|
|
@ -169,8 +169,9 @@ for (const kind of ['launchServer', 'run-server'] as const) {
|
||||||
await browser.close();
|
await browser.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should ignore page.pause when headed', async ({ connect, startRemoteServer, browserType }) => {
|
test('should ignore page.pause when headed', async ({ connect, startRemoteServer, browserType, headless }) => {
|
||||||
const headless = (browserType as any)._defaultLaunchOptions.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;
|
(browserType as any)._defaultLaunchOptions.headless = false;
|
||||||
const remoteServer = await startRemoteServer(kind);
|
const remoteServer = await startRemoteServer(kind);
|
||||||
const browser = await connect(remoteServer.wsEndpoint());
|
const browser = await connect(remoteServer.wsEndpoint());
|
||||||
|
|
@ -178,7 +179,7 @@ for (const kind of ['launchServer', 'run-server'] as const) {
|
||||||
const page = await browserContext.newPage();
|
const page = await browserContext.newPage();
|
||||||
await page.pause();
|
await page.pause();
|
||||||
await browser.close();
|
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 }) => {
|
test('should be able to visit ipv6 through localhost', async ({ connect, startRemoteServer, ipV6ServerPort }) => {
|
||||||
|
|
|
||||||
|
|
@ -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 }) => {
|
it('should report google.com frame with headed', async ({ browserType, server }) => {
|
||||||
// @see https://github.com/GoogleChrome/puppeteer/issues/2548
|
// @see https://github.com/GoogleChrome/puppeteer/issues/2548
|
||||||
// https://google.com is isolated by default in Chromium embedder.
|
// 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();
|
const page = await browser.newPage();
|
||||||
await page.goto(server.EMPTY_PAGE);
|
await page.goto(server.EMPTY_PAGE);
|
||||||
await page.route('**/*', route => {
|
await page.route('**/*', route => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue