docs: adds all three package manager commands on js introduction page
adds all three package manager commands on introduction page namley npm yarn and pnpm at all places earlier only npx and npm command were present Fixes #30012
This commit is contained in:
parent
b6a7d0a17e
commit
c2097a28bc
|
|
@ -50,6 +50,7 @@ pnpm create playwright
|
||||||
```
|
```
|
||||||
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -81,10 +82,40 @@ The `tests` folder contains a basic example test to help you get started with te
|
||||||
|
|
||||||
By default tests will be run on all 3 browsers, chromium, firefox and webkit using 3 workers. This can be configured in the [playwright.config file](./test-configuration.md). Tests are run in headless mode meaning no browser will open up when running the tests. Results of the tests and test logs will be shown in the terminal.
|
By default tests will be run on all 3 browsers, chromium, firefox and webkit using 3 workers. This can be configured in the [playwright.config file](./test-configuration.md). Tests are run in headless mode meaning no browser will open up when running the tests. Results of the tests and test logs will be shown in the terminal.
|
||||||
|
|
||||||
|
<Tabs
|
||||||
|
defaultValue="npm"
|
||||||
|
values={[
|
||||||
|
{label: 'npm', value: 'npm'},
|
||||||
|
{label: 'yarn', value: 'yarn'},
|
||||||
|
{label: 'pnpm', value: 'pnpm'}
|
||||||
|
]
|
||||||
|
}>
|
||||||
|
<TabItem value="npm">
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npx playwright test
|
npx playwright test
|
||||||
```
|
```
|
||||||
|
|
||||||
|
</TabItem>
|
||||||
|
|
||||||
|
<TabItem value="yarn">
|
||||||
|
|
||||||
|
```bash
|
||||||
|
yarn run playwright test
|
||||||
|
```
|
||||||
|
|
||||||
|
</TabItem>
|
||||||
|
|
||||||
|
<TabItem value="pnpm">
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pnpm playwright test
|
||||||
|
```
|
||||||
|
|
||||||
|
</TabItem>
|
||||||
|
|
||||||
|
</Tabs>
|
||||||
|
|
||||||

|

|
||||||
See our doc on [Running Tests](./running-tests.md) to learn more about running tests in headed mode, running multiple tests, running specific tests etc.
|
See our doc on [Running Tests](./running-tests.md) to learn more about running tests in headed mode, running multiple tests, running specific tests etc.
|
||||||
|
|
||||||
|
|
@ -92,19 +123,81 @@ See our doc on [Running Tests](./running-tests.md) to learn more about running t
|
||||||
|
|
||||||
After your test completes, an [HTML Reporter](./test-reporters.md#html-reporter) will be generated, which shows you a full report of your tests allowing you to filter the report by browsers, passed tests, failed tests, skipped tests and flaky tests. You can click on each test and explore the test's errors as well as each step of the test. By default, the HTML report is opened automatically if some of the tests failed.
|
After your test completes, an [HTML Reporter](./test-reporters.md#html-reporter) will be generated, which shows you a full report of your tests allowing you to filter the report by browsers, passed tests, failed tests, skipped tests and flaky tests. You can click on each test and explore the test's errors as well as each step of the test. By default, the HTML report is opened automatically if some of the tests failed.
|
||||||
|
|
||||||
|
<Tabs
|
||||||
|
defaultValue="npm"
|
||||||
|
values={[
|
||||||
|
{label: 'npm', value: 'npm'},
|
||||||
|
{label: 'yarn', value: 'yarn'},
|
||||||
|
{label: 'pnpm', value: 'pnpm'}
|
||||||
|
]
|
||||||
|
}>
|
||||||
|
<TabItem value="npm">
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npx playwright show-report
|
npx playwright show-report
|
||||||
```
|
```
|
||||||
|
|
||||||
|
</TabItem>
|
||||||
|
|
||||||
|
<TabItem value="yarn">
|
||||||
|
|
||||||
|
```bash
|
||||||
|
yarn run playwright show-report
|
||||||
|
```
|
||||||
|
|
||||||
|
</TabItem>
|
||||||
|
|
||||||
|
<TabItem value="pnpm">
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pnpm playwright show-report
|
||||||
|
```
|
||||||
|
|
||||||
|
</TabItem>
|
||||||
|
|
||||||
|
</Tabs>
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Running the Example Test in UI Mode
|
## Running the Example Test in UI Mode
|
||||||
|
|
||||||
Run your tests with [UI Mode](./test-ui-mode.md) for a better developer experience with time travel debugging, watch mode and more.
|
Run your tests with [UI Mode](./test-ui-mode.md) for a better developer experience with time travel debugging, watch mode and more.
|
||||||
|
|
||||||
|
<Tabs
|
||||||
|
defaultValue="npm"
|
||||||
|
values={[
|
||||||
|
{label: 'npm', value: 'npm'},
|
||||||
|
{label: 'yarn', value: 'yarn'},
|
||||||
|
{label: 'pnpm', value: 'pnpm'}
|
||||||
|
]
|
||||||
|
}>
|
||||||
|
|
||||||
|
<TabItem value="npm">
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npx playwright test --ui
|
npx playwright test --ui
|
||||||
```
|
```
|
||||||
|
|
||||||
|
</TabItem>
|
||||||
|
|
||||||
|
<TabItem value="yarn">
|
||||||
|
|
||||||
|
```bash
|
||||||
|
yarn run playwright test --ui
|
||||||
|
```
|
||||||
|
|
||||||
|
</TabItem>
|
||||||
|
|
||||||
|
<TabItem value="pnpm">
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pnpm playwright test --ui
|
||||||
|
```
|
||||||
|
|
||||||
|
</TabItem>
|
||||||
|
|
||||||
|
</Tabs>
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Check out or [detailed guide on UI Mode](./test-ui-mode.md) to learn more about its features.
|
Check out or [detailed guide on UI Mode](./test-ui-mode.md) to learn more about its features.
|
||||||
|
|
@ -113,17 +206,84 @@ Check out or [detailed guide on UI Mode](./test-ui-mode.md) to learn more about
|
||||||
|
|
||||||
To update Playwright to the latest version run the following command:
|
To update Playwright to the latest version run the following command:
|
||||||
|
|
||||||
|
<Tabs
|
||||||
|
defaultValue="npm"
|
||||||
|
values={[
|
||||||
|
{label: 'npm', value: 'npm'},
|
||||||
|
{label: 'yarn', value: 'yarn'},
|
||||||
|
{label: 'pnpm', value: 'pnpm'}
|
||||||
|
]
|
||||||
|
}>
|
||||||
|
|
||||||
|
<TabItem value="npm">
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm install -D @playwright/test@latest
|
npm install -D @playwright/test@latest
|
||||||
# Also download new browser binaries and their dependencies:
|
# Also download new browser binaries and their dependencies:
|
||||||
npx playwright install --with-deps
|
npx playwright install --with-deps
|
||||||
```
|
```
|
||||||
|
|
||||||
|
</TabItem>
|
||||||
|
|
||||||
|
<TabItem value="yarn">
|
||||||
|
|
||||||
|
```bash
|
||||||
|
yarn add -D @playwright/test@latest
|
||||||
|
# Also download new browser binaries and their dependencies:
|
||||||
|
yarn run playwright install --with-deps
|
||||||
|
```
|
||||||
|
|
||||||
|
</TabItem>
|
||||||
|
|
||||||
|
<TabItem value="pnpm">
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pnpm install -D @playwright/test@latest
|
||||||
|
# Also download new browser binaries and their dependencies:
|
||||||
|
pnpm playwright install --with-deps
|
||||||
|
```
|
||||||
|
|
||||||
|
</TabItem>
|
||||||
|
|
||||||
|
</Tabs>
|
||||||
|
|
||||||
You can always check which version of Playwright you have by running the following command:
|
You can always check which version of Playwright you have by running the following command:
|
||||||
|
|
||||||
|
<Tabs
|
||||||
|
defaultValue="npm"
|
||||||
|
values={[
|
||||||
|
{label: 'npm', value: 'npm'},
|
||||||
|
{label: 'yarn', value: 'yarn'},
|
||||||
|
{label: 'pnpm', value: 'pnpm'}
|
||||||
|
]
|
||||||
|
}>
|
||||||
|
|
||||||
|
<TabItem value="npm">
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npx playwright --version
|
npx playwright --version
|
||||||
```
|
```
|
||||||
|
|
||||||
|
</TabItem>
|
||||||
|
|
||||||
|
<TabItem value="yarn">
|
||||||
|
|
||||||
|
```bash
|
||||||
|
yarn run playwright --version
|
||||||
|
```
|
||||||
|
|
||||||
|
</TabItem>
|
||||||
|
|
||||||
|
<TabItem value="pnpm">
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pnpm playwright --version
|
||||||
|
```
|
||||||
|
|
||||||
|
</TabItem>
|
||||||
|
|
||||||
|
</Tabs>
|
||||||
|
|
||||||
## System requirements
|
## System requirements
|
||||||
|
|
||||||
- Node.js 18+
|
- Node.js 18+
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue