Skip to content

Warning

You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
image/svg+xml

Run Playwright tests

Actions
Run Playwright tests on GitHub Actions
v1.4.4
Verified creator
Star (350)

Verified

GitHub has manually verified the creator of the action as an official partner organization. For more info see About badges in GitHub Marketplace.

Playwright GitHub Action

ubuntu windows macos

Set up GitHub Actions to run cross-browser tests on Chromium, WebKit and Firefox with Playwright.

Usage

Add uses: microsoft/playwright-github-action@v1 to the GitHub workflow definition before running your tests.

on:
  push:
    branches:
    - master

jobs:
  e2e-tests:
    runs-on: ubuntu-latest # or macos-latest, windows-latest

    steps:
      - uses: actions/checkout@v2

      - uses: actions/setup-node@v1

      - uses: microsoft/playwright-github-action@v1

      - name: Install dependencies and run tests
        run: npm install && npm test

Upload artifacts

This GitHub Action can be combined with the Upload Artifact action to upload test artifacts (like screenshots or logs).

steps:
- uses: microsoft/playwright-github-action@v1

- name: Install dependencies and run tests
  run: npm install && npm test

- uses: actions/upload-artifact@v2
  with:
    name: test-artifacts
    path: path/to/artifacts

Run in headful mode

This GitHub Action can also execute tests in headful mode. To do this, use xvfb-run on a Linux agent.

# Windows/macOS
$ npm test

# Linux
$ xfvb-run --auto-servernum -- npm test

Resources

Run Playwright tests is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Run Playwright tests on GitHub Actions
v1.4.4

Verified

GitHub has manually verified the creator of the action as an official partner organization. For more info see About badges in GitHub Marketplace.

Run Playwright tests is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.