test: add Playwright E2E suite for GuidedTour and SampleApp#28
Merged
Conversation
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.
There was a problem hiding this comment.
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/andsamples/SampleApp/playwright-tests/covering key flows including deferred consent + call-chaining assertions. - Wires execution into
maketargets, devcontainer post-create provisioning, and CI (e2ejob 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
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a browser end-to-end test suite (
@playwright/test, TypeScript) covering the GuidedTour and SampleApp Blazor demos. Playwright'swebServerboots 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
mode,scheme,iss,sub,scope, agent identities, and the nestedactdelegation chain for call-chaining (not just substring/existence checks).tests/e2e/helpers/) for Blazor cold-circuit first-click drops, dynamic consent granting, and inspector JSON parsing.e2e,e2e-tour,e2e-sample,e2e-install,e2e-report.post-create.shinstalls Node 20 + Playwright Chromium.e2ejob (needs: build) runs the suite and uploads the HTML report as an artifact.Validation
tsc --noEmitclean.make e2e→ 20 passed, 0 skipped (11 GuidedTour + 9 SampleApp) locally.Notes
node_modules/,playwright-report/,test-results/) are gitignored.e2eCI job runs in parallel-eligible but gated behindbuild; it skips if the build/unit tests fail.