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

This commit is contained in:
Max Schmitt 2022-09-12 17:24:23 +02:00 committed by GitHub
parent dce7cbb446
commit b12cd9fb21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 15 deletions

View file

@ -37,7 +37,7 @@ configurations for common CI providers.
1. **Run your tests**: 1. **Run your tests**:
```bash js ```bash js
npm test npx playwright test
``` ```
```bash python ```bash python
pytest pytest
@ -66,7 +66,7 @@ steps:
- name: Install Playwright - name: Install Playwright
run: npx playwright install --with-deps run: npx playwright install --with-deps
- name: Run your tests - name: Run your tests
run: npm test run: npx playwright test
- name: Upload test results - name: Upload test results
if: always() if: always()
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
@ -148,7 +148,7 @@ jobs:
- name: Install Playwright - name: Install Playwright
run: npx playwright install --with-deps run: npx playwright install --with-deps
- name: Run Playwright tests - name: Run Playwright tests
run: npm run test:e2e run: npx playwright test
env: env:
# This might depend on your test-runner/language binding # This might depend on your test-runner/language binding
PLAYWRIGHT_TEST_BASE_URL: ${{ github.event.deployment_status.target_url }} 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 executor: pw-focal-development
parallelism: 4 parallelism: 4
steps: 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 ### Jenkins
@ -410,7 +410,7 @@ pipeline {
steps { steps {
// Depends on your language / test framework // Depends on your language / test framework
sh 'npm install' 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. 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 ```bash js
DEBUG=pw:browser* npm run test DEBUG=pw:browser* npx playwright test
``` ```
```bash python ```bash python
DEBUG=pw:browser* pytest DEBUG=pw:browser* pytest

View file

@ -100,17 +100,17 @@ Generates selector for the given element.
Playwright supports verbose logging with the `DEBUG` environment variable. Playwright supports verbose logging with the `DEBUG` environment variable.
```bash tab=bash-bash lang=js ```bash tab=bash-bash lang=js
DEBUG=pw:api npm run test DEBUG=pw:api npx playwright test
``` ```
```batch tab=bash-batch lang=js ```batch tab=bash-batch lang=js
set DEBUG=pw:api set DEBUG=pw:api
npm run test npx playwright test
``` ```
```powershell tab=bash-powershell lang=js ```powershell tab=bash-powershell lang=js
$env:DEBUG="pw:api" $env:DEBUG="pw:api"
npm run test npx playwright test
``` ```
```bash tab=bash-bash lang=java ```bash tab=bash-bash lang=java

View file

@ -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. configures Playwright for debugging and opens the inspector.
```bash tab=bash-bash lang=js ```bash tab=bash-bash lang=js
PWDEBUG=1 npm run test PWDEBUG=1 npx playwright test
``` ```
```batch tab=bash-batch lang=js ```batch tab=bash-batch lang=js
set PWDEBUG=1 set PWDEBUG=1
npm run test npx playwright test
``` ```
```powershell tab=bash-powershell lang=js ```powershell tab=bash-powershell lang=js
$env:PWDEBUG=1 $env:PWDEBUG=1
npm run test npx playwright test
``` ```
```bash tab=bash-bash lang=java ```bash tab=bash-bash lang=java
@ -108,17 +108,17 @@ Using `PWDEBUG=console` will configure the browser for debugging in Developer to
composite selectors. composite selectors.
```bash tab=bash-bash lang=js ```bash tab=bash-bash lang=js
PWDEBUG=console npm run test PWDEBUG=console npx playwright test
``` ```
```batch tab=bash-batch lang=js ```batch tab=bash-batch lang=js
set PWDEBUG=console set PWDEBUG=console
npm run test npx playwright test
``` ```
```powershell tab=bash-powershell lang=js ```powershell tab=bash-powershell lang=js
$env:PWDEBUG="console" $env:PWDEBUG="console"
npm run test npx playwright test
``` ```
```bash tab=bash-bash lang=java ```bash tab=bash-bash lang=java