Skip to content

Migrate web E2E to Playwright with approval-gated CI#365

Merged
ZappoMan merged 18 commits into
developfrom
tests/migrate-web-e2e-playwright
May 24, 2026
Merged

Migrate web E2E to Playwright with approval-gated CI#365
ZappoMan merged 18 commits into
developfrom
tests/migrate-web-e2e-playwright

Conversation

@ZappoMan
Copy link
Copy Markdown
Contributor

@ZappoMan ZappoMan commented May 23, 2026

Summary

  • Replace Maestro web E2E with a Playwright suite under tests/e2e/web/ (16 spec files, 26 test cases covering auth, billing, admin, policies, navigation, profile, and marketing)
  • Add approval-gated CI (.github/workflows/e2e-web-pr-approval.yml) that runs against the PR preview after @ZappoMan approves, verifies preview SHA, bootstraps signed cookies, and posts formatted results to the PR
  • Seed standard + admin test users in global setup; add rich PR comment formatter and Playwright 1.60.0 security bump

Test plan

  • npm run test:e2e:web:install (first run / after Playwright upgrade)
  • supabase start + npm run test:e2e:web locally — all 26 test cases pass
  • Open PR against develop, get preview deploy, approve as @ZappoMan — E2E workflow runs and posts comment with summary table + per-spec details
  • Confirm Maestro mobile E2E unchanged (tests/e2e/mobile/)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 23, 2026

CI Coverage & Test Summary

Metric Coverage Covered / Total
Statements 99.85% 18539 / 18567
Branches 98.16% 4843 / 4934
Functions 99.22% 767 / 773
Lines 99.88% 18508 / 18530

Suites: 62 passed, 0 failed (62 total) · Tests: 658 passed, 0 failed (658 total)

✅ All reported test suites passed.

Coverage artifacts: coverage-summary, coverage-packages.


Updated at: May 23, 2026 at 10:32 PM PDT

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 23, 2026

Component Status Link
🌐 Web View logs
🗄️ Database ✅ Migrated
💳 Billing ✅ Deployed
📱 Mobile ⏭️ Skipped

Last deployed: 22:08 PDT

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 23, 2026

DB & Integration Test Summary

Check Status Details
Migration filename format
Database tests (pgTAP) ✅ Pass 12/12 files · 189/189 assertions
Integration tests (Jest) ✅ Pass 9/9 suites · 50/50 tests
Live Supabase client (Vitest) ✅ Pass 1/1 files · 1/1 tests

Full logs: db-tests-log, integration-log artifacts.


Updated at: May 23, 2026 at 10:34 PM PDT

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

This PR migrates centralized web E2E testing from Maestro (beta web support) to a Playwright suite under tests/e2e/web/, and adds an approval-gated GitHub Actions workflow to run those E2Es against the PR preview deployment after an explicit approver review.

Changes:

  • Added Playwright web E2E suite (fixtures, global setup/teardown, config) and replaced the previous Maestro web flow.
  • Introduced an approval-gated CI workflow (e2e-web-pr-approval.yml) that validates the preview deployment SHA, optionally bootstraps CloudFront signed cookies, runs Playwright, uploads artifacts, and posts a formatted PR comment.
  • Added supporting scripts (signed-cookie bootstrap URL generator + PR comment formatter + unit tests), updated docs, and bumped dependencies for Playwright.

Reviewed changes

