File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3434 run : npm run build
3535
3636 - name : Run Playwright tests
37- run : |
38- npm run serve &
39- SERVER_PID=$!
40-
41- # Wait for server to be ready
42- echo "Waiting for server to be ready..."
43- max_attempts=30
44- attempt=0
45- while [ $attempt -lt $max_attempts ]; do
46- if curl -s http://localhost:3000 > /dev/null 2>&1; then
47- echo "Server is ready!"
48- break
49- fi
50- attempt=$((attempt + 1))
51- sleep 1
52- done
53-
54- # Run tests
55- export PLAYWRIGHT_JUNIT_OUTPUT_FILE=test-results/junit.xml
56- npx playwright test --reporter=junit,html,list || TEST_EXIT_CODE=$?
57-
58- # Stop server
59- kill $SERVER_PID || true
60-
61- # Exit with test result
62- exit ${TEST_EXIT_CODE:-0}
37+ env :
38+ PLAYWRIGHT_JUNIT_OUTPUT_FILE : test-results/junit.xml
39+ run : npx playwright test --reporter=junit,html,list
6340
6441 - name : Upload test results (JUnit XML)
6542 if : always()
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ export default defineConfig({
5858
5959 /* Run your local dev server before starting the tests */
6060 webServer : {
61- command : 'npm start' ,
61+ command : process . env . CI ? 'npm run serve' : 'npm start' ,
6262 url : 'http://localhost:3000' ,
6363 reuseExistingServer : ! process . env . CI ,
6464 timeout : 120000 ,
You can’t perform that action at this time.
0 commit comments