Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

devops: make tests 1 lighter, drop Node 20 from CI bots (#43362)

Pavel Feldman647e485f2ba5
diff --git a/.github/actions/run-test/action.yml b/.github/actions/run-test/action.yml
index 8f2fa3a82f..577d3997ec 100644
--- a/.github/actions/run-test/action.yml
+++ b/.github/actions/run-test/action.yml
@@ -10,7 +10,7 @@ inputs:
node-version:
description: 'Node.js version to use'
required: false
- default: '20'
+ default: '22'
browsers-to-install:
description: 'Browser to install. Default is all browsers.'
required: false
diff --git a/.github/workflows/tests_primary.yml b/.github/workflows/tests_primary.yml
index 2261eb18c8..0362edc8df 100644
--- a/.github/workflows/tests_primary.yml
+++ b/.github/workflows/tests_primary.yml
@@ -37,17 +37,7 @@ jobs:
matrix:
browser: [chromium, firefox, webkit]
os: [ubuntu-22.04]
- node-version: [20]
- include:
- - os: ubuntu-22.04
- node-version: 22
- browser: chromium
- - os: ubuntu-22.04
- node-version: 24
- browser: chromium
- - os: ubuntu-22.04-arm
- node-version: 20
- browser: chromium
+ node-version: [22]
runs-on: ${{ matrix.os }}
permissions:
contents: read # This is required for actions/checkout to succeed
@@ -65,57 +55,29 @@ jobs:
strategy:
fail-fast: false
matrix:
- os: [ubuntu-latest, macos-latest]
+ os: [playwright-x64-ubuntu24-64-core, playwright-x64-server2025-64-core]
+ node-version: [22]
+ runs-on: ${{ matrix.os }}
+ permissions:
+ contents: read # This is required for actions/checkout to succeed
+ steps:
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ - uses: ./.github/actions/run-test
+ with:
+ node-version: ${{matrix.node-version}}
+ command: npm run ttest
+ bot-name: "${{ matrix.os }}-node${{ matrix.node-version }}"
+
+ test_test_runner_mac:
+ name: Test Runner
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [macos-latest]
node-version: [22]
shardIndex: [1, 2]
shardTotal: [2]
shardWeights: ['58:42']
- include:
- - os: windows-latest
- node-version: 22
- shardIndex: 1
- shardTotal: 3
- shardWeights: '44:33:23'
- - os: windows-latest
- node-version: 22
- shardIndex: 2
- shardTotal: 3
- shardWeights: '44:33:23'
- - os: windows-latest
- node-version: 22
- shardIndex: 3
- shardTotal: 3
- shardWeights: '44:33:23'
- - os: ubuntu-latest
- node-version: 20
- shardIndex: 1
- shardTotal: 2
- shardWeights: '58:42'
- - os: ubuntu-latest
- node-version: 20
- shardIndex: 2
- shardTotal: 2
- shardWeights: '58:42'
- - os: ubuntu-latest
- node-version: 24
- shardIndex: 1
- shardTotal: 2
- shardWeights: '58:42'
- - os: ubuntu-latest
- node-version: 24
- shardIndex: 2
- shardTotal: 2
- shardWeights: '58:42'
- - os: ubuntu-latest
- node-version: 26
- shardIndex: 1
- shardTotal: 2
- shardWeights: '58:42'
- - os: ubuntu-latest
- node-version: 26
- shardIndex: 2
- shardTotal: 2
- shardWeights: '58:42'
runs-on: ${{ matrix.os }}
permissions:
contents: read # This is required for actions/checkout to succeed
@@ -143,7 +105,7 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ./.github/actions/run-test
with:
- node-version: 20
+ node-version: 22
browsers-to-install: chromium
command: npm run test-${{ matrix.package }}
bot-name: "web-components-${{ matrix.package }}"
@@ -155,7 +117,7 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
- node-version: 20
+ node-version: 22
- run: npm ci
env:
DEBUG: pw:install
@@ -214,23 +176,3 @@ jobs:
node-version: 22
bot-name: "package-installations-${{ matrix.os }}"
shell: ${{ matrix.os == 'windows-latest' && 'pwsh' || 'bash' }}
-
- test_clock_frozen_time_linux:
- name: time library - ${{ matrix.clock }}
- permissions:
- contents: read # This is required for actions/checkout to succeed
- strategy:
- fail-fast: false
- matrix:
- clock: [frozen, realtime]
- runs-on: ubuntu-22.04
- steps:
- - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- - uses: ./.github/actions/run-test
- with:
- node-version: 22
- browsers-to-install: chromium
- command: npm run test -- --project=chromium-*
- bot-name: "${{ matrix.clock }}-time-library-chromium-linux"
- env:
- PW_CLOCK: ${{ matrix.clock }}
diff --git a/.github/workflows/tests_secondary.yml b/.github/workflows/tests_secondary.yml
index 0f30b28072..72bf3920bd 100644
--- a/.github/workflows/tests_secondary.yml
+++ b/.github/workflows/tests_secondary.yml
@@ -29,9 +29,6 @@ jobs:
# Arm64: *-xlarge
os: [macos-15-large, macos-15-xlarge]
browser: [chromium, firefox, webkit]
- include:
- - os: macos-14-xlarge
- browser: chromium
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
@@ -65,8 +62,6 @@ jobs:
fail-fast: false
matrix:
include:
- - os: ubuntu-latest
- node_version: 20
- os: ubuntu-latest
node_version: 24
- os: ubuntu-latest
@@ -89,35 +84,75 @@ jobs:
command: npm run itest
bot-name: "package-installations-${{ matrix.os }}-node${{ matrix.node_version }}"
- driver_linux:
- name: "Driver"
+ test_linux:
+ name: ${{ matrix.os }} (${{ matrix.browser }} - Node.js ${{ matrix.node-version }})
+ if: ${{ github.event_name == 'push' || github.event.label.name == 'CQ1' }}
strategy:
fail-fast: false
+ matrix:
+ include:
+ - os: ubuntu-22.04
+ node-version: 24
+ browser: chromium
+ - os: ubuntu-22.04
+ node-version: 26
+ browser: chromium
+ - os: ubuntu-22.04-arm
+ node-version: 22
+ browser: chromium
+ runs-on: ${{ matrix.os }}
+ steps:
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ - uses: ./.github/actions/run-test
+ with:
+ node-version: ${{ matrix.node-version }}
+ browsers-to-install: ${{ matrix.browser }} chromium
+ command: npm run test -- --project=${{ matrix.browser }}-*
+ bot-name: "${{ matrix.browser }}-${{ matrix.os }}-node${{ matrix.node-version }}"
+
+ test_clock_frozen_time_linux:
+ name: time library - ${{ matrix.clock }}
+ if: ${{ github.event_name == 'push' || github.event.label.name == 'CQ1' }}
+ strategy:
+ fail-fast: false
+ matrix:
+ clock: [frozen, realtime]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ./.github/actions/run-test
with:
+ node-version: 22
browsers-to-install: chromium
- command: npm run ctest
- bot-name: "driver"
+ command: npm run test -- --project=chromium-*
+ bot-name: "${{ matrix.clock }}-time-library-chromium-linux"
env:
- PWTEST_MODE: driver
+ PW_CLOCK: ${{ matrix.clock }}
+
+ test_test_runner:
+ name: Test Runner
+ if: ${{ github.event_name == 'push' || github.event.label.name == 'CQ1' }}
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [playwright-x64-ubuntu24-64-core]
+ node-version: [24, 26]
+ runs-on: ${{ matrix.os }}
+ steps:
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ - uses: ./.github/actions/run-test
+ with:
+ node-version: ${{matrix.node-version}}
+ command: npm run ttest
+ bot-name: "${{ matrix.os }}-node${{ matrix.node-version }}"
tracing_linux:
name: Tracing ${{ matrix.browser }}
strategy:
fail-fast: false
matrix:
- include:
- - browser: chromium
- runs-on: ubuntu-22.04
- - browser: firefox
- runs-on: ubuntu-22.04
- # See https://github.com/microsoft/playwright/issues/35586
- - browser: webkit
- runs-on: ubuntu-24.04
- runs-on: ${{ matrix.runs-on }}
+ browser: [chromium, firefox]
+ runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ./.github/actions/run-test
@@ -184,25 +219,6 @@ jobs:
command: npm run atest
bot-name: "android"
- test_clock_frozen_time_test_runner:
- name: time test runner - ${{ matrix.clock }}
- runs-on: ubuntu-22.04
- permissions:
- contents: read # This is required for actions/checkout to succeed
- strategy:
- fail-fast: false
- matrix:
- clock: [frozen, realtime]
- steps:
- - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- - uses: ./.github/actions/run-test
- with:
- node-version: 22
- command: npm run ttest
- bot-name: "${{ matrix.clock }}-time-runner-chromium-linux"
- env:
- PW_CLOCK: ${{ matrix.clock }}
-
test_electron:
name: Electron - ${{ matrix.os }}
strategy:
diff --git a/tests/playwright-test/playwright.config.ts b/tests/playwright-test/playwright.config.ts
index 1a11d9c490..dd2ee01d63 100644
--- a/tests/playwright-test/playwright.config.ts
+++ b/tests/playwright-test/playwright.config.ts
@@ -56,7 +56,5 @@ export default defineConfig({
],
reporter: reporters(),
tag: process.env.PW_TAG,
- metadata: {
- clock: process.env.PW_CLOCK ? 'clock-' + process.env.PW_CLOCK : undefined,
- },
+ metadata: {},
});
diff --git a/tests/playwright-test/playwright.spec.ts b/tests/playwright-test/playwright.spec.ts
index 33ac3988af..18d6dd18eb 100644
--- a/tests/playwright-test/playwright.spec.ts
+++ b/tests/playwright-test/playwright.spec.ts
@@ -1107,7 +1107,6 @@ test('PWDEBUG=console should opt-in to exposing window.playwright', async ({ run
});
test('init script should not observe playwright internals', async ({ server, runInlineTest }) => {
- test.skip(!!process.env.PW_CLOCK, 'clock installs globalThis.__pwClock');
const result = await runInlineTest({
'a.test.ts': `
import { test, expect } from '@playwright/test';