Copilot reviewed 32 out of 34 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tests/e2e/web/specs/profile/profile-edit.spec.ts Playwright spec for editing profile display name.
tests/e2e/web/specs/navigation/user-menu.spec.ts Playwright spec validating authenticated user-menu navigation.
tests/e2e/web/specs/marketing/policies.spec.ts Playwright spec covering policy pages rendering.
tests/e2e/web/specs/marketing/landing.spec.ts Playwright specs for marketing landing + CTA navigation.
tests/e2e/web/specs/billing/usage.spec.ts Playwright spec validating billing usage view.
tests/e2e/web/specs/billing/plans.spec.ts Playwright spec validating billing plans view.
tests/e2e/web/specs/billing/overview.spec.ts Playwright spec validating billing overview hub.
tests/e2e/web/specs/billing/navigation.spec.ts Playwright spec validating billing tab navigation.
tests/e2e/web/specs/auth/signup.spec.ts Playwright spec for signup happy-path/confirm-email branch.
tests/e2e/web/specs/auth/signup-invite.spec.ts Playwright spec for invalid invite handling.
tests/e2e/web/specs/auth/protected-routes.spec.ts Playwright specs ensuring unauthenticated redirects work.
tests/e2e/web/specs/auth/logout.spec.ts Playwright spec for logout + re-login flow.
tests/e2e/web/specs/auth/login.spec.ts Playwright spec for seeded-user login.
tests/e2e/web/specs/auth/login-validation.spec.ts Playwright specs for login form validation + signup link.
tests/e2e/web/specs/auth/forgot-password.spec.ts Playwright specs for forgot-password UX variants.
tests/e2e/web/specs/admin/access.spec.ts Playwright specs for admin access + navigation.
tests/e2e/web/playwright.config.ts Playwright runner configuration (reporters, webServer behavior, retries/workers).
tests/e2e/web/global-teardown.ts Teardown that deletes seeded users via service-role client.
tests/e2e/web/global-setup.ts Seeds standard/admin users and saves storageState for authenticated fixtures.
tests/e2e/web/fixtures/auth.fixture.ts Shared Playwright fixtures/helpers for authenticated/admin pages + form helpers.
tests/e2e/web/env.ts Centralized env helpers for base URL/path handling + preview Supabase env mapping.
tests/e2e/web/flows/home.yaml Removes old Maestro web YAML flow.
scripts/run-e2e.sh Switches web E2E execution from Maestro to Playwright.
scripts/pr-preview/generate-preview-bootstrap-url.sh New helper to generate signed-cookie bootstrap URL for preview access.
scripts/ci/format-playwright-e2e-pr-comment.mjs New formatter to post Playwright JSON results as a PR comment.
scripts/__tests__/format-playwright-e2e-pr-comment.test.mjs Adds unit tests for the PR comment formatter script.
scripts/__tests__/fixtures/playwright-e2e-report.json Fixture JSON report used by the formatter unit tests.
package.json Replaces web E2E script with Playwright commands; adds @playwright/test.
package-lock.json Locks Playwright dependencies (@playwright/test, playwright, playwright-core).
docs/TESTING.md Updates testing documentation to reflect Playwright web E2E + approval-gated CI.
docs/ARCHITECTURE.md Documents the approval-gated Playwright web E2E workflow.
.gitignore Ignores Playwright E2E artifacts and auth state files under tests/e2e/web/.
.github/workflows/pr-preview-environment.yml Refactors signed-cookie bootstrap URL generation to the new script.
.github/workflows/e2e-web-pr-approval.yml Adds the new approval-gated Playwright web E2E workflow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/e2e-web-pr-approval.yml Outdated
Comment thread docs/ARCHITECTURE.md
Comment thread .github/workflows/pr-preview-environment.yml Outdated
Comment thread .github/workflows/e2e-web-pr-approval.yml Outdated
Comment thread scripts/__tests__/format-playwright-e2e-pr-comment.test.mjs
Comment thread tests/e2e/web/playwright.config.ts
@ZappoMan ZappoMan force-pushed the tests/migrate-web-e2e-playwright branch from 255d223 to 0964e61 Compare May 23, 2026 22:47
ZappoMan added 6 commits May 23, 2026 16:25
Web flows now run via Playwright locally and against PR previews when @ZappoMan approves; mobile Maestro is unchanged.
Parse Playwright JSON results to post structured pass/fail/retry counts and test breakdowns on approval runs.
…cies.

Seed an admin user alongside the standard test user so critical flows like logout, billing tabs, and admin access are exercised end-to-end.
…s gate.

The db-tests job was failing when migration-filenames was skipped on PRs without supabase schema changes, even though pgTAP and integration tests passed in supabase-tests.
…egistration.

Pass WEB_URL as deploy origin with WEB_BASE_PATH for preview E2E, stop logging signed bootstrap URLs via eval, register the Playwright comment formatter test in test:unit:scripts, and clarify spec vs test-case counts in docs.
@ZappoMan ZappoMan force-pushed the tests/migrate-web-e2e-playwright branch from 0964e61 to e22ea5f Compare May 23, 2026 23:25
ZappoMan added 3 commits May 23, 2026 16:35
…ignore.

Cover blob reports and root-level Playwright cache paths so local test runs do not leave untracked temporary files.
Authors who cannot self-approve can start the Playwright preview workflow without @ZappoMan approval.
issue_comment workflows only run from main; add a dispatcher there plus label and workflow_dispatch triggers on the Playwright workflow.
@ZappoMan ZappoMan mentioned this pull request May 24, 2026
3 tasks
@ZappoMan ZappoMan added the run-e2e Trigger Playwright web E2E against PR preview label May 24, 2026
Accept the latest successful pr-N-preview deployment when HEAD only changed CI/docs and no web-relevant files changed since that deploy.
@ZappoMan ZappoMan added run-e2e Trigger Playwright web E2E against PR preview and removed run-e2e Trigger Playwright web E2E against PR preview labels May 24, 2026
Accept /pr-N landing URLs with or without a trailing slash instead of requiring the URL to end in /.
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

Copilot reviewed 34 out of 36 changed files in this pull request and generated 6 comments.

