Skip to content

Commit deacef1

Browse files
committed
update plawright config
1 parent e9a762b commit deacef1

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
"build": "next build",
88
"start": "next start",
99
"lint": "next lint",
10+
"serve": "npx http-server --port 5432 out",
1011
"test": "npx playwright test",
11-
"test:prod": "npm run build && concurrently 'npx http-server --silent --port 5432 out' 'npm run test' --kill-others -s first",
12+
"test:ci": "CI=true npm run test",
1213
"test:watch": "chokidar '**/*.spec.ts' '**/*.page.tsx' -c 'test_file_path=$(echo {path} | sed s/page.tsx/spec.ts/) && npm run test -- --retries=0 ${test_file_path}'"
1314
},
1415
"dependencies": {
@@ -22,7 +23,6 @@
2223
"@types/react": "^18",
2324
"@types/react-dom": "^18",
2425
"chokidar-cli": "^3.0.0",
25-
"concurrently": "^8.2.2",
2626
"typescript": "^5"
2727
}
2828
}

playwright.config.ts

+10
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@ export default defineConfig({
3131
trace: "on-first-retry",
3232
},
3333

34+
// on CI, run the static server to serve the built app
35+
webServer: process.env.CI
36+
? {
37+
command: "npm run serve",
38+
url: "http://localhost:5432",
39+
reuseExistingServer: true,
40+
timeout: 120 * 1000,
41+
}
42+
: undefined,
43+
3444
/* Configure projects for major browsers */
3545
projects: [
3646
{

src/pages/index.page.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default function App() {
2+
return <div>Index page</div>;
3+
}

0 commit comments

Comments
 (0)