Skip to content

Commit 0f84544

Browse files
fixup! feat(test): replace cloudflare open-next build test with playwright tests
simplify logic as suggested
1 parent 560a62d commit 0f84544

File tree

2 files changed

+11
-27
lines changed

2 files changed

+11
-27
lines changed

.github/workflows/playwright-cloudflare-open-next.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
run: pnpm playwright
7373
env:
7474
PLAYWRIGHT_WEB_SERVER_COMMAND: pnpm turbo run cloudflare:preview
75-
PLAYWRIGHT_WEB_SERVER_PORT: 8787
75+
PLAYWRIGHT_BASE_URL: http://127.0.0.1:8787
7676

7777
- name: Upload Playwright test results
7878
if: always()

apps/site/playwright.config.ts

Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { defineConfig, devices } from '@playwright/test';
2-
import type { PlaywrightTestConfig } from '@playwright/test';
32

43
const isCI = !!process.env.CI;
54

@@ -11,34 +10,19 @@ export default defineConfig({
1110
retries: isCI ? 2 : 0,
1211
workers: isCI ? 1 : undefined,
1312
reporter: isCI ? [['html'], ['github']] : [['html']],
14-
...(() => {
15-
const use: PlaywrightTestConfig['use'] = {
16-
baseURL: process.env.PLAYWRIGHT_BASE_URL || 'http://127.0.0.1:3000',
17-
trace: 'on-first-retry',
18-
};
19-
20-
const webServerCommand = process.env.PLAYWRIGHT_WEB_SERVER_COMMAND;
21-
const webServerPort = parseInt(
22-
process.env.PLAYWRIGHT_WEB_SERVER_PORT ?? ''
23-
);
24-
if (webServerCommand && !isNaN(webServerPort)) {
25-
use.baseURL = `http://127.0.0.1:${webServerPort}`;
26-
return {
13+
...(process.env.PLAYWRIGHT_WEB_SERVER_COMMAND
14+
? {
2715
webServer: {
28-
command: webServerCommand,
29-
port: webServerPort,
30-
stdout: 'pipe',
31-
stderr: 'pipe',
16+
command: process.env.PLAYWRIGHT_WEB_SERVER_COMMAND,
17+
url: process.env.PLAYWRIGHT_BASE_URL || 'http://127.0.0.1:3000',
3218
timeout: 60_000 * 3,
3319
},
34-
use,
35-
};
36-
}
37-
38-
return {
39-
use,
40-
};
41-
})(),
20+
}
21+
: {}),
22+
use: {
23+
baseURL: process.env.PLAYWRIGHT_BASE_URL || 'http://127.0.0.1:3000',
24+
trace: 'on-first-retry',
25+
},
4226
projects: [
4327
{
4428
name: 'chromium',

0 commit comments

Comments
 (0)