Playwright browser provider. List and run Playwright browsers.
Click to expand
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
Constructor. Returns an instance of browser-provider
.
headless
(boolean, default true): run in headless modelaunch
(object): custom options to pass tolaunch()
context
(object): custom options to pass tonewContext()
page
(object): custom options to pass tonewPage()
In Airtap these can be set like so:
browsers:
- name: chromium
options:
headless: false
launch:
args: [--lang=en-US]
With npm do:
npm install airtap-playwright
MIT © 2020-present Airtap contributors