Skip to content

Commit b464c3d

Browse files
fix(e2e): separate unauthenticated from logged-in projects
1 parent 8c9242c commit b464c3d

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

playwright.config.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { defineConfig, devices } from '@playwright/test'
44
* Playwright E2E Test Configuration for GitBox
55
*
66
* Configures auth setup with cookie injection for Supabase + GitHub OAuth,
7-
* and logged-in test projects that depend on the auth state.
7+
* and separate projects for authenticated vs unauthenticated tests.
88
*/
99

1010
/** Path to store authenticated state for reuse across tests */
@@ -37,13 +37,25 @@ export default defineConfig({
3737
projects: [
3838
/**
3939
* Setup project: Injects auth cookies to bypass OAuth flow.
40-
* Runs before all other projects that need authentication.
40+
* Runs before authenticated tests.
4141
*/
4242
{
4343
name: 'setup',
4444
testMatch: /auth\.setup\.ts/,
4545
},
4646

47+
/**
48+
* Unauthenticated tests: Landing page, login page, etc.
49+
* These don't require authentication state.
50+
*/
51+
{
52+
name: 'unauthenticated',
53+
use: {
54+
...devices['Desktop Chrome'],
55+
},
56+
testMatch: /landing\.spec\.ts|login\.spec\.ts/,
57+
},
58+
4759
/**
4860
* Logged-in tests: Tests that require authenticated state.
4961
* Depends on 'setup' project and uses its stored auth state.
@@ -55,7 +67,7 @@ export default defineConfig({
5567
...devices['Desktop Chrome'],
5668
storageState: AUTH_FILE,
5769
},
58-
testIgnore: /auth\.setup\.ts/,
70+
testMatch: /boards\.spec\.ts|kanban\.spec\.ts|settings\.spec\.ts/,
5971
},
6072
],
6173

0 commit comments

Comments
 (0)