Skip to content

Commit

Permalink
docs: update docs (#3253)
Browse files Browse the repository at this point in the history
- Make docs/README.md more prominent, include capabilities
- Link to examples from specific topics
  • Loading branch information
dgozman authored Jul 31, 2020
1 parent 3edfb2a commit 928a176
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 22 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![npm version](https://img.shields.io/npm/v/playwright.svg?style=flat)](https://www.npmjs.com/package/playwright) [![Join Slack](https://img.shields.io/badge/join-slack-infomational)](https://join.slack.com/t/playwright/shared_invite/enQtOTEyMTUxMzgxMjIwLThjMDUxZmIyNTRiMTJjNjIyMzdmZDA3MTQxZWUwZTFjZjQwNGYxZGM5MzRmNzZlMWI5ZWUyOTkzMjE5Njg1NDg) <!-- GEN:chromium-version-badge -->[![Chromium version](https://img.shields.io/badge/chromium-86.0.4217.0-blue.svg?logo=google-chrome)](https://www.chromium.org/Home)<!-- GEN:stop --> <!-- GEN:firefox-version-badge -->[![Firefox version](https://img.shields.io/badge/firefox-78.0b5-blue.svg?logo=mozilla-firefox)](https://www.mozilla.org/en-US/firefox/new/)<!-- GEN:stop --> [![WebKit version](https://img.shields.io/badge/webkit-14.0-blue.svg?logo=safari)](https://webkit.org/)

##### [Docs](https://playwright.dev/#?path=docs/README.md) | [API reference](https://playwright.dev/#?path=docs/api.md) | [Changelog](https://github.com/microsoft/playwright/releases)
## [Documentation](https://playwright.dev/#?path=docs/README.md) | [API reference](https://playwright.dev/#?path=docs/api.md)

Playwright is a Node.js library to automate [Chromium](https://www.chromium.org/Home), [Firefox](https://www.mozilla.org/en-US/firefox/new/) and [WebKit](https://webkit.org/) with a single API. Playwright is built to enable cross-browser web automation that is **ever-green**, **capable**, **reliable** and **fast**.

Expand Down Expand Up @@ -136,6 +136,6 @@ const { webkit } = require('playwright');

* [Documentation](https://playwright.dev/#?path=docs/README.md)
* [API reference](https://playwright.dev/#?path=docs/api.md)
* [Example recipes](https://playwright.dev/#?path=docs/examples/README.md)
* [Contributing](CONTRIBUTING.md)
* [Community showcase](https://playwright.dev/#?path=docs/showcase.md)
* [Contribution guide](CONTRIBUTING.md)
* [Changelog](https://github.com/microsoft/playwright/releases)
17 changes: 16 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Documentation

### Capabilities

Playwright is a library to automate [Chromium](https://www.chromium.org/Home), [Firefox](https://www.mozilla.org/en-US/firefox/new/) and [WebKit](https://webkit.org/) with a single API. Playwright is built to enable cross-browser web automation that is **ever-green**, **capable**, **reliable** and **fast**.

* Ever-green browser engines
* Headless execution
* Scenarios that span multiple pages, domains and iframes
* Auto-wait for elements to be ready before executing actions (like click, fill)
* Reliable signals instead of timeouts (like network response, popup, navigation)
* Intercept network activity for stubbing and mocking network requests
* Emulate mobile devices, geolocation, permissions
* Support for web components via shadow-piercing selectors
* Native input events for mouse and keyboard
* Upload and download files

### Table of contents

1. [Getting Started](./intro.md)
Expand Down Expand Up @@ -82,4 +97,4 @@
1. [Actionability](./actionability.md)
1. [Extensibility](./extensibility.md)
- [Custom selector engines](./extensibility.md#custom-selector-engines)
1. [API Reference](./api.md)
1. [API Reference](./api.md)
4 changes: 4 additions & 0 deletions docs/core-concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ const context = await browser.newContext({
});
```

#### Example

[This script](examples/authentication.js) logs in on GitHub.com through Chromium, and then reuses the login cookies state in WebKit. This recipe can be used to speed up tests by logging in once and reusing login state.

#### API reference

- [class `BrowserContext`](./api.md#class-browsercontext)
Expand Down
18 changes: 0 additions & 18 deletions docs/examples/README.md

This file was deleted.

4 changes: 4 additions & 0 deletions docs/input.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,10 @@ await page.setInputFiles('input#upload', {

You can select input files for upload using the `page.setInputFiles` method. It expects first argument to point to an [input element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input) with the type `"file"`. Multiple files can be passed in the array. If some of the file paths are relative, they are resolved relative to the [current working directory](https://nodejs.org/api/process.html#process_process_cwd). Empty array clears the selected files.

#### Example

[This script](examples/upload.js) uploads a file to an `input` element that accepts file uploads.

#### API reference

- [page.setInputFiles(selector, files[, options])](https://github.com/microsoft/playwright/blob/master/docs/api.md#pagesetinputfilesselector-value-options)
Expand Down

0 comments on commit 928a176

Please sign in to comment.