Skip to content

How do I set up GitHub Actions workflows for Playwright?

You can configure GitHub Actions to run Playwright tests and report results to Testomat.io.

Playwright workflow triggered by pull requests

name: Playwright reporting
on:
pull_request:
jobs:
reporting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18.x
- run: npm i
- run: npx playwright install
- run: npx playwright test
env:
TESTOMATIO: '${{ secrets.TESTOMATIO }}'
TESTOMATIO_TITLE: 'PR ${{ github.event.number }} ${{ github.event.pull_request.title }}'

Workflow manually launched from Testomat.io

Use workflow_dispatch and pass TESTOMATIO_RUN:

on:
workflow_dispatch:
inputs:
grep:
required: false
run:
required: false
- run: npx playwright test --grep "${{ github.event.inputs.grep }}"
env:
TESTOMATIO: '${{ secrets.TESTOMATIO }}'
TESTOMATIO_RUN: '${{ github.event.inputs.run }}'

To view workflow results in Testomat.io, connect GitHub under Settings → Continuous Integration, then launch tests from the Runs page. After GitHub Actions completes, the report appears on the Runs page.