Skip to content

test: add Playwright E2E suite for GuidedTour and SampleApp#28

Merged
dasiths merged 3 commits into
mainfrom
test/playwright-e2e-suite
May 31, 2026
Merged

test: add Playwright E2E suite for GuidedTour and SampleApp#28
dasiths merged 3 commits into
mainfrom
test/playwright-e2e-suite

Conversation

@dasiths
Copy link
Copy Markdown
Collaborator

@dasiths dasiths commented May 31, 2026

Summary

Adds a browser end-to-end test suite (@playwright/test, TypeScript) covering the GuidedTour and SampleApp Blazor demos. Playwright's webServer boots all six AAuth services itself (WhoAmI, Orchestrator, MockPersonServer, MockAgentProvider, GuidedTour, SampleApp), so the suite is fully self-contained — no manual orchestration required.

What's included

  • 20 specs asserting exact response content: mode, scheme, iss, sub, scope, agent identities, and the nested act delegation chain for call-chaining (not just substring/existence checks).
  • Shared helpers (tests/e2e/helpers/) for Blazor cold-circuit first-click drops, dynamic consent granting, and inspector JSON parsing.
  • Makefile targets: e2e, e2e-tour, e2e-sample, e2e-install, e2e-report.
  • Dev container: post-create.sh installs Node 20 + Playwright Chromium.
  • CI: a gated e2e job (needs: build) runs the suite and uploads the HTML report as an artifact.

Validation

  • tsc --noEmit clean.
  • make e2e20 passed, 0 skipped (11 GuidedTour + 9 SampleApp) locally.

Notes

  • Test artifacts (node_modules/, playwright-report/, test-results/) are gitignored.
  • The e2e CI job runs in parallel-eligible but gated behind build; it skips if the build/unit tests fail.

Add a browser end-to-end test suite (@playwright/test, TypeScript) covering
the GuidedTour and SampleApp Blazor demos. Playwright's webServer boots all
six AAuth services (WhoAmI, Orchestrator, MockPersonServer, MockAgentProvider,
GuidedTour, SampleApp) so the suite is self-contained.

- 20 specs assert exact response content: modes, schemes, issuers, scopes,
  agent identities, and the nested act delegation chain for call-chaining.
- Shared helpers handle Blazor cold-circuit first-click drops, consent
  granting, and inspector JSON parsing.
- Makefile targets: e2e, e2e-tour, e2e-sample, e2e-install, e2e-report.
- post-create.sh installs Node 20 + Playwright Chromium for the dev container.
- CI gains a gated e2e job (needs: build) that runs the suite and uploads the
  HTML report artifact.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a self-contained Playwright (@playwright/test, TypeScript) end-to-end test suite for the Blazor Server demo apps (GuidedTour and SampleApp), including local/devcontainer setup and CI execution.

Changes:

  • Introduces Playwright toolchain/config under tests/e2e/ (config, helpers, docs, npm deps).
  • Adds E2E specs under samples/GuidedTour/playwright-tests/ and samples/SampleApp/playwright-tests/ covering key flows including deferred consent + call-chaining assertions.
  • Wires execution into make targets, devcontainer post-create provisioning, and CI (e2e job with HTML report artifact).
