Skip to content

Upgrade Playwright to the latest version 1.49.1 #1154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
38 changes: 35 additions & 3 deletions .github/actions/playwright/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,53 @@ description: Install playwright and required browsers

inputs:
PLAYWRIGHT_VERSION:
required: true
description: Playwright version to use
description: If provided, the action will use this version directly
required: false
PACKAGE_JSON_PATH:
description: Path to package.json where '@playwright/test' is defined
required: false
default: './internal/e2e-js/package.json'

runs:
using: composite
steps:
- name: Validate input
shell: bash
run: |
# Ensure at least one of PLAYWRIGHT_VERSION or PACKAGE_JSON_PATH is passed
if [ -z "${{ inputs.PLAYWRIGHT_VERSION }}" ] && [ -z "${{ inputs.PACKAGE_JSON_PATH }}" ]; then
echo "Error: You must provide either PLAYWRIGHT_VERSION or PACKAGE_JSON_PATH."
exit 1
fi

- name: Get Playwright version
id: playwright-version
shell: bash
run: |
# If a version is explicitly provided, use that
if [ -n "${{ inputs.PLAYWRIGHT_VERSION }}" ]; then
DETECTED_VERSION="${{ inputs.PLAYWRIGHT_VERSION }}"
echo "Using explicit Playwright version: $DETECTED_VERSION"
else
# Otherwise, read it from package.json
echo "Reading Playwright version from ${{ inputs.PACKAGE_JSON_PATH }}"
DETECTED_VERSION=$(jq -r '.devDependencies["@playwright/test"]' "${{ inputs.PACKAGE_JSON_PATH }}")
DETECTED_VERSION=${DETECTED_VERSION#^} # Remove ^
echo "Detected Playwright version: $DETECTED_VERSION"
fi

echo "PLAYWRIGHT_VERSION=$DETECTED_VERSION" >> $GITHUB_ENV

- name: Cache playwright binaries
uses: actions/cache@v4
id: playwright-cache
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ inputs.PLAYWRIGHT_VERSION }}
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}

- if: steps.playwright-cache.outputs.cache-hit != 'true'
name: Install Playwright
shell: bash
run: npx playwright install --with-deps chromium

2 changes: 1 addition & 1 deletion .github/workflows/browser-js-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- name: Install Playwright
uses: ./.github/actions/playwright
with:
PLAYWRIGHT_VERSION: '1.35.1' # TODO: Read from deps ?
PACKAGE_JSON_PATH: ./internal/e2e-js/package.json
- name: Test
run: npm run -w=@sw-internal/e2e-js dev -- --project ${{ matrix.project }}
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/browser-js-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
- name: Install Playwright
uses: ./.github/actions/playwright
with:
PLAYWRIGHT_VERSION: '1.35.1' # TODO: Read from deps ?
PACKAGE_JSON_PATH: ./internal/e2e-js/package.json
- name: Test
run: npm run -w=@sw-internal/e2e-js dev -- --project ${{ matrix.project }}
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/realtime-api-production-euswcom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Install Playwright
uses: ./.github/actions/playwright
with:
PLAYWRIGHT_VERSION: '1.35.1' # TODO: Read from deps ?
PACKAGE_JSON_PATH: ./internal/e2e-realtime-api/package.json
- name: Test
id: run-tests
run: npm run -w=@sw-internal/e2e-realtime-api dev
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/realtime-api-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
if: matrix.test_command == 'dev:playwright'
uses: ./.github/actions/playwright
with:
PLAYWRIGHT_VERSION: '1.35.1'
PACKAGE_JSON_PATH: ./internal/e2e-realtime-api/package.json
- name: Test
run: 'npm run -w=@sw-internal/e2e-realtime-api ${{ matrix.test_command }}'
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/realtime-api-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
if: matrix.test_command == 'dev:playwright'
uses: ./.github/actions/playwright
with:
PLAYWRIGHT_VERSION: '1.35.1'
PACKAGE_JSON_PATH: ./internal/e2e-realtime-api/package.json
- name: Test
run: 'npm run -w=@sw-internal/e2e-realtime-api ${{ matrix.test_command }}'
env:
Expand Down
5 changes: 4 additions & 1 deletion internal/e2e-js/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
.env
test-results/
node_modules/
/test-results/
/playwright-report/
/playwright/.cache/
5 changes: 2 additions & 3 deletions internal/e2e-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
"node-fetch": "^2.6.7"
},
"devDependencies": {
"@playwright/test": "^1.35.1",
"playwrigth-ws-inspector": "^1.0.0",
"vite": "^6.2.0"
"@playwright/test": "^1.49.1",
"playwrigth-ws-inspector": "^1.1.0"
}
}
2 changes: 1 addition & 1 deletion internal/e2e-realtime-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"test": ""
},
"devDependencies": {
"@playwright/test": "^1.35.1",
"@playwright/test": "^1.49.1",
"@types/tap": "^15.0.8",
"esbuild-register": "^3.6.0",
"vite": "^6.2.0"
Expand Down
101 changes: 58 additions & 43 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading