` is not a direct child of `article`
+- `"css:light=article > .in-the-shadow"` does not match anything.
+- `"css=article li#target"` matches the `
Deep in the shadow `, piercing two shadow roots.
+
+#### CSS extension: visible
+
+The `:visible` pseudo-class matches elements that are visible as defined in the [actionability](./actionability.md#visible) guide. For example, `input` matches all the inputs on the page, while `input:visible` matches only visible inputs. This is useful to distinguish elements that are very similar but differ in visibility.
+
+```js
+// Clicks the first button.
+await page.click('button');
+// Clicks the first visible button. If there are some invisible buttons, this click will just ignore them.
+await page.click('button:visible');
+```
+
+Use `:visible` with caution, because it has two major drawbacks:
+* When elements change their visibility dynamically, `:visible` will give upredictable results based on the timing.
+* `:visible` forces a layout and may lead to querying being slow, especially when used with `page.waitForSelector(selector[, options])` method.
+
+#### CSS extension: text
+
+The `:text` pseudo-class matches elements that have a text node child with specific text. It is similar to the [text engine](#text-and-textlight). There are a few variations that support different arguments:
+
+* `:text("substring")` - Matches when element's text contains "substring" somewhere. Matching is case-insensitive. Matching also normalizes whitespace, for example it turns multiple spaces into one, trusn line breaks into spaces and ignores leading and trailing whitespace.
+* `:text-is("string")` - Matches when element's text equals the "string". Matching is case-insensitive and normalizes whitespace.
+* `button:text("Sign in")` - Text selector may be combined with regular CSS.
+* `:text-matches("[+-]?\\d+")` - Matches text against a regular expression. Note that special characters like back-slash `\`, quotes `"`, square brackets `[]` and more should be escaped. Learn more about [regular expressions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp).
+* `:text-matches("value", "i")` - Matches text against a regular expression with specified flags.
+
+```js
+// Click a button with text "Sign in".
+await page.click('button:text("Sign in")');
+```
+
+#### CSS extension: light
+
+`css` engine [pierces shadow](#shadow-piercing) by default. It is possible to disable this behavior by wrapping a selector in `:light` pseudo-class: `:light(section > button.class)` matches in light DOM only.
+
+```js
+await page.click(':light(.article > .header)');
+```
+
+
+
+### xpath
+
+XPath engine is equivalent to [`Document.evaluate`](https://developer.mozilla.org/en/docs/Web/API/Document/evaluate). Example: `xpath=//html/body`.
+
+Malformed selector starting with `//` or `..` is assumed to be an xpath selector. For example, Playwright converts `page.$('//html/body')` to `page.$('xpath=//html/body')`.
+
+Note that `xpath` does not pierce shadow roots.
+
+### text and text:light
+
+Text engine finds an element that contains a text node with the passed text. For example, `page.click('text=Login')` clicks on a login button, and `page.waitForSelector('"lazy loaded text")` waits for the `"lazy loaded text"` to appear in the page.
+
+- By default, the match is case-insensitive, ignores leading/trailing whitespace and searches for a substring. This means `text= Login` matches `
Button loGIN (click me) `.
+- Text body can be escaped with single or double quotes for precise matching, insisting on exact match, including specified whitespace and case. This means `text="Login "` will only match `
Login ` with exactly one space after "Login". Quoted text follows the usual escaping rules, e.g. use `\"` to escape double quote in a double-quoted string: `text="foo\"bar"`.
+- Text body can also be a JavaScript-like regex wrapped in `/` symbols. This means `text=/^\\s*Login$/i` will match `
loGIN ` with any number of spaces before "Login" and no spaces after.
+- Input elements of the type `button` and `submit` are rendered with their value as text, and text engine finds them. For example, `text=Login` matches `
`.
+
+Malformed selector starting and ending with a quote (either `"` or `'`) is assumed to be a text selector. For example, Playwright converts `page.click('"Login"')` to `page.click('text="Login"')`.
+
+`text` engine open pierces shadow roots similarly to `css`, while `text:light` does not. Text engine first searches for elements in the light dom in the iteration order, and then recursively inside open shadow roots in the iteration order. It does not search inside closed shadow roots or iframes.
+
+### id, data-testid, data-test-id, data-test and their :light counterparts
+
+Attribute engines are selecting based on the corresponding attribute value. For example: `data-test-id=foo` is equivalent to `css=[data-test-id="foo"]`, and `id:light=foo` is equivalent to `css:light=[id="foo"]`.
+
+[css]: #css-and-csslight
+[text]: #text-and-textlight
+[xpath]: #xpath
+[id]: #id-data-testid-data-test-id-data-test-and-their-light-counterparts
\ No newline at end of file
diff --git a/docs-src/showcase.md b/docs-src/showcase.md
new file mode 100644
index 0000000000..fe2c4564fb
--- /dev/null
+++ b/docs-src/showcase.md
@@ -0,0 +1,57 @@
+# Community Showcase
+
+## Users
+
+* [VS Code](https://github.com/microsoft/vscode): Playwright is used to run cross-browser tests on their web builds
+* [TypeScript](https://github.com/microsoft/TypeScript): Playwright is used test typescript.js across browsers
+* [Elastic APM JS agent](https://github.com/elastic/apm-agent-rum-js): Playwright is used to run benchmark tests across browsers
+* [Blockstack](https://github.com/blockstack/ux): Playwright is used to run cross-browser UI tests
+* [Instakittens React admin](https://github.com/fredericbonnet/instakittens-react-admin): Playwright is used to run end-to-end test scenarios written with Cucumber
+* [xterm.js](https://github.com/xtermjs/xterm.js): Playwright is used to run cross-browser integration tests
+* [Accessibility Insights for Web](https://github.com/microsoft/accessibility-insights-web): Playwright is used with Jest and axe-core to run end-to-end functional and accessibility tests of a WebExtension-based browser extension
+
+## Tools
+
+* [CodeceptJS](https://github.com/Codeception/CodeceptJS): Write scenario-driven Playwright tests with synchronous code
+* [dom-to-playwright](https://github.com/Xiphe/dom-to-playwright) to copy a JSDOM snapshot into a Playwright page.
+* [expected-condition-playwright](https://github.com/elaichenkov/expected-condition-playwright): Supplies a set of common expected conditions that can wait for certain states and conditions
+* [Headless Testing](https://headlesstesting.com/support/start/playwright.html): Run Playwright tests on browsers in the cloud
+* [Lumberjack](https://github.com/JakePartusch/lumberjack): Automated accessibility scanner to run checks on your entire website
+* [mockiavelli](https://github.com/HLTech/mockiavelli) Request mocking library for Playwright to test SPA in isolation from backend APIs.
+* [Moon](https://github.com/aerokube/moon): Run Playwright tests in parallel in Kubernetes cluster (free up to 4 parallel sessions)
+* [playwright-test](https://github.com/hugomrdias/playwright-test) Run unit tests and benchmarks in browsers with Node's seamless experience.
+* [playwright-video](https://github.com/qawolf/playwright-video): Capture a video while executing a Playwright script
+* [QA Wolf](https://github.com/qawolf/qawolf): Record and create Playwright tests and then run them in CI
+* [Root Cause OSS](https://github.com/testimio/root-cause): Capture screenshots on every step and display in a viewer with logs for easy troubleshooting.
+* [test-real-styles](https://github.com/Xiphe/test-real-styles): Utility to test real styling of virtual DOM elements in a browser
+* [Testim Playground](https://www.testim.io/playground/): Record Playwright UI tests as code
+* [Try Playwright](https://try.playwright.tech/): Interactive playground for Playwright to run examples directly from your browser
+* [Applitools](https://applitools.com): Add AI-powered visual assertions and run your Playwright tests on all browser, device, and viewport combinations in parallel, without requiring any setup.
+
+## Frameworks
+
+* [jest-playwright](https://github.com/mmarkelov/jest-playwright): Jest preset to run Playwright tests with Jest
+* [query-selector-shadow-dom](https://github.com/Georgegriff/query-selector-shadow-dom): Custom selector engine to pierce shadow DOM roots
+* [Playwright Sharp](https://github.com/kblok/playwright-sharp): Work in progress port of Playwright to .NET
+* [playwright-fluent](https://github.com/hdorgeval/playwright-fluent): Fluent API around Playwright
+* [robotframework-browser](https://robotframework-browser.org/) Robotframework library that uses Playwright to achieve good development ergonomics.
+
+## Examples
+
+* [e2e Boilerplates](https://github.com/e2e-boilerplate?utf8=%E2%9C%93&q=playwright): Project boilerplates for using Playwright with TypeScript, Cucumber, Jest, and other libraries
+* [react-app-playwright](https://github.com/KyleADay/react-app-playwright): Using Playwright with a create-react-app project
+* [playwright-react-typescript-jest-example](https://github.com/azemetre/playwright-react-typescript-jest-example): Using Playwright + Jest with a custom webpack configuration for React + Typescript project
+* [playwright-mocha](https://github.com/roggerfe/playwright-mocha): Using Playwright with Mocha and Chai
+* [playwright-cljs](https://github.com/apeckham/playwright-cljs): Playwright examples in ClojureScript
+* [playwright-azure-functions](https://github.com/arjun27/playwright-azure-functions): Playwright setup on Azure Functions
+* [playwright-aws-lambda](https://github.com/austinkelleher/playwright-aws-lambda): Playwright setup on AWS Lambda
+* [playwright-jest-circus-allure](https://github.com/d-shch/playwright-jest-circus-allure): Example how to use allure-report and jest-circus with playwright
+* [Heroku Playwright Example](https://github.com/mxschmitt/heroku-playwright-example): Example using Playwright on Heroku
+
+## Guides
+
+* [theheadless.dev](https://theheadless.dev): Practical guides and runnable examples on Playwright (and Puppeteer)
+
+## Contributing
+
+Did we miss something in this list? Send us a PR!
diff --git a/docs-src/test-runners.md b/docs-src/test-runners.md
new file mode 100644
index 0000000000..f1f6d10bc7
--- /dev/null
+++ b/docs-src/test-runners.md
@@ -0,0 +1,112 @@
+# Test Runners
+
+With a few lines of code, you can hook up Playwright to your favorite JavaScript test runner.
+
+
+
+
+
+
+
+
+## Jest / Jasmine
+
+For Jest, [jest-playwright](https://github.com/playwright-community/jest-playwright) can be used. However for a light-weight solution, requiring playwright directly works fine. Jest shares it's syntax with Jasmine, so this applies to Jasmine as well.
+
+```js
+const {chromium} = require('playwright');
+const expect = require('expect');
+let browser;
+let page;
+beforeAll(async () => {
+ browser = await chromium.launch();
+});
+afterAll(async () => {
+ await browser.close();
+});
+beforeEach(async () => {
+ page = await browser.newPage();
+});
+afterEach(async () => {
+ await page.close();
+});
+
+it('should work', async () => {
+ await page.goto('https://www.example.com/');
+ expect(await page.title()).toBe('Example Domain');
+});
+```
+
+
+
+## AVA
+
+Tests run concurrently in AVA, so a single page variable cannot be shared between tests. Instead, create new pages with a macro function.
+
+```js
+const {chromium} = require('playwright');
+const test = require('ava').default;
+const browserPromise = chromium.launch();
+
+async function pageMacro(t, callback) {
+ const browser = await browserPromise;
+ const page = await browser.newPage();
+ try {
+ await callback(t, page);
+ } finally {
+ await page.close();
+ }
+}
+
+test('should work', pageMacro, async (t, page) => {
+ await page.goto('https://www.example.com/');
+ t.is(await page.title(), 'Example Domain');
+});
+```
+
+
+
+## Mocha
+
+Mocha looks very similar to the Jest/Jasmine setup, and functions in the same way.
+
+```js
+const {chromium} = require('playwright');
+const assert = require('assert');
+let browser;
+before(async() => {
+ browser = await chromium.launch();
+});
+after(async () => {
+ await browser.close();
+});
+let page;
+beforeEach(async() => {
+ page = await browser.newPage();
+});
+afterEach(async () => {
+ await page.close();
+});
+
+it('should work', async () => {
+ await page.goto('https://www.example.com/');
+ assert.equal(await page.title(), 'Example Domain');
+});
+```
+
+
+## Multiple Browsers
+
+These simple examples can be extended to support multiple browsers using an environment variable.
+
+```js
+const {chromium, webkit, firefox} = require('playwright');
+const browserName = process.env.BROWSER || 'webkit';
+let browser;
+beforeAll(async() => {
+ browser = await {chromium, webkit, firefox}[browserName].launch();
+});
+```
+
+Then set `BROWSER=firefox` to run your tests with firefox, or any other browser.
+
diff --git a/docs-src/troubleshooting.md b/docs-src/troubleshooting.md
new file mode 100644
index 0000000000..40a53ae199
--- /dev/null
+++ b/docs-src/troubleshooting.md
@@ -0,0 +1,33 @@
+# Troubleshooting
+
+
+
+
+## Browser dependencies
+
+Playwright does self-inspection every time it runs to make sure the browsers can be launched successfully. If there are missing
+dependencies, playwright will print instructions to acquire them.
+
+We also provide [Ubuntu 18.04 dockerfile](docker/Dockerfile.bionic) and [Ubuntu 20.04 dockerfile](docker/Dockerfile.focal) with the list of Debian dependencies.
+
+## Code transpilation issues
+
+If you are using a JavaScript transpiler like babel or TypeScript, calling `evaluate()` with an async function might not work. This is because while `playwright` uses `Function.prototype.toString()` to serialize functions while transpilers could be changing the output code in such a way it's incompatible with `playwright`.
+
+Some workarounds to this problem would be to instruct the transpiler not to mess up with the code, for example, configure TypeScript to use latest ECMAScript version (`"target": "es2018"`). Another workaround could be using string templates instead of functions:
+
+```js
+await page.evaluate(`(async() => {
+ console.log('1');
+})()`);
+```
+
+## Node.js requirements
+
+### ReferenceError: URL is not defined
+
+Playwright requires Node.js 10 or higher. Node.js 8 is not supported, and will cause you to receive this error.
+
+# Please file an issue
+
+Playwright is a new project, and we are watching the issues very closely. As we solve common issues, this document will grow to include the common answers.
diff --git a/docs-src/verification.md b/docs-src/verification.md
new file mode 100644
index 0000000000..172c59a34a
--- /dev/null
+++ b/docs-src/verification.md
@@ -0,0 +1,153 @@
+# Verification
+
+
+
+
+
+
+## Videos
+
+Playwright can record videos for all pages in a [browser context](core-concepts.md#browser-contexts). Videos are saved upon context closure, so make sure to await `browserContext.close()`.
+
+```js
+// With browser.newContext()
+const context = await browser.newContext({ recordVideo: { dir: 'videos/' } });
+// Make sure to await close, so that videos are saved.
+await context.close();
+
+// With browser.newPage()
+const page = await browser.newPage({ recordVideo: { dir: 'videos/' } });
+// Make sure to await close, so that videos are saved.
+await page.close();
+
+// [Optional] Specify video size; defaults to viewport size
+const context = await browser.newContext({
+ recordVideo: {
+ dir: 'videos/',
+ size: { width: 800, height: 600 },
+ }
+});
+```
+
+#### API reference
+
+- [BrowserContext]
+- [`method: Browser.newContext`]
+- [`method: Browser.newPage`]
+- [`method: BrowserContext.close`]
+
+## Screenshots
+
+```js
+// Save to file
+await page.screenshot({ path: 'screenshot.png' });
+
+// Capture full page
+await page.screenshot({ path: 'screenshot.png', fullPage: true });
+
+// Capture into buffer
+const buffer = await page.screenshot();
+console.log(buffer.toString('base64'));
+
+// Capture given element
+const elementHandle = await page.$('.header');
+await elementHandle.screenshot({ path: 'screenshot.png' });
+```
+
+#### API reference
+
+- [`method: Page.screenshot`]
+- [`method: ElementHandle.screenshot`]
+
+
+
+## Console logs
+
+Console messages logged in the page can be brought into the Node.js context.
+
+```js
+// Listen for all console logs
+page.on('console', msg => console.log(msg.text()))
+
+// Listen for all console events and handle errors
+page.on('console', msg => {
+ if (msg.type() === 'error')
+ console.log(`Error text: "${msg.text()}"`);
+});
+
+// Get the next console log
+const [msg] = await Promise.all([
+ page.waitForEvent('console'),
+ // Issue console.log inside the page
+ page.evaluate(() => {
+ console.log('hello', 42, { foo: 'bar' });
+ }),
+]);
+
+// Deconstruct console log arguments
+await msg.args[0].jsonValue() // hello
+await msg.args[1].jsonValue() // 42
+```
+
+#### API reference
+
+- [ConsoleMessage]
+- [Page]
+- [`event: Page.console`]
+
+
+
+## Page errors
+
+Listen for uncaught exceptions in the page with the `pagerror` event.
+
+```js
+// Log all uncaught errors to the terminal
+page.on('pageerror', exception => {
+ console.log(`Uncaught exception: "${exception}"`);
+});
+
+// Navigate to a page with an exception.
+await page.goto('data:text/html,');
+```
+
+#### API reference
+
+- [Page]
+- [`event: Page.pageerror`]
+
+
+
+## Page events
+
+#### `"requestfailed"`
+
+```js
+page.on('requestfailed', request => {
+ console.log(request.url() + ' ' + request.failure().errorText);
+});
+```
+
+#### `"dialog"` - handle alert, confirm, prompt
+
+```js
+page.on('dialog', dialog => {
+ dialog.accept();
+});
+```
+
+#### `"popup"` - handle popup windows
+
+```js
+const [popup] = await Promise.all([
+ page.waitForEvent('popup'),
+ page.click('#open')
+]);
+```
+
+#### API reference
+
+- [Page]
+- [`event: Page.requestfailed`]
+- [`event: Page.dialog`]
+- [`event: Page.popup`]
diff --git a/docs-src/why-playwright.md b/docs-src/why-playwright.md
new file mode 100644
index 0000000000..3a10ae0d4d
--- /dev/null
+++ b/docs-src/why-playwright.md
@@ -0,0 +1,52 @@
+# Why Playwright?
+
+Playwright enables fast, reliable and capable automation across all modern browsers. This guide covers those key differentiators to help you decide on the right tool for your automated tests.
+
+
+
+
+## Support for all browsers
+* **Test on Chromium, Firefox and WebKit**. Playwright has full API coverage for all modern browsers, including Google Chrome and Microsoft Edge (with [Chromium](https://www.chromium.org/)), Apple Safari (with [WebKit](https://webkit.org/)) and Mozilla Firefox.
+
+* **Cross-platform WebKit testing**. With Playwright, test how your app behaves in Apple Safari with WebKit builds for Windows, Linux and macOS. Test locally and on CI.
+
+* **Test for mobile**. Use [device emulation](./emulation.md) to test your responsive web apps in mobile web browsers.
+
+* **Headless and headful**. Playwright supports headless (without browser UI) and headful (with browser UI) modes for all browsers and all platforms. Headful is great for debugging, and headless is faster and suited for CI/cloud executions.
+
+## Fast and reliable execution
+* **Auto-wait APIs**. Playwright interactions [auto-wait for elements](./actionability.md) to be ready. This improves reliability and simplifies test authoring.
+
+* **Timeout-free automation**. Playwright receives browser signals, like network requests, page navigations and page load events to eliminate the need for sleep timeouts that cause flakiness.
+
+* **Lean parallelization with browser contexts**. Reuse a single browser instance for multiple parallelized, isolated execution environments with [browser contexts](core-concepts.md).
+
+* **Resilient element selectors**. Playwright can rely on user-facing strings, like text content and accessibility labels to [select elements](./selectors.md). These strings are more resilient than selectors tightly-coupled to the DOM structure.
+
+## Powerful automation capabilities
+* **Multiple domains, pages and frames**. Playwright is an out-of-process automation driver that is not limited by the scope of in-page JavaScript execution and can automate scenarios with [multiple pages](multi-pages.md).
+
+* **Powerful network control**. Playwright introduces context-wide [network interception](./network.md) to stub and mock network requests.
+
+* **Modern web features**. Playwright supports web components through [shadow-piercing selectors](./selectors.md), [geolocation, permissions](./emulation.md), web workers and other modern web APIs.
+
+* **Capabilities to cover all scenarios**. Support for [file downloads](./network.md) and [uploads](./input.md), out-of-process iframes, native [input events](./input.md), and even [dark mode](./emulation.md).
+
+## Integrates with your workflow
+* **One-line installation**. Running `npm i playwright` auto-downloads browser dependencies for your team to be onboarded quickly.
+
+* **TypeScript support**. Playwright ships with built-in types for auto-completion and other benefits.
+
+* **Debugging tools**. Playwright works with the [editor debugger and browser developer tools](./debug.md) to pause execution and inspect the web page.
+
+* **Language bindings**. Playwright is also available in [Python](https://github.com/microsoft/playwright-python) and [C#](https://github.com/microsoft/playwright-sharp). Learn about [supported languages](./languages.md).
+
+* **Deploy tests to CI**. First-party [Docker image](docker/README.md) and [GitHub Actions](https://github.com/microsoft/playwright-github-action) to deploy tests to [your preferred CI/CD provider](./ci.md).
+
+## Limitations
+
+* **Legacy Edge and IE11 support**. Playwright does not support legacy Microsoft Edge or IE11 ([deprecation notice](https://techcommunity.microsoft.com/t5/microsoft-365-blog/microsoft-365-apps-say-farewell-to-internet-explorer-11-and/ba-p/1591666)). The new Microsoft Edge (on Chromium) is supported.
+
+* **Java language bindings**: The Playwright API cannot be used in Java or Ruby today. This is a temporary limitation as Playwright is built to support bindings for any language.
+
+* **Test on real mobile devices**: Playwright uses desktop browsers to emulate mobile devices. If you are interested in running on real mobile devices, please [upvote this issue](https://github.com/microsoft/playwright/issues/1122).
diff --git a/docs/actionability.md b/docs/actionability.md
index 6e7e133019..e2eafc01af 100644
--- a/docs/actionability.md
+++ b/docs/actionability.md
@@ -1,10 +1,18 @@
+
+
# Actionability
-Playwright does a range of actionability checks on the elements before performing certain actions. These checks ensure that action behaves as expected, for example Playwright does not click on a disabled button.
+Playwright does a range of actionability checks on the elements before
+performing certain actions. These checks ensure that action behaves as expected,
+for example Playwright does not click on a disabled button.
-Playwright waits until all the relevant actionability checks pass before performing an action. This means that action will fail with `TimeoutError` if checks do not pass within the specified `timeout`.
+Playwright waits until all the relevant actionability checks pass before
+performing an action. This means that action will fail with `TimeoutError` if
+checks do not pass within the specified `timeout`.
-Some actions like `page.click()` support `{force: true}` option that disable non-essential actionability checks, for example passing `force` to `click()` method will not check that the target element actually receives click events.
+Some actions like `page.click()` support `{force: true}` option that disable
+non-essential actionability checks, for example passing `force` to `click()`
+method will not check that the target element actually receives click events.
| Actions | Performed checks |
| ------ | ------- |
@@ -18,15 +26,19 @@ Some actions like `page.click()` support `{force: true}` option that disable non
### Visible
-Element is considered visible when it has non-empty bounding box and does not have `visibility:hidden` computed style. Note that elements of zero size or with `display:none` are not considered visible.
+Element is considered visible when it has non-empty bounding box and does not
+have `visibility:hidden` computed style. Note that elements of zero size or with
+`display:none` are not considered visible.
### Stable
-Element is considered stable when it has maintained the same bounding box for at least two consecutive animation frames.
+Element is considered stable when it has maintained the same bounding box for at
+least two consecutive animation frames.
### Enabled
-Element is considered enabled when it is not a `
`, `` or ` ` with a `disabled` property set.
+Element is considered enabled when it is not a ``, `` or
+` ` with a `disabled` property set.
### Editable
@@ -34,19 +46,30 @@ Element is considered editable when it does not have `readonly` property set.
### Receiving events
-Element is considered receiving pointer events when it is the hit target of the pointer event at the action point. For example, when clicking at the point `(10;10)`, Playwright checks whether some other element (usually an overlay) will instead capture the click at `(10;10)`.
+Element is considered receiving pointer events when it is the hit target of the
+pointer event at the action point. For example, when clicking at the point
+`(10;10)`, Playwright checks whether some other element (usually an overlay)
+will instead capture the click at `(10;10)`.
### Attached
-Element is considered attached when it is [connected](https://developer.mozilla.org/en-US/docs/Web/API/Node/isConnected) to a Document or a ShadowRoot.
+Element is considered attached when it is
+[connected](https://developer.mozilla.org/en-US/docs/Web/API/Node/isConnected)
+to a Document or a ShadowRoot.
-Attached check differs between selector-based and handle-based actions, like `page.click(selector, options)` as opposite to `elementHandle.click(options)`:
-- For selector-based actions, Playwright first waits for an element matching `selector` to be attached to the DOM, and then checks that element is still attached before performing the action. If element was detached, the action is retried from the start.
+Attached check differs between selector-based and handle-based actions, like
+`page.click(selector, options)` as opposite to `elementHandle.click(options)`:
+- For selector-based actions, Playwright first waits for an element matching
+ `selector` to be attached to the DOM, and then checks that element is still
+ attached before performing the action. If element was detached, the action
+ is retried from the start.
- For handle-based actions, Playwright throws if the element is not attached.
-For example, consider a scenario where Playwright will click `Sign Up` button regardless of when the `page.click()` call was made:
+For example, consider a scenario where Playwright will click `Sign Up` button
+regardless of when the `page.click()` call was made:
- page is checking that user name is unique and `Sign Up` button is disabled;
-- after checking with the server, the disabled `Sign Up` button is replaced with another one that is now enabled.
+- after checking with the server, the disabled `Sign Up` button is replaced
+ with another one that is now enabled.
[Visible]: #visible "Visible"
[Stable]: #stable "Stable"
@@ -54,3 +77,60 @@ For example, consider a scenario where Playwright will click `Sign Up` button re
[Editable]: #editable "Editable"
[Receiving Events]: #receiving-events "Receiving Events"
[Attached]: #attached "Attached"
+[Playwright]: api.md#class-playwright "Playwright"
+[Browser]: api.md#class-browser "Browser"
+[BrowserContext]: api.md#class-browsercontext "BrowserContext"
+[Page]: api.md#class-page "Page"
+[Frame]: api.md#class-frame "Frame"
+[ElementHandle]: api.md#class-elementhandle "ElementHandle"
+[JSHandle]: api.md#class-jshandle "JSHandle"
+[ConsoleMessage]: api.md#class-consolemessage "ConsoleMessage"
+[Dialog]: api.md#class-dialog "Dialog"
+[Download]: api.md#class-download "Download"
+[Video]: api.md#class-video "Video"
+[FileChooser]: api.md#class-filechooser "FileChooser"
+[Keyboard]: api.md#class-keyboard "Keyboard"
+[Mouse]: api.md#class-mouse "Mouse"
+[Touchscreen]: api.md#class-touchscreen "Touchscreen"
+[Request]: api.md#class-request "Request"
+[Response]: api.md#class-response "Response"
+[Selectors]: api.md#class-selectors "Selectors"
+[Route]: api.md#class-route "Route"
+[WebSocket]: api.md#class-websocket "WebSocket"
+[TimeoutError]: api.md#class-timeouterror "TimeoutError"
+[Accessibility]: api.md#class-accessibility "Accessibility"
+[Worker]: api.md#class-worker "Worker"
+[BrowserServer]: api.md#class-browserserver "BrowserServer"
+[BrowserType]: api.md#class-browsertype "BrowserType"
+[Logger]: api.md#class-logger "Logger"
+[ChromiumBrowser]: api.md#class-chromiumbrowser "ChromiumBrowser"
+[ChromiumBrowserContext]: api.md#class-chromiumbrowsercontext "ChromiumBrowserContext"
+[ChromiumCoverage]: api.md#class-chromiumcoverage "ChromiumCoverage"
+[CDPSession]: api.md#class-cdpsession "CDPSession"
+[FirefoxBrowser]: api.md#class-firefoxbrowser "FirefoxBrowser"
+[WebKitBrowser]: api.md#class-webkitbrowser "WebKitBrowser"
+[Array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array "Array"
+[Buffer]: https://nodejs.org/api/buffer.html#buffer_class_buffer "Buffer"
+[ChildProcess]: https://nodejs.org/api/child_process.html "ChildProcess"
+[Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element"
+[Error]: https://nodejs.org/api/errors.html#errors_class_error "Error"
+[EvaluationArgument]: #evaluationargument "Evaluation Argument"
+[Map]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map "Map"
+[Object]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object "Object"
+[Promise]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "Promise"
+[RegExp]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp "RegExp"
+[Serializable]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#Description "Serializable"
+[UIEvent.detail]: https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail "UIEvent.detail"
+[URL]: https://nodejs.org/api/url.html "URL"
+[USKeyboardLayout]: ../src/usKeyboardLayout.ts "USKeyboardLayout"
+[UnixTime]: https://en.wikipedia.org/wiki/Unix_time "Unix Time"
+[boolean]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type "Boolean"
+[function]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function "Function"
+[iterator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols "Iterator"
+[null]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null "null"
+[number]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type "Number"
+[origin]: https://developer.mozilla.org/en-US/docs/Glossary/Origin "Origin"
+[selector]: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors "selector"
+[Readable]: https://nodejs.org/api/stream.html#stream_class_stream_readable "Readable"
+[string]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type "string"
+[xpath]: https://developer.mozilla.org/en-US/docs/Web/XPath "xpath"
diff --git a/docs/api.md b/docs/api.md
index c5e094ac61..c1a72c95a5 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -62,13 +62,13 @@ const { chromium, firefox, webkit } = require('playwright');
By default, the `playwright` NPM package automatically downloads browser executables during installation. The `playwright-core` NPM package can be used to skip automatic downloads.
-
-- [playwright.chromium](#playwrightchromium)
-- [playwright.devices](#playwrightdevices)
-- [playwright.errors](#playwrighterrors)
-- [playwright.firefox](#playwrightfirefox)
-- [playwright.selectors](#playwrightselectors)
-- [playwright.webkit](#playwrightwebkit)
+
+- [playwright.chromium](./api.md#playwrightchromium)
+- [playwright.devices](./api.md#playwrightdevices)
+- [playwright.errors](./api.md#playwrighterrors)
+- [playwright.firefox](./api.md#playwrightfirefox)
+- [playwright.selectors](./api.md#playwrightselectors)
+- [playwright.webkit](./api.md#playwrightwebkit)
#### playwright.chromium
- type: <[BrowserType]>
@@ -78,7 +78,7 @@ This object can be used to launch or connect to Chromium, returning instances of
#### playwright.devices
- type: <[Object]>
-Returns a list of devices to be used with [browser.newContext([options])](#browsernewcontextoptions) or [browser.newPage([options])](#browsernewpageoptions). Actual list of devices can be found in [src/server/deviceDescriptors.ts](https://github.com/Microsoft/playwright/blob/master/src/server/deviceDescriptors.ts).
+Returns a list of devices to be used with [browser.newContext([options])](./api.md#browsernewcontextoptions) or [browser.newPage([options])](./api.md#browsernewpageoptions). Actual list of devices can be found in [src/server/deviceDescriptors.ts](https://github.com/Microsoft/playwright/blob/master/src/server/deviceDescriptors.ts).
```js
const { webkit, devices } = require('playwright');
@@ -100,7 +100,7 @@ const iPhone = devices['iPhone 6'];
- type: <[Object]>
- `TimeoutError` <[function]> A class of [TimeoutError].
-Playwright methods might throw errors if they are unable to fulfill a request. For example, [page.waitForSelector(selector[, options])](#pagewaitforselectorselector-options) might fail if the selector doesn't match any nodes during the given timeframe.
+Playwright methods might throw errors if they are unable to fulfill a request. For example, [page.waitForSelector(selector[, options])](./api.md#pagewaitforselectorselector-options) might fail if the selector doesn't match any nodes during the given timeframe.
For certain types of errors Playwright uses specific error classes. These classes are available via [`playwright.errors`](#playwrighterrors).
@@ -131,12 +131,10 @@ Selectors can be used to install custom selector engines. See [Working with sele
This object can be used to launch or connect to WebKit, returning instances of [WebKitBrowser].
-[Playwright]: #class-playwright "Playwright"
-
### class: Browser
* extends: [EventEmitter](https://nodejs.org/api/events.html#events_class_eventemitter)
-A Browser is created when Playwright connects to a browser instance, either through [browserType.launch([options])](#browsertypelaunchoptions) or [browserType.connect(params)](#browsertypeconnectparams).
+A Browser is created when Playwright connects to a browser instance, either through [browserType.launch([options])](./api.md#browsertypelaunchoptions) or [browserType.connect(params)](./api.md#browsertypeconnectparams).
An example of using a [Browser] to create a [Page]:
@@ -151,29 +149,29 @@ const { firefox } = require('playwright'); // Or 'chromium' or 'webkit'.
})();
```
-See [ChromiumBrowser], [FirefoxBrowser] and [WebKitBrowser] for browser-specific features. Note that [browserType.connect(params)](#browsertypeconnectparams) and [browserType.launch([options])](#browsertypelaunchoptions) always return a specific browser instance, based on the browser being connected to or launched.
+See [ChromiumBrowser], [FirefoxBrowser] and [WebKitBrowser] for browser-specific features. Note that [browserType.connect(params)](./api.md#browsertypeconnectparams) and [browserType.launch([options])](./api.md#browsertypelaunchoptions) always return a specific browser instance, based on the browser being connected to or launched.
-
-- [browser.on('disconnected')](#browserondisconnected)
-- [browser.close()](#browserclose)
-- [browser.contexts()](#browsercontexts)
-- [browser.isConnected()](#browserisconnected)
-- [browser.newContext([options])](#browsernewcontextoptions)
-- [browser.newPage([options])](#browsernewpageoptions)
-- [browser.version()](#browserversion)
+
+- [browser.on('disconnected')](./api.md#browserondisconnected)
+- [browser.close()](./api.md#browserclose)
+- [browser.contexts()](./api.md#browsercontexts)
+- [browser.isConnected()](./api.md#browserisconnected)
+- [browser.newContext([options])](./api.md#browsernewcontextoptions)
+- [browser.newPage([options])](./api.md#browsernewpageoptions)
+- [browser.version()](./api.md#browserversion)
#### browser.on('disconnected')
Emitted when Browser gets disconnected from the browser application. This might happen because of one of the following:
* Browser application is closed or crashed.
-* The [browser.close()](#browserclose) method was called.
+* The [browser.close()](./api.md#browserclose) method was called.
#### browser.close()
- returns: <[Promise]>
-In case this browser is obtained using [browserType.launch([options])](#browsertypelaunchoptions), closes the browser and all of its pages (if any were opened).
+In case this browser is obtained using [browserType.launch([options])](./api.md#browsertypelaunchoptions), closes the browser and all of its pages (if any were opened).
-In case this browser is obtained using [browserType.connect(params)](#browsertypeconnectparams), clears all created contexts belonging to this browser and disconnects from the browser server.
+In case this browser is obtained using [browserType.connect(params)](./api.md#browsertypeconnectparams), clears all created contexts belonging to this browser and disconnects from the browser server.
The [Browser] object itself is considered to be disposed and cannot be used anymore.
@@ -199,7 +197,7 @@ Indicates that the browser is connected.
- `options` <[Object]>
- `acceptDownloads` <[boolean]> Whether to automatically download all the attachments. Defaults to `false` where all the downloads are canceled.
- `bypassCSP` <[boolean]> Toggles bypassing page's Content-Security-Policy.
- - `colorScheme` <"light"|"dark"|"no-preference"> Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See [page.emulateMedia(params)](#pageemulatemediaparams) for more details. Defaults to '`light`'.
+ - `colorScheme` <"light"|"dark"|"no-preference"> Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See [page.emulateMedia(params)](./api.md#pageemulatemediaparams) for more details. Defaults to '`light`'.
- `deviceScaleFactor` <[number]> Specify device scale factor (can be thought of as dpr). Defaults to `1`.
- `extraHTTPHeaders` <[Object]<[string], [string]>> An object containing additional HTTP headers to be sent with every request. All header values must be strings.
- `geolocation` <[Object]>
@@ -216,21 +214,21 @@ Indicates that the browser is connected.
- `locale` <[string]> Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value, `Accept-Language` request header value as well as number and date formatting rules.
- `logger` <[Logger]> Logger sink for Playwright logging.
- `offline` <[boolean]> Whether to emulate network being offline. Defaults to `false`.
- - `permissions` <[Array]<[string]>> A list of permissions to grant to all pages in this context. See [browserContext.grantPermissions(permissions[, options])](#browsercontextgrantpermissionspermissions-options) for more details.
+ - `permissions` <[Array]<[string]>> A list of permissions to grant to all pages in this context. See [browserContext.grantPermissions(permissions[, options])](./api.md#browsercontextgrantpermissionspermissions-options) for more details.
- `proxy` <[Object]> Network proxy settings to use with this context. Note that browser needs to be launched with the global proxy for this option to work. If all contexts override the proxy, global proxy will be never used and can be any string, for example `launch({ proxy: { server: 'per-context' } })`.
- `server` <[string]> Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example `http://myproxy.com:3128` or `socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy.
- `bypass` <[string]> Optional coma-separated domains to bypass proxy, for example `".com, chromium.org, .domain.com"`.
- `username` <[string]> Optional username to use if HTTP proxy requires authentication.
- `password` <[string]> Optional password to use if HTTP proxy requires authentication.
- - `recordHar` <[Object]> Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file. If not specified, the HAR is not recorded. Make sure to await [browserContext.close()](#browsercontextclose) for the HAR to be saved.
+ - `recordHar` <[Object]> Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file. If not specified, the HAR is not recorded. Make sure to await [browserContext.close()](./api.md#browsercontextclose) for the HAR to be saved.
- `omitContent` <[boolean]> Optional setting to control whether to omit request content from the HAR. Defaults to `false`.
- `path` <[string]> Path on the filesystem to write the HAR file to.
- - `recordVideo` <[Object]> Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded. Make sure to await [browserContext.close()](#browsercontextclose) for videos to be saved.
+ - `recordVideo` <[Object]> Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded. Make sure to await [browserContext.close()](./api.md#browsercontextclose) for videos to be saved.
- `dir` <[string]> Path to the directory to put videos into.
- `size` <[Object]> Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport`. If `viewport` is not configured explicitly the video size defaults to 1280x720. Actual picture of each page will be scaled down if necessary to fit the specified size.
- `width` <[number]> Video frame width.
- `height` <[number]> Video frame height.
- - `storageState` <[string]|[Object]> Populates context with given storage state. This method can be used to initialize context with logged-in information obtained via [browserContext.storageState([options])](#browsercontextstoragestateoptions). Either a path to the file with saved storage, or an object with the following fields:
+ - `storageState` <[string]|[Object]> Populates context with given storage state. This method can be used to initialize context with logged-in information obtained via [browserContext.storageState([options])](./api.md#browsercontextstoragestateoptions). Either a path to the file with saved storage, or an object with the following fields:
- `cookies` <[Array]<[Object]>> Optional cookies to set for context
- `name` <[string]> **required**
- `value` <[string]> **required**
@@ -251,7 +249,7 @@ Indicates that the browser is connected.
- `videoSize` <[Object]> **NOTE** Use `recordVideo` instead, it takes precedence over `videoSize`. Specifies dimensions of the automatically recorded video. Can only be used if `videosPath` is set. If not specified the size will be equal to `viewport`. If `viewport` is not configured explicitly the video size defaults to 1280x720. Actual picture of the page will be scaled down if necessary to fit specified size.
- `width` <[number]> Video frame width.
- `height` <[number]> Video frame height.
- - `videosPath` <[string]> **NOTE** Use `recordVideo` instead, it takes precedence over `videosPath`. Enables video recording for all pages to `videosPath` directory. If not specified, videos are not recorded. Make sure to await [browserContext.close()](#browsercontextclose) for videos to be saved.
+ - `videosPath` <[string]> **NOTE** Use `recordVideo` instead, it takes precedence over `videosPath`. Enables video recording for all pages to `videosPath` directory. If not specified, videos are not recorded. Make sure to await [browserContext.close()](./api.md#browsercontextclose) for videos to be saved.
- `viewport` <[null]|[Object]> Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `null` disables the default viewport.
- `width` <[number]> page width in pixels.
- `height` <[number]> page height in pixels.
@@ -274,7 +272,7 @@ Creates a new browser context. It won't share cookies/cache with other browser c
- `options` <[Object]>
- `acceptDownloads` <[boolean]> Whether to automatically download all the attachments. Defaults to `false` where all the downloads are canceled.
- `bypassCSP` <[boolean]> Toggles bypassing page's Content-Security-Policy.
- - `colorScheme` <"light"|"dark"|"no-preference"> Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See [page.emulateMedia(params)](#pageemulatemediaparams) for more details. Defaults to '`light`'.
+ - `colorScheme` <"light"|"dark"|"no-preference"> Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See [page.emulateMedia(params)](./api.md#pageemulatemediaparams) for more details. Defaults to '`light`'.
- `deviceScaleFactor` <[number]> Specify device scale factor (can be thought of as dpr). Defaults to `1`.
- `extraHTTPHeaders` <[Object]<[string], [string]>> An object containing additional HTTP headers to be sent with every request. All header values must be strings.
- `geolocation` <[Object]>
@@ -291,21 +289,21 @@ Creates a new browser context. It won't share cookies/cache with other browser c
- `locale` <[string]> Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value, `Accept-Language` request header value as well as number and date formatting rules.
- `logger` <[Logger]> Logger sink for Playwright logging.
- `offline` <[boolean]> Whether to emulate network being offline. Defaults to `false`.
- - `permissions` <[Array]<[string]>> A list of permissions to grant to all pages in this context. See [browserContext.grantPermissions(permissions[, options])](#browsercontextgrantpermissionspermissions-options) for more details.
+ - `permissions` <[Array]<[string]>> A list of permissions to grant to all pages in this context. See [browserContext.grantPermissions(permissions[, options])](./api.md#browsercontextgrantpermissionspermissions-options) for more details.
- `proxy` <[Object]> Network proxy settings to use with this context. Note that browser needs to be launched with the global proxy for this option to work. If all contexts override the proxy, global proxy will be never used and can be any string, for example `launch({ proxy: { server: 'per-context' } })`.
- `server` <[string]> Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example `http://myproxy.com:3128` or `socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy.
- `bypass` <[string]> Optional coma-separated domains to bypass proxy, for example `".com, chromium.org, .domain.com"`.
- `username` <[string]> Optional username to use if HTTP proxy requires authentication.
- `password` <[string]> Optional password to use if HTTP proxy requires authentication.
- - `recordHar` <[Object]> Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file. If not specified, the HAR is not recorded. Make sure to await [browserContext.close()](#browsercontextclose) for the HAR to be saved.
+ - `recordHar` <[Object]> Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file. If not specified, the HAR is not recorded. Make sure to await [browserContext.close()](./api.md#browsercontextclose) for the HAR to be saved.
- `omitContent` <[boolean]> Optional setting to control whether to omit request content from the HAR. Defaults to `false`.
- `path` <[string]> Path on the filesystem to write the HAR file to.
- - `recordVideo` <[Object]> Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded. Make sure to await [browserContext.close()](#browsercontextclose) for videos to be saved.
+ - `recordVideo` <[Object]> Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded. Make sure to await [browserContext.close()](./api.md#browsercontextclose) for videos to be saved.
- `dir` <[string]> Path to the directory to put videos into.
- `size` <[Object]> Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport`. If `viewport` is not configured explicitly the video size defaults to 1280x720. Actual picture of each page will be scaled down if necessary to fit the specified size.
- `width` <[number]> Video frame width.
- `height` <[number]> Video frame height.
- - `storageState` <[string]|[Object]> Populates context with given storage state. This method can be used to initialize context with logged-in information obtained via [browserContext.storageState([options])](#browsercontextstoragestateoptions). Either a path to the file with saved storage, or an object with the following fields:
+ - `storageState` <[string]|[Object]> Populates context with given storage state. This method can be used to initialize context with logged-in information obtained via [browserContext.storageState([options])](./api.md#browsercontextstoragestateoptions). Either a path to the file with saved storage, or an object with the following fields:
- `cookies` <[Array]<[Object]>> Optional cookies to set for context
- `name` <[string]> **required**
- `value` <[string]> **required**
@@ -326,7 +324,7 @@ Creates a new browser context. It won't share cookies/cache with other browser c
- `videoSize` <[Object]> **NOTE** Use `recordVideo` instead, it takes precedence over `videoSize`. Specifies dimensions of the automatically recorded video. Can only be used if `videosPath` is set. If not specified the size will be equal to `viewport`. If `viewport` is not configured explicitly the video size defaults to 1280x720. Actual picture of the page will be scaled down if necessary to fit specified size.
- `width` <[number]> Video frame width.
- `height` <[number]> Video frame height.
- - `videosPath` <[string]> **NOTE** Use `recordVideo` instead, it takes precedence over `videosPath`. Enables video recording for all pages to `videosPath` directory. If not specified, videos are not recorded. Make sure to await [browserContext.close()](#browsercontextclose) for videos to be saved.
+ - `videosPath` <[string]> **NOTE** Use `recordVideo` instead, it takes precedence over `videosPath`. Enables video recording for all pages to `videosPath` directory. If not specified, videos are not recorded. Make sure to await [browserContext.close()](./api.md#browsercontextclose) for videos to be saved.
- `viewport` <[null]|[Object]> Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `null` disables the default viewport.
- `width` <[number]> page width in pixels.
- `height` <[number]> page height in pixels.
@@ -334,15 +332,13 @@ Creates a new browser context. It won't share cookies/cache with other browser c
Creates a new page in a new browser context. Closing this page will close the context as well.
-This is a convenience API that should only be used for the single-page scenarios and short snippets. Production code and testing frameworks should explicitly create [browser.newContext([options])](#browsernewcontextoptions) followed by the [browserContext.newPage()](#browsercontextnewpage) to control their exact life times.
+This is a convenience API that should only be used for the single-page scenarios and short snippets. Production code and testing frameworks should explicitly create [browser.newContext([options])](./api.md#browsernewcontextoptions) followed by the [browserContext.newPage()](./api.md#browsercontextnewpage) to control their exact life times.
#### browser.version()
- returns: <[string]>
Returns the browser version.
-[Browser]: #class-browser "Browser"
-
### class: BrowserContext
* extends: [EventEmitter](https://nodejs.org/api/events.html#events_class_eventemitter)
@@ -362,43 +358,43 @@ await page.goto('https://example.com');
await context.close();
```
-
-- [browserContext.on('close')](#browsercontextonclose)
-- [browserContext.on('page')](#browsercontextonpage)
-- [browserContext.addCookies(cookies)](#browsercontextaddcookiescookies)
-- [browserContext.addInitScript(script[, arg])](#browsercontextaddinitscriptscript-arg)
-- [browserContext.browser()](#browsercontextbrowser)
-- [browserContext.clearCookies()](#browsercontextclearcookies)
-- [browserContext.clearPermissions()](#browsercontextclearpermissions)
-- [browserContext.close()](#browsercontextclose)
-- [browserContext.cookies([urls])](#browsercontextcookiesurls)
-- [browserContext.exposeBinding(name, playwrightBinding[, options])](#browsercontextexposebindingname-playwrightbinding-options)
-- [browserContext.exposeFunction(name, playwrightFunction)](#browsercontextexposefunctionname-playwrightfunction)
-- [browserContext.grantPermissions(permissions[, options])](#browsercontextgrantpermissionspermissions-options)
-- [browserContext.newPage()](#browsercontextnewpage)
-- [browserContext.pages()](#browsercontextpages)
-- [browserContext.route(url, handler)](#browsercontextrouteurl-handler)
-- [browserContext.setDefaultNavigationTimeout(timeout)](#browsercontextsetdefaultnavigationtimeouttimeout)
-- [browserContext.setDefaultTimeout(timeout)](#browsercontextsetdefaulttimeouttimeout)
-- [browserContext.setExtraHTTPHeaders(headers)](#browsercontextsetextrahttpheadersheaders)
-- [browserContext.setGeolocation(geolocation)](#browsercontextsetgeolocationgeolocation)
-- [browserContext.setHTTPCredentials(httpCredentials)](#browsercontextsethttpcredentialshttpcredentials)
-- [browserContext.setOffline(offline)](#browsercontextsetofflineoffline)
-- [browserContext.storageState([options])](#browsercontextstoragestateoptions)
-- [browserContext.unroute(url[, handler])](#browsercontextunrouteurl-handler)
-- [browserContext.waitForEvent(event[, optionsOrPredicate])](#browsercontextwaitforeventevent-optionsorpredicate)
+
+- [browserContext.on('close')](./api.md#browsercontextonclose)
+- [browserContext.on('page')](./api.md#browsercontextonpage)
+- [browserContext.addCookies(cookies)](./api.md#browsercontextaddcookiescookies)
+- [browserContext.addInitScript(script[, arg])](./api.md#browsercontextaddinitscriptscript-arg)
+- [browserContext.browser()](./api.md#browsercontextbrowser)
+- [browserContext.clearCookies()](./api.md#browsercontextclearcookies)
+- [browserContext.clearPermissions()](./api.md#browsercontextclearpermissions)
+- [browserContext.close()](./api.md#browsercontextclose)
+- [browserContext.cookies([urls])](./api.md#browsercontextcookiesurls)
+- [browserContext.exposeBinding(name, playwrightBinding[, options])](./api.md#browsercontextexposebindingname-playwrightbinding-options)
+- [browserContext.exposeFunction(name, playwrightFunction)](./api.md#browsercontextexposefunctionname-playwrightfunction)
+- [browserContext.grantPermissions(permissions[, options])](./api.md#browsercontextgrantpermissionspermissions-options)
+- [browserContext.newPage()](./api.md#browsercontextnewpage)
+- [browserContext.pages()](./api.md#browsercontextpages)
+- [browserContext.route(url, handler)](./api.md#browsercontextrouteurl-handler)
+- [browserContext.setDefaultNavigationTimeout(timeout)](./api.md#browsercontextsetdefaultnavigationtimeouttimeout)
+- [browserContext.setDefaultTimeout(timeout)](./api.md#browsercontextsetdefaulttimeouttimeout)
+- [browserContext.setExtraHTTPHeaders(headers)](./api.md#browsercontextsetextrahttpheadersheaders)
+- [browserContext.setGeolocation(geolocation)](./api.md#browsercontextsetgeolocationgeolocation)
+- [browserContext.setHTTPCredentials(httpCredentials)](./api.md#browsercontextsethttpcredentialshttpcredentials)
+- [browserContext.setOffline(offline)](./api.md#browsercontextsetofflineoffline)
+- [browserContext.storageState([options])](./api.md#browsercontextstoragestateoptions)
+- [browserContext.unroute(url[, handler])](./api.md#browsercontextunrouteurl-handler)
+- [browserContext.waitForEvent(event[, optionsOrPredicate])](./api.md#browsercontextwaitforeventevent-optionsorpredicate)
#### browserContext.on('close')
Emitted when Browser context gets closed. This might happen because of one of the following:
* Browser context is closed.
* Browser application is closed or crashed.
-* The [browser.close()](#browserclose) method was called.
+* The [browser.close()](./api.md#browserclose) method was called.
#### browserContext.on('page')
- type: <[Page]>
-The event is emitted when a new Page is created in the BrowserContext. The page may still be loading. The event will also fire for popup pages. See also [page.on('popup')](#pageonpopup) to receive events about popups relevant to a specific page.
+The event is emitted when a new Page is created in the BrowserContext. The page may still be loading. The event will also fire for popup pages. See also [page.on('popup')](./api.md#pageonpopup) to receive events about popups relevant to a specific page.
The earliest moment that page is available is when it has navigated to the initial url. For example, when opening a popup with `window.open('http://example.com')`, this event will fire when the network request to "http://example.com" is done and its response has started loading in the popup.
@@ -410,7 +406,7 @@ const [page] = await Promise.all([
console.log(await page.evaluate('location.href'));
```
-> **NOTE** Use [page.waitForLoadState([state, options])](#pagewaitforloadstatestate-options) to wait until the page gets to a particular state (you should not need it in most cases).
+> **NOTE** Use [page.waitForLoadState([state, options])](./api.md#pagewaitforloadstatestate-options) to wait until the page gets to a particular state (you should not need it in most cases).
#### browserContext.addCookies(cookies)
- `cookies` <[Array]<[Object]>>
@@ -425,7 +421,7 @@ console.log(await page.evaluate('location.href'));
- `sameSite` <"Strict"|"Lax"|"None"> Optional.
- returns: <[Promise]>
-Adds cookies into this browser context. All pages within this context will have these cookies installed. Cookies can be obtained via [browserContext.cookies([urls])](#browsercontextcookiesurls).
+Adds cookies into this browser context. All pages within this context will have these cookies installed. Cookies can be obtained via [browserContext.cookies([urls])](./api.md#browsercontextcookiesurls).
```js
await browserContext.addCookies([cookieObject1, cookieObject2]);
@@ -458,7 +454,7 @@ await browserContext.addInitScript({
});
```
-> **NOTE** The order of evaluation of multiple scripts installed via [browserContext.addInitScript(script[, arg])](#browsercontextaddinitscriptscript-arg) and [page.addInitScript(script[, arg])](#pageaddinitscriptscript-arg) is not defined.
+> **NOTE** The order of evaluation of multiple scripts installed via [browserContext.addInitScript(script[, arg])](./api.md#browsercontextaddinitscriptscript-arg) and [page.addInitScript(script[, arg])](./api.md#pageaddinitscriptscript-arg) is not defined.
#### browserContext.browser()
- returns: <[null]|[Browser]>
@@ -514,7 +510,7 @@ The method adds a function called `name` on the `window` object of every frame i
The first argument of the `playwrightBinding` function contains information about the caller: `{ browserContext: BrowserContext, page: Page, frame: Frame }`.
-See [page.exposeBinding(name, playwrightBinding[, options])](#pageexposebindingname-playwrightbinding-options) for page-only version.
+See [page.exposeBinding(name, playwrightBinding[, options])](./api.md#pageexposebindingname-playwrightbinding-options) for page-only version.
An example of exposing page URL to all frames in all pages in the context:
@@ -563,7 +559,7 @@ The method adds a function called `name` on the `window` object of every frame i
If the `playwrightFunction` returns a [Promise], it will be awaited.
-See [page.exposeFunction(name, playwrightFunction)](#pageexposefunctionname-playwrightfunction) for page-only version.
+See [page.exposeFunction(name, playwrightFunction)](./api.md#pageexposefunctionname-playwrightfunction) for page-only version.
An example of adding an `md5` function to all pages in the context:
@@ -621,7 +617,7 @@ Creates a new page in the browser context.
#### browserContext.pages()
- returns: <[Array]<[Page]>>
-Returns all open pages in the context. Non visible pages, such as `"background_page"`, will not be listed here. You can find them using [chromiumBrowserContext.backgroundPages()](#chromiumbrowsercontextbackgroundpages).
+Returns all open pages in the context. Non visible pages, such as `"background_page"`, will not be listed here. You can find them using [chromiumBrowserContext.backgroundPages()](./api.md#chromiumbrowsercontextbackgroundpages).
#### browserContext.route(url, handler)
- `url` <[string]|[RegExp]|[function]\([URL]\):[boolean]> A glob pattern, regex pattern or predicate receiving [URL] to match while routing.
@@ -650,7 +646,7 @@ await page.goto('https://example.com');
await browser.close();
```
-Page routes (set up with [page.route(url, handler)](#pagerouteurl-handler)) take precedence over browser context routes when request matches both handlers.
+Page routes (set up with [page.route(url, handler)](./api.md#pagerouteurl-handler)) take precedence over browser context routes when request matches both handlers.
> **NOTE** Enabling routing disables http cache.
@@ -658,27 +654,27 @@ Page routes (set up with [page.route(url, handler)](#pagerouteurl-handler)) take
- `timeout` <[number]> Maximum navigation time in milliseconds
This setting will change the default maximum navigation time for the following methods and related shortcuts:
-* [page.goBack([options])](#pagegobackoptions)
-* [page.goForward([options])](#pagegoforwardoptions)
-* [page.goto(url[, options])](#pagegotourl-options)
-* [page.reload([options])](#pagereloadoptions)
-* [page.setContent(html[, options])](#pagesetcontenthtml-options)
-* [page.waitForNavigation([options])](#pagewaitfornavigationoptions)
+* [page.goBack([options])](./api.md#pagegobackoptions)
+* [page.goForward([options])](./api.md#pagegoforwardoptions)
+* [page.goto(url[, options])](./api.md#pagegotourl-options)
+* [page.reload([options])](./api.md#pagereloadoptions)
+* [page.setContent(html[, options])](./api.md#pagesetcontenthtml-options)
+* [page.waitForNavigation([options])](./api.md#pagewaitfornavigationoptions)
-> **NOTE** [page.setDefaultNavigationTimeout(timeout)](#pagesetdefaultnavigationtimeouttimeout) and [page.setDefaultTimeout(timeout)](#pagesetdefaulttimeouttimeout) take priority over [browserContext.setDefaultNavigationTimeout(timeout)](#browsercontextsetdefaultnavigationtimeouttimeout).
+> **NOTE** [page.setDefaultNavigationTimeout(timeout)](./api.md#pagesetdefaultnavigationtimeouttimeout) and [page.setDefaultTimeout(timeout)](./api.md#pagesetdefaulttimeouttimeout) take priority over [browserContext.setDefaultNavigationTimeout(timeout)](./api.md#browsercontextsetdefaultnavigationtimeouttimeout).
#### browserContext.setDefaultTimeout(timeout)
- `timeout` <[number]> Maximum time in milliseconds
This setting will change the default maximum time for all the methods accepting `timeout` option.
-> **NOTE** [page.setDefaultNavigationTimeout(timeout)](#pagesetdefaultnavigationtimeouttimeout), [page.setDefaultTimeout(timeout)](#pagesetdefaulttimeouttimeout) and [browserContext.setDefaultNavigationTimeout(timeout)](#browsercontextsetdefaultnavigationtimeouttimeout) take priority over [browserContext.setDefaultTimeout(timeout)](#browsercontextsetdefaulttimeouttimeout).
+> **NOTE** [page.setDefaultNavigationTimeout(timeout)](./api.md#pagesetdefaultnavigationtimeouttimeout), [page.setDefaultTimeout(timeout)](./api.md#pagesetdefaulttimeouttimeout) and [browserContext.setDefaultNavigationTimeout(timeout)](./api.md#browsercontextsetdefaultnavigationtimeouttimeout) take priority over [browserContext.setDefaultTimeout(timeout)](./api.md#browsercontextsetdefaulttimeouttimeout).
#### browserContext.setExtraHTTPHeaders(headers)
- `headers` <[Object]<[string], [string]>> An object containing additional HTTP headers to be sent with every request. All header values must be strings.
- returns: <[Promise]>
-The extra HTTP headers will be sent with every request initiated by any page in the context. These headers are merged with page-specific extra HTTP headers set with [page.setExtraHTTPHeaders(headers)](#pagesetextrahttpheadersheaders). If page overrides a particular header, page-specific header value will be used instead of the browser context header value.
+The extra HTTP headers will be sent with every request initiated by any page in the context. These headers are merged with page-specific extra HTTP headers set with [page.setExtraHTTPHeaders(headers)](./api.md#pagesetextrahttpheadersheaders). If page overrides a particular header, page-specific header value will be used instead of the browser context header value.
> **NOTE** `browserContext.setExtraHTTPHeaders` does not guarantee the order of headers in the outgoing requests.
@@ -695,7 +691,7 @@ Sets the context's geolocation. Passing `null` or `undefined` emulates position
await browserContext.setGeolocation({latitude: 59.95, longitude: 30.31667});
```
-> **NOTE** Consider using [browserContext.grantPermissions(permissions[, options])](#browsercontextgrantpermissionspermissions-options) to grant permissions for the browser context pages to read its geolocation.
+> **NOTE** Consider using [browserContext.grantPermissions(permissions[, options])](./api.md#browsercontextgrantpermissionspermissions-options) to grant permissions for the browser context pages to read its geolocation.
#### browserContext.setHTTPCredentials(httpCredentials)
- `httpCredentials` <[null]|[Object]>
@@ -733,17 +729,17 @@ Provide credentials for [HTTP authentication](https://developer.mozilla.org/en-U
Returns storage state for this browser context, contains current cookies and local storage snapshot.
#### browserContext.unroute(url[, handler])
-- `url` <[string]|[RegExp]|[function]\([URL]\):[boolean]> A glob pattern, regex pattern or predicate receiving [URL] used to register a routing with [browserContext.route(url, handler)](#browsercontextrouteurl-handler).
-- `handler` <[function]\([Route], [Request]\)> Optional handler function used to register a routing with [browserContext.route(url, handler)](#browsercontextrouteurl-handler).
+- `url` <[string]|[RegExp]|[function]\([URL]\):[boolean]> A glob pattern, regex pattern or predicate receiving [URL] used to register a routing with [browserContext.route(url, handler)](./api.md#browsercontextrouteurl-handler).
+- `handler` <[function]\([Route], [Request]\)> Optional handler function used to register a routing with [browserContext.route(url, handler)](./api.md#browsercontextrouteurl-handler).
- returns: <[Promise]>
-Removes a route created with [browserContext.route(url, handler)](#browsercontextrouteurl-handler). When `handler` is not specified, removes all routes for the `url`.
+Removes a route created with [browserContext.route(url, handler)](./api.md#browsercontextrouteurl-handler). When `handler` is not specified, removes all routes for the `url`.
#### browserContext.waitForEvent(event[, optionsOrPredicate])
- `event` <[string]> Event name, same one would pass into `browserContext.on(event)`.
- `optionsOrPredicate` <[Function]|[Object]> Either a predicate that receives an event or an options object. Optional.
- `predicate` <[Function]> receives the event data and resolves to truthy value when the waiting should resolve.
- - `timeout` <[number]> maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [browserContext.setDefaultTimeout(timeout)](#browsercontextsetdefaulttimeouttimeout).
+ - `timeout` <[number]> maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [browserContext.setDefaultTimeout(timeout)](./api.md#browsercontextsetdefaulttimeouttimeout).
- returns: <[Promise]<[Object]>>
Waits for event to fire and passes its value into the predicate function. Returns when the predicate returns truthy value. Will throw an error if the context closes before the event is fired. Returns the event data value.
@@ -753,8 +749,6 @@ const context = await browser.newContext();
await context.grantPermissions(['geolocation']);
```
-[BrowserContext]: #class-browsercontext "BrowserContext"
-
### class: Page
* extends: [EventEmitter](https://nodejs.org/api/events.html#events_class_eventemitter)
@@ -794,95 +788,95 @@ page.on('request', logRequest);
page.removeListener('request', logRequest);
```
-
-- [page.on('close')](#pageonclose)
-- [page.on('console')](#pageonconsole)
-- [page.on('crash')](#pageoncrash)
-- [page.on('dialog')](#pageondialog)
-- [page.on('domcontentloaded')](#pageondomcontentloaded)
-- [page.on('download')](#pageondownload)
-- [page.on('filechooser')](#pageonfilechooser)
-- [page.on('frameattached')](#pageonframeattached)
-- [page.on('framedetached')](#pageonframedetached)
-- [page.on('framenavigated')](#pageonframenavigated)
-- [page.on('load')](#pageonload)
-- [page.on('pageerror')](#pageonpageerror)
-- [page.on('popup')](#pageonpopup)
-- [page.on('request')](#pageonrequest)
-- [page.on('requestfailed')](#pageonrequestfailed)
-- [page.on('requestfinished')](#pageonrequestfinished)
-- [page.on('response')](#pageonresponse)
-- [page.on('websocket')](#pageonwebsocket)
-- [page.on('worker')](#pageonworker)
-- [page.$(selector)](#pageselector)
-- [page.$$(selector)](#pageselector-1)
-- [page.$eval(selector, pageFunction[, arg])](#pageevalselector-pagefunction-arg)
-- [page.$$eval(selector, pageFunction[, arg])](#pageevalselector-pagefunction-arg-1)
-- [page.accessibility](#pageaccessibility)
-- [page.addInitScript(script[, arg])](#pageaddinitscriptscript-arg)
-- [page.addScriptTag(params)](#pageaddscripttagparams)
-- [page.addStyleTag(params)](#pageaddstyletagparams)
-- [page.bringToFront()](#pagebringtofront)
-- [page.check(selector[, options])](#pagecheckselector-options)
-- [page.click(selector[, options])](#pageclickselector-options)
-- [page.close([options])](#pagecloseoptions)
-- [page.content()](#pagecontent)
-- [page.context()](#pagecontext)
-- [page.coverage](#pagecoverage)
-- [page.dblclick(selector[, options])](#pagedblclickselector-options)
-- [page.dispatchEvent(selector, type[, eventInit, options])](#pagedispatcheventselector-type-eventinit-options)
-- [page.emulateMedia(params)](#pageemulatemediaparams)
-- [page.evaluate(pageFunction[, arg])](#pageevaluatepagefunction-arg)
-- [page.evaluateHandle(pageFunction[, arg])](#pageevaluatehandlepagefunction-arg)
-- [page.exposeBinding(name, playwrightBinding[, options])](#pageexposebindingname-playwrightbinding-options)
-- [page.exposeFunction(name, playwrightFunction)](#pageexposefunctionname-playwrightfunction)
-- [page.fill(selector, value[, options])](#pagefillselector-value-options)
-- [page.focus(selector[, options])](#pagefocusselector-options)
-- [page.frame(frameSelector)](#pageframeframeselector)
-- [page.frames()](#pageframes)
-- [page.getAttribute(selector, name[, options])](#pagegetattributeselector-name-options)
-- [page.goBack([options])](#pagegobackoptions)
-- [page.goForward([options])](#pagegoforwardoptions)
-- [page.goto(url[, options])](#pagegotourl-options)
-- [page.hover(selector[, options])](#pagehoverselector-options)
-- [page.innerHTML(selector[, options])](#pageinnerhtmlselector-options)
-- [page.innerText(selector[, options])](#pageinnertextselector-options)
-- [page.isClosed()](#pageisclosed)
-- [page.keyboard](#pagekeyboard)
-- [page.mainFrame()](#pagemainframe)
-- [page.mouse](#pagemouse)
-- [page.opener()](#pageopener)
-- [page.pdf([options])](#pagepdfoptions)
-- [page.press(selector, key[, options])](#pagepressselector-key-options)
-- [page.reload([options])](#pagereloadoptions)
-- [page.route(url, handler)](#pagerouteurl-handler)
-- [page.screenshot([options])](#pagescreenshotoptions)
-- [page.selectOption(selector, values[, options])](#pageselectoptionselector-values-options)
-- [page.setContent(html[, options])](#pagesetcontenthtml-options)
-- [page.setDefaultNavigationTimeout(timeout)](#pagesetdefaultnavigationtimeouttimeout)
-- [page.setDefaultTimeout(timeout)](#pagesetdefaulttimeouttimeout)
-- [page.setExtraHTTPHeaders(headers)](#pagesetextrahttpheadersheaders)
-- [page.setInputFiles(selector, files[, options])](#pagesetinputfilesselector-files-options)
-- [page.setViewportSize(viewportSize)](#pagesetviewportsizeviewportsize)
-- [page.tap(selector[, options])](#pagetapselector-options)
-- [page.textContent(selector[, options])](#pagetextcontentselector-options)
-- [page.title()](#pagetitle)
-- [page.touchscreen](#pagetouchscreen)
-- [page.type(selector, text[, options])](#pagetypeselector-text-options)
-- [page.uncheck(selector[, options])](#pageuncheckselector-options)
-- [page.unroute(url[, handler])](#pageunrouteurl-handler)
-- [page.url()](#pageurl)
-- [page.video()](#pagevideo)
-- [page.viewportSize()](#pageviewportsize)
-- [page.waitForEvent(event[, optionsOrPredicate])](#pagewaitforeventevent-optionsorpredicate)
-- [page.waitForFunction(pageFunction[, arg, options])](#pagewaitforfunctionpagefunction-arg-options)
-- [page.waitForLoadState([state, options])](#pagewaitforloadstatestate-options)
-- [page.waitForNavigation([options])](#pagewaitfornavigationoptions)
-- [page.waitForRequest(urlOrPredicate[, options])](#pagewaitforrequesturlorpredicate-options)
-- [page.waitForResponse(urlOrPredicate[, options])](#pagewaitforresponseurlorpredicate-options)
-- [page.waitForSelector(selector[, options])](#pagewaitforselectorselector-options)
-- [page.waitForTimeout(timeout)](#pagewaitfortimeouttimeout)
-- [page.workers()](#pageworkers)
+
+- [page.on('close')](./api.md#pageonclose)
+- [page.on('console')](./api.md#pageonconsole)
+- [page.on('crash')](./api.md#pageoncrash)
+- [page.on('dialog')](./api.md#pageondialog)
+- [page.on('domcontentloaded')](./api.md#pageondomcontentloaded)
+- [page.on('download')](./api.md#pageondownload)
+- [page.on('filechooser')](./api.md#pageonfilechooser)
+- [page.on('frameattached')](./api.md#pageonframeattached)
+- [page.on('framedetached')](./api.md#pageonframedetached)
+- [page.on('framenavigated')](./api.md#pageonframenavigated)
+- [page.on('load')](./api.md#pageonload)
+- [page.on('pageerror')](./api.md#pageonpageerror)
+- [page.on('popup')](./api.md#pageonpopup)
+- [page.on('request')](./api.md#pageonrequest)
+- [page.on('requestfailed')](./api.md#pageonrequestfailed)
+- [page.on('requestfinished')](./api.md#pageonrequestfinished)
+- [page.on('response')](./api.md#pageonresponse)
+- [page.on('websocket')](./api.md#pageonwebsocket)
+- [page.on('worker')](./api.md#pageonworker)
+- [page.$(selector)](./api.md#pageselector)
+- [page.$$(selector)](./api.md#pageselector-1)
+- [page.$eval(selector, pageFunction[, arg])](./api.md#pageevalselector-pagefunction-arg)
+- [page.$$eval(selector, pageFunction[, arg])](./api.md#pageevalselector-pagefunction-arg-1)
+- [page.accessibility](./api.md#pageaccessibility)
+- [page.addInitScript(script[, arg])](./api.md#pageaddinitscriptscript-arg)
+- [page.addScriptTag(params)](./api.md#pageaddscripttagparams)
+- [page.addStyleTag(params)](./api.md#pageaddstyletagparams)
+- [page.bringToFront()](./api.md#pagebringtofront)
+- [page.check(selector[, options])](./api.md#pagecheckselector-options)
+- [page.click(selector[, options])](./api.md#pageclickselector-options)
+- [page.close([options])](./api.md#pagecloseoptions)
+- [page.content()](./api.md#pagecontent)
+- [page.context()](./api.md#pagecontext)
+- [page.coverage](./api.md#pagecoverage)
+- [page.dblclick(selector[, options])](./api.md#pagedblclickselector-options)
+- [page.dispatchEvent(selector, type[, eventInit, options])](./api.md#pagedispatcheventselector-type-eventinit-options)
+- [page.emulateMedia(params)](./api.md#pageemulatemediaparams)
+- [page.evaluate(pageFunction[, arg])](./api.md#pageevaluatepagefunction-arg)
+- [page.evaluateHandle(pageFunction[, arg])](./api.md#pageevaluatehandlepagefunction-arg)
+- [page.exposeBinding(name, playwrightBinding[, options])](./api.md#pageexposebindingname-playwrightbinding-options)
+- [page.exposeFunction(name, playwrightFunction)](./api.md#pageexposefunctionname-playwrightfunction)
+- [page.fill(selector, value[, options])](./api.md#pagefillselector-value-options)
+- [page.focus(selector[, options])](./api.md#pagefocusselector-options)
+- [page.frame(frameSelector)](./api.md#pageframeframeselector)
+- [page.frames()](./api.md#pageframes)
+- [page.getAttribute(selector, name[, options])](./api.md#pagegetattributeselector-name-options)
+- [page.goBack([options])](./api.md#pagegobackoptions)
+- [page.goForward([options])](./api.md#pagegoforwardoptions)
+- [page.goto(url[, options])](./api.md#pagegotourl-options)
+- [page.hover(selector[, options])](./api.md#pagehoverselector-options)
+- [page.innerHTML(selector[, options])](./api.md#pageinnerhtmlselector-options)
+- [page.innerText(selector[, options])](./api.md#pageinnertextselector-options)
+- [page.isClosed()](./api.md#pageisclosed)
+- [page.keyboard](./api.md#pagekeyboard)
+- [page.mainFrame()](./api.md#pagemainframe)
+- [page.mouse](./api.md#pagemouse)
+- [page.opener()](./api.md#pageopener)
+- [page.pdf([options])](./api.md#pagepdfoptions)
+- [page.press(selector, key[, options])](./api.md#pagepressselector-key-options)
+- [page.reload([options])](./api.md#pagereloadoptions)
+- [page.route(url, handler)](./api.md#pagerouteurl-handler)
+- [page.screenshot([options])](./api.md#pagescreenshotoptions)
+- [page.selectOption(selector, values[, options])](./api.md#pageselectoptionselector-values-options)
+- [page.setContent(html[, options])](./api.md#pagesetcontenthtml-options)
+- [page.setDefaultNavigationTimeout(timeout)](./api.md#pagesetdefaultnavigationtimeouttimeout)
+- [page.setDefaultTimeout(timeout)](./api.md#pagesetdefaulttimeouttimeout)
+- [page.setExtraHTTPHeaders(headers)](./api.md#pagesetextrahttpheadersheaders)
+- [page.setInputFiles(selector, files[, options])](./api.md#pagesetinputfilesselector-files-options)
+- [page.setViewportSize(viewportSize)](./api.md#pagesetviewportsizeviewportsize)
+- [page.tap(selector[, options])](./api.md#pagetapselector-options)
+- [page.textContent(selector[, options])](./api.md#pagetextcontentselector-options)
+- [page.title()](./api.md#pagetitle)
+- [page.touchscreen](./api.md#pagetouchscreen)
+- [page.type(selector, text[, options])](./api.md#pagetypeselector-text-options)
+- [page.uncheck(selector[, options])](./api.md#pageuncheckselector-options)
+- [page.unroute(url[, handler])](./api.md#pageunrouteurl-handler)
+- [page.url()](./api.md#pageurl)
+- [page.video()](./api.md#pagevideo)
+- [page.viewportSize()](./api.md#pageviewportsize)
+- [page.waitForEvent(event[, optionsOrPredicate])](./api.md#pagewaitforeventevent-optionsorpredicate)
+- [page.waitForFunction(pageFunction[, arg, options])](./api.md#pagewaitforfunctionpagefunction-arg-options)
+- [page.waitForLoadState([state, options])](./api.md#pagewaitforloadstatestate-options)
+- [page.waitForNavigation([options])](./api.md#pagewaitfornavigationoptions)
+- [page.waitForRequest(urlOrPredicate[, options])](./api.md#pagewaitforrequesturlorpredicate-options)
+- [page.waitForResponse(urlOrPredicate[, options])](./api.md#pagewaitforresponseurlorpredicate-options)
+- [page.waitForSelector(selector[, options])](./api.md#pagewaitforselectorselector-options)
+- [page.waitForTimeout(timeout)](./api.md#pagewaitfortimeouttimeout)
+- [page.workers()](./api.md#pageworkers)
#### page.on('close')
@@ -937,7 +931,7 @@ await new Promise((resolve, reject) => {
#### page.on('dialog')
- type: <[Dialog]>
-Emitted when a JavaScript dialog appears, such as `alert`, `prompt`, `confirm` or `beforeunload`. Playwright can respond to the dialog via [dialog.accept([promptText])](#dialogacceptprompttext) or [dialog.dismiss()](#dialogdismiss) methods.
+Emitted when a JavaScript dialog appears, such as `alert`, `prompt`, `confirm` or `beforeunload`. Playwright can respond to the dialog via [dialog.accept([promptText])](./api.md#dialogacceptprompttext) or [dialog.dismiss()](./api.md#dialogdismiss) methods.
#### page.on('domcontentloaded')
@@ -953,7 +947,7 @@ Emitted when attachment download started. User can access basic file operations
#### page.on('filechooser')
- type: <[FileChooser]>
-Emitted when a file chooser is supposed to appear, such as after clicking the ` `. Playwright can respond to it via setting the input files using [fileChooser.setFiles(files[, options])](#filechoosersetfilesfiles-options) that can be uploaded after that.
+Emitted when a file chooser is supposed to appear, such as after clicking the ` `. Playwright can respond to it via setting the input files using [fileChooser.setFiles(files[, options])](./api.md#filechoosersetfilesfiles-options) that can be uploaded after that.
```js
page.on('filechooser', async (fileChooser) => {
@@ -988,7 +982,7 @@ Emitted when an uncaught exception happens within the page.
#### page.on('popup')
- type: <[Page]>
-Emitted when the page opens a new tab or window. This event is emitted in addition to the [browserContext.on('page')](#browsercontextonpage), but only for popups relevant to this page.
+Emitted when the page opens a new tab or window. This event is emitted in addition to the [browserContext.on('page')](./api.md#browsercontextonpage), but only for popups relevant to this page.
The earliest moment that page is available is when it has navigated to the initial url. For example, when opening a popup with `window.open('http://example.com')`, this event will fire when the network request to "http://example.com" is done and its response has started loading in the popup.
@@ -1000,19 +994,19 @@ const [popup] = await Promise.all([
console.log(await popup.evaluate('location.href'));
```
-> **NOTE** Use [page.waitForLoadState([state, options])](#pagewaitforloadstatestate-options) to wait until the page gets to a particular state (you should not need it in most cases).
+> **NOTE** Use [page.waitForLoadState([state, options])](./api.md#pagewaitforloadstatestate-options) to wait until the page gets to a particular state (you should not need it in most cases).
#### page.on('request')
- type: <[Request]>
-Emitted when a page issues a request. The [request] object is read-only. In order to intercept and mutate requests, see [page.route(url, handler)](#pagerouteurl-handler) or [browserContext.route(url, handler)](#browsercontextrouteurl-handler).
+Emitted when a page issues a request. The [request] object is read-only. In order to intercept and mutate requests, see [page.route(url, handler)](./api.md#pagerouteurl-handler) or [browserContext.route(url, handler)](./api.md#browsercontextrouteurl-handler).
#### page.on('requestfailed')
- type: <[Request]>
Emitted when a request fails, for example by timing out.
-> **NOTE** HTTP Error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so request will complete with [page.on('requestfinished')](#pageonrequestfinished) event and not with [page.on('requestfailed')](#pageonrequestfailed).
+> **NOTE** HTTP Error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so request will complete with [page.on('requestfinished')](./api.md#pageonrequestfinished) event and not with [page.on('requestfailed')](./api.md#pageonrequestfailed).
#### page.on('requestfinished')
- type: <[Request]>
@@ -1040,7 +1034,7 @@ Emitted when a dedicated [WebWorker](https://developer.mozilla.org/en-US/docs/We
The method finds an element matching the specified selector within the page. If no elements match the selector, the return value resolves to `null`.
-Shortcut for main frame's [frame.$(selector)](#frameselector).
+Shortcut for main frame's [frame.$(selector)](./api.md#frameselector).
#### page.$$(selector)
- `selector` <[string]> A selector to query for. See [working with selectors](#working-with-selectors) for more details.
@@ -1048,7 +1042,7 @@ Shortcut for main frame's [frame.$(selector)](#frameselector).
The method finds all elements matching the specified selector within the page. If no elements match the selector, the return value resolves to `[]`.
-Shortcut for main frame's [frame.$$(selector)](#frameselector-1).
+Shortcut for main frame's [frame.$$(selector)](./api.md#frameselector-1).
#### page.$eval(selector, pageFunction[, arg])
- `selector` <[string]> A selector to query for. See [working with selectors](#working-with-selectors) for more details.
@@ -1058,7 +1052,7 @@ Shortcut for main frame's [frame.$$(selector)](#frameselector-1).
The method finds an element matching the specified selector within the page and passes it as a first argument to `pageFunction`. If no elements match the selector, the method throws an error. Returns the value of `pageFunction`.
-If `pageFunction` returns a [Promise], then [page.$eval(selector, pageFunction[, arg])](#pageevalselector-pagefunction-arg) would wait for the promise to resolve and return its value.
+If `pageFunction` returns a [Promise], then [page.$eval(selector, pageFunction[, arg])](./api.md#pageevalselector-pagefunction-arg) would wait for the promise to resolve and return its value.
Examples:
@@ -1068,7 +1062,7 @@ const preloadHref = await page.$eval('link[rel=preload]', el => el.href);
const html = await page.$eval('.main-container', (e, suffix) => e.outerHTML + suffix, 'hello');
```
-Shortcut for main frame's [frame.$eval(selector, pageFunction[, arg])](#frameevalselector-pagefunction-arg).
+Shortcut for main frame's [frame.$eval(selector, pageFunction[, arg])](./api.md#frameevalselector-pagefunction-arg).
#### page.$$eval(selector, pageFunction[, arg])
- `selector` <[string]> A selector to query for. See [working with selectors](#working-with-selectors) for more details.
@@ -1078,7 +1072,7 @@ Shortcut for main frame's [frame.$eval(selector, pageFunction[, arg])](#frameeva
The method finds all elements matching the specified selector within the page and passes an array of matched elements as a first argument to `pageFunction`. Returns the result of `pageFunction` invocation.
-If `pageFunction` returns a [Promise], then [page.$$eval(selector, pageFunction[, arg])](#pageevalselector-pagefunction-arg-1) would wait for the promise to resolve and return its value.
+If `pageFunction` returns a [Promise], then [page.$$eval(selector, pageFunction[, arg])](./api.md#pageevalselector-pagefunction-arg-1) would wait for the promise to resolve and return its value.
Examples:
@@ -1113,7 +1107,7 @@ const preloadFile = fs.readFileSync('./preload.js', 'utf8');
await page.addInitScript(preloadFile);
```
-> **NOTE** The order of evaluation of multiple scripts installed via [browserContext.addInitScript(script[, arg])](#browsercontextaddinitscriptscript-arg) and [page.addInitScript(script[, arg])](#pageaddinitscriptscript-arg) is not defined.
+> **NOTE** The order of evaluation of multiple scripts installed via [browserContext.addInitScript(script[, arg])](./api.md#browsercontextaddinitscriptscript-arg) and [page.addInitScript(script[, arg])](./api.md#pageaddinitscriptscript-arg) is not defined.
#### page.addScriptTag(params)
- `params` <[Object]>
@@ -1125,7 +1119,7 @@ await page.addInitScript(preloadFile);
Adds a `');
```
#### API reference
-
-- [class: Page](./api.md#class-page)
+- [Page]
- [page.on('pageerror')](./api.md#pageonpageerror)
@@ -151,8 +151,64 @@ const [popup] = await Promise.all([
```
#### API reference
-
-- [class: Page](./api.md#class-page)
+- [Page]
- [page.on('requestfailed')](./api.md#pageonrequestfailed)
- [page.on('dialog')](./api.md#pageondialog)
- [page.on('popup')](./api.md#pageonpopup)
+[Playwright]: api.md#class-playwright "Playwright"
+[Browser]: api.md#class-browser "Browser"
+[BrowserContext]: api.md#class-browsercontext "BrowserContext"
+[Page]: api.md#class-page "Page"
+[Frame]: api.md#class-frame "Frame"
+[ElementHandle]: api.md#class-elementhandle "ElementHandle"
+[JSHandle]: api.md#class-jshandle "JSHandle"
+[ConsoleMessage]: api.md#class-consolemessage "ConsoleMessage"
+[Dialog]: api.md#class-dialog "Dialog"
+[Download]: api.md#class-download "Download"
+[Video]: api.md#class-video "Video"
+[FileChooser]: api.md#class-filechooser "FileChooser"
+[Keyboard]: api.md#class-keyboard "Keyboard"
+[Mouse]: api.md#class-mouse "Mouse"
+[Touchscreen]: api.md#class-touchscreen "Touchscreen"
+[Request]: api.md#class-request "Request"
+[Response]: api.md#class-response "Response"
+[Selectors]: api.md#class-selectors "Selectors"
+[Route]: api.md#class-route "Route"
+[WebSocket]: api.md#class-websocket "WebSocket"
+[TimeoutError]: api.md#class-timeouterror "TimeoutError"
+[Accessibility]: api.md#class-accessibility "Accessibility"
+[Worker]: api.md#class-worker "Worker"
+[BrowserServer]: api.md#class-browserserver "BrowserServer"
+[BrowserType]: api.md#class-browsertype "BrowserType"
+[Logger]: api.md#class-logger "Logger"
+[ChromiumBrowser]: api.md#class-chromiumbrowser "ChromiumBrowser"
+[ChromiumBrowserContext]: api.md#class-chromiumbrowsercontext "ChromiumBrowserContext"
+[ChromiumCoverage]: api.md#class-chromiumcoverage "ChromiumCoverage"
+[CDPSession]: api.md#class-cdpsession "CDPSession"
+[FirefoxBrowser]: api.md#class-firefoxbrowser "FirefoxBrowser"
+[WebKitBrowser]: api.md#class-webkitbrowser "WebKitBrowser"
+[Array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array "Array"
+[Buffer]: https://nodejs.org/api/buffer.html#buffer_class_buffer "Buffer"
+[ChildProcess]: https://nodejs.org/api/child_process.html "ChildProcess"
+[Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element"
+[Error]: https://nodejs.org/api/errors.html#errors_class_error "Error"
+[EvaluationArgument]: #evaluationargument "Evaluation Argument"
+[Map]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map "Map"
+[Object]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object "Object"
+[Promise]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "Promise"
+[RegExp]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp "RegExp"
+[Serializable]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#Description "Serializable"
+[UIEvent.detail]: https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail "UIEvent.detail"
+[URL]: https://nodejs.org/api/url.html "URL"
+[USKeyboardLayout]: ../src/usKeyboardLayout.ts "USKeyboardLayout"
+[UnixTime]: https://en.wikipedia.org/wiki/Unix_time "Unix Time"
+[boolean]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type "Boolean"
+[function]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function "Function"
+[iterator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols "Iterator"
+[null]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null "null"
+[number]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type "Number"
+[origin]: https://developer.mozilla.org/en-US/docs/Glossary/Origin "Origin"
+[selector]: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors "selector"
+[Readable]: https://nodejs.org/api/stream.html#stream_class_stream_readable "Readable"
+[string]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type "string"
+[xpath]: https://developer.mozilla.org/en-US/docs/Web/XPath "xpath"
diff --git a/docs/why-playwright.md b/docs/why-playwright.md
index b03d1900a5..0e7cd74b03 100644
--- a/docs/why-playwright.md
+++ b/docs/why-playwright.md
@@ -1,6 +1,10 @@
+
+
# Why Playwright?
-Playwright enables fast, reliable and capable automation across all modern browsers. This guide covers those key differentiators to help you decide on the right tool for your automated tests.
+Playwright enables fast, reliable and capable automation across all modern
+browsers. This guide covers those key differentiators to help you decide on the
+right tool for your automated tests.
- [Support for all browsers](#support-for-all-browsers)
@@ -11,47 +15,132 @@ Playwright enables fast, reliable and capable automation across all modern brows
## Support for all browsers
-* **Test on Chromium, Firefox and WebKit**. Playwright has full API coverage for all modern browsers, including Google Chrome and Microsoft Edge (with [Chromium](https://www.chromium.org/)), Apple Safari (with [WebKit](https://webkit.org/)) and Mozilla Firefox.
-
-* **Cross-platform WebKit testing**. With Playwright, test how your app behaves in Apple Safari with WebKit builds for Windows, Linux and macOS. Test locally and on CI.
-
-* **Test for mobile**. Use [device emulation](emulation.md) to test your responsive web apps in mobile web browsers.
-
-* **Headless and headful**. Playwright supports headless (without browser UI) and headful (with browser UI) modes for all browsers and all platforms. Headful is great for debugging, and headless is faster and suited for CI/cloud executions.
+* **Test on Chromium, Firefox and WebKit**. Playwright has full API coverage
+ for all modern browsers, including Google Chrome and Microsoft Edge (with
+ [Chromium](https://www.chromium.org/)), Apple Safari (with
+ [WebKit](https://webkit.org/)) and Mozilla Firefox.
+* **Cross-platform WebKit testing**. With Playwright, test how your app
+ behaves in Apple Safari with WebKit builds for Windows, Linux and macOS.
+ Test locally and on CI.
+* **Test for mobile**. Use [device emulation](./emulation.md) to test your
+ responsive web apps in mobile web browsers.
+* **Headless and headful**. Playwright supports headless (without browser UI)
+ and headful (with browser UI) modes for all browsers and all platforms.
+ Headful is great for debugging, and headless is faster and suited for
+ CI/cloud executions.
## Fast and reliable execution
-* **Auto-wait APIs**. Playwright interactions [auto-wait for elements](actionability.md) to be ready. This improves reliability and simplifies test authoring.
-
-* **Timeout-free automation**. Playwright receives browser signals, like network requests, page navigations and page load events to eliminate the need for sleep timeouts that cause flakiness.
-
-* **Lean parallelization with browser contexts**. Reuse a single browser instance for multiple parallelized, isolated execution environments with [browser contexts](core-concepts.md).
-
-* **Resilient element selectors**. Playwright can rely on user-facing strings, like text content and accessibility labels to [select elements](selectors.md). These strings are more resilient than selectors tightly-coupled to the DOM structure.
+* **Auto-wait APIs**. Playwright interactions
+ [auto-wait for elements](./actionability.md) to be ready. This improves
+ reliability and simplifies test authoring.
+* **Timeout-free automation**. Playwright receives browser signals, like
+ network requests, page navigations and page load events to eliminate the
+ need for sleep timeouts that cause flakiness.
+* **Lean parallelization with browser contexts**. Reuse a single browser
+ instance for multiple parallelized, isolated execution environments with
+ [browser contexts](core-concepts.md).
+* **Resilient element selectors**. Playwright can rely on user-facing strings,
+ like text content and accessibility labels to
+ [select elements](./selectors.md). These strings are more resilient than
+ selectors tightly-coupled to the DOM structure.
## Powerful automation capabilities
-* **Multiple domains, pages and frames**. Playwright is an out-of-process automation driver that is not limited by the scope of in-page JavaScript execution and can automate scenarios with [multiple pages](multi-pages.md).
-
-* **Powerful network control**. Playwright introduces context-wide [network interception](network.md) to stub and mock network requests.
-
-* **Modern web features**. Playwright supports web components through [shadow-piercing selectors](selectors.md), [geolocation, permissions](emulation.md), web workers and other modern web APIs.
-
-* **Capabilities to cover all scenarios**. Support for [file downloads](network.md) and [uploads](input.md), out-of-process iframes, native [input events](input.md), and even [dark mode](emulation.md).
+* **Multiple domains, pages and frames**. Playwright is an out-of-process
+ automation driver that is not limited by the scope of in-page JavaScript
+ execution and can automate scenarios with [multiple pages](multi-pages.md).
+* **Powerful network control**. Playwright introduces context-wide
+ [network interception](./network.md) to stub and mock network requests.
+* **Modern web features**. Playwright supports web components through
+ [shadow-piercing selectors](./selectors.md),
+ [geolocation, permissions](./emulation.md), web workers and other modern web
+ APIs.
+* **Capabilities to cover all scenarios**. Support for
+ [file downloads](./network.md) and [uploads](./input.md), out-of-process
+ iframes, native [input events](./input.md), and even
+ [dark mode](./emulation.md).
## Integrates with your workflow
-* **One-line installation**. Running `npm i playwright` auto-downloads browser dependencies for your team to be onboarded quickly.
-
-* **TypeScript support**. Playwright ships with built-in types for auto-completion and other benefits.
-
-* **Debugging tools**. Playwright works with the [editor debugger and browser developer tools](debug.md) to pause execution and inspect the web page.
-
-* **Language bindings**. Playwright is also available in [Python](https://github.com/microsoft/playwright-python) and [C#](https://github.com/microsoft/playwright-sharp). Learn about [supported languages](./languages.md).
-
-* **Deploy tests to CI**. First-party [Docker image](docker/README.md) and [GitHub Actions](https://github.com/microsoft/playwright-github-action) to deploy tests to [your preferred CI/CD provider](ci.md).
+* **One-line installation**. Running `npm i playwright` auto-downloads browser
+ dependencies for your team to be onboarded quickly.
+* **TypeScript support**. Playwright ships with built-in types for
+ auto-completion and other benefits.
+* **Debugging tools**. Playwright works with the
+ [editor debugger and browser developer tools](./debug.md) to pause execution
+ and inspect the web page.
+* **Language bindings**. Playwright is also available in
+ [Python](https://github.com/microsoft/playwright-python) and
+ [C#](https://github.com/microsoft/playwright-sharp). Learn about
+ [supported languages](./languages.md).
+* **Deploy tests to CI**. First-party [Docker image](docker/README.md) and
+ [GitHub Actions](https://github.com/microsoft/playwright-github-action) to
+ deploy tests to [your preferred CI/CD provider](./ci.md).
## Limitations
-
-* **Legacy Edge and IE11 support**. Playwright does not support legacy Microsoft Edge or IE11 ([deprecation notice](https://techcommunity.microsoft.com/t5/microsoft-365-blog/microsoft-365-apps-say-farewell-to-internet-explorer-11-and/ba-p/1591666)). The new Microsoft Edge (on Chromium) is supported.
-
-* **Java language bindings**: The Playwright API cannot be used in Java or Ruby today. This is a temporary limitation as Playwright is built to support bindings for any language.
-
-* **Test on real mobile devices**: Playwright uses desktop browsers to emulate mobile devices. If you are interested in running on real mobile devices, please [upvote this issue](https://github.com/microsoft/playwright/issues/1122).
+* **Legacy Edge and IE11 support**. Playwright does not support legacy
+ Microsoft Edge or IE11
+ ([deprecation notice](https://techcommunity.microsoft.com/t5/microsoft-365-blog/microsoft-365-apps-say-farewell-to-internet-explorer-11-and/ba-p/1591666)).
+ The new Microsoft Edge (on Chromium) is supported.
+* **Java language bindings**: The Playwright API cannot be used in Java or
+ Ruby today. This is a temporary limitation as Playwright is built to support
+ bindings for any language.
+* **Test on real mobile devices**: Playwright uses desktop browsers to emulate
+ mobile devices. If you are interested in running on real mobile devices,
+ please
+ [upvote this issue](https://github.com/microsoft/playwright/issues/1122).
+[Playwright]: api.md#class-playwright "Playwright"
+[Browser]: api.md#class-browser "Browser"
+[BrowserContext]: api.md#class-browsercontext "BrowserContext"
+[Page]: api.md#class-page "Page"
+[Frame]: api.md#class-frame "Frame"
+[ElementHandle]: api.md#class-elementhandle "ElementHandle"
+[JSHandle]: api.md#class-jshandle "JSHandle"
+[ConsoleMessage]: api.md#class-consolemessage "ConsoleMessage"
+[Dialog]: api.md#class-dialog "Dialog"
+[Download]: api.md#class-download "Download"
+[Video]: api.md#class-video "Video"
+[FileChooser]: api.md#class-filechooser "FileChooser"
+[Keyboard]: api.md#class-keyboard "Keyboard"
+[Mouse]: api.md#class-mouse "Mouse"
+[Touchscreen]: api.md#class-touchscreen "Touchscreen"
+[Request]: api.md#class-request "Request"
+[Response]: api.md#class-response "Response"
+[Selectors]: api.md#class-selectors "Selectors"
+[Route]: api.md#class-route "Route"
+[WebSocket]: api.md#class-websocket "WebSocket"
+[TimeoutError]: api.md#class-timeouterror "TimeoutError"
+[Accessibility]: api.md#class-accessibility "Accessibility"
+[Worker]: api.md#class-worker "Worker"
+[BrowserServer]: api.md#class-browserserver "BrowserServer"
+[BrowserType]: api.md#class-browsertype "BrowserType"
+[Logger]: api.md#class-logger "Logger"
+[ChromiumBrowser]: api.md#class-chromiumbrowser "ChromiumBrowser"
+[ChromiumBrowserContext]: api.md#class-chromiumbrowsercontext "ChromiumBrowserContext"
+[ChromiumCoverage]: api.md#class-chromiumcoverage "ChromiumCoverage"
+[CDPSession]: api.md#class-cdpsession "CDPSession"
+[FirefoxBrowser]: api.md#class-firefoxbrowser "FirefoxBrowser"
+[WebKitBrowser]: api.md#class-webkitbrowser "WebKitBrowser"
+[Array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array "Array"
+[Buffer]: https://nodejs.org/api/buffer.html#buffer_class_buffer "Buffer"
+[ChildProcess]: https://nodejs.org/api/child_process.html "ChildProcess"
+[Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element"
+[Error]: https://nodejs.org/api/errors.html#errors_class_error "Error"
+[EvaluationArgument]: #evaluationargument "Evaluation Argument"
+[Map]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map "Map"
+[Object]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object "Object"
+[Promise]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "Promise"
+[RegExp]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp "RegExp"
+[Serializable]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#Description "Serializable"
+[UIEvent.detail]: https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail "UIEvent.detail"
+[URL]: https://nodejs.org/api/url.html "URL"
+[USKeyboardLayout]: ../src/usKeyboardLayout.ts "USKeyboardLayout"
+[UnixTime]: https://en.wikipedia.org/wiki/Unix_time "Unix Time"
+[boolean]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type "Boolean"
+[function]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function "Function"
+[iterator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols "Iterator"
+[null]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null "null"
+[number]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type "Number"
+[origin]: https://developer.mozilla.org/en-US/docs/Glossary/Origin "Origin"
+[selector]: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors "selector"
+[Readable]: https://nodejs.org/api/stream.html#stream_class_stream_readable "Readable"
+[string]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type "string"
+[xpath]: https://developer.mozilla.org/en-US/docs/Web/XPath "xpath"
diff --git a/types/types.d.ts b/types/types.d.ts
index a163f77043..0a84ca0c0c 100644
--- a/types/types.d.ts
+++ b/types/types.d.ts
@@ -108,7 +108,7 @@ export interface Page {
* ```
*
* Shortcut for main frame's
- * [`frame.evaluate(pageFunction[, arg])`](https://github.com/microsoft/playwright/blob/master/docs/api.md#frameevaluatepagefunction-arg).
+ * [frame.evaluate(pageFunction[, arg])](https://github.com/microsoft/playwright/blob/master/docs/api.md#frameevaluatepagefunction-arg).
* @param pageFunction Function to be evaluated in the page context
* @param arg Optional argument to pass to `pageFunction`
*/
@@ -150,7 +150,7 @@ export interface Page {
* return value resolves to `null`.
*
* Shortcut for main frame's
- * [`frame.$(selector)`](https://github.com/microsoft/playwright/blob/master/docs/api.md#frameselector).
+ * [frame.$(selector)](https://github.com/microsoft/playwright/blob/master/docs/api.md#frameselector).
* @param selector A selector to query for. See [working with selectors](https://github.com/microsoft/playwright/blob/master/docs/api.md#working-with-selectors) for more details.
*/
$(selector: K): Promise | null>;
@@ -161,7 +161,7 @@ export interface Page {
* return value resolves to `[]`.
*
* Shortcut for main frame's
- * [`frame.$$(selector)`](https://github.com/microsoft/playwright/blob/master/docs/api.md#frameselector).
+ * [frame.$$(selector)](https://github.com/microsoft/playwright/blob/master/docs/api.md#frameselector).
* @param selector A selector to query for. See [working with selectors](https://github.com/microsoft/playwright/blob/master/docs/api.md#working-with-selectors) for more details.
*/
$$(selector: K): Promise[]>;
@@ -172,7 +172,7 @@ export interface Page {
* `pageFunction`. If no elements match the selector, the method throws an error. Returns the value of `pageFunction`.
*
* If `pageFunction` returns a [Promise], then
- * [`page.$eval(selector, pageFunction[, arg])`](https://github.com/microsoft/playwright/blob/master/docs/api.md#pageevalselector-pagefunction-arg)
+ * [page.$eval(selector, pageFunction[, arg])](https://github.com/microsoft/playwright/blob/master/docs/api.md#pageevalselector-pagefunction-arg)
* would wait for the promise to resolve and return its value.
*
* Examples:
@@ -184,7 +184,7 @@ export interface Page {
* ```
*
* Shortcut for main frame's
- * [`frame.$eval(selector, pageFunction[, arg])`](https://github.com/microsoft/playwright/blob/master/docs/api.md#frameevalselector-pagefunction-arg).
+ * [frame.$eval(selector, pageFunction[, arg])](https://github.com/microsoft/playwright/blob/master/docs/api.md#frameevalselector-pagefunction-arg).
* @param selector A selector to query for. See [working with selectors](https://github.com/microsoft/playwright/blob/master/docs/api.md#working-with-selectors) for more details.
* @param pageFunction Function to be evaluated in browser context
* @param arg Optional argument to pass to `pageFunction`
@@ -199,7 +199,7 @@ export interface Page {
* a first argument to `pageFunction`. Returns the result of `pageFunction` invocation.
*
* If `pageFunction` returns a [Promise], then
- * [`page.$$eval(selector, pageFunction[, arg])`](https://github.com/microsoft/playwright/blob/master/docs/api.md#pageevalselector-pagefunction-arg)
+ * [page.$$eval(selector, pageFunction[, arg])](https://github.com/microsoft/playwright/blob/master/docs/api.md#pageevalselector-pagefunction-arg)
* would wait for the promise to resolve and return its value.
*
* Examples:
@@ -243,7 +243,7 @@ export interface Page {
* ```
*
* Shortcut for main frame's
- * [`frame.waitForFunction(pageFunction[, arg, options])`](https://github.com/microsoft/playwright/blob/master/docs/api.md#framewaitforfunctionpagefunction-arg-options).
+ * [frame.waitForFunction(pageFunction[, arg, options])](https://github.com/microsoft/playwright/blob/master/docs/api.md#framewaitforfunctionpagefunction-arg-options).
* @param pageFunction Function to be evaluated in browser context
* @param arg Optional argument to pass to `pageFunction`
* @param options
@@ -295,7 +295,7 @@ export interface Page {
* BrowserContext, page: Page, frame: Frame }`.
*
* See
- * [`browserContext.exposeBinding(name, playwrightBinding[, options])`](https://github.com/microsoft/playwright/blob/master/docs/api.md#browsercontextexposebindingname-playwrightbinding-options)
+ * [browserContext.exposeBinding(name, playwrightBinding[, options])](https://github.com/microsoft/playwright/blob/master/docs/api.md#browsercontextexposebindingname-playwrightbinding-options)
* for the context-wide version.
*
* > **NOTE** Functions installed via `page.exposeBinding` survive navigations.
@@ -404,8 +404,8 @@ export interface Page {
/**
* Emitted when a JavaScript dialog appears, such as `alert`, `prompt`, `confirm` or `beforeunload`. Playwright can respond
* to the dialog via
- * [`dialog.accept([promptText])`](https://github.com/microsoft/playwright/blob/master/docs/api.md#dialogacceptprompttext)
- * or [`dialog.dismiss()`](https://github.com/microsoft/playwright/blob/master/docs/api.md#dialogdismiss) methods.
+ * [dialog.accept([promptText])](https://github.com/microsoft/playwright/blob/master/docs/api.md#dialogacceptprompttext) or
+ * [dialog.dismiss()](https://github.com/microsoft/playwright/blob/master/docs/api.md#dialogdismiss) methods.
*/
on(event: 'dialog', listener: (dialog: Dialog) => void): this;
@@ -428,7 +428,7 @@ export interface Page {
/**
* Emitted when a file chooser is supposed to appear, such as after clicking the ` `. Playwright can
* respond to it via setting the input files using
- * [`fileChooser.setFiles(files[, options])`](https://github.com/microsoft/playwright/blob/master/docs/api.md#filechoosersetfilesfiles-options)
+ * [fileChooser.setFiles(files[, options])](https://github.com/microsoft/playwright/blob/master/docs/api.md#filechoosersetfilesfiles-options)
* that can be uploaded after that.
*
* ```js
@@ -467,7 +467,7 @@ export interface Page {
/**
* Emitted when the page opens a new tab or window. This event is emitted in addition to the
- * [`browserContext.on('page')`](https://github.com/microsoft/playwright/blob/master/docs/api.md#browsercontextonpage), but
+ * [browserContext.on('page')](https://github.com/microsoft/playwright/blob/master/docs/api.md#browsercontextonpage), but
* only for popups relevant to this page.
*
* The earliest moment that page is available is when it has navigated to the initial url. For example, when opening a
@@ -483,15 +483,15 @@ export interface Page {
* ```
*
* > **NOTE** Use
- * [`page.waitForLoadState([state, options])`](https://github.com/microsoft/playwright/blob/master/docs/api.md#pagewaitforloadstatestate-options)
+ * [page.waitForLoadState([state, options])](https://github.com/microsoft/playwright/blob/master/docs/api.md#pagewaitforloadstatestate-options)
* to wait until the page gets to a particular state (you should not need it in most cases).
*/
on(event: 'popup', listener: (page: Page) => void): this;
/**
* Emitted when a page issues a request. The [request] object is read-only. In order to intercept and mutate requests, see
- * [`page.route(url, handler)`](https://github.com/microsoft/playwright/blob/master/docs/api.md#pagerouteurl-handler) or
- * [`browserContext.route(url, handler)`](https://github.com/microsoft/playwright/blob/master/docs/api.md#browsercontextrouteurl-handler).
+ * [page.route(url, handler)](https://github.com/microsoft/playwright/blob/master/docs/api.md#pagerouteurl-handler) or
+ * [browserContext.route(url, handler)](https://github.com/microsoft/playwright/blob/master/docs/api.md#browsercontextrouteurl-handler).
*/
on(event: 'request', listener: (request: Request) => void): this;
@@ -500,9 +500,9 @@ export interface Page {
*
* > **NOTE** HTTP Error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so request
* will complete with
- * [`page.on('requestfinished')`](https://github.com/microsoft/playwright/blob/master/docs/api.md#pageonrequestfinished)
+ * [page.on('requestfinished')](https://github.com/microsoft/playwright/blob/master/docs/api.md#pageonrequestfinished)
* event and not with
- * [`page.on('requestfailed')`](https://github.com/microsoft/playwright/blob/master/docs/api.md#pageonrequestfailed).
+ * [page.on('requestfailed')](https://github.com/microsoft/playwright/blob/master/docs/api.md#pageonrequestfailed).
*/
on(event: 'requestfailed', listener: (request: Request) => void): this;
@@ -589,8 +589,8 @@ export interface Page {
/**
* Emitted when a JavaScript dialog appears, such as `alert`, `prompt`, `confirm` or `beforeunload`. Playwright can respond
* to the dialog via
- * [`dialog.accept([promptText])`](https://github.com/microsoft/playwright/blob/master/docs/api.md#dialogacceptprompttext)
- * or [`dialog.dismiss()`](https://github.com/microsoft/playwright/blob/master/docs/api.md#dialogdismiss) methods.
+ * [dialog.accept([promptText])](https://github.com/microsoft/playwright/blob/master/docs/api.md#dialogacceptprompttext) or
+ * [dialog.dismiss()](https://github.com/microsoft/playwright/blob/master/docs/api.md#dialogdismiss) methods.
*/
once(event: 'dialog', listener: (dialog: Dialog) => void): this;
@@ -613,7 +613,7 @@ export interface Page {
/**
* Emitted when a file chooser is supposed to appear, such as after clicking the ` `. Playwright can
* respond to it via setting the input files using
- * [`fileChooser.setFiles(files[, options])`](https://github.com/microsoft/playwright/blob/master/docs/api.md#filechoosersetfilesfiles-options)
+ * [fileChooser.setFiles(files[, options])](https://github.com/microsoft/playwright/blob/master/docs/api.md#filechoosersetfilesfiles-options)
* that can be uploaded after that.
*
* ```js
@@ -652,7 +652,7 @@ export interface Page {
/**
* Emitted when the page opens a new tab or window. This event is emitted in addition to the
- * [`browserContext.on('page')`](https://github.com/microsoft/playwright/blob/master/docs/api.md#browsercontextonpage), but
+ * [browserContext.on('page')](https://github.com/microsoft/playwright/blob/master/docs/api.md#browsercontextonpage), but
* only for popups relevant to this page.
*
* The earliest moment that page is available is when it has navigated to the initial url. For example, when opening a
@@ -668,15 +668,15 @@ export interface Page {
* ```
*
* > **NOTE** Use
- * [`page.waitForLoadState([state, options])`](https://github.com/microsoft/playwright/blob/master/docs/api.md#pagewaitforloadstatestate-options)
+ * [page.waitForLoadState([state, options])](https://github.com/microsoft/playwright/blob/master/docs/api.md#pagewaitforloadstatestate-options)
* to wait until the page gets to a particular state (you should not need it in most cases).
*/
once(event: 'popup', listener: (page: Page) => void): this;
/**
* Emitted when a page issues a request. The [request] object is read-only. In order to intercept and mutate requests, see
- * [`page.route(url, handler)`](https://github.com/microsoft/playwright/blob/master/docs/api.md#pagerouteurl-handler) or
- * [`browserContext.route(url, handler)`](https://github.com/microsoft/playwright/blob/master/docs/api.md#browsercontextrouteurl-handler).
+ * [page.route(url, handler)](https://github.com/microsoft/playwright/blob/master/docs/api.md#pagerouteurl-handler) or
+ * [browserContext.route(url, handler)](https://github.com/microsoft/playwright/blob/master/docs/api.md#browsercontextrouteurl-handler).
*/
once(event: 'request', listener: (request: Request) => void): this;
@@ -685,9 +685,9 @@ export interface Page {
*
* > **NOTE** HTTP Error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so request
* will complete with
- * [`page.on('requestfinished')`](https://github.com/microsoft/playwright/blob/master/docs/api.md#pageonrequestfinished)
+ * [page.on('requestfinished')](https://github.com/microsoft/playwright/blob/master/docs/api.md#pageonrequestfinished)
* event and not with
- * [`page.on('requestfailed')`](https://github.com/microsoft/playwright/blob/master/docs/api.md#pageonrequestfailed).
+ * [page.on('requestfailed')](https://github.com/microsoft/playwright/blob/master/docs/api.md#pageonrequestfailed).
*/
once(event: 'requestfailed', listener: (request: Request) => void): this;
@@ -774,8 +774,8 @@ export interface Page {
/**
* Emitted when a JavaScript dialog appears, such as `alert`, `prompt`, `confirm` or `beforeunload`. Playwright can respond
* to the dialog via
- * [`dialog.accept([promptText])`](https://github.com/microsoft/playwright/blob/master/docs/api.md#dialogacceptprompttext)
- * or [`dialog.dismiss()`](https://github.com/microsoft/playwright/blob/master/docs/api.md#dialogdismiss) methods.
+ * [dialog.accept([promptText])](https://github.com/microsoft/playwright/blob/master/docs/api.md#dialogacceptprompttext) or
+ * [dialog.dismiss()](https://github.com/microsoft/playwright/blob/master/docs/api.md#dialogdismiss) methods.
*/
addListener(event: 'dialog', listener: (dialog: Dialog) => void): this;
@@ -798,7 +798,7 @@ export interface Page {
/**
* Emitted when a file chooser is supposed to appear, such as after clicking the ` `. Playwright can
* respond to it via setting the input files using
- * [`fileChooser.setFiles(files[, options])`](https://github.com/microsoft/playwright/blob/master/docs/api.md#filechoosersetfilesfiles-options)
+ * [fileChooser.setFiles(files[, options])](https://github.com/microsoft/playwright/blob/master/docs/api.md#filechoosersetfilesfiles-options)
* that can be uploaded after that.
*
* ```js
@@ -837,7 +837,7 @@ export interface Page {
/**
* Emitted when the page opens a new tab or window. This event is emitted in addition to the
- * [`browserContext.on('page')`](https://github.com/microsoft/playwright/blob/master/docs/api.md#browsercontextonpage), but
+ * [browserContext.on('page')](https://github.com/microsoft/playwright/blob/master/docs/api.md#browsercontextonpage), but
* only for popups relevant to this page.
*
* The earliest moment that page is available is when it has navigated to the initial url. For example, when opening a
@@ -853,15 +853,15 @@ export interface Page {
* ```
*
* > **NOTE** Use
- * [`page.waitForLoadState([state, options])`](https://github.com/microsoft/playwright/blob/master/docs/api.md#pagewaitforloadstatestate-options)
+ * [page.waitForLoadState([state, options])](https://github.com/microsoft/playwright/blob/master/docs/api.md#pagewaitforloadstatestate-options)
* to wait until the page gets to a particular state (you should not need it in most cases).
*/
addListener(event: 'popup', listener: (page: Page) => void): this;
/**
* Emitted when a page issues a request. The [request] object is read-only. In order to intercept and mutate requests, see
- * [`page.route(url, handler)`](https://github.com/microsoft/playwright/blob/master/docs/api.md#pagerouteurl-handler) or
- * [`browserContext.route(url, handler)`](https://github.com/microsoft/playwright/blob/master/docs/api.md#browsercontextrouteurl-handler).
+ * [page.route(url, handler)](https://github.com/microsoft/playwright/blob/master/docs/api.md#pagerouteurl-handler) or
+ * [browserContext.route(url, handler)](https://github.com/microsoft/playwright/blob/master/docs/api.md#browsercontextrouteurl-handler).
*/
addListener(event: 'request', listener: (request: Request) => void): this;
@@ -870,9 +870,9 @@ export interface Page {
*
* > **NOTE** HTTP Error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so request
* will complete with
- * [`page.on('requestfinished')`](https://github.com/microsoft/playwright/blob/master/docs/api.md#pageonrequestfinished)
+ * [page.on('requestfinished')](https://github.com/microsoft/playwright/blob/master/docs/api.md#pageonrequestfinished)
* event and not with
- * [`page.on('requestfailed')`](https://github.com/microsoft/playwright/blob/master/docs/api.md#pageonrequestfailed).
+ * [page.on('requestfailed')](https://github.com/microsoft/playwright/blob/master/docs/api.md#pageonrequestfailed).
*/
addListener(event: 'requestfailed', listener: (request: Request) => void): this;
@@ -959,8 +959,8 @@ export interface Page {
/**
* Emitted when a JavaScript dialog appears, such as `alert`, `prompt`, `confirm` or `beforeunload`. Playwright can respond
* to the dialog via
- * [`dialog.accept([promptText])`](https://github.com/microsoft/playwright/blob/master/docs/api.md#dialogacceptprompttext)
- * or [`dialog.dismiss()`](https://github.com/microsoft/playwright/blob/master/docs/api.md#dialogdismiss) methods.
+ * [dialog.accept([promptText])](https://github.com/microsoft/playwright/blob/master/docs/api.md#dialogacceptprompttext) or
+ * [dialog.dismiss()](https://github.com/microsoft/playwright/blob/master/docs/api.md#dialogdismiss) methods.
*/
removeListener(event: 'dialog', listener: (dialog: Dialog) => void): this;
@@ -983,7 +983,7 @@ export interface Page {
/**
* Emitted when a file chooser is supposed to appear, such as after clicking the ` `. Playwright can
* respond to it via setting the input files using
- * [`fileChooser.setFiles(files[, options])`](https://github.com/microsoft/playwright/blob/master/docs/api.md#filechoosersetfilesfiles-options)
+ * [fileChooser.setFiles(files[, options])](https://github.com/microsoft/playwright/blob/master/docs/api.md#filechoosersetfilesfiles-options)
* that can be uploaded after that.
*
* ```js
@@ -1022,7 +1022,7 @@ export interface Page {
/**
* Emitted when the page opens a new tab or window. This event is emitted in addition to the
- * [`browserContext.on('page')`](https://github.com/microsoft/playwright/blob/master/docs/api.md#browsercontextonpage), but
+ * [browserContext.on('page')](https://github.com/microsoft/playwright/blob/master/docs/api.md#browsercontextonpage), but
* only for popups relevant to this page.
*
* The earliest moment that page is available is when it has navigated to the initial url. For example, when opening a
@@ -1038,15 +1038,15 @@ export interface Page {
* ```
*
* > **NOTE** Use
- * [`page.waitForLoadState([state, options])`](https://github.com/microsoft/playwright/blob/master/docs/api.md#pagewaitforloadstatestate-options)
+ * [page.waitForLoadState([state, options])](https://github.com/microsoft/playwright/blob/master/docs/api.md#pagewaitforloadstatestate-options)
* to wait until the page gets to a particular state (you should not need it in most cases).
*/
removeListener(event: 'popup', listener: (page: Page) => void): this;
/**
* Emitted when a page issues a request. The [request] object is read-only. In order to intercept and mutate requests, see
- * [`page.route(url, handler)`](https://github.com/microsoft/playwright/blob/master/docs/api.md#pagerouteurl-handler) or
- * [`browserContext.route(url, handler)`](https://github.com/microsoft/playwright/blob/master/docs/api.md#browsercontextrouteurl-handler).
+ * [page.route(url, handler)](https://github.com/microsoft/playwright/blob/master/docs/api.md#pagerouteurl-handler) or
+ * [browserContext.route(url, handler)](https://github.com/microsoft/playwright/blob/master/docs/api.md#browsercontextrouteurl-handler).
*/
removeListener(event: 'request', listener: (request: Request) => void): this;
@@ -1055,9 +1055,9 @@ export interface Page {
*
* > **NOTE** HTTP Error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so request
* will complete with
- * [`page.on('requestfinished')`](https://github.com/microsoft/playwright/blob/master/docs/api.md#pageonrequestfinished)
+ * [page.on('requestfinished')](https://github.com/microsoft/playwright/blob/master/docs/api.md#pageonrequestfinished)
* event and not with
- * [`page.on('requestfailed')`](https://github.com/microsoft/playwright/blob/master/docs/api.md#pageonrequestfailed).
+ * [page.on('requestfailed')](https://github.com/microsoft/playwright/blob/master/docs/api.md#pageonrequestfailed).
*/
removeListener(event: 'requestfailed', listener: (request: Request) => void): this;
@@ -1144,8 +1144,8 @@ export interface Page {
/**
* Emitted when a JavaScript dialog appears, such as `alert`, `prompt`, `confirm` or `beforeunload`. Playwright can respond
* to the dialog via
- * [`dialog.accept([promptText])`](https://github.com/microsoft/playwright/blob/master/docs/api.md#dialogacceptprompttext)
- * or [`dialog.dismiss()`](https://github.com/microsoft/playwright/blob/master/docs/api.md#dialogdismiss) methods.
+ * [dialog.accept([promptText])](https://github.com/microsoft/playwright/blob/master/docs/api.md#dialogacceptprompttext) or
+ * [dialog.dismiss()](https://github.com/microsoft/playwright/blob/master/docs/api.md#dialogdismiss) methods.
*/
off(event: 'dialog', listener: (dialog: Dialog) => void): this;
@@ -1168,7 +1168,7 @@ export interface Page {
/**
* Emitted when a file chooser is supposed to appear, such as after clicking the ` `. Playwright can
* respond to it via setting the input files using
- * [`fileChooser.setFiles(files[, options])`](https://github.com/microsoft/playwright/blob/master/docs/api.md#filechoosersetfilesfiles-options)
+ * [fileChooser.setFiles(files[, options])](https://github.com/microsoft/playwright/blob/master/docs/api.md#filechoosersetfilesfiles-options)
* that can be uploaded after that.
*
* ```js
@@ -1207,7 +1207,7 @@ export interface Page {
/**
* Emitted when the page opens a new tab or window. This event is emitted in addition to the
- * [`browserContext.on('page')`](https://github.com/microsoft/playwright/blob/master/docs/api.md#browsercontextonpage), but
+ * [browserContext.on('page')](https://github.com/microsoft/playwright/blob/master/docs/api.md#browsercontextonpage), but
* only for popups relevant to this page.
*
* The earliest moment that page is available is when it has navigated to the initial url. For example, when opening a
@@ -1223,15 +1223,15 @@ export interface Page {
* ```
*
* > **NOTE** Use
- * [`page.waitForLoadState([state, options])`](https://github.com/microsoft/playwright/blob/master/docs/api.md#pagewaitforloadstatestate-options)
+ * [page.waitForLoadState([state, options])](https://github.com/microsoft/playwright/blob/master/docs/api.md#pagewaitforloadstatestate-options)
* to wait until the page gets to a particular state (you should not need it in most cases).
*/
off(event: 'popup', listener: (page: Page) => void): this;
/**
* Emitted when a page issues a request. The [request] object is read-only. In order to intercept and mutate requests, see
- * [`page.route(url, handler)`](https://github.com/microsoft/playwright/blob/master/docs/api.md#pagerouteurl-handler) or
- * [`browserContext.route(url, handler)`](https://github.com/microsoft/playwright/blob/master/docs/api.md#browsercontextrouteurl-handler).
+ * [page.route(url, handler)](https://github.com/microsoft/playwright/blob/master/docs/api.md#pagerouteurl-handler) or
+ * [browserContext.route(url, handler)](https://github.com/microsoft/playwright/blob/master/docs/api.md#browsercontextrouteurl-handler).
*/
off(event: 'request', listener: (request: Request) => void): this;
@@ -1240,9 +1240,9 @@ export interface Page {
*
* > **NOTE** HTTP Error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so request
* will complete with
- * [`page.on('requestfinished')`](https://github.com/microsoft/playwright/blob/master/docs/api.md#pageonrequestfinished)
+ * [page.on('requestfinished')](https://github.com/microsoft/playwright/blob/master/docs/api.md#pageonrequestfinished)
* event and not with
- * [`page.on('requestfailed')`](https://github.com/microsoft/playwright/blob/master/docs/api.md#pageonrequestfailed).
+ * [page.on('requestfailed')](https://github.com/microsoft/playwright/blob/master/docs/api.md#pageonrequestfailed).
*/
off(event: 'requestfailed', listener: (request: Request) => void): this;
@@ -1292,9 +1292,9 @@ export interface Page {
* ```
*
* > **NOTE** The order of evaluation of multiple scripts installed via
- * [`browserContext.addInitScript(script[, arg])`](https://github.com/microsoft/playwright/blob/master/docs/api.md#browsercontextaddinitscriptscript-arg)
+ * [browserContext.addInitScript(script[, arg])](https://github.com/microsoft/playwright/blob/master/docs/api.md#browsercontextaddinitscriptscript-arg)
* and
- * [`page.addInitScript(script[, arg])`](https://github.com/microsoft/playwright/blob/master/docs/api.md#pageaddinitscriptscript-arg)
+ * [page.addInitScript(script[, arg])](https://github.com/microsoft/playwright/blob/master/docs/api.md#pageaddinitscriptscript-arg)
* is not defined.
* @param script Script to be evaluated in the page.
* @param arg Optional argument to pass to `script` (only supported when passing a function).
@@ -1317,7 +1317,7 @@ export interface Page {
* fires or when the script content was injected into frame.
*
* Shortcut for main frame's
- * [`frame.addScriptTag(params)`](https://github.com/microsoft/playwright/blob/master/docs/api.md#frameaddscripttagparams).
+ * [frame.addScriptTag(params)](https://github.com/microsoft/playwright/blob/master/docs/api.md#frameaddscripttagparams).
* @param params
*/
addScriptTag(params: {
@@ -1349,7 +1349,7 @@ export interface Page {
* content. Returns the added tag when the stylesheet's onload fires or when the CSS content was injected into frame.
*
* Shortcut for main frame's
- * [`frame.addStyleTag(params)`](https://github.com/microsoft/playwright/blob/master/docs/api.md#frameaddstyletagparams).
+ * [frame.addStyleTag(params)](https://github.com/microsoft/playwright/blob/master/docs/api.md#frameaddstyletagparams).
* @param params
*/
addStyleTag(params: {
@@ -1383,7 +1383,7 @@ export interface Page {
* 1. Wait for [actionability](https://github.com/microsoft/playwright/blob/master/docs/actionability.md) checks on the matched element, unless `force` option is set. If the
* element is detached during the checks, the whole action is retried.
* 1. Scroll the element into view if needed.
- * 1. Use [`page.mouse`](https://github.com/microsoft/playwright/blob/master/docs/api.md#pagemouse) to click in the center
+ * 1. Use [page.mouse](https://github.com/microsoft/playwright/blob/master/docs/api.md#pagemouse) to click in the center
* of the element.
* 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.
* 1. Ensure that the element is now checked. If not, this method rejects.
@@ -1392,7 +1392,7 @@ export interface Page {
* Passing zero timeout disables this.
*
* Shortcut for main frame's
- * [`frame.check(selector[, options])`](https://github.com/microsoft/playwright/blob/master/docs/api.md#framecheckselector-options).
+ * [frame.check(selector[, options])](https://github.com/microsoft/playwright/blob/master/docs/api.md#framecheckselector-options).
* @param selector A selector to search for element. If there are multiple elements satisfying the selector, the first will be used. See [working with selectors](https://github.com/microsoft/playwright/blob/master/docs/api.md#working-with-selectors) for more details.
* @param options
*/
@@ -1412,9 +1412,9 @@ export interface Page {
/**
* Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
* using the
- * [`browserContext.setDefaultTimeout(timeout)`](https://github.com/microsoft/playwright/blob/master/docs/api.md#browsercontextsetdefaulttimeouttimeout)
+ * [browserContext.setDefaultTimeout(timeout)](https://github.com/microsoft/playwright/blob/master/docs/api.md#browsercontextsetdefaulttimeouttimeout)
* or
- * [`page.setDefaultTimeout(timeout)`](https://github.com/microsoft/playwright/blob/master/docs/api.md#pagesetdefaulttimeouttimeout)
+ * [page.setDefaultTimeout(timeout)](https://github.com/microsoft/playwright/blob/master/docs/api.md#pagesetdefaulttimeouttimeout)
* methods.
*/
timeout?: number;
@@ -1426,7 +1426,7 @@ export interface Page {
* 1. Wait for [actionability](https://github.com/microsoft/playwright/blob/master/docs/actionability.md) checks on the matched element, unless `force` option is set. If the
* element is detached during the checks, the whole action is retried.
* 1. Scroll the element into view if needed.
- * 1. Use [`page.mouse`](https://github.com/microsoft/playwright/blob/master/docs/api.md#pagemouse) to click in the center
+ * 1. Use [page.mouse](https://github.com/microsoft/playwright/blob/master/docs/api.md#pagemouse) to click in the center
* of the element, or the specified `position`.
* 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.
*
@@ -1434,7 +1434,7 @@ export interface Page {
* Passing zero timeout disables this.
*
* Shortcut for main frame's
- * [`frame.click(selector[, options])`](https://github.com/microsoft/playwright/blob/master/docs/api.md#frameclickselector-options).
+ * [frame.click(selector[, options])](https://github.com/microsoft/playwright/blob/master/docs/api.md#frameclickselector-options).
* @param selector A selector to search for element. If there are multiple elements satisfying the selector, the first will be used. See [working with selectors](https://github.com/microsoft/playwright/blob/master/docs/api.md#working-with-selectors) for more details.
* @param options
*/
@@ -1485,9 +1485,9 @@ export interface Page {
/**
* Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
* using the
- * [`browserContext.setDefaultTimeout(timeout)`](https://github.com/microsoft/playwright/blob/master/docs/api.md#browsercontextsetdefaulttimeouttimeout)
+ * [browserContext.setDefaultTimeout(timeout)](https://github.com/microsoft/playwright/blob/master/docs/api.md#browsercontextsetdefaulttimeouttimeout)
* or
- * [`page.setDefaultTimeout(timeout)`](https://github.com/microsoft/playwright/blob/master/docs/api.md#pagesetdefaulttimeouttimeout)
+ * [page.setDefaultTimeout(timeout)](https://github.com/microsoft/playwright/blob/master/docs/api.md#pagesetdefaulttimeouttimeout)
* methods.
*/
timeout?: number;
@@ -1501,7 +1501,7 @@ export interface Page {
*
* > **NOTE** if `runBeforeUnload` is passed as true, a `beforeunload` dialog might be summoned
* > and should be handled manually via
- * [`page.on('dialog')`](https://github.com/microsoft/playwright/blob/master/docs/api.md#pageondialog) event.
+ * [page.on('dialog')](https://github.com/microsoft/playwright/blob/master/docs/api.md#pageondialog) event.
* @param options
*/
close(options?: {
@@ -1534,10 +1534,10 @@ export interface Page {
* 1. Wait for [actionability](https://github.com/microsoft/playwright/blob/master/docs/actionability.md) checks on the matched element, unless `force` option is set. If the
* element is detached during the checks, the whole action is retried.
* 1. Scroll the element into view if needed.
- * 1. Use [`page.mouse`](https://github.com/microsoft/playwright/blob/master/docs/api.md#pagemouse) to double click in the
+ * 1. Use [page.mouse](https://github.com/microsoft/playwright/blob/master/docs/api.md#pagemouse) to double click in the
* center of the element, or the specified `position`.
- * 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. Note that if the first
- * click of the `dblclick()` triggers a navigation event, this method will reject.
+ * 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. Note that if the
+ * first click of the `dblclick()` triggers a navigation event, this method will reject.
*
* When all steps combined have not finished during the specified `timeout`, this method rejects with a [TimeoutError].
* Passing zero timeout disables this.
@@ -1545,7 +1545,7 @@ export interface Page {
* > **NOTE** `page.dblclick()` dispatches two `click` events and a single `dblclick` event.
*
* Shortcut for main frame's
- * [`frame.dblclick(selector[, options])`](https://github.com/microsoft/playwright/blob/master/docs/api.md#framedblclickselector-options).
+ * [frame.dblclick(selector[, options])](https://github.com/microsoft/playwright/blob/master/docs/api.md#framedblclickselector-options).
* @param selector A selector to search for element. If there are multiple elements satisfying the selector, the first will be used. See [working with selectors](https://github.com/microsoft/playwright/blob/master/docs/api.md#working-with-selectors) for more details.
* @param options
*/
@@ -1591,9 +1591,9 @@ export interface Page {
/**
* Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
* using the
- * [`browserContext.setDefaultTimeout(timeout)`](https://github.com/microsoft/playwright/blob/master/docs/api.md#browsercontextsetdefaulttimeouttimeout)
+ * [browserContext.setDefaultTimeout(timeout)](https://github.com/microsoft/playwright/blob/master/docs/api.md#browsercontextsetdefaulttimeouttimeout)
* or
- * [`page.setDefaultTimeout(timeout)`](https://github.com/microsoft/playwright/blob/master/docs/api.md#pagesetdefaulttimeouttimeout)
+ * [page.setDefaultTimeout(timeout)](https://github.com/microsoft/playwright/blob/master/docs/api.md#pagesetdefaulttimeouttimeout)
* methods.
*/
timeout?: number;
@@ -1637,9 +1637,9 @@ export interface Page {
/**
* Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
* using the
- * [`browserContext.setDefaultTimeout(timeout)`](https://github.com/microsoft/playwright/blob/master/docs/api.md#browsercontextsetdefaulttimeouttimeout)
+ * [browserContext.setDefaultTimeout(timeout)](https://github.com/microsoft/playwright/blob/master/docs/api.md#browsercontextsetdefaulttimeouttimeout)
* or
- * [`page.setDefaultTimeout(timeout)`](https://github.com/microsoft/playwright/blob/master/docs/api.md#pagesetdefaulttimeouttimeout)
+ * [page.setDefaultTimeout(timeout)](https://github.com/microsoft/playwright/blob/master/docs/api.md#pagesetdefaulttimeouttimeout)
* methods.
*/
timeout?: number;
@@ -1700,7 +1700,7 @@ export interface Page {
* If the `playwrightFunction` returns a [Promise], it will be awaited.
*
* See
- * [`browserContext.exposeFunction(name, playwrightFunction)`](https://github.com/microsoft/playwright/blob/master/docs/api.md#browsercontextexposefunctionname-playwrightfunction)
+ * [browserContext.exposeFunction(name, playwrightFunction)](https://github.com/microsoft/playwright/blob/master/docs/api.md#browsercontextexposefunctionname-playwrightfunction)
* for context-wide exposed function.
*
* > **NOTE** Functions installed via `page.exposeFunction` survive navigations.
@@ -1769,10 +1769,10 @@ export interface Page {
* clear the input field.
*
* To send fine-grained keyboard events, use
- * [`page.type(selector, text[, options])`](https://github.com/microsoft/playwright/blob/master/docs/api.md#pagetypeselector-text-options).
+ * [page.type(selector, text[, options])](https://github.com/microsoft/playwright/blob/master/docs/api.md#pagetypeselector-text-options).
*
* Shortcut for main frame's
- * [`frame.fill(selector, value[, options])`](https://github.com/microsoft/playwright/blob/master/docs/api.md#framefillselector-value-options)
+ * [frame.fill(selector, value[, options])](https://github.com/microsoft/playwright/blob/master/docs/api.md#framefillselector-value-options)
* @param selector A selector to search for element. If there are multiple elements satisfying the selector, the first will be used. See [working with selectors](https://github.com/microsoft/playwright/blob/master/docs/api.md#working-with-selectors) for more details.
* @param value Value to fill for the ` `, `