Skip to content

Playwright end-to-end gate: composite and e2e-playwright reusable workflow (#75) - #169

Open
ms280690 wants to merge 1 commit into
issue-72-test-nodefrom
issue-75-e2e-playwright
Open

ms280690 wants to merge 1 commit into
issue-72-test-nodefrom
issue-75-e2e-playwright

Conversation

@ms280690

Copy link
Copy Markdown
Collaborator

Closes #75. Stacked on #147 (issue-72-test-node) for the Node setup pattern (setup-node, pnpm/action-setup, lockfile detection); retarget once that merges.

What

  • .github/actions/playwright: Node version and package manager from the lockfile (same detection as node-test), setup-node with the package-manager cache, install, read the installed @playwright/test version, actions/cache on ~/.cache/ms-playwright keyed on that version and the browser list, playwright install --with-deps (only install-deps on a cache hit), then playwright test --reporter=github,junit,blob with --project and --shard i/n when given and BASE_URL exported from target-url. summary.py (stdlib) turns the JUnit XML into a per-file table and a failure list in the step summary and the tests-total, tests-failed, tests-skipped outputs; annotations come from the github reporter (file and line). HTML report built from the blob with merge-reports. Artefacts: JUnit, blob and HTML always (<name>-results[-shard]), test-results/ with traces, videos and screenshots on failure (<name>-traces[-shard]). Final gate step fails on a non-zero playwright test exit.
  • e2e-playwright.yml: inputs from the issue plus browsers, extra-args, runtime-version, install-command, actions-ref. shards job builds the matrix, test runs one composite per shard (fail-fast: false), report (only when shards > 1) downloads the shard blobs and runs npx @playwright/test@<same version> merge-reports --reporter html into playwright-report.
  • Fixture project tests/e2e-playwright/fixtures/project: @playwright/test 1.64.0 pinned with a lockfile, server.js as the webServer, two passing specs and a failing spec enabled by E2E_FIXTURE_FAIL; playwright.config.js is the documented config contract (BASE_URL, trace: retain-on-failure).
  • CI E2E Playwright job: summary.py fixtures, the composite on the fixture (3 tests, 0 failed), then with E2E_FIXTURE_FAIL=1 expecting failure with tests-failed=1.
  • README rows and "E2E (Playwright)" section. No new third-party actions beyond those feat(#72): Node test gate — vitest / jest reusable workflow #147 already approved.

Tests

tests/e2e-playwright/run.sh with recorded Playwright JUnit (pass with a skipped test, one failure): counts, outputs, headings with and without a shard, suite rows, failure message, no duplicate annotations, exit codes. Verified locally with Playwright 1.64.0: passing run, failing run (annotation ::error file=tests/failing.spec.js,...,line=7), --shard 1/2 blob and merge-reports --reporter html.

Deferred

  • Run against one Sparkgeo frontend repository after merge.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NPH9145e4gFo6bmXvMgBoF

The playwright composite detects Node and the package manager from the
lockfile, installs dependencies through setup-node's cache, caches the
browsers on the installed @playwright/test version, and runs
`playwright test` with the github, junit and blob reporters: one check
annotation per failure with file and line, counts in the step summary and
as outputs, an HTML report built from the blob, and traces, videos and
screenshots uploaded when tests fail. target-url is exported as BASE_URL
for the repo's playwright.config.

e2e-playwright.yml plans a shard matrix from the shards input, runs one
composite per shard and, above one shard, merges the blobs into a single
HTML report with the same Playwright version.

The fixture project (webServer, two passing specs, a failing spec enabled
by E2E_FIXTURE_FAIL) runs in CI twice: once passing, once failing with the
expected count.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NPH9145e4gFo6bmXvMgBoF
@ms280690 ms280690 self-assigned this Oct 12, 2026

- name: Install pnpm
if: ${{ steps.detect.outputs.pm == 'pnpm' }}
uses: pnpm/action-setup@d9184bf108216479bc5a137cc391f4d7b14c870b # v6.1.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants