Skip to content

Commit 5d6beb6

Browse files
feat: add Playwright webServer configurations for all advanced-api examples
- Add webServer configurations to Playwright configs to automatically start and manage dev servers - This eliminates port conflicts and build loop issues by letting Playwright manage server lifecycle - Update e2e:ci scripts to use simple 'npx playwright test' since servers are managed by Playwright - Configure proper timeout (120s) and reuseExistingServer settings for CI environments Examples updated: - dynamic-remotes-runtime-environment-variables (ports 3000, 3001) - automatic-vendor-sharing (ports 3001, 3002) - dynamic-remotes-synchronous-imports (ports 3001, 3002) - dynamic-remotes (ports 3001, 3002, 3003) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent fe7b18e commit 5d6beb6

File tree

8 files changed

+66
-12
lines changed

8 files changed

+66
-12
lines changed

advanced-api/automatic-vendor-sharing/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"clean": "pnpm --filter automatic-vendor-sharing_app* --parallel clean",
1515
"legacy:start": "pnpm --filter automatic-vendor-sharing_app* --parallel legacy:start",
1616
"legacy:build": "pnpm --filter automatic-vendor-sharing_app* --parallel legacy:build",
17-
"e2e:ci": "pnpm start & wait-on http-get://localhost:3001/ http-get://localhost:3002/ && npx playwright test",
17+
"e2e:ci": "npx playwright test",
1818
"legacy:e2e:ci": "pnpm legacy:start & wait-on http-get://localhost:3001/ http-get://localhost:3002/ && npx playwright test"
1919
},
2020
"devDependencies": {

advanced-api/automatic-vendor-sharing/playwright.config.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,18 @@ export default defineConfig({
2929
},
3030
],
3131

32-
// webServer configuration removed - servers are started manually in package.json scripts
33-
// This ensures better compatibility with CI environments and matches the original Cypress approach
32+
webServer: [
33+
{
34+
command: 'pnpm --filter automatic-vendor-sharing_app1 start',
35+
port: 3001,
36+
reuseExistingServer: !process.env.CI,
37+
timeout: 120000,
38+
},
39+
{
40+
command: 'pnpm --filter automatic-vendor-sharing_app2 start',
41+
port: 3002,
42+
reuseExistingServer: !process.env.CI,
43+
timeout: 120000,
44+
},
45+
],
3446
});

advanced-api/dynamic-remotes-runtime-environment-variables/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"docker:build": "pnpm --filter dynamic-remotes-runtime-environment-variables_* --parallel docker:build",
1616
"docker:run": "pnpm --filter dynamic-remotes-runtime-environment-variables_* --parallel docker:run",
1717
"docker:rm": "pnpm --filter dynamic-remotes-runtime-environment-variables_* --parallel docker:rm",
18-
"e2e:ci": "pnpm start & wait-on http-get://localhost:3000/ http-get://localhost:3001/ && npx playwright test",
18+
"e2e:ci": "npx playwright test",
1919
"legacy:e2e:ci": "pnpm legacy:start & wait-on http-get://localhost:3000/ http-get://localhost:3001/ && npx playwright test"
2020
},
2121
"devDependencies": {

advanced-api/dynamic-remotes-runtime-environment-variables/playwright.config.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,18 @@ export default defineConfig({
2929
},
3030
],
3131

32-
// webServer configuration removed - servers are started manually in package.json scripts
33-
// This ensures better compatibility with CI environments and matches the original Cypress approach
32+
webServer: [
33+
{
34+
command: 'pnpm --filter dynamic-remotes-runtime-environment-variables_host start',
35+
port: 3000,
36+
reuseExistingServer: !process.env.CI,
37+
timeout: 120000,
38+
},
39+
{
40+
command: 'pnpm --filter dynamic-remotes-runtime-environment-variables_remote start',
41+
port: 3001,
42+
reuseExistingServer: !process.env.CI,
43+
timeout: 120000,
44+
},
45+
],
3446
});

advanced-api/dynamic-remotes-synchronous-imports/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"build": "pnpm --filter dynamic-remotes-synchronous-imports_app* --parallel build",
1212
"serve": "pnpm --filter dynamic-remotes-synchronous-imports_app* --parallel serve",
1313
"clean": "pnpm --filter dynamic-remotes-synchronous-imports_app* --parallel clean",
14-
"e2e:ci": "pnpm start & wait-on http-get://localhost:3001/ http-get://localhost:3002/ && pnpm exec playwright test"
14+
"e2e:ci": "npx playwright test"
1515
},
1616
"devDependencies": {
1717
"@playwright/test": "^1.54.2",

advanced-api/dynamic-remotes-synchronous-imports/playwright.config.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,18 @@ export default defineConfig({
2929
},
3030
],
3131

32-
// webServer configuration removed - servers are started manually in package.json scripts
33-
// This ensures better compatibility with CI environments and matches the original Cypress approach
32+
webServer: [
33+
{
34+
command: 'pnpm --filter dynamic-remotes-synchronous-imports_app1 start',
35+
port: 3001,
36+
reuseExistingServer: !process.env.CI,
37+
timeout: 120000,
38+
},
39+
{
40+
command: 'pnpm --filter dynamic-remotes-synchronous-imports_app2 start',
41+
port: 3002,
42+
reuseExistingServer: !process.env.CI,
43+
timeout: 120000,
44+
},
45+
],
3446
});

advanced-api/dynamic-remotes/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"test:e2e": "npx playwright test",
1818
"test:e2e:ui": "npx playwright test --ui",
1919
"test:e2e:debug": "npx playwright test --debug",
20-
"e2e:ci": "pnpm start & sleep 5 && wait-on tcp:3001 tcp:3002 tcp:3003 && npx playwright test --reporter=list; kill $(jobs -p) 2>/dev/null || true",
20+
"e2e:ci": "npx playwright test --reporter=list",
2121
"legacy:e2e:ci": "pnpm legacy:start & sleep 5 && wait-on tcp:3001 tcp:3002 tcp:3003 && LEGACY_MODE=true npx playwright test --reporter=list; kill $(jobs -p) 2>/dev/null || true"
2222
},
2323
"devDependencies": {

advanced-api/dynamic-remotes/playwright.config.ts

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,24 @@ export default defineConfig({
2929
},
3030
],
3131

32-
// webServer configuration removed - servers are started manually in package.json scripts
33-
// This ensures better compatibility with CI environments and matches the original Cypress approach
32+
webServer: [
33+
{
34+
command: 'pnpm --filter dynamic-remotes_app1 start',
35+
port: 3001,
36+
reuseExistingServer: !process.env.CI,
37+
timeout: 120000,
38+
},
39+
{
40+
command: 'pnpm --filter dynamic-remotes_app2 start',
41+
port: 3002,
42+
reuseExistingServer: !process.env.CI,
43+
timeout: 120000,
44+
},
45+
{
46+
command: 'pnpm --filter dynamic-remotes_app3 start',
47+
port: 3003,
48+
reuseExistingServer: !process.env.CI,
49+
timeout: 120000,
50+
},
51+
],
3452
});

0 commit comments

Comments
 (0)