Skip to content

Commit 4f93942

Browse files
committed
fix: e2e tests
1 parent 3e22f61 commit 4f93942

2 files changed

Lines changed: 4 additions & 27 deletions

File tree

.github/workflows/test.yml

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -34,32 +34,9 @@ jobs:
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()

playwright.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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,

0 commit comments

Comments
 (0)