Skip to content

Commit fa5906c

Browse files
committed
Update playwright.yml
1 parent aaaca8d commit fa5906c

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

.github/workflows/playwright.yml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,36 @@ jobs:
1717
run: npm ci
1818
- name: Install Playwright Browsers
1919
run: npx playwright install --with-deps
20+
- name: Build the project
21+
run: npm run build
22+
env:
23+
NEXT_PUBLIC_GRAPHQL_URL: ${{ secrets.NEXT_PUBLIC_GRAPHQL_URL }}
24+
- name: Start the application
25+
run: npm run start &
26+
env:
27+
NEXT_PUBLIC_GRAPHQL_URL: ${{ secrets.NEXT_PUBLIC_GRAPHQL_URL }}
28+
- name: Wait for the application to be ready
29+
run: |
30+
echo "Waiting for the application to be ready..."
31+
timeout 300 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:3000)" != "200" ]]; do sleep 5; done' || false
32+
echo "Application is ready!"
2033
- name: Run Playwright tests
2134
run: npx playwright test
2235
env:
23-
CI: true
24-
NEXT_PUBLIC_GRAPHQL_URL: ${{ secrets.NEXT_PUBLIC_GRAPHQL_URL }}
25-
- uses: actions/upload-artifact@v4
36+
CI: true
37+
NEXT_PUBLIC_GRAPHQL_URL: ${{ secrets.NEXT_PUBLIC_GRAPHQL_URL }}
38+
DEBUG: pw:api
39+
- name: Upload test results
2640
if: always()
41+
uses: actions/upload-artifact@v4
2742
with:
2843
name: playwright-report
2944
path: playwright-report/
3045
retention-days: 30
46+
- name: Upload test traces
47+
if: failure()
48+
uses: actions/upload-artifact@v4
49+
with:
50+
name: playwright-traces
51+
path: test-results/
52+
retention-days: 30

0 commit comments

Comments
 (0)