diff --git a/.github/workflows/tests_secondary.yml b/.github/workflows/tests_secondary.yml index 8cf78d145a..6f47843edf 100644 --- a/.github/workflows/tests_secondary.yml +++ b/.github/workflows/tests_secondary.yml @@ -268,23 +268,6 @@ jobs: - run: npx playwright install-deps - run: utils/build/build-playwright-driver.sh - test_linux_chromium_headless_old: - name: Linux Chromium Headless Old - environment: ${{ github.event_name == 'push' && 'allow-uploading-flakiness-results' || null }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/run-test - with: - browsers-to-install: chromium - command: npm run ctest - bot-name: "headless-old" - flakiness-client-id: ${{ secrets.AZURE_FLAKINESS_DASHBOARD_CLIENT_ID }} - flakiness-tenant-id: ${{ secrets.AZURE_FLAKINESS_DASHBOARD_TENANT_ID }} - flakiness-subscription-id: ${{ secrets.AZURE_FLAKINESS_DASHBOARD_SUBSCRIPTION_ID }} - env: - PLAYWRIGHT_CHROMIUM_USE_HEADLESS_OLD: 1 - test_linux_chromium_headless_shell: name: Chromium Headless Shell environment: ${{ github.event_name == 'push' && 'allow-uploading-flakiness-results' || null }} diff --git a/packages/playwright-core/src/server/bidi/bidiChromium.ts b/packages/playwright-core/src/server/bidi/bidiChromium.ts index f87fe5cb22..62d76cda8f 100644 --- a/packages/playwright-core/src/server/bidi/bidiChromium.ts +++ b/packages/playwright-core/src/server/bidi/bidiChromium.ts @@ -112,10 +112,7 @@ export class BidiChromium extends BrowserType { if (options.devtools) chromeArguments.push('--auto-open-devtools-for-tabs'); if (options.headless) { - if (process.env.PLAYWRIGHT_CHROMIUM_USE_HEADLESS_OLD) - chromeArguments.push('--headless=old'); - else - chromeArguments.push('--headless=new'); + chromeArguments.push('--headless=new'); chromeArguments.push( '--hide-scrollbars', diff --git a/packages/playwright-core/src/server/chromium/chromium.ts b/packages/playwright-core/src/server/chromium/chromium.ts index 203527e92d..597563efea 100644 --- a/packages/playwright-core/src/server/chromium/chromium.ts +++ b/packages/playwright-core/src/server/chromium/chromium.ts @@ -309,10 +309,7 @@ export class Chromium extends BrowserType { if (options.devtools) chromeArguments.push('--auto-open-devtools-for-tabs'); if (options.headless) { - if (process.env.PLAYWRIGHT_CHROMIUM_USE_HEADLESS_OLD || options.channel === 'chromium-headless-shell') - chromeArguments.push('--headless=old'); - else - chromeArguments.push('--headless=new'); + chromeArguments.push('--headless=new'); chromeArguments.push( '--hide-scrollbars', diff --git a/tests/library/browsercontext-credentials.spec.ts b/tests/library/browsercontext-credentials.spec.ts index e4edbdd936..4471badfa9 100644 --- a/tests/library/browsercontext-credentials.spec.ts +++ b/tests/library/browsercontext-credentials.spec.ts @@ -19,9 +19,7 @@ import { browserTest as base, expect } from '../config/browserTest'; const it = base.extend<{ isChromiumHeadedLike: boolean }>({ isChromiumHeadedLike: async ({ browserName, headless, channel }, use) => { - const isChromiumHeadedLike = browserName === 'chromium' - && ((headless && !process.env.PLAYWRIGHT_CHROMIUM_USE_HEADLESS_OLD - && channel !== 'chromium-headless-shell') || !headless); + const isChromiumHeadedLike = browserName === 'chromium' && ((headless && channel !== 'chromium-headless-shell') || !headless); await use(isChromiumHeadedLike); }, }); diff --git a/tests/library/download.spec.ts b/tests/library/download.spec.ts index 6a0aa4c4b0..94f61cbe8c 100644 --- a/tests/library/download.spec.ts +++ b/tests/library/download.spec.ts @@ -636,8 +636,8 @@ it('should be able to download a inline PDF file via response interception', asy await page.close(); }); -it('should be able to download a inline PDF file via navigation', async ({ browser, server, asset, browserName, headless }) => { - it.fixme(((!headless || !process.env.PLAYWRIGHT_CHROMIUM_USE_HEADLESS_OLD) && browserName === 'chromium')); +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'); const page = await browser.newPage(); await page.goto(server.EMPTY_PAGE); await page.setContent(` diff --git a/tests/library/emulation-focus.spec.ts b/tests/library/emulation-focus.spec.ts index eb59c63cad..5bbef6b164 100644 --- a/tests/library/emulation-focus.spec.ts +++ b/tests/library/emulation-focus.spec.ts @@ -101,10 +101,10 @@ it('should change document.activeElement', async ({ page, server }) => { expect(active).toEqual(['INPUT', 'TEXTAREA']); }); -it('should not affect screenshots', async ({ page, server, browserName, headless, isWindows }) => { +it('should not affect screenshots', async ({ page, server, browserName, headless, isWindows, channel }) => { it.skip(browserName === 'webkit' && isWindows && !headless, 'WebKit/Windows/headed has a larger minimal viewport. See https://github.com/microsoft/playwright/issues/22616'); it.skip(browserName === 'firefox' && !headless, 'Firefox headed produces a different image'); - it.fixme(browserName === 'chromium' && !process.env.PLAYWRIGHT_CHROMIUM_USE_HEADLESS_OLD, 'https://github.com/microsoft/playwright/issues/33330'); + it.fixme(browserName === 'chromium' && channel !== 'chromium-headless-shell', 'https://github.com/microsoft/playwright/issues/33330'); const page2 = await page.context().newPage(); await Promise.all([ diff --git a/tests/library/permissions.spec.ts b/tests/library/permissions.spec.ts index a7418e6dd6..3c4855b930 100644 --- a/tests/library/permissions.spec.ts +++ b/tests/library/permissions.spec.ts @@ -145,12 +145,12 @@ it.describe('permissions', () => { }); }); -it('should support clipboard read', async ({ page, context, server, browserName, isWindows, isLinux, headless }) => { +it('should support clipboard read', async ({ page, context, server, browserName, isWindows, isLinux, headless, channel }) => { it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/27475' }); 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' && (!headless || !process.env.PLAYWRIGHT_CHROMIUM_USE_HEADLESS_OLD); + const isChromiumHeadedLike = browserName === 'chromium' && channel !== 'chromium-headless-shell'; await page.goto(server.EMPTY_PAGE); // There is no 'clipboard-read' permission in WebKit Web API. diff --git a/tests/library/playwright.config.ts b/tests/library/playwright.config.ts index 8a392a57c5..79d1f5c7a1 100644 --- a/tests/library/playwright.config.ts +++ b/tests/library/playwright.config.ts @@ -127,8 +127,6 @@ for (const browserName of browserNames) { platform: process.platform, docker: !!process.env.INSIDE_DOCKER, headless: (() => { - if (process.env.PLAYWRIGHT_CHROMIUM_USE_HEADLESS_OLD) - return 'headless-old'; if (headed) return 'headed'; return 'headless'; diff --git a/tests/library/screenshot.spec.ts b/tests/library/screenshot.spec.ts index f982430bd9..2f8e516963 100644 --- a/tests/library/screenshot.spec.ts +++ b/tests/library/screenshot.spec.ts @@ -22,8 +22,8 @@ import { verifyViewport } from '../config/utils'; browserTest.describe('page screenshot', () => { browserTest.skip(({ browserName, headless }) => browserName === 'firefox' && !headless, 'Firefox headed produces a different image.'); - browserTest('should run in parallel in multiple pages', async ({ server, contextFactory, browserName }) => { - browserTest.fixme(browserName === 'chromium' && !process.env.PLAYWRIGHT_CHROMIUM_USE_HEADLESS_OLD, 'https://github.com/microsoft/playwright/issues/33330'); + browserTest('should run in parallel in multiple pages', async ({ server, contextFactory, browserName, channel }) => { + browserTest.fixme(browserName === 'chromium' && channel !== 'chromium-headless-shell', 'https://github.com/microsoft/playwright/issues/33330'); const context = await contextFactory(); const N = 5; const pages = await Promise.all(Array(N).fill(0).map(async () => { diff --git a/tests/library/tracing.spec.ts b/tests/library/tracing.spec.ts index 04a772745f..6acd778464 100644 --- a/tests/library/tracing.spec.ts +++ b/tests/library/tracing.spec.ts @@ -407,9 +407,9 @@ for (const params of [ height: 768, } ]) { - browserTest(`should produce screencast frames ${params.id}`, async ({ video, contextFactory, browserName, platform, headless }, testInfo) => { + 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' && (!headless || !process.env.PLAYWRIGHT_CHROMIUM_USE_HEADLESS_OLD), 'Chromium screencast on headed has a min width issue'); + browserTest.fixme(browserName === 'chromium' && channel !== 'chromium-headless-shell', 'Chromium screencast on headed 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 f3c3a2894a..54b3fcfaa8 100644 --- a/tests/library/video.spec.ts +++ b/tests/library/video.spec.ts @@ -473,8 +473,8 @@ it.describe('screencast', () => { expect(videoFiles.length).toBe(2); }); - it('should scale frames down to the requested size ', async ({ browser, browserName, server, headless, trace }, testInfo) => { - const isChromiumHeadlessNew = browserName === 'chromium' && !!headless && !process.env.PLAYWRIGHT_CHROMIUM_USE_HEADLESS_OLD; + 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'); const context = await browser.newContext({ @@ -722,9 +722,9 @@ it.describe('screencast', () => { expect(files.length).toBe(1); }); - it('should capture full viewport', async ({ browserType, browserName, headless, isWindows }, testInfo) => { + it('should capture full viewport', async ({ browserType, browserName, isWindows, channel }, testInfo) => { it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/22411' }); - it.fixme(browserName === 'chromium' && (!headless || !process.env.PLAYWRIGHT_CHROMIUM_USE_HEADLESS_OLD), 'The square is not on the video'); + it.fixme(browserName === 'chromium' && channel !== 'chromium-headless-shell', 'The square is not on the video'); it.fixme(browserName === 'firefox' && isWindows, 'https://github.com/microsoft/playwright/issues/14405'); const size = { width: 600, height: 400 }; const browser = await browserType.launch(); @@ -757,9 +757,9 @@ it.describe('screencast', () => { expectAll(pixels, almostRed); }); - it('should capture full viewport on hidpi', async ({ browserType, browserName, headless, isWindows, isLinux }, testInfo) => { + it('should capture full viewport on hidpi', async ({ browserType, browserName, headless, isWindows, isLinux, channel }, testInfo) => { it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/22411' }); - it.fixme(browserName === 'chromium' && (!headless || !process.env.PLAYWRIGHT_CHROMIUM_USE_HEADLESS_OLD), 'The square is not on the video'); + it.fixme(browserName === 'chromium' && channel !== 'chromium-headless-shell', 'The square is not on the video'); it.fixme(browserName === 'firefox' && isWindows, 'https://github.com/microsoft/playwright/issues/14405'); it.fixme(browserName === 'webkit' && isLinux && !headless, 'https://github.com/microsoft/playwright/issues/22617'); const size = { width: 600, height: 400 }; @@ -794,9 +794,10 @@ it.describe('screencast', () => { expectAll(pixels, almostRed); }); - it('should work with video+trace', async ({ browser, trace, headless }, testInfo) => { + it('should work with video+trace', async ({ browser, trace, headless, browserName, channel }, testInfo) => { it.skip(trace === 'on'); - it.fixme(!headless || !process.env.PLAYWRIGHT_CHROMIUM_USE_HEADLESS_OLD, 'different trace screencast image size on all browsers'); + const isChromiumHeadlessNew = browserName === 'chromium' && channel !== 'chromium-headless-shell'; + it.fixme(!headless || isChromiumHeadlessNew, 'different trace screencast image size on all browsers'); 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 67e2459650..dd3883c210 100644 --- a/tests/page/page-focus.spec.ts +++ b/tests/page/page-focus.spec.ts @@ -119,8 +119,8 @@ 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, headless }) => { - it.fixme(browserName === 'chromium' && (!headless || !process.env.PLAYWRIGHT_CHROMIUM_USE_HEADLESS_OLD), +}, async ({ page, browserName, channel }) => { + it.fixme(browserName === 'chromium' && channel !== 'chromium-headless-shell', 'Chromium in headful mode keeps input focused.'); it.fixme(browserName !== 'chromium'); await page.setContent(` @@ -147,8 +147,8 @@ 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, headless }) => { - it.fixme(browserName === 'chromium' && (!headless || !process.env.PLAYWRIGHT_CHROMIUM_USE_HEADLESS_OLD), +}, async ({ page, browserName, channel }) => { + it.fixme(browserName === 'chromium' && channel !== 'chromium-headless-shell', 'Chromium in headful mode keeps last input focused.'); it.fixme(browserName !== 'chromium'); await page.setContent(`