docs: remove troubleshooting guide (#23454)
Signed-off-by: Dmitry Gozman <dgozman@gmail.com> Co-authored-by: Max Schmitt <max@schmitt.mx>
This commit is contained in:
parent
e47b23e5d4
commit
b1974961b0
|
|
@ -12,7 +12,7 @@ Playwright is a framework for Web Testing and Automation. It allows testing [Chr
|
|||
| WebKit <!-- GEN:webkit-version -->16.4<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
||||
| Firefox <!-- GEN:firefox-version -->113.0<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
||||
|
||||
Headless execution is supported for all browsers on all platforms. Check out [system requirements](https://playwright.dev/docs/troubleshooting#system-requirements) for details.
|
||||
Headless execution is supported for all browsers on all platforms. Check out [system requirements](https://playwright.dev/docs/intro#system-requirements) for details.
|
||||
|
||||
Looking for Playwright for [Python](https://playwright.dev/python/docs/intro), [.NET](https://playwright.dev/dotnet/docs/intro), or [Java](https://playwright.dev/java/docs/intro)?
|
||||
|
||||
|
|
|
|||
|
|
@ -132,6 +132,8 @@ playwright install --with-deps chromium
|
|||
pwsh bin/Debug/netX/playwright.ps1 install --with-deps chromium
|
||||
```
|
||||
|
||||
See [system requirements](./intro.md#system-requirements) for officially supported operating systems.
|
||||
|
||||
## Update Playwright regulary
|
||||
* langs: js
|
||||
|
||||
|
|
@ -153,12 +155,12 @@ npx playwright --version
|
|||
|
||||
## Configure Browsers
|
||||
|
||||
Playwright can run tests on Chromium, WebKit and Firefox browsers as well as branded browsers such as Google Chrome and Microsoft Edge. It can also run on emulated tablet and mobile devices. See the [registry of device parameters](https://github.com/microsoft/playwright/blob/main/packages/playwright-core/src/server/deviceDescriptorsSource.json) for a complete list of selected desktop, tablet and mobile devices.
|
||||
Playwright can run tests on Chromium, WebKit and Firefox browsers as well as branded browsers such as Google Chrome and Microsoft Edge. It can also run on emulated tablet and mobile devices. See the [registry of device parameters](https://github.com/microsoft/playwright/blob/main/packages/playwright-core/src/server/deviceDescriptorsSource.json) for a complete list of selected desktop, tablet and mobile devices.
|
||||
|
||||
### Run tests on different browsers
|
||||
* langs: js
|
||||
|
||||
Playwright can run your tests in multiple browsers and configurations by setting up **projects** in the config. You can also add [different options](./test-configuration) for each project.
|
||||
Playwright can run your tests in multiple browsers and configurations by setting up **projects** in the config. You can also add [different options](./test-configuration) for each project.
|
||||
|
||||
```js
|
||||
import { defineConfig, devices } from '@playwright/test';
|
||||
|
|
@ -341,7 +343,7 @@ While Playwright can download and use the recent Chromium build, it can operate
|
|||
Available channels are `chrome`, `msedge`, `chrome-beta`, `msedge-beta` or `msedge-dev`.
|
||||
|
||||
:::warning
|
||||
Certain Enterprise Browser Policies may impact Playwright's ability to launch and control Google Chrome and Microsoft Edge. Running in an environment with browser policies is outside of the Playwright project's scope. See [this page](./troubleshooting.md##incompatible-microsoft-edge--google-chrome-policy-settings) for some known issues.
|
||||
Certain Enterprise Browser Policies may impact Playwright's ability to launch and control Google Chrome and Microsoft Edge. Running in an environment with browser policies is outside of the Playwright project's scope.
|
||||
:::
|
||||
|
||||
```js
|
||||
|
|
@ -959,12 +961,12 @@ This can be done by setting `PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD` variable before i
|
|||
```bash tab=bash-bash lang=js
|
||||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npx playwright install
|
||||
```
|
||||
|
||||
|
||||
```batch tab=bash-batch lang=js
|
||||
set PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
|
||||
npx playwright install
|
||||
```
|
||||
|
||||
|
||||
```powershell tab=bash-powershell lang=js
|
||||
$Env:PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
|
||||
npx playwright install
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ Playwright will look at your page and figure out the best locator, prioritizing
|
|||
|
||||
### Run in Debug Mode
|
||||
|
||||
To set a breakpoint click next to the line number where you want the breakpoint to be until a red dot appears. Run the tests in debug mode by right clicking on the line next to the test you want to run.
|
||||
To set a breakpoint click next to the line number where you want the breakpoint to be until a red dot appears. Run the tests in debug mode by right clicking on the line next to the test you want to run.
|
||||
|
||||
<img width="1269" alt="setting debug test mode" src="https://user-images.githubusercontent.com/13063165/212739847-ecb7dcfe-8929-45f3-b24e-f9c4b592f430.png" />
|
||||
|
||||
|
|
@ -457,7 +457,8 @@ dotnet run
|
|||
|
||||
:::note
|
||||
**For WebKit**: launching WebKit Inspector during the execution will
|
||||
prevent the Playwright script from executing any further.
|
||||
prevent the Playwright script from executing any further and
|
||||
will reset pre-configured user agent and device emulation.
|
||||
:::
|
||||
|
||||
## Headed mode
|
||||
|
|
@ -470,12 +471,12 @@ to slow down execution (by N milliseconds per operation) and follow along while
|
|||
|
||||
```js
|
||||
// Chromium, Firefox, or WebKit
|
||||
await chromium.launch({ headless: false, slowMo: 100 });
|
||||
await chromium.launch({ headless: false, slowMo: 100 });
|
||||
```
|
||||
|
||||
```java
|
||||
// Chromium, Firefox, or WebKit
|
||||
chromium.launch(new BrowserType.LaunchOptions()
|
||||
chromium.launch(new BrowserType.LaunchOptions()
|
||||
.setHeadless(false)
|
||||
.setSlowMo(100));
|
||||
```
|
||||
|
|
|
|||
|
|
@ -196,6 +196,13 @@ dotnet test -- MSTest.Parallelize.Workers=5
|
|||
|
||||
See our doc on [Test Runners](./test-runners.md) to learn more about running tests in headed mode, running multiple tests, running specific configurations etc.
|
||||
|
||||
## System requirements
|
||||
|
||||
- Playwright is distributed as a .NET Standard 2.0 library. We recommend .NET 6.
|
||||
- Windows 10+, Windows Server 2016+ or Windows Subsystem for Linux (WSL).
|
||||
- MacOS 12 Monterey or MacOS 13 Ventura.
|
||||
- Debian 11, Ubuntu 20.04 or Ubuntu 22.04.
|
||||
|
||||
## What's next
|
||||
|
||||
- [Write tests using web first assertions, page fixtures and locators](./writing-tests.md)
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ id: intro
|
|||
title: "Installation"
|
||||
---
|
||||
|
||||
Playwright was created specifically to accommodate the needs of end-to-end testing. Playwright supports all modern rendering engines including Chromium, WebKit, and Firefox. Test on Windows, Linux, and macOS, locally or on CI, headless or headed with native mobile emulation.
|
||||
Playwright was created specifically to accommodate the needs of end-to-end testing. Playwright supports all modern rendering engines including Chromium, WebKit, and Firefox. Test on Windows, Linux, and macOS, locally or on CI, headless or headed with native mobile emulation.
|
||||
|
||||
Playwright is distributed as a set of [Maven](https://maven.apache.org/what-is-maven.html) modules. The easiest way to use it is to add one dependency to your project's `pom.xml` as described below. If you're not familiar with Maven please refer to its [documentation](https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html).
|
||||
|
||||
|
|
@ -124,6 +124,13 @@ mvn compile exec:java -D exec.mainClass="org.example.App"
|
|||
|
||||
By default browsers launched with Playwright run headless, meaning no browser UI will open up when running the script. To change that you can pass `new BrowserType.LaunchOptions().setHeadless(false)` when launching the browser.
|
||||
|
||||
## System requirements
|
||||
|
||||
- Java 8 or higher.
|
||||
- Windows 10+, Windows Server 2016+ or Windows Subsystem for Linux (WSL).
|
||||
- MacOS 12 Monterey or MacOS 13 Ventura.
|
||||
- Debian 11, Ubuntu 20.04 or Ubuntu 22.04.
|
||||
|
||||
## What's next
|
||||
|
||||
- [Write tests using web first assertions, page fixtures and locators](./writing-tests.md)
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ yarn create playwright
|
|||
```
|
||||
|
||||
</TabItem>
|
||||
|
||||
|
||||
<TabItem value="pnpm">
|
||||
|
||||
```bash
|
||||
|
|
@ -73,7 +73,7 @@ tests-examples/
|
|||
```
|
||||
|
||||
The [playwright.config](./test-configuration.md) is where you can add configuration for Playwright including modifying which browsers you would like to run Playwright on. If you are running tests inside an already existing project then dependencies will be added directly to your `package.json`.
|
||||
|
||||
|
||||
The `tests` folder contains a basic example test to help you get started with testing. For a more detailed example check out the `tests-examples` folder which contains tests written to test a todo app.
|
||||
|
||||
## Running the Example Test
|
||||
|
|
@ -102,6 +102,13 @@ npx playwright show-report
|
|||
|
||||
<img width="1392" alt="HTML Reporter" src="https://user-images.githubusercontent.com/13063165/212743312-edf1e8ed-3fc2-48aa-9c93-24ae3e36504d.png" />
|
||||
|
||||
## System requirements
|
||||
|
||||
- Node.js 16+
|
||||
- Windows 10+, Windows Server 2016+ or Windows Subsystem for Linux (WSL).
|
||||
- MacOS 12 Monterey or MacOS 13 Ventura.
|
||||
- Debian 11, Ubuntu 20.04 or Ubuntu 22.04.
|
||||
|
||||
## What's next
|
||||
|
||||
- [Write tests using web first assertions, page fixtures and locators](./writing-tests.md)
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ id: intro
|
|||
title: "Installation"
|
||||
---
|
||||
|
||||
Playwright was created specifically to accommodate the needs of end-to-end testing. Playwright supports all modern rendering engines including Chromium, WebKit, and Firefox. Test on Windows, Linux, and macOS, locally or on CI, headless or headed with native mobile emulation.
|
||||
Playwright was created specifically to accommodate the needs of end-to-end testing. Playwright supports all modern rendering engines including Chromium, WebKit, and Firefox. Test on Windows, Linux, and macOS, locally or on CI, headless or headed with native mobile emulation.
|
||||
|
||||
Playwright recommends using the official [Playwright Pytest plugin](./test-runners.md) to write end-to-end tests. It provides context isolation, running it on multiple browser configurations out of the box. Alternatively you can use the [library](./library.md) to manually write the testing infrastructure with your preferred test-runner. The Pytest plugin utilizes the sync version of Playwright, there is also an async version accessible via the library.
|
||||
|
||||
|
|
@ -57,6 +57,13 @@ By default tests will be run on chromium. This can be configured via the CLI opt
|
|||
pytest
|
||||
```
|
||||
|
||||
## System requirements
|
||||
|
||||
- Python 3.7 or higher.
|
||||
- Windows 10+, Windows Server 2016+ or Windows Subsystem for Linux (WSL).
|
||||
- MacOS 12 Monterey or MacOS 13 Ventura.
|
||||
- Debian 11, Ubuntu 20.04 or Ubuntu 22.04.
|
||||
|
||||
## What's next
|
||||
|
||||
- [Write tests using web first assertions, page fixtures and locators](./writing-tests.md)
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ In addition to the above, Playwright Test, as a full-featured Test Runner, inclu
|
|||
|
||||
## Usage
|
||||
|
||||
Use npm or Yarn to install Playwright library in your Node.js project. See [system requirements](./troubleshooting.md#system-requirements).
|
||||
Use npm or Yarn to install Playwright library in your Node.js project. See [system requirements](./intro.md#system-requirements).
|
||||
|
||||
```bash
|
||||
npm i -D playwright
|
||||
|
|
|
|||
|
|
@ -87,3 +87,16 @@ In `package.json`, add two scripts:
|
|||
The `pretest` script runs typescript on the tests. `test` will run the tests that have been generated to the `tests-out` directory. The `-c` argument configures the test runner to look for tests inside the `tests-out` directory.
|
||||
|
||||
Then `npm run test` will build the tests and run them.
|
||||
|
||||
## Transpilation issues
|
||||
|
||||
Using dynamic imports inside a function passed to various `evaluate()` methods is not supported. This is because Playwright uses `Function.prototype.toString()` to serialize functions, and transpiler will sometimes replace dynamic imports with `require()` calls, which are not valid inside the web page.
|
||||
|
||||
To work around this issue, use a string template instead of a function:
|
||||
|
||||
```js
|
||||
await page.evaluate(`async () => {
|
||||
const { value } = await import('some-module');
|
||||
console.log(value);
|
||||
}`);
|
||||
```
|
||||
|
|
|
|||
|
|
@ -1,95 +0,0 @@
|
|||
---
|
||||
id: troubleshooting
|
||||
title: "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.
|
||||
|
||||
See also in the [browsers](./browsers.md#install-system-dependencies) doc
|
||||
which has a command to install all necessary dependencies automatically for Ubuntu
|
||||
LTS releases.
|
||||
|
||||
## Code transpilation issues
|
||||
* langs: js
|
||||
|
||||
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
|
||||
* langs: js
|
||||
|
||||
Playwright requires Node.js version 16 or above
|
||||
|
||||
### ReferenceError: URL is not defined
|
||||
|
||||
Playwright requires Node.js 16 or higher.
|
||||
|
||||
### Unknown file extension ".ts"
|
||||
|
||||
Running TypeScript tests in `"type": "module"` project requires Node.js 16 or higher.
|
||||
|
||||
## Incompatible Microsoft Edge / Google Chrome policy settings
|
||||
|
||||
It's known that Playwright is not working as expected when some Microsoft Edge / Google Chrome policy settings are set. The following shows some of them, there might be more that affect Playwright's functionalities. If you find any other policy settings that break functionality, please file an issue and we'll add it to this document. You can see a list of applied policies by running `chrome://policy` in the browser.
|
||||
|
||||
- `BrowserSignin` - This policy may prevent Playwright from launching the browser without signing in. Playwright will fail to launch browser if the policy forces users to sign-in to use the browser. See discussion in [this bug](https://github.com/microsoft/playwright/issues/22016)
|
||||
- `ExtensionInstallForcelist` - This policy is used to specify a list of extensions that should be installed. Playwright's browser close will not work if this policy is set. See discussion in [this bug](https://github.com/microsoft/playwright/issues/17299).
|
||||
- `UserDataDir` - This policy is used to specify the location of the user data directory. Playwright uses a temporary directory for user data, so this policy is not compatible with Playwright. See discussion in [this bug](https://github.com/microsoft/playwright/issues/17448).
|
||||
|
||||
## .NET requirements
|
||||
* langs: csharp
|
||||
|
||||
Playwright is distributed as a **.NET Standard 2.0** library. We recommend .NET 6 or newer.
|
||||
|
||||
## Python requirements
|
||||
* langs: python
|
||||
|
||||
Playwright requires **Python 3.7** or newer.
|
||||
|
||||
## Java requirements
|
||||
* langs: java
|
||||
|
||||
Playwright requires **Java 8** or newer.
|
||||
|
||||
## WebKit Web Inspector
|
||||
|
||||
Launching WebKit Inspector during the execution will prevent the Playwright script from executing any further and
|
||||
will reset pre-configured user agent and device emulation.
|
||||
|
||||
This is a known limitation.
|
||||
|
||||
## System requirements
|
||||
|
||||
The browser binaries for Chromium, Firefox and WebKit work across the 3 platforms (Windows, macOS, Linux):
|
||||
|
||||
### Windows
|
||||
|
||||
Works with Windows 10+, Windows Server 2016+ and Windows Subsystem for Linux (WSL).
|
||||
|
||||
### macOS
|
||||
|
||||
Requires 12 (Monterey) or above.
|
||||
|
||||
### Linux
|
||||
|
||||
Depending on your Linux distribution, you might need to install additional
|
||||
dependencies to run the browsers.
|
||||
|
||||
:::note
|
||||
Only Debian 11, Ubuntu 20.04 and 22.04 are officially supported.
|
||||
:::
|
||||
|
||||
See also in the [browsers](./browsers.md#install-system-dependencies) doc
|
||||
which has a command to install all necessary dependencies automatically for Ubuntu
|
||||
LTS releases.
|
||||
|
||||
Loading…
Reference in a new issue