Skip to content

Commit

Permalink
Update playwright.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
w3bdesign committed Oct 23, 2024
1 parent aaaca8d commit fa5906c
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,36 @@ jobs:
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Build the project
run: npm run build
env:
NEXT_PUBLIC_GRAPHQL_URL: ${{ secrets.NEXT_PUBLIC_GRAPHQL_URL }}
- name: Start the application
run: npm run start &
env:
NEXT_PUBLIC_GRAPHQL_URL: ${{ secrets.NEXT_PUBLIC_GRAPHQL_URL }}
- name: Wait for the application to be ready
run: |
echo "Waiting for the application to be ready..."
timeout 300 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:3000)" != "200" ]]; do sleep 5; done' || false
echo "Application is ready!"
- name: Run Playwright tests
run: npx playwright test
env:
CI: true
NEXT_PUBLIC_GRAPHQL_URL: ${{ secrets.NEXT_PUBLIC_GRAPHQL_URL }}
- uses: actions/upload-artifact@v4
CI: true
NEXT_PUBLIC_GRAPHQL_URL: ${{ secrets.NEXT_PUBLIC_GRAPHQL_URL }}
DEBUG: pw:api
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: playwright-report/
retention-days: 30
- name: Upload test traces
if: failure()
uses: actions/upload-artifact@v4
with:
name: playwright-traces
path: test-results/
retention-days: 30

0 comments on commit fa5906c

Please sign in to comment.