Skip to content

fix: investigate Playwright v1.59.1 release failure #133

fix: investigate Playwright v1.59.1 release failure

fix: investigate Playwright v1.59.1 release failure #133

name: Patchright Chromium Tests
on:
workflow_call:
inputs:
playwright_version:
description: 'Playwright version (tag) to test against. If empty, latest release is used.'
required: false
type: string
outputs:
test_outcome:
description: Combined result for page/library test steps
value: ${{ jobs.run-patchright-tests.outputs.test_outcome }}
workflow_dispatch:
inputs:
playwright_version:
description: 'Playwright version (tag) to test against. If empty, latest release is used.'
required: false
type: string
push:
branches: [main, dev-tests]
pull_request:
types: [opened, synchronize, reopened]
jobs:
run-patchright-tests:
runs-on: ubuntu-latest
outputs:
test_outcome: ${{ steps.set_test_outcome.outputs.test_outcome }}
steps:
- name: Checkout Repository
uses: actions/checkout@v6
- name: Configure Fast APT Mirror
uses: vegardit/fast-apt-mirror.sh@v1
- name: Setup Node v24
uses: actions/setup-node@v6
with:
node-version: 24
registry-url: 'https://registry.npmjs.org'
- name: Install NPM Dependencies
run: npm install
- name: Install Playwright Driver
run: |
branch_version="${{ inputs.playwright_version || github.event.inputs.playwright_version }}"
if [ -z "$branch_version" ]; then
response=$(curl --silent "https://api.github.com/repos/microsoft/playwright/releases/latest")
branch_version=$(echo "$response" | grep '"tag_name"' | sed -E 's/.*"([^"]+)".*/\1/')
fi
git clone https://github.com/microsoft/playwright --branch "$branch_version"
cd playwright
npm ci
- name: Fetch Client Patches from patchright-nodejs
run: |
git clone https://github.com/Kaliiiiiiiiii-Vinyzu/patchright-nodejs.git
cp patchright-nodejs/patchright_nodejs_patch.js ./patchright_nodejs_patch.js
# Append driver patches starting after the marker line; this avoids relying on fixed line offsets.
awk '/^\/\/ patchright-driver-patch: start$/ {p=1; next} p' patchright_driver_patch.ts >> patchright_nodejs_patch.js
rm -rf patchright-nodejs
- name: Patch Playwright Driver
run: |
cd playwright
node "../patchright_nodejs_patch.js"
- name: Generate Channels
# Script exits 1 when files are modified, which is expected
continue-on-error: true
run: |
cd playwright
node utils/generate_channels.js
- name: Build Patchright Driver
run: |
cd playwright
npm run build
- name: Install Browser Dependencies
run: |
cd playwright
npx playwright install-deps
- name: Install Chromium Browser
run: |
cd playwright
npx playwright install chromium
- name: Modify Tests for Patchright
run: node modify_tests.js
- name: Run Page Tests
id: test_page
continue-on-error: ${{ github.event_name == 'workflow_call' }}
run: |
cd playwright
PWTEST_MODE=driver xvfb-run -a npx playwright test --config=tests/library/playwright.config.ts --project=chromium-page --max-failures=0 --reporter=github --retries=3
- name: Run Library Tests
id: test_library
continue-on-error: ${{ github.event_name == 'workflow_call' }}
run: |
cd playwright
PWTEST_MODE=driver xvfb-run -a npx playwright test --config=tests/library/playwright.config.ts --project=chromium-library --max-failures=0 --reporter=github --retries=3
- name: Set Test Outcome
id: set_test_outcome
if: always()
run: |
if [ "${{ steps.test_page.outcome }}" = "failure" ] || [ "${{ steps.test_library.outcome }}" = "failure" ]; then
echo "test_outcome=failure" >> "$GITHUB_OUTPUT"
else
echo "test_outcome=success" >> "$GITHUB_OUTPUT"
fi