Skip to content

airtap/playwright

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

airtap-playwright

Playwright browser provider. List and run Playwright browsers.

npm status node Test Standard

Table of Contents

Click to expand

Usage

Programmatic

const Playwright = require('airtap-playwright')
const provider = new Playwright()

// Get a list of desired browsers
const wanted = [{ name: 'chromium' }]
const manifests = await provider.manifests(wanted)

// Instantiate a browser
const target = { url: 'http://localhost:3000' }
const browser = provider.browser(manifests[0], target)

await browser.open()

With Airtap

providers:
  - airtap-playwright

browsers:
  - name: chromium
  - name: webkit
  - name: firefox

This provider also exposes a supports property to match on:

browsers:
  - name: chromium
    supports:
      headless: true

API

Playwright()

Constructor. Returns an instance of browser-provider.

Browser options

  • headless (boolean, default true): run in headless mode
  • launch (object): custom options to pass to launch()
  • context (object): custom options to pass to newContext()
  • page (object): custom options to pass to newPage()

In Airtap these can be set like so:

browsers:
  - name: chromium
    options:
      headless: false
      launch:
        args: [--lang=en-US]

Install

With npm do:

npm install airtap-playwright

License

MIT © 2020-present Airtap contributors