Skip to content
This repository has been archived by the owner on Jun 1, 2021. It is now read-only.

GitHub action to setup playwright in your CI workflows.

License

Notifications You must be signed in to change notification settings

maxmilton/action-setup-playwright

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

DEPRECATED: Use playwright CLI instead e.g., playwright install-deps chromium. See https://playwright.dev/docs/cli/#install-system-dependencies.


Build status Coverage status GitHub release (latest SemVer) Licence

maxmilton/action-setup-playwright

GitHub action to setup playwright in your CI workflows. Installs the system dependencies required to run cross-browser tests on Chromium, WebKit, and Firefox with Playwright.

Originally based on https://github.com/microsoft/playwright-github-action.

Usage

Add a uses: maxmilton/action-setup-playwright@v1 step to your GitHub workflow definition:

name: ci
on: push
jobs:
  e2e:
    runs-on: ubuntu-latest
    timeout-minutes: 10 # in case a browser hangs
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v2

      - uses: maxmilton/action-setup-playwright@v1
        with:
          browsers: chromium, firefox, webkit # optional
          headless: true # optional

      - run: yarn install --frozen-lockfile
      - run: yarn run build
      - run: yarn run test-e2e

Run in headful mode

This action can also execute tests in headful mode. To do this, set the optional headless input to false:

steps:
  - uses: maxmilton/action-setup-playwright@v1
    with:
      headless: false

Then use xvfb-run on a Linux agent:

# Windows/macOS
$ yarn run test

# Linux
$ xvfb-run --auto-servernum -- yarn run test

Select browsers

By default system dependencies for all browsers are installed, however, you can limit this to specific browsers only. Set the optional browsers input to a comma-separated list of the browsers you intend to launch:

steps:
  - uses: maxmilton/action-setup-playwright@v1
    with:
      browsers: chromium, firefox, webkit

Bugs

Please report any bugs you encounter on the GitHub issue tracker.

Changelog

See releases on GitHub.

License

maxmilton/action-setup-playwright is an MIT licensed open source project. See LICENSE.


© 2021 Max Milton