Show a summary per file
File Description
tests/e2e/tsconfig.json TypeScript config for the E2E toolchain + cross-folder spec typechecking.
tests/e2e/README.md Runbook for installing/running the E2E suite and explaining server lifecycle.
tests/e2e/playwright.config.ts Playwright config with two projects and webServer bootstrapping of all required services.
tests/e2e/package.json Playwright/TS devDependencies and scripts (including NODE_PATH setup).
tests/e2e/package-lock.json Dependency lockfile for reproducible E2E installs.
tests/e2e/helpers/tour.ts GuidedTour page-object helpers and response/token parsing utilities.
tests/e2e/helpers/json.ts SampleApp JSON/status assertion helpers.
tests/e2e/helpers/consent.ts MockPersonServer consent admin + popup approval helpers.
tests/e2e/helpers/blazor.ts Blazor Server interactivity gating and first-click retry helper.
tests/e2e/helpers/agents.ts Shared constants for URLs/agent IDs used across E2E specs.
tests/e2e/.gitignore Ignores Playwright and npm artifacts under the E2E folder.
samples/SampleApp/playwright-tests/jwt.spec.ts E2E coverage for JWT three-party direct grant (with pre-granted consent).
samples/SampleApp/playwright-tests/jwks-uri.spec.ts E2E coverage for JWKS URI agent identity flow (enrol + signed request).
samples/SampleApp/playwright-tests/jkt-jwt.spec.ts E2E coverage for JKT-JWT key rotation flow.
samples/SampleApp/playwright-tests/hwk.spec.ts E2E coverage for HWK pseudonymous signing flow.
samples/SampleApp/playwright-tests/home.spec.ts E2E coverage for SampleApp landing page content/links.
samples/SampleApp/playwright-tests/deferred.spec.ts E2E coverage for deferred consent approve/deny paths via popup.
samples/SampleApp/playwright-tests/call-chain.spec.ts E2E coverage for multi-hop call-chaining with nested act assertions.
samples/GuidedTour/playwright-tests/smoke.spec.ts Basic smoke test ensuring GuidedTour loads and becomes interactive.
samples/GuidedTour/playwright-tests/reset.spec.ts GuidedTour reset + inspector behavior coverage.
samples/GuidedTour/playwright-tests/picker.spec.ts GuidedTour picker UI structure and reactive text coverage.
samples/GuidedTour/playwright-tests/identity.spec.ts GuidedTour identity flow coverage across signing modes.
samples/GuidedTour/playwright-tests/deferred.spec.ts GuidedTour deferred flow approve/deny coverage via consent popup.
samples/GuidedTour/playwright-tests/call-chain.spec.ts GuidedTour call-chain flow assertions including decoded chain summary.
samples/GuidedTour/playwright-tests/bootstrap.spec.ts GuidedTour bootstrap/enrolment flow assertions including decoded token checks.
samples/GuidedTour/playwright-tests/autonomous.spec.ts GuidedTour autonomous (direct grant) flow assertions.
Makefile Adds make e2e* targets to install/run/report the Playwright suite.
.github/workflows/ci.yml Adds gated e2e CI job running Playwright and uploading the HTML report artifact.
.devcontainer/post-create.sh Installs Node 20 and provisions Playwright dependencies/browsers in devcontainer.
.agent/plans/2026-05-31-playwright-sample-e2e/research.md Research doc for the initiative (now needs CI note aligned with actual changes).
.agent/plans/2026-05-31-playwright-sample-e2e/implementation-plan.md Implementation plan with phased DoD (now needs CI DoD aligned with actual changes).

Copilot's findings

Files not reviewed (1)
  • tests/e2e/package-lock.json: Language not supported
  • Files reviewed: 31/32 changed files
  • Comments generated: 5

Comment thread tests/e2e/helpers/consent.ts Outdated
Comment thread tests/e2e/helpers/consent.ts Outdated
Comment thread tests/e2e/helpers/tour.ts Outdated
Comment thread .agent/plans/2026-05-31-playwright-sample-e2e/research.md Outdated
Comment thread .agent/plans/2026-05-31-playwright-sample-e2e/implementation-plan.md Outdated
Make the Playwright suite hermetic and tighten its helpers in response to
the PR #28 review (GitHub Copilot inline comments + local PR Review agent).

Core MockPersonServer change:
- Add ConsentStore.Clear() and PendingStore.Clear().
- Add demo-only POST /admin/reset that wipes consent + pending state so the
  test harness can start each spec from a known-empty store.

E2E suite:
- New helpers/fixtures.ts: a consentReset auto-fixture posts /admin/reset
  before every test; all specs now import test/expect from it so the suite
  is order-independent (fixes consent leakage between SampleApp specs).
- grantConsent and resetConsent throw on non-OK admin responses.
- Remove unused exports: revokeConsent, readTokenJson, successAlert,
  gotoInteractive, Agents.sampleAppEnrolled, Urls.guidedTour, Urls.sampleApp.
- runAll waits on a single deterministic "Running..." signal; expectResponse
  and expectStatus scope the status check to the status line / a word-boundary
  match instead of a bare substring.
- package.json declares "engines": { "node": ">=20" }.

CI:
- Cache ~/.cache/ms-playwright keyed on the resolved Playwright version.
- Upload tests/e2e/test-results on failure.

Validated: dotnet build (MockPersonServer), tsc --noEmit clean, make e2e
green (20 passed, 0 skipped).
@dasiths dasiths merged commit ae24c37 into main May 31, 2026
2 checks passed
@dasiths dasiths deleted the test/playwright-e2e-suite branch May 31, 2026 18:27
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