docs: basic readme (#403)

This commit is contained in:
Arjun Attam 2020-01-07 11:51:22 -08:00 committed by Yury Semikhatsky
parent 2a2ba713ed
commit f1b825e6a2
2 changed files with 38 additions and 2 deletions

View File

@ -1,5 +1,41 @@
# Playwright
# Contributing
[![npm version](https://badge.fury.io/js/playwright.svg)](https://badge.fury.io/js/playwright)
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](https://github.com/microsoft/playwright/blob/master/docs/api.md) for a comprehensive list.
#### Example
This code snippet navigates to example.com in the Webkit browser, and saves a screenshot.
```js
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

View File

@ -1,7 +1,7 @@
{
"name": "playwright",
"version": "0.9.9-post",
"description": "A high-level API to control web browsers",
"description": "A high-level API to automate web browsers",
"repository": "github:Microsoft/playwright",
"engines": {
"node": ">=10.17.0"