From 34014638da377ee28275261accb8f782412f9a67 Mon Sep 17 00:00:00 2001
From: Playwright Service <89237858+playwrightmachine@users.noreply.github.com>
Date: Mon, 15 Aug 2022 00:43:33 -0700
Subject: [PATCH] chery-pick(docs): sync with ToT docs (#16533)
This PR cherry-picks the following commits:
- b089d0a5aa295b5e612790b8b4db89df49773bd8
- 13f210a1e8b0372b4099d27dc932b68c3860028d
- 2bdf51d284613a189282b39b9cb35f5e46e2e286
- 32adf50e6514046e7ee3dd5f315648b409b4098c
- 435272248fb1b4f9fc52c199c3a7d1e55311b3b7
- 8170432fabd51bec26e833ec7a4a1bb55dcf37d4
---
docs/src/browsers.md | 38 +++---
docs/src/ci.md | 2 +-
docs/src/cli.md | 38 +++---
docs/src/codegen-intro.md | 2 +-
docs/src/codegen.md | 16 +--
docs/src/debug.md | 2 +-
docs/src/intro-csharp.md | 4 +-
docs/src/library-csharp.md | 2 +-
docs/src/mock-js.md | 2 +-
docs/src/network.md | 2 +-
docs/src/release-notes-csharp.md | 52 +++++++-
docs/src/release-notes-java.md | 22 ++++
docs/src/release-notes-python.md | 19 +++
docs/src/running-tests-csharp.md | 23 +---
docs/src/test-runners-csharp.md | 111 +++++++++---------
.../trace-viewer-intro-csharp-java-python.md | 2 +-
docs/src/trace-viewer.md | 4 +-
packages/playwright-core/src/cli/cli.ts | 2 +-
.../src/server/registry/index.ts | 2 +-
19 files changed, 212 insertions(+), 133 deletions(-)
diff --git a/docs/src/browsers.md b/docs/src/browsers.md
index 8be8e97002..9f5bfe7cba 100644
--- a/docs/src/browsers.md
+++ b/docs/src/browsers.md
@@ -134,27 +134,27 @@ you can still opt into stable channels on the bots that are typically free of su
To invoke Playwright CLI commands, you need to invoke a PowerShell script:
```bash
-pwsh bin\Debug\netX\playwright.ps1 --help
+pwsh bin/Debug/netX/playwright.ps1 --help
```
Playwright can install supported browsers by means of the CLI tool.
```bash csharp
# Running without arguments will install all browsers
-pwsh bin\Debug\netX\playwright.ps1 install
+pwsh bin/Debug/netX/playwright.ps1 install
```
You can also install specific browsers by providing an argument:
```bash csharp
# Install WebKit
-pwsh bin\Debug\netX\playwright.ps1 install webkit
+pwsh bin/Debug/netX/playwright.ps1 install webkit
```
See all supported browsers:
```bash csharp
-pwsh bin\Debug\netX\playwright.ps1 install --help
+pwsh bin/Debug/netX/playwright.ps1 install --help
```
## Install browsers via API
@@ -236,17 +236,17 @@ mvn test
```bash tab=bash-bash lang=csharp
PLAYWRIGHT_BROWSERS_PATH=$HOME/pw-browsers
-pwsh bin\Debug\netX\playwright.ps1 install
+pwsh bin/Debug/netX/playwright.ps1 install
```
```batch tab=bash-batch lang=csharp
set PLAYWRIGHT_BROWSERS_PATH=%USERPROFILE%\pw-browsers
-pwsh bin\Debug\netX\playwright.ps1 install
+pwsh bin/Debug/netX/playwright.ps1 install
```
```powershell tab=bash-powershell lang=csharp
$env:PLAYWRIGHT_BROWSERS_PATH="$env:USERPROFILE\pw-browsers"
-pwsh bin\Debug\netX\playwright.ps1 install
+pwsh bin/Debug/netX/playwright.ps1 install
```
When running Playwright scripts, ask it to search for browsers in a shared location.
@@ -405,17 +405,17 @@ mvn test
```
```bash tab=bash-bash lang=csharp
-HTTPS_PROXY=https://192.0.2.1 pwsh bin\Debug\netX\playwright.ps1 install
+HTTPS_PROXY=https://192.0.2.1 pwsh bin/Debug/netX/playwright.ps1 install
```
```batch tab=bash-batch lang=csharp
set HTTPS_PROXY=https://192.0.2.1
-pwsh bin\Debug\netX\playwright.ps1 install
+pwsh bin/Debug/netX/playwright.ps1 install
```
```powershell tab=bash-powershell lang=csharp
$env:HTTPS_PROXY="https://192.0.2.1"
-pwsh bin\Debug\netX\playwright.ps1 install
+pwsh bin/Debug/netX/playwright.ps1 install
```
If the requests of the proxy get intercepted with a custom untrusted certificate authority (CA) and it yields to `Error: self signed certificate in certificate chain` while downloading the browsers, you must set your custom root certificates via the [`NODE_EXTRA_CA_CERTS`](https://nodejs.org/api/cli.html#node_extra_ca_certsfile) environment variable before installing the browsers:
@@ -500,17 +500,17 @@ mvn test
```
```bash tab=bash-bash lang=csharp
-PLAYWRIGHT_DOWNLOAD_HOST=192.0.2.1 pwsh bin\Debug\netX\playwright.ps1 install
+PLAYWRIGHT_DOWNLOAD_HOST=192.0.2.1 pwsh bin/Debug/netX/playwright.ps1 install
```
```batch tab=bash-batch lang=csharp
set PLAYWRIGHT_DOWNLOAD_HOST=192.0.2.1
-pwsh bin\Debug\netX\playwright.ps1 install
+pwsh bin/Debug/netX/playwright.ps1 install
```
```powershell tab=bash-powershell lang=csharp
$env:PLAYWRIGHT_DOWNLOAD_HOST="192.0.2.1"
-pwsh bin\Debug\netX\playwright.ps1 install
+pwsh bin/Debug/netX/playwright.ps1 install
```
It is also possible to use a per-browser download hosts using `PLAYWRIGHT_CHROMIUM_DOWNLOAD_HOST`, `PLAYWRIGHT_FIREFOX_DOWNLOAD_HOST` and `PLAYWRIGHT_WEBKIT_DOWNLOAD_HOST` env variables that
@@ -584,19 +584,19 @@ mvn test
```
```bash tab=bash-bash lang=csharp
-PLAYWRIGHT_FIREFOX_DOWNLOAD_HOST=203.0.113.3 PLAYWRIGHT_DOWNLOAD_HOST=192.0.2.1 pwsh bin\Debug\netX\playwright.ps1 install
+PLAYWRIGHT_FIREFOX_DOWNLOAD_HOST=203.0.113.3 PLAYWRIGHT_DOWNLOAD_HOST=192.0.2.1 pwsh bin/Debug/netX/playwright.ps1 install
```
```batch tab=bash-batch lang=csharp
set PLAYWRIGHT_FIREFOX_DOWNLOAD_HOST=203.0.113.3
set PLAYWRIGHT_DOWNLOAD_HOST=192.0.2.1
-pwsh bin\Debug\netX\playwright.ps1 install
+pwsh bin/Debug/netX/playwright.ps1 install
```
```powershell tab=bash-powershell lang=csharp
$env:PLAYWRIGHT_DOWNLOAD_HOST="192.0.2.1"
$env:PLAYWRIGHT_FIREFOX_DOWNLOAD_HOST="203.0.113.3"
-pwsh bin\Debug\netX\playwright.ps1 install
+pwsh bin/Debug/netX/playwright.ps1 install
```
## Skip browser downloads
@@ -638,17 +638,17 @@ mvn test
```
```bash tab=bash-bash lang=csharp
-PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 pwsh bin\Debug\netX\playwright.ps1 install
+PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 pwsh bin/Debug/netX/playwright.ps1 install
```
```batch tab=bash-batch lang=csharp
set PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
-pwsh bin\Debug\netX\playwright.ps1 install
+pwsh bin/Debug/netX/playwright.ps1 install
```
```powershell tab=bash-powershell lang=csharp
$env:PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
-pwsh bin\Debug\netX\playwright.ps1 install
+pwsh bin/Debug/netX/playwright.ps1 install
```
## Download single browser binary
diff --git a/docs/src/ci.md b/docs/src/ci.md
index 070da50180..3804b96766 100644
--- a/docs/src/ci.md
+++ b/docs/src/ci.md
@@ -32,7 +32,7 @@ configurations for common CI providers.
mvn exec:java -e -Dexec.mainClass=com.microsoft.playwright.CLI -Dexec.args="install --with-deps"
```
```bash csharp
- pwsh bin\Debug\netX\playwright.ps1 install --with-deps
+ pwsh bin/Debug/netX/playwright.ps1 install --with-deps
```
1. **Run your tests**:
diff --git a/docs/src/cli.md b/docs/src/cli.md
index c34781b4b4..3485cc0ea8 100644
--- a/docs/src/cli.md
+++ b/docs/src/cli.md
@@ -23,7 +23,7 @@ playwright
```bash csharp
# Use the tools.
-pwsh bin\Debug\netX\playwright.ps1 --help
+pwsh bin/Debug/netX/playwright.ps1 --help
```
```json js
@@ -56,7 +56,7 @@ playwright install
```bash csharp
# Running without arguments will install default browsers
-pwsh bin\Debug\netX\playwright.ps1 install
+pwsh bin/Debug/netX/playwright.ps1 install
```
You can also install specific browsers by providing an argument:
@@ -78,7 +78,7 @@ playwright install webkit
```bash csharp
# Install WebKit
-pwsh bin\Debug\netX\playwright.ps1 install webkit
+pwsh bin/Debug/netX/playwright.ps1 install webkit
```
See all supported browsers:
@@ -96,7 +96,7 @@ playwright install --help
```
```bash csharp
-pwsh bin\Debug\netX\playwright.ps1 install --help
+pwsh bin/Debug/netX/playwright.ps1 install --help
```
## Install system dependencies
@@ -120,7 +120,7 @@ playwright install-deps
```bash csharp
# See command help
-pwsh bin\Debug\netX\playwright.ps1 install-deps
+pwsh bin/Debug/netX/playwright.ps1 install-deps
```
You can also install the dependencies for a single browser only by passing it as an argument:
@@ -138,7 +138,7 @@ playwright install-deps chromium
```
```bash csharp
-pwsh bin\Debug\netX\playwright.ps1 install-deps chromium
+pwsh bin/Debug/netX/playwright.ps1 install-deps chromium
```
It's also possible to combine `install-deps` with `install` and install by that the browsers and OS dependencies with a single command. This would do both for Chromium, but you can also leave it out.
@@ -156,7 +156,7 @@ playwright install --with-deps chromium
```
```bash csharp
-pwsh bin\Debug\netX\playwright.ps1 install --with-deps chromium
+pwsh bin/Debug/netX/playwright.ps1 install --with-deps chromium
```
## Generate code
@@ -174,7 +174,7 @@ playwright codegen wikipedia.org
```
```bash csharp
-pwsh bin\Debug\netX\playwright.ps1 codegen wikipedia.org
+pwsh bin/Debug/netX/playwright.ps1 codegen wikipedia.org
```
Run `codegen` and perform actions in the browser. Playwright CLI will generate JavaScript code for the user interactions. `codegen` will attempt to generate resilient text-based selectors.
@@ -204,7 +204,7 @@ playwright codegen --save-storage=auth.json
```
```bash csharp
-pwsh bin\Debug\netX\playwright.ps1 codegen --save-storage=auth.json
+pwsh bin/Debug/netX/playwright.ps1 codegen --save-storage=auth.json
# Perform authentication and exit.
# auth.json will contain the storage state.
```
@@ -231,8 +231,8 @@ playwright codegen --load-storage=auth.json my.web.app
```
```bash csharp
-pwsh bin\Debug\netX\playwright.ps1 open --load-storage=auth.json my.web.app
-pwsh bin\Debug\netX\playwright.ps1 codegen --load-storage=auth.json my.web.app
+pwsh bin/Debug/netX/playwright.ps1 open --load-storage=auth.json my.web.app
+pwsh bin/Debug/netX/playwright.ps1 codegen --load-storage=auth.json my.web.app
# Perform actions in authenticated state.
```
@@ -351,7 +351,7 @@ playwright open example.com
```bash csharp
# Open page in Chromium
-pwsh bin\Debug\netX\playwright.ps1 open example.com
+pwsh bin/Debug/netX/playwright.ps1 open example.com
```
```bash js
@@ -371,7 +371,7 @@ playwright wk example.com
```bash csharp
# Open page in WebKit
-pwsh bin\Debug\netX\playwright.ps1 wk example.com
+pwsh bin/Debug/netX/playwright.ps1 wk example.com
```
### Emulate devices
@@ -394,7 +394,7 @@ playwright open --device="iPhone 11" wikipedia.org
```bash csharp
# Emulate iPhone 11.
-pwsh bin\Debug\netX\playwright.ps1 open --device="iPhone 11" wikipedia.org
+pwsh bin/Debug/netX/playwright.ps1 open --device="iPhone 11" wikipedia.org
```
### Emulate color scheme and viewport size
@@ -416,7 +416,7 @@ playwright open --viewport-size=800,600 --color-scheme=dark twitter.com
```bash csharp
# Emulate screen size and color scheme.
-pwsh bin\Debug\netX\playwright.ps1 open --viewport-size=800,600 --color-scheme=dark twitter.com
+pwsh bin/Debug/netX/playwright.ps1 open --viewport-size=800,600 --color-scheme=dark twitter.com
```
### Emulate geolocation, language and timezone
@@ -442,7 +442,7 @@ playwright open --timezone="Europe/Rome" --geolocation="41.890221,12.492348" --l
```bash csharp
# Emulate timezone, language & location
# Once page opens, click the "my location" button to see geolocation in action
-pwsh bin\Debug\netX\playwright.ps1 open --timezone="Europe/Rome" --geolocation="41.890221,12.492348" --lang="it-IT" maps.google.com
+pwsh bin/Debug/netX/playwright.ps1 open --timezone="Europe/Rome" --geolocation="41.890221,12.492348" --lang="it-IT" maps.google.com
```
## Inspect selectors
@@ -542,7 +542,7 @@ playwright screenshot \
```bash csharp
# Wait 3 seconds before capturing a screenshot after page loads ('load' event fires)
-pwsh bin\Debug\netX\playwright.ps1 screenshot \
+pwsh bin/Debug/netX/playwright.ps1 screenshot \
--device="iPhone 11" \
--color-scheme=dark \
--wait-for-timeout=3000 \
@@ -566,7 +566,7 @@ playwright screenshot --full-page en.wikipedia.org wiki-full.png
```bash csharp
# Capture a full page screenshot
-pwsh bin\Debug\netX\playwright.ps1 screenshot --full-page en.wikipedia.org wiki-full.png
+pwsh bin/Debug/netX/playwright.ps1 screenshot --full-page en.wikipedia.org wiki-full.png
```
## Generate PDF
@@ -590,5 +590,5 @@ playwright pdf https://en.wikipedia.org/wiki/PDF wiki.pdf
```bash csharp
# See command help
-pwsh bin\Debug\netX\playwright.ps1 pdf https://en.wikipedia.org/wiki/PDF wiki.pdf
+pwsh bin/Debug/netX/playwright.ps1 pdf https://en.wikipedia.org/wiki/PDF wiki.pdf
```
diff --git a/docs/src/codegen-intro.md b/docs/src/codegen-intro.md
index c8e6247fe4..6d715d44c7 100644
--- a/docs/src/codegen-intro.md
+++ b/docs/src/codegen-intro.md
@@ -25,7 +25,7 @@ playwright codegen playwright.dev
```
```bash csharp
-pwsh bin\Debug\netX\playwright.ps1 codegen playwright.dev
+pwsh bin/Debug/netX/playwright.ps1 codegen playwright.dev
```
Run `codegen` and perform actions in the browser. Playwright will generate the code for the user interactions. `Codegen` will attempt to generate resilient text-based selectors.
diff --git a/docs/src/codegen.md b/docs/src/codegen.md
index 79d74f1b5f..7f374dff38 100644
--- a/docs/src/codegen.md
+++ b/docs/src/codegen.md
@@ -20,7 +20,7 @@ playwright codegen playwright.dev
```
```bash csharp
-pwsh bin\Debug\netX\playwright.ps1 codegen playwright.dev
+pwsh bin/Debug/netX/playwright.ps1 codegen playwright.dev
```
Run `codegen` and perform actions in the browser. Playwright will generate the code for the user interactions. `Codegen` will attempt to generate resilient text-based selectors.
@@ -45,7 +45,7 @@ playwright codegen --viewport-size=800,600 playwright.dev
```
```bash csharp
-pwsh bin\Debug\netX\playwright.ps1 codegen --viewport-size=800,600 playwright.dev
+pwsh bin/Debug/netX/playwright.ps1 codegen --viewport-size=800,600 playwright.dev
```
@@ -69,7 +69,7 @@ playwright codegen --device="iPhone 11" playwright.dev
```
```bash csharp
-pwsh bin\Debug\netX\playwright.ps1 codegen --device="iPhone 11" playwright.dev
+pwsh bin/Debug/netX/playwright.ps1 codegen --device="iPhone 11" playwright.dev
```
@@ -92,7 +92,7 @@ playwright codegen --color-scheme=dark playwright.dev
```
```bash csharp
-pwsh bin\Debug\netX\playwright.ps1 codegen --color-scheme=dark playwright.dev
+pwsh bin/Debug/netX/playwright.ps1 codegen --color-scheme=dark playwright.dev
```
@@ -114,7 +114,7 @@ playwright codegen --timezone="Europe/Rome" --geolocation="41.890221,12.492348"
```
```bash csharp
-pwsh bin\Debug\netX\playwright.ps1 codegen --timezone="Europe/Rome" --geolocation="41.890221,12.492348" --lang="it-IT" maps.google.com
+pwsh bin/Debug/netX/playwright.ps1 codegen --timezone="Europe/Rome" --geolocation="41.890221,12.492348" --lang="it-IT" maps.google.com
```
@@ -138,7 +138,7 @@ playwright codegen --save-storage=auth.json
```
```bash csharp
-pwsh bin\Debug\netX\playwright.ps1 codegen --save-storage=auth.json
+pwsh bin/Debug/netX/playwright.ps1 codegen --save-storage=auth.json
```
@@ -158,7 +158,7 @@ playwright codegen --load-storage=auth.json github.com/microsoft/playwright
```
```bash csharp
-pwsh bin\Debug\netX\playwright.ps1 codegen --load-storage=auth.json github.com/microsoft/playwright
+pwsh bin/Debug/netX/playwright.ps1 codegen --load-storage=auth.json github.com/microsoft/playwright
```
@@ -178,7 +178,7 @@ playwright open --load-storage=auth.json github.com/microsoft/playwright
```
```bash csharp
-pwsh bin\Debug\netX\playwright.ps1 open --load-storage=auth.json github.com/microsoft/playwright
+pwsh bin/Debug/netX/playwright.ps1 open --load-storage=auth.json github.com/microsoft/playwright
```
diff --git a/docs/src/debug.md b/docs/src/debug.md
index daaec2ab09..970fc2b23b 100644
--- a/docs/src/debug.md
+++ b/docs/src/debug.md
@@ -193,7 +193,7 @@ playwright codegen wikipedia.org
```
```bash csharp
-pwsh bin\Debug\netX\playwright.ps1 codegen wikipedia.org
+pwsh bin/Debug/netX/playwright.ps1 codegen wikipedia.org
```
### Stepping through the Playwright script
diff --git a/docs/src/intro-csharp.md b/docs/src/intro-csharp.md
index bc0258cfe4..6f5aeb6a44 100644
--- a/docs/src/intro-csharp.md
+++ b/docs/src/intro-csharp.md
@@ -70,9 +70,11 @@ dotnet build
4. Install required browsers by replacing `netX` with the actual output folder name, e.g. `net6.0`:
```bash
-pwsh bin\Debug\netX\playwright.ps1 install
+pwsh bin/Debug/netX/playwright.ps1 install
```
+If `pwsh` is not available, you have to [install PowerShell](https://docs.microsoft.com/powershell/scripting/install/installing-powershell).
+
## Add Example Tests
Edit the `UnitTest1.cs` file with the code below to create an example end-to-end test:
diff --git a/docs/src/library-csharp.md b/docs/src/library-csharp.md
index f0ddc9d0ae..e0f737c492 100644
--- a/docs/src/library-csharp.md
+++ b/docs/src/library-csharp.md
@@ -19,7 +19,7 @@ dotnet add package Microsoft.Playwright
# Build the project
dotnet build
# Install required browsers - replace netX with actual output folder name, e.g. net6.0.
-pwsh bin\Debug\netX\playwright.ps1 install
+pwsh bin/Debug/netX/playwright.ps1 install
# If the pwsh command does not work (throws TypeNotFound), make sure to use an up-to-date version of PowerShell.
dotnet tool update --global PowerShell
diff --git a/docs/src/mock-js.md b/docs/src/mock-js.md
index a7e1c626c6..ce8726ad3f 100644
--- a/docs/src/mock-js.md
+++ b/docs/src/mock-js.md
@@ -5,7 +5,7 @@ title: "Mock APIs"
Playwright provides native support for most of the browser features. However, there are some experimental APIs
and APIs which are not (yet) fully supported by all browsers. Playwright usually doesn't provide dedicated
-atomation APIs in such cases. You can use mocks to test behavior of your application in such cases. This guide
+automation APIs in such cases. You can use mocks to test behavior of your application in such cases. This guide
gives a few examples.
diff --git a/docs/src/network.md b/docs/src/network.md
index d4bde2508a..4fea6546c8 100644
--- a/docs/src/network.md
+++ b/docs/src/network.md
@@ -719,7 +719,7 @@ playwright open --save-har=example.har --save-har-glob="**/api/**" https://examp
```bash csharp
# Save API requests from example.com as "example.har" archive.
-pwsh bin\Debug\netX\playwright.ps1 open --save-har=example.har --save-har-glob="**/api/**" https://example.com
+pwsh bin/Debug/netX/playwright.ps1 open --save-har=example.har --save-har-glob="**/api/**" https://example.com
```
### Recording HAR with a script
diff --git a/docs/src/release-notes-csharp.md b/docs/src/release-notes-csharp.md
index 95743663d4..0380ab4cfa 100644
--- a/docs/src/release-notes-csharp.md
+++ b/docs/src/release-notes-csharp.md
@@ -4,6 +4,52 @@ title: "Release notes"
toc_max_heading_level: 2
---
+## Version 1.25
+
+### New .runsettings file support
+
+`Microsoft.Playwright.NUnit` and `Microsoft.Playwright.MSTest` will now consider the `.runsettings` file and passed settings via the CLI when running end-to-end tests. See in the [documentation](https://playwright.dev/dotnet/docs/test-runners) for a full list of supported settings.
+
+The following does now work:
+
+```xml
+
+