Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
Go to file
2020-01-07 15:27:45 -08:00
.ci Initial commit 2019-11-19 10:58:15 -08:00
.github/workflows chore(ci): iterate on debug output for GH Action 2019-12-19 17:41:01 -08:00
browser_patches browser(webkit): delete BrowserInspectorTargetAgent (#401) 2020-01-07 11:40:25 -08:00
docs chore: refactor CRBrowserServer (#408) 2020-01-07 14:13:55 -08:00
src chore: move server-side code to src/server (#411) 2020-01-07 15:27:45 -08:00
test chore: refactor CRBrowserServer (#408) 2020-01-07 14:13:55 -08:00
utils chore: move server-side code to src/server (#411) 2020-01-07 15:27:45 -08:00
.appveyor.yml Initial commit 2019-11-19 10:58:15 -08:00
.cirrus.yml Initial commit 2019-11-19 10:58:15 -08:00
.editorconfig Initial commit 2019-11-19 10:58:15 -08:00
.eslintignore feat: basic d.ts file (#161) 2019-12-06 11:28:23 -08:00
.eslintrc.js lint: fixes (#85) 2019-11-26 08:19:02 -08:00
.gitignore chore: reuse BrowserFetcher between browsers (#177) 2019-12-08 13:29:03 -08:00
.npmignore chore: mark version v0.9.3 2019-12-14 11:56:34 -08:00
.travis.yml chore(ci): use bionic for travis 2019-12-05 15:18:55 -08:00
chromium.js fix: async stacks should work now (#325) 2019-12-20 15:31:20 -08:00
CODE_OF_CONDUCT.md Initial CODE_OF_CONDUCT.md commit 2019-11-15 10:32:47 -08:00
DeviceDescriptors.js chore: cleanup code around device descriptors (#404) 2020-01-07 12:53:06 -08:00
Errors.js chrome: co-locate transport types (#236) 2019-12-12 21:30:49 -08:00
firefox.js fix: async stacks should work now (#325) 2019-12-20 15:31:20 -08:00
index.d.ts chore: move server-side code to src/server (#411) 2020-01-07 15:27:45 -08:00
index.js chore: move server-side code to src/server (#411) 2020-01-07 15:27:45 -08:00
install.js chore: allow to be installed from npm 2019-12-14 12:14:00 -08:00
LICENSE chore(license): use Apache 2.0 (#389) 2020-01-06 18:22:35 -08:00
NOTICE chore(license): add NOTICE (#309) 2019-12-19 12:19:54 -08:00
package.json chore(webkit): delete browser target agent (#402) 2020-01-07 12:41:37 -08:00
README.md docs: basic readme (#403) 2020-01-07 11:51:22 -08:00
SECURITY.md Initial SECURITY.md commit 2019-11-15 10:32:49 -08:00
tsconfig.json feat: basic d.ts file (#161) 2019-12-06 11:28:23 -08:00
webkit.js fix: async stacks should work now (#325) 2019-12-20 15:31:20 -08:00

Playwright

npm version

Playwright is a Node library to automate web browsers (Chromium, Webkit and Firefox).

Getting started

Installation

npm i playwright

Usage

Playwright can be used to create a browser instance, open pages, and then manipulate them. See API docs for a comprehensive list.

Example

This code snippet navigates to example.com in the Webkit browser, and saves a screenshot.

const pw = require('playwright');

(async () => {
    const browser = await pw.playwright('webkit').launch(); // or 'chromium', 'firefox'
    const context = await browser.newContext();
    const page = await context.newPage();

    await page.goto('https://www.example.com/');
    await page.screenshot({ path: 'example.png' });

    await browser.close();
})();

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.