e2e-playwright.yml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. name: E2E (Cine Studio)
  2. # Browser-driven end-to-end tests for the Cine Studio WebApp. These are
  3. # front-end only (Node + Playwright + a static file server) and do not
  4. # touch the Go build, so they run as an independent job. Scoped to changes
  5. # under the app or the test harness to avoid running on unrelated commits.
  6. on:
  7. push:
  8. paths:
  9. - "src/web/Cine Studio/**"
  10. - "test/e2e/playwright/**"
  11. - ".github/workflows/e2e-playwright.yml"
  12. pull_request:
  13. paths:
  14. - "src/web/Cine Studio/**"
  15. - "test/e2e/playwright/**"
  16. - ".github/workflows/e2e-playwright.yml"
  17. permissions:
  18. contents: read
  19. jobs:
  20. playwright:
  21. runs-on: ubuntu-latest
  22. steps:
  23. - name: Checkout
  24. uses: actions/checkout@v4
  25. # Branches that do not ship the Cine Studio test harness (for example
  26. # v3.0.5, where the test directory was removed) must skip instead of
  27. # failing because the working directory does not exist.
  28. - name: Check for E2E harness
  29. id: harness
  30. run: |
  31. if [ -f test/e2e/playwright/package.json ]; then
  32. echo "exists=true" >> "$GITHUB_OUTPUT"
  33. else
  34. echo "exists=false" >> "$GITHUB_OUTPUT"
  35. echo "::notice::Skipping E2E: test/e2e/playwright is not present on this branch."
  36. fi
  37. - name: Set up Node.js
  38. if: steps.harness.outputs.exists == 'true'
  39. uses: actions/setup-node@v4
  40. with:
  41. node-version: "20"
  42. - name: Install dependencies
  43. if: steps.harness.outputs.exists == 'true'
  44. working-directory: test/e2e/playwright
  45. run: npm install --no-audit --no-fund
  46. - name: Install Playwright Chromium (with OS deps)
  47. if: steps.harness.outputs.exists == 'true'
  48. working-directory: test/e2e/playwright
  49. run: npx playwright install --with-deps chromium
  50. - name: Run E2E tests
  51. if: steps.harness.outputs.exists == 'true'
  52. working-directory: test/e2e/playwright
  53. run: npm test