The playwright.yml workflow automatically runs Playwright end-to-end tests for the AS500 application.
The workflow runs on:
- Push to
mainormasterbranches - Pull requests targeting
mainormasterbranches - Manual dispatch via GitHub Actions UI
-
Setup Environment
- Checks out the code
- Sets up Node.js 20
- Installs all dependencies (root, server, and client)
- Installs Playwright browsers (Chromium)
-
Start Services
- Starts Docker Compose services (PostgreSQL, server, client)
- Waits for PostgreSQL to be ready
- Waits for the client application to be available
- Seeds the database with test data
-
Run Tests
- Executes Playwright tests with
npm run test - Uses CI-optimized settings (1 worker, 2 retries)
- Executes Playwright tests with
-
Collect Results
- Uploads Playwright HTML report (available for 30 days)
- Uploads test results and traces (available for 30 days)
- Shows Docker logs if tests fail
The workflow is configured to:
- Run for up to 60 minutes
- Run tests sequentially on CI (workers: 1)
- Retry failed tests twice
- Capture screenshots and traces on failures
After a workflow run:
- Go to the Actions tab in GitHub
- Click on the workflow run
- Download artifacts:
playwright-report- HTML report with screenshots and tracestest-results- Raw test results
The Playwright configuration automatically handles local vs CI environments:
Local Development:
npm run test # Automatically starts docker-compose
npm run test:ui # Run tests in UI mode
npm run test:headed # Run tests with browser visibleCI Environment: Docker Compose is started manually by the workflow, not by Playwright.
If tests fail:
- Check the "Show Docker logs on failure" step output
- Download and open the
playwright-reportartifact - Review screenshots and traces of failed tests
- Check the "Wait for services to be ready" step for timeout issues
You can manually trigger the workflow:
- Go to Actions tab
- Select Playwright Tests workflow
- Click Run workflow
- Select branch and click Run workflow