Skip to content

#1 PDF Application on GitHub that lets you edit PDFs on any device anywhere

Run Playwright on all platforms in PRs (#7304)

James Brunton78acd9a14b29
diff --git a/.github/workflows/e2e-stubbed.yml b/.github/workflows/e2e-stubbed.yml
index 0d972303ff..df3c5fa82a 100644
--- a/.github/workflows/e2e-stubbed.yml
+++ b/.github/workflows/e2e-stubbed.yml
@@ -2,7 +2,8 @@ name: Playwright E2E (stubbed)
# Reusable workflow called from build.yml. Backend-free Playwright suite —
# fast, no Spring Boot required. Runs against the `stubbed` project which
-# mocks API responses in the browser.
+# mocks API responses in the browser. Fans out one job per browser
+# (chromium/firefox/webkit) so all three run in parallel on their own runner.
on:
workflow_call:
@@ -11,7 +12,19 @@ permissions:
jobs:
playwright-e2e:
+ name: playwright-e2e (${{ matrix.browser }})
runs-on: ubuntu-latest
+ strategy:
+ # One browser breaking must not mask a failure in another - report all.
+ fail-fast: false
+ matrix:
+ include:
+ - browser: chromium
+ project: stubbed
+ - browser: firefox
+ project: stubbed-firefox
+ - browser: webkit
+ project: stubbed-webkit
steps:
- name: Harden Runner
uses: step-security/harden-runner@bf7454d06d71f1098171f2acdf0cd4708d7b5920 # v2.20.0
@@ -27,16 +40,16 @@ jobs:
cache-dependency-path: frontend/package-lock.json
- name: Install Task
uses: go-task/setup-task@01a4adf9db2d14c1de7a560f09170b6e0df736aa # v2.1.0
- - name: Install Playwright (chromium only)
- run: task e2e:install -- chromium
+ - name: Install Playwright (${{ matrix.browser }})
+ run: task e2e:install -- ${{ matrix.browser }}
- name: Build frontend (production bundle for vite preview)
env:
VITE_BUILD_FOR_PREVIEW: "1"
run: task frontend:build
- - name: Run stubbed E2E tests (chromium)
+ - name: Run stubbed E2E tests (${{ matrix.browser }})
env:
PLAYWRIGHT_JSON_OUTPUT_FILE: ${{ github.workspace }}/frontend/playwright-report/results.json
- run: task e2e:stubbed -- --workers=3
+ run: task e2e:stubbed-project PROJECT=${{ matrix.project }} -- --workers=3
- name: Flag flaky tests
# Runs regardless of the test outcome: a flaky test (passed on retry)
# leaves the step green, so this is the only place it surfaces. Emits
@@ -50,6 +63,6 @@ jobs:
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
- name: playwright-report-stubbed-${{ github.run_id }}
+ name: playwright-report-stubbed-${{ matrix.browser }}-${{ github.run_id }}
path: frontend/playwright-report/
retention-days: 7
diff --git a/.taskfiles/e2e.yml b/.taskfiles/e2e.yml
index 618041807f..084906960b 100644
--- a/.taskfiles/e2e.yml
+++ b/.taskfiles/e2e.yml
@@ -15,6 +15,15 @@ tasks:
cmds:
- npx playwright test --project=stubbed {{.CLI_ARGS}}
+ stubbed-project:
+ desc: "Run the stubbed E2E suite for a single Playwright project"
+ dir: frontend/editor
+ deps: [ ':frontend:prepare' ]
+ vars:
+ PROJECT: '{{.PROJECT | default "stubbed"}}'
+ cmds:
+ - npx playwright test --project={{.PROJECT}} {{.CLI_ARGS}}
+
live:
desc: "Run live E2E tests"
summary: |