docs(java): clarify how to configure souce location (#22613)

This commit is contained in:
Yury Semikhatsky 2023-04-25 11:11:47 -07:00 committed by GitHub
parent ec5f7d5491
commit f0fb4b67c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -111,26 +111,6 @@ configures Playwright for debugging and opens the inspector. Additional useful d
- Browsers launch in headed mode
- Default timeout is set to 0 (= no timeout)
```bash tab=bash-bash lang=java
# Source directories in the list are separated by : on macos and linux and by ; on win.
PWDEBUG=1 PLAYWRIGHT_JAVA_SRC=<java source dirs> mvn test
```
```batch tab=bash-batch lang=java
# Source directories in the list are separated by : on macos and linux and by ; on win.
set PLAYWRIGHT_JAVA_SRC=<java source dirs>
set PWDEBUG=1
mvn test
```
```powershell tab=bash-powershell lang=java
# Source directories in the list are separated by : on macos and linux and by ; on win.
$env:PLAYWRIGHT_JAVA_SRC="<java source dirs>"
$env:PWDEBUG=1
mvn test
```
```bash tab=bash-bash lang=python
PWDEBUG=1 pytest -s
```
@ -159,6 +139,32 @@ $env:PWDEBUG=1
dotnet test
```
#### Configure source location
* langs: java
To tell Playwright where to look for the source code that you are debugging, pass
a list of the source directories via `PLAYWRIGHT_JAVA_SRC` environment variable. Paths in
the list should be separated by : on macOS and Linux, and by ; on Windows.
```bash tab=bash-bash lang=java
# Source directories in the list are separated by : on macos and linux and by ; on win.
PWDEBUG=1 PLAYWRIGHT_JAVA_SRC=<java source dirs> mvn test
```
```batch tab=bash-batch lang=java
# Source directories in the list are separated by : on macos and linux and by ; on win.
set PLAYWRIGHT_JAVA_SRC=<java source dirs>
set PWDEBUG=1
mvn test
```
```powershell tab=bash-powershell lang=java
# Source directories in the list are separated by : on macos and linux and by ; on win.
$env:PLAYWRIGHT_JAVA_SRC="<java source dirs>"
$env:PWDEBUG=1
mvn test
```
### Stepping through your tests
You can play, pause or step through each action of your test using the toolbar at the top of the Inspector. You can see the current action highlighted in the test code, and matching elements highlighted in the browser window.