airtap-playwright

1.0.1 • Public • Published

airtap-playwright

Playwright browser provider. List and run Playwright browsers.

npm status node Travis build status JavaScript Style Guide

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

Package Sidebar

Install

npm i airtap-playwright

Weekly Downloads

26

Version

1.0.1

License

MIT

Unpacked Size

7 kB

Total Files

4

Last publish

Collaborators

  • vweevers