feat: ephemeral e2e preview environments#68
Merged
Conversation
Shared seed script that creates test users (owner, member, admin), organization, and memberships in any Turso/SQLite database. Used by both Playwright globalSetup (CI) and the preview-db workflow (preview).
Replace signup-based auth setup with login-only flow for three personas (owner, member, admin). Add ownerPage, memberPage, adminPage fixtures. authenticatedPage remains as backward-compatible owner alias.
Member and admin personas should not see the onboarding wizard. This was previously blocked by the lack of pre-seeded accounts.
New workflow creates an isolated Turso database per PR, seeds test accounts, sets Vercel branch-scoped env vars, and posts a PR comment with login credentials. Cleans up on PR close. Also removes unused E2E_TEST_EMAIL/PASSWORD from the e2e workflow since auth now uses the seeded personas.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Preview Environment
Preview URL: https://switchflag-k8wvvv7v0-tom-blaymires-projects-d8765916.vercel.app
|
Auto-derive BETTER_AUTH_URL from VERCEL_URL in preview environments so auth API calls go to the correct origin. Also allow vercel.live scripts and connections in CSP.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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
What changed
New files:
e2e/helpers/seed.constants.ts— shared persona definitions (owner/member/admin)e2e/seed-db.ts— database seed script usingbetter-auth/cryptofor password hashinge2e/global-setup.ts— Playwright globalSetup that seeds local SQLite DBs in CI.github/workflows/preview-db.yml— preview DB lifecycle (create → seed → Vercel env vars → PR comment → cleanup)Modified files:
e2e/auth.setup.ts— simplified to login-only loop for 3 personase2e/fixtures/auth.fixture.ts— addedownerPage,memberPage,adminPagefixturese2e/helpers/auth.constants.ts— derives from seed constantse2e/onboarding.spec.ts— added member/admin role-specific testsplaywright.config.ts— added globalSetup.github/workflows/e2e.yml— removed unused E2E_TEST_EMAIL/PASSWORDRequired secrets
The preview-db workflow requires these GitHub Actions secrets (already added):
TURSO_API_TOKEN,TURSO_GROUPVERCEL_TOKEN,VERCEL_PROJECT_ID,VERCEL_ORG_IDTest plan
e2e-owner@test.local/TestPassword123!on the preview URL