Skip to content

Commit c456415

Browse files
authored
test: ensure server is only manually started in CI (#584)
1 parent 2bd70c1 commit c456415

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

apps/kitchensink-react/playwright.config.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ import {createPlaywrightConfig} from '@repo/e2e'
33
export default createPlaywrightConfig({
44
testDir: './e2e',
55
/* Run your local dev server before starting the tests */
6-
webServer: {
7-
command: process.env['CI']
8-
? 'pnpm build --mode e2e && pnpm preview --mode e2e --port 3333'
9-
: 'pnpm dev --mode e2e',
10-
reuseExistingServer: true,
11-
stdout: 'pipe',
12-
},
6+
...(process.env['CI']
7+
? {} // In CI, don't start a webServer since it's started manually
8+
: {
9+
webServer: {
10+
command: 'pnpm dev --mode e2e',
11+
reuseExistingServer: true,
12+
stdout: 'pipe',
13+
},
14+
}),
1315
})

packages/@repo/e2e/src/setup/auth.setup.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,7 @@ const authenticateUser = async (context: BrowserContext, config: AuthConfig) =>
4444
await page.goto(loginUrl.toString())
4545

4646
// Wait for the redirect to complete AND network to be idle
47-
await Promise.all([
48-
page.waitForURL(config.expectedRedirectUrl),
49-
page.waitForLoadState('networkidle'),
50-
])
47+
await Promise.all([page.waitForURL(config.expectedRedirectUrl)])
5148

5249
await page.close()
5350
}

0 commit comments

Comments
 (0)