Comment thread .github/workflows/e2e-web-pr-approval.yml
Comment thread tests/e2e/web/env.ts
Comment thread tests/e2e/web/global-setup.ts
Comment thread tests/e2e/web/playwright.config.ts
Comment thread .github/workflows/e2e-web-pr-comment-trigger.yml Outdated
Comment thread tests/e2e/web/specs/auth/signup.spec.ts Outdated
ZappoMan added 3 commits May 23, 2026 21:50
Use a single HTML table with colspan file headers and a gray background band for easier scanning in PR comments.
…t trim.

Grant issues:write for E2E PR comments, declare Playwright env vars for type-check, race signup outcomes, and match Run e2e comments case-insensitively after trim.
Reuse the summary section icons in each test's Status column for quicker scanning.
@ZappoMan ZappoMan added run-e2e Trigger Playwright web E2E against PR preview and removed run-e2e Trigger Playwright web E2E against PR preview labels May 24, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 24, 2026

End 2 End - Test Results

Summary

Metric Count
✅ Passed 26
☑️ Passed after retry 0
⚠️ Skipped 0
❌ Failed 0
⏱️ Total Duration 0.37 min

Test Environment

🌐 Domain: https://deploy.beakerstack.com/pr-365/

View workflow run

Details

Test Status Duration
admin/access.spec.ts
Admin access › redirects non-admin users to not authorized ✅ passed 0.01 min
Admin access › allows admin users to view admin overview ✅ passed 0.01 min
Admin access › admin can open users page from overview ✅ passed 0.01 min
auth/forgot-password.spec.ts
Forgot password › submits reset request and shows confirmation message ✅ passed 0.02 min
Forgot password › validates email is required ✅ passed 0.01 min
Forgot password › shows expired link notice when expired query param is set ✅ passed 0.01 min
auth/login-validation.spec.ts
Login validation › requires email and password before submit ✅ passed 0.01 min
Login validation › links to signup from login page ✅ passed 0.01 min
auth/login.spec.ts
Login › signs in seeded user and lands on dashboard ✅ passed 0.02 min
auth/logout.spec.ts
Logout › signs out from user menu and returns to landing ✅ passed 0.02 min
auth/protected-routes.spec.ts
Protected routes › redirects unauthenticated dashboard visit to home ✅ passed 0.01 min
Protected routes › redirects unauthenticated profile visit to home ✅ passed 0.01 min
Protected routes › redirects unauthenticated billing visit to home ✅ passed 0.01 min
auth/signup-invite.spec.ts
Signup invite › shows invalid invite message when token is missing ✅ passed 0.01 min
auth/signup.spec.ts
Signup › creates an account or prompts for email confirmation ✅ passed 0.02 min
billing/navigation.spec.ts
Billing navigation › navigates across billing tabs ✅ passed 0.01 min
billing/overview.spec.ts
Billing overview › shows billing hub with current plan context ✅ passed 0.01 min
billing/plans.spec.ts
Billing plans › lists available plans for authenticated users ✅ passed 0.01 min
billing/usage.spec.ts
Billing usage › shows usage meters and plan limits ✅ passed 0.01 min
marketing/landing.spec.ts
Marketing landing › shows hero content and signup CTA ✅ passed 0.01 min
Marketing landing › navigates to signup from Get started CTA ✅ passed 0.01 min
marketing/policies.spec.ts
Policy pages › renders Terms of Service ✅ passed 0.01 min
Policy pages › renders Privacy Policy ✅ passed 0.01 min
Policy pages › renders Refunds Policy ✅ passed 0.01 min
navigation/user-menu.spec.ts
Authenticated navigation › user menu links reach profile, billing, and dashboard ✅ passed 0.01 min
profile/profile-edit.spec.ts
Profile › updates display name from profile editor ✅ passed 0.01 min

Poll for slower preview responses, surface UI errors, and force open signup mode during global setup.
@ZappoMan ZappoMan added run-e2e Trigger Playwright web E2E against PR preview and removed run-e2e Trigger Playwright web E2E against PR preview labels May 24, 2026
Bump email rate limits and enable autoconfirm during Playwright setup so signup and password-reset specs are not blocked by shared preview SMTP quotas.
@ZappoMan ZappoMan added run-e2e Trigger Playwright web E2E against PR preview and removed run-e2e Trigger Playwright web E2E against PR preview labels May 24, 2026
@ZappoMan ZappoMan requested a review from Copilot May 24, 2026 05:20
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

Copilot reviewed 36 out of 39 changed files in this pull request and generated 5 comments.

Comment thread tests/e2e/web/playwright.config.ts Outdated
Comment thread tests/e2e/web/global-setup.ts
Comment thread tests/e2e/web/preview-auth-config.ts Outdated
Comment thread scripts/run-e2e.sh Outdated
Comment thread scripts/run-e2e.sh Outdated
Disable Playwright webServer for all preview targets, snapshot/restore waitlist signup mode and patched auth fields, and standardize run-e2e.sh preview env wiring with --skip-web support.
@ZappoMan ZappoMan merged commit e8ddc33 into develop May 24, 2026
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-e2e Trigger Playwright web E2E against PR preview

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants