How do I integrate automated tests into GitHub Actions, Jenkins or GitLab CI effectively?
Asked by The SDET Playbook
Asked Sep 28, 2026Viewed 0 times
How do I integrate automated tests into GitHub Actions, Jenkins or GitLab CI effectively?
Asked by The SDET Playbook
Sign in to answer and to vote.
Run fast checks on every commit and pull request, and publish reports. Playwright's reference workflow triggers on push and pull request, checks out code, installs dependencies with a lockfile, installs browsers, runs tests and uploads the report as an artifact even when the run fails. For speed it shards across a job matrix and can run only tests changed relative to the base branch. The same ideas carry to Jenkins and GitLab: put quick, narrow tests in early stages and broad ones later (Fowler ties stage order to speed and scope, not test type), export results in a standard format such as JUnit XML, and keep artifacts like traces and screenshots.
On GitHub Actions, one way to show results on the pull request is to write JUnit XML and publish it with a reporter action:
- name: Run Playwright tests
run: npx playwright test --reporter=junit,github
env:
PLAYWRIGHT_JUNIT_OUTPUT_NAME: results.xml
- name: Publish test report
uses: dorny/test-reporter@v3
if: always()
with:
name: Playwright results
path: results.xml
reporter: java-junit
Without PLAYWRIGHT_JUNIT_OUTPUT_NAME (or outputFile in the config), the JUnit reporter prints to standard output and there is no file to publish. The reporter action creates a check run, so the job also needs permissions: checks: write.
Sources: Playwright CI, Playwright sharding, dorny/test-reporter, Fowler