diff --git a/tests/library/browsercontext-credentials.spec.ts b/tests/library/browsercontext-credentials.spec.ts index 4471badfa9..c061ffb067 100644 --- a/tests/library/browsercontext-credentials.spec.ts +++ b/tests/library/browsercontext-credentials.spec.ts @@ -15,33 +15,26 @@ * limitations under the License. */ -import { browserTest as base, expect } from '../config/browserTest'; +import { browserTest as it, expect } from '../config/browserTest'; -const it = base.extend<{ isChromiumHeadedLike: boolean }>({ - isChromiumHeadedLike: async ({ browserName, headless, channel }, use) => { - const isChromiumHeadedLike = browserName === 'chromium' && ((headless && channel !== 'chromium-headless-shell') || !headless); - await use(isChromiumHeadedLike); - }, -}); - -it('should fail without credentials', async ({ browser, server, isChromiumHeadedLike }) => { +it('should fail without credentials', async ({ browser, server, browserName, channel }) => { server.setAuth('/empty.html', 'user', 'pass'); const context = await browser.newContext(); const page = await context.newPage(); const responseOrError = await page.goto(server.EMPTY_PAGE).catch(e => e); - if (isChromiumHeadedLike) + if (browserName === 'chromium' && channel !== 'chromium-headless-shell') expect(responseOrError.message).toContain('net::ERR_INVALID_AUTH_CREDENTIALS'); else expect(responseOrError.status()).toBe(401); }); -it('should work with setHTTPCredentials', async ({ browser, server, isChromiumHeadedLike }) => { +it('should work with setHTTPCredentials', async ({ browser, server, browserName, channel }) => { server.setAuth('/empty.html', 'user', 'pass'); const context = await browser.newContext(); const page = await context.newPage(); let responseOrError = await page.goto(server.EMPTY_PAGE).catch(e => e); - if (isChromiumHeadedLike) + if (browserName === 'chromium' && channel !== 'chromium-headless-shell') expect(responseOrError.message).toContain('net::ERR_INVALID_AUTH_CREDENTIALS'); else expect(responseOrError.status()).toBe(401); @@ -109,21 +102,21 @@ it('should work with correct credentials and matching origin case insensitive', await context.close(); }); -it('should fail with correct credentials and mismatching scheme', async ({ browser, server, isChromiumHeadedLike }) => { +it('should fail with correct credentials and mismatching scheme', async ({ browser, server, browserName, channel }) => { server.setAuth('/empty.html', 'user', 'pass'); const context = await browser.newContext({ httpCredentials: { username: 'user', password: 'pass', origin: server.PREFIX.replace('http://', 'https://') } }); const page = await context.newPage(); const responseOrError = await page.goto(server.EMPTY_PAGE).catch(e => e); - if (isChromiumHeadedLike) + if (browserName === 'chromium' && channel !== 'chromium-headless-shell') expect(responseOrError.message).toContain('net::ERR_INVALID_AUTH_CREDENTIALS'); else expect(responseOrError.status()).toBe(401); await context.close(); }); -it('should fail with correct credentials and mismatching hostname', async ({ browser, server, isChromiumHeadedLike }) => { +it('should fail with correct credentials and mismatching hostname', async ({ browser, server, browserName, channel }) => { server.setAuth('/empty.html', 'user', 'pass'); const hostname = new URL(server.PREFIX).hostname; const origin = server.PREFIX.replace(hostname, 'mismatching-hostname'); @@ -132,14 +125,14 @@ it('should fail with correct credentials and mismatching hostname', async ({ bro }); const page = await context.newPage(); const responseOrError = await page.goto(server.EMPTY_PAGE).catch(e => e); - if (isChromiumHeadedLike) + if (browserName === 'chromium' && channel !== 'chromium-headless-shell') expect(responseOrError.message).toContain('net::ERR_INVALID_AUTH_CREDENTIALS'); else expect(responseOrError.status()).toBe(401); await context.close(); }); -it('should fail with correct credentials and mismatching port', async ({ browser, server, isChromiumHeadedLike }) => { +it('should fail with correct credentials and mismatching port', async ({ browser, server, browserName, channel }) => { server.setAuth('/empty.html', 'user', 'pass'); const origin = server.PREFIX.replace(server.PORT.toString(), (server.PORT + 1).toString()); const context = await browser.newContext({ @@ -147,7 +140,7 @@ it('should fail with correct credentials and mismatching port', async ({ browser }); const page = await context.newPage(); const responseOrError = await page.goto(server.EMPTY_PAGE).catch(e => e); - if (isChromiumHeadedLike) + if (browserName === 'chromium' && channel !== 'chromium-headless-shell') expect(responseOrError.message).toContain('net::ERR_INVALID_AUTH_CREDENTIALS'); else expect(responseOrError.status()).toBe(401); diff --git a/tests/library/download.spec.ts b/tests/library/download.spec.ts index 94f61cbe8c..791aa5f6d5 100644 --- a/tests/library/download.spec.ts +++ b/tests/library/download.spec.ts @@ -637,7 +637,7 @@ it('should be able to download a inline PDF file via response interception', asy }); it('should be able to download a inline PDF file via navigation', async ({ browser, server, asset, browserName, channel }) => { - it.fixme(browserName === 'chromium' && channel !== 'chromium-headless-shell'); + it.skip(browserName === 'chromium' && channel !== 'chromium-headless-shell'); const page = await browser.newPage(); await page.goto(server.EMPTY_PAGE); await page.setContent(` diff --git a/tests/library/permissions.spec.ts b/tests/library/permissions.spec.ts index 3c4855b930..7da179b2e6 100644 --- a/tests/library/permissions.spec.ts +++ b/tests/library/permissions.spec.ts @@ -150,15 +150,14 @@ it('should support clipboard read', async ({ page, context, server, browserName, it.fail(browserName === 'firefox', 'No such permissions (requires flag) in Firefox'); it.fixme(browserName === 'webkit' && isWindows, 'WebPasteboardProxy::allPasteboardItemInfo not implemented for Windows.'); it.fixme(browserName === 'webkit' && isLinux && headless, 'WebPasteboardProxy::allPasteboardItemInfo not implemented for WPE.'); - const isChromiumHeadedLike = browserName === 'chromium' && channel !== 'chromium-headless-shell'; await page.goto(server.EMPTY_PAGE); // There is no 'clipboard-read' permission in WebKit Web API. if (browserName !== 'webkit') expect(await getPermission(page, 'clipboard-read')).toBe('prompt'); - if (!isChromiumHeadedLike) { - // Headed Chromium shows a dialog and does not resolve the promise. + if (browserName === 'chromium' && channel !== 'chromium-headless-shell') { + // Chromium shows a dialog and does not resolve the promise. const error = await page.evaluate(() => navigator.clipboard.readText()).catch(e => e); expect(error.toString()).toContain('denied'); } diff --git a/tests/library/playwright.config.ts b/tests/library/playwright.config.ts index 79d1f5c7a1..399eec1b6b 100644 --- a/tests/library/playwright.config.ts +++ b/tests/library/playwright.config.ts @@ -126,11 +126,7 @@ for (const browserName of browserNames) { metadata: { platform: process.platform, docker: !!process.env.INSIDE_DOCKER, - headless: (() => { - if (headed) - return 'headed'; - return 'headless'; - })(), + headless: headed ? 'headed' : 'headless', browserName, channel, mode, diff --git a/tests/library/tracing.spec.ts b/tests/library/tracing.spec.ts index 6acd778464..b13ed1b84a 100644 --- a/tests/library/tracing.spec.ts +++ b/tests/library/tracing.spec.ts @@ -409,7 +409,7 @@ for (const params of [ ]) { browserTest(`should produce screencast frames ${params.id}`, async ({ video, contextFactory, browserName, platform, headless, channel }, testInfo) => { browserTest.skip(browserName === 'chromium' && video === 'on', 'Same screencast resolution conflicts'); - browserTest.fixme(browserName === 'chromium' && channel !== 'chromium-headless-shell', 'Chromium screencast on headed has a min width issue'); + browserTest.fixme(browserName === 'chromium' && channel !== 'chromium-headless-shell', 'Chromium screencast has a min width issue'); browserTest.fixme(params.id === 'fit' && browserName === 'chromium' && platform === 'darwin', 'High DPI maxes image at 600x600'); browserTest.fixme(params.id === 'fit' && browserName === 'webkit' && platform === 'linux', 'Image size is flaky'); browserTest.fixme(browserName === 'firefox' && !headless, 'Image size is different'); diff --git a/tests/library/video.spec.ts b/tests/library/video.spec.ts index 54b3fcfaa8..c6b8de24fb 100644 --- a/tests/library/video.spec.ts +++ b/tests/library/video.spec.ts @@ -474,8 +474,8 @@ it.describe('screencast', () => { }); it('should scale frames down to the requested size ', async ({ browser, browserName, server, headless, channel }, testInfo) => { - const isChromiumHeadlessNew = browserName === 'chromium' && channel !== 'chromium-headless-shell'; - it.fixme(!headless || isChromiumHeadlessNew, 'Fails on headed'); + it.fixme(!headless, 'Fails on headed'); + it.fixme(browserName === 'chromium' && channel !== 'chromium-headless-shell', 'Fails on Chromiums'); const context = await browser.newContext({ recordVideo: { @@ -796,8 +796,8 @@ it.describe('screencast', () => { it('should work with video+trace', async ({ browser, trace, headless, browserName, channel }, testInfo) => { it.skip(trace === 'on'); - const isChromiumHeadlessNew = browserName === 'chromium' && channel !== 'chromium-headless-shell'; - it.fixme(!headless || isChromiumHeadlessNew, 'different trace screencast image size on all browsers'); + it.fixme(!headless, 'different trace screencast image size on all browsers'); + it.fixme(browserName === 'chromium' && channel !== 'chromium-headless-shell', 'different trace screencast image size on Chromium'); const size = { width: 500, height: 400 }; const traceFile = testInfo.outputPath('trace.zip'); diff --git a/tests/page/page-focus.spec.ts b/tests/page/page-focus.spec.ts index dd3883c210..67e3e883b4 100644 --- a/tests/page/page-focus.spec.ts +++ b/tests/page/page-focus.spec.ts @@ -120,8 +120,7 @@ it('clicking checkbox should activate it', async ({ page, browserName, headless, it('tab should cycle between single input and browser', { annotation: { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/32339' } }, async ({ page, browserName, channel }) => { - it.fixme(browserName === 'chromium' && channel !== 'chromium-headless-shell', - 'Chromium in headful mode keeps input focused.'); + it.fixme(browserName === 'chromium' && channel !== 'chromium-headless-shell', 'Chromium keeps input focused.'); it.fixme(browserName !== 'chromium'); await page.setContent(` @@ -148,8 +147,7 @@ it('tab should cycle between single input and browser', { it('tab should cycle between document elements and browser', { annotation: { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/32339' } }, async ({ page, browserName, channel }) => { - it.fixme(browserName === 'chromium' && channel !== 'chromium-headless-shell', - 'Chromium in headful mode keeps last input focused.'); + it.fixme(browserName === 'chromium' && channel !== 'chromium-headless-shell', 'Chromium keeps last input focused.'); it.fixme(browserName !== 'chromium'); await page.setContent(`