Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

docs: have npm test -> npx playwright test (#17250)

Max Schmittb12cd9fb2151
diff --git a/docs/src/ci.md b/docs/src/ci.md
index 1e899675c9..af8787bf69 100644
--- a/docs/src/ci.md
+++ b/docs/src/ci.md
@@ -37,7 +37,7 @@ configurations for common CI providers.
1. **Run your tests**:
```bash js
- npm test
+ npx playwright test
```
```bash python
pytest
@@ -66,7 +66,7 @@ steps:
- name: Install Playwright
run: npx playwright install --with-deps
- name: Run your tests
- run: npm test
+ run: npx playwright test
- name: Upload test results
if: always()
uses: actions/upload-artifact@v2
@@ -148,7 +148,7 @@ jobs:
- name: Install Playwright
run: npx playwright install --with-deps
- name: Run Playwright tests
- run: npm run test:e2e
+ run: npx playwright test
env:
# This might depend on your test-runner/language binding
PLAYWRIGHT_TEST_BASE_URL: ${{ github.event.deployment_status.target_url }}
@@ -394,7 +394,7 @@ Sharding in Circle CI is indexed with 0 which means that you will need to overri
executor: pw-focal-development
parallelism: 4
steps:
- - run: SHARD="$((${CIRCLE_NODE_INDEX}+1))"; npm run test -- --shard=${SHARD}/${CIRCLE_NODE_TOTAL}
+ - run: SHARD="$((${CIRCLE_NODE_INDEX}+1))"; npx playwright test -- --shard=${SHARD}/${CIRCLE_NODE_TOTAL}
```
### Jenkins
@@ -410,7 +410,7 @@ pipeline {
steps {
// Depends on your language / test framework
sh 'npm install'
- sh 'npm run test'
+ sh 'npx playwright test'
}
}
}
@@ -524,7 +524,7 @@ configuration, against a hash of the Playwright version.
Playwright supports the `DEBUG` environment variable to output debug logs during execution. Setting it to `pw:browser*` is helpful while debugging `Error: Failed to launch browser` errors.
```bash js
-DEBUG=pw:browser* npm run test
+DEBUG=pw:browser* npx playwright test
```
```bash python
DEBUG=pw:browser* pytest
diff --git a/docs/src/debug-selectors.md b/docs/src/debug-selectors.md
index 22ecf046db..e7a42c4712 100644
--- a/docs/src/debug-selectors.md
+++ b/docs/src/debug-selectors.md
@@ -100,17 +100,17 @@ Generates selector for the given element.
Playwright supports verbose logging with the `DEBUG` environment variable.
```bash tab=bash-bash lang=js
-DEBUG=pw:api npm run test
+DEBUG=pw:api npx playwright test
```
```batch tab=bash-batch lang=js
set DEBUG=pw:api
-npm run test
+npx playwright test
```
```powershell tab=bash-powershell lang=js
$env:DEBUG="pw:api"
-npm run test
+npx playwright test
```
```bash tab=bash-bash lang=java
diff --git a/docs/src/debug.md b/docs/src/debug.md
index 970fc2b23b..6ebab2464c 100644
--- a/docs/src/debug.md
+++ b/docs/src/debug.md
@@ -34,17 +34,17 @@ Set the `PWDEBUG` environment variable to run your scripts in debug mode. This
configures Playwright for debugging and opens the inspector.
```bash tab=bash-bash lang=js
-PWDEBUG=1 npm run test
+PWDEBUG=1 npx playwright test
```
```batch tab=bash-batch lang=js
set PWDEBUG=1
-npm run test
+npx playwright test
```
```powershell tab=bash-powershell lang=js
$env:PWDEBUG=1
-npm run test
+npx playwright test
```
```bash tab=bash-bash lang=java
@@ -108,17 +108,17 @@ Using `PWDEBUG=console` will configure the browser for debugging in Developer to
composite selectors.
```bash tab=bash-bash lang=js
-PWDEBUG=console npm run test
+PWDEBUG=console npx playwright test
```
```batch tab=bash-batch lang=js
set PWDEBUG=console
-npm run test
+npx playwright test
```
```powershell tab=bash-powershell lang=js
$env:PWDEBUG="console"
-npm run test
+npx playwright test
```
```bash tab=bash-bash lang=java