saasprokit
Testing

E2E Tests

Playwright end-to-end test suite organized by feature area

Specs live in domain folders under apps/web/e2e/ (plus fixtures/ and helpers/ — see Maildev helper). List current cases with npx playwright test --list in apps/web.

How E2E is wired

Default projects in apps/web/playwright.config.ts:

ProjectMatchesDepends on
auth-setupsetup/auth.setup.tsensureVerifiedUser writes e2e/.auth/user.json
org-setupsetup/org.setup.ts — writes org slugauth-setup
no-auth(public|auth)/*.spec.ts — no login
authenticated(account|admin|dashboard|members|payment)/*.spec.tsauth-setup, org-setup
capture (opt-in)e2e/capture/*.capture.tsCAPTURE=1 / pnpm --filter app capture

globalSetup (e2e/setup/global-setup.ts) clears MailDev. pnpm --filter app test:e2e is plain playwright test and does not load capture.

Local infra: docker compose -f docker-compose.e2e.yml up -d (Postgres on 5433, Maildev). CI (.github/workflows/e2e.yml) is gated behind the e2e PR label.

account/ — 9 tests

FileTestsCovers
delete-account.spec.ts1Account deletion confirmation, and being unable to sign in again afterward
home.spec.ts2/account redirect to profile + unauthenticated guard on protected routes
new-org.spec.ts2Create-organization form — slug auto-generation, name validation
profile.spec.ts3Profile editing — populated name/read-only email, validation, persistence
security.spec.ts1Security page render — change-password form, 2FA section, sessions list

admin/ — 4 tests

FileTestsCovers
admin-access.spec.ts4Admin area access control across regular, moderator, and staff/admin roles

auth/ — 13 tests

FileTestsCovers
magic-link.spec.ts1Full magic-link sign-in round trip — request, email, click
password-reset.spec.ts3Forgot-password form, reset-confirmation email, full reset-and-restore flow
sign-in.spec.ts3Sign-in form render, redirect on success, sign-out
sign-up.spec.ts3Sign-up form render, password-mismatch validation, verification-email flow
two-factor.spec.ts1/auth/2fa challenge page render with no pending session
verify-email.spec.ts2Resend button visibility + resend-verification-email flow

dashboard/ — 5 tests

FileTestsCovers
overview.spec.ts2Org dashboard heading + sidebar navigation to Members
selection.spec.ts1/org resolves to the test organization
settings.spec.ts2Org settings form — populated name/read-only slug, persistence

members/ — 13 tests

FileTestsCovers
invitations.spec.ts2Pending-invitations table + empty search results
invite-accept.spec.ts4Invite-accept error states, email-mismatch guard, Free-plan member-limit guard
invite-links.spec.ts2Invite-link create dialog + generated URL appearing in the table
invite-preview.spec.ts1Invalid invite-token error card
list.spec.ts4Member list — current-user row, sidebar navigation, invite validation, Free-plan member-limit guard

payment/ — 8 tests

FileTestsCovers
billing-page.spec.ts4Current Plan/Change Plan sections, Free/Pro/Enterprise tiers, monthly/annual toggle, disabled Current-Plan button
checkout-canceled.spec.ts2Checkout-canceled page render + Try Again navigation
checkout-success.spec.ts1Checkout-error card when the session can't be verified
checkout.spec.ts1Upgrade-to-Pro checkout server action

public/ — 2 tests

FileTestsCovers
home.spec.ts2Hero/CTA/pricing/footer sections + monthly/annual pricing toggle

Running these tests

docker compose -f docker-compose.e2e.yml up -d
pnpm --filter app test:e2e
pnpm --filter app test:e2e:ui
pnpm --filter app test:e2e:auth          # --project=no-auth
pnpm --filter app test:e2e:app           # --project=authenticated
pnpm --filter app capture                # CAPTURE=1
pnpm --filter app test:e2e -- e2e/payment

On this page