An example implementation of Playwright tests with a GitHub workflow that generates a HTML report published on GitHub Pages.
- GitHub workflow with cron scheduling, Docker images, Artifacts storage, and HTML reporting on GitHub Pages
npm i -D @playwright/test
npx playwright install
Run tests headlessly:
npx playwright test
Run tests in headed browsers:
npx playwright test --headed
Run tests with the substring "check" in the title ("-g" can also be written as "--grep"):
npx playwright test -g "check"
Run tests with the Tag "@smoke" (Tags are part of the test title):
npx playwright test -g "@smoke"
The GitHub example workflow uses a cron schedule to trigger a build on every push and runs at minute 5 past every 3rd hour from 1 through 23.
It uses a Docker image with all operating system dependencies and the pre-installed browsers provided by Playwright.
It generates a HTML report that gets published on GitHub Pages (a static web site on GitHub).
All Artifacts get attached as a zip file to the build results (in the "Actions" section of GitHub). Artifacts include the HTML test report and videos of the test executions.