Skip to content

Commit 99ec32a

Browse files
authored
chore: more doc nits (#6937)
1 parent 8960584 commit 99ec32a

File tree

2 files changed

+28
-35
lines changed

2 files changed

+28
-35
lines changed

docs/src/intro-csharp.md

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,13 @@ Create a console project and add the Playwright dependency.
2020

2121
```bash
2222
# Create project
23-
dotnet new console -n pw_demo
24-
cd pw_demo
23+
dotnet new console -n PlaywrightDemo
24+
cd PlaywrightDemo
2525

26-
# Install dependencies
27-
dotnet add package Microsoft.Playwright --prerelease
28-
29-
# Install local Playwright tool and use it to install browsers.
30-
dotnet new tool-manifest
31-
dotnet tool install Microsoft.Playwright.CLI --version 1.0.0-alpha-1
32-
dotnet playwright install
26+
# Install dependencies, build project and download necessary browsers.
27+
dotnet add package Microsoft.Playwright
28+
dotnet build
29+
playwright install
3330
```
3431

3532
Create a `Program.cs` that will navigate to `https://playwright.dev/dotnet` and take a screenshot in Chromium.
@@ -70,16 +67,15 @@ You can choose to use NUnit test fixtures that come bundled with Playwright. The
7067
```bash
7168
# Create new project.
7269
dotnet new nunit -n PlaywrightTests
73-
cd pw_test
70+
cd PlaywrightTests
71+
```
7472

75-
# Install dependencies
76-
dotnet add package Microsoft.Playwright --prerelease
77-
dotnet add package Microsoft.Playwright.NUnit --prerelease
73+
Install dependencies, build project and download necessary browsers. This is only done once per project.
7874

79-
# Install local Playwright tool and use it to install browsers.
80-
dotnet new tool-manifest
81-
dotnet tool install Microsoft.Playwright.CLI --version 1.0.0-alpha-1
82-
dotnet playwright install
75+
```bash
76+
dotnet add package Microsoft.Playwright
77+
dotnet build
78+
playwright install
8379
```
8480

8581
Edit UnitTest1.cs file.

docs/src/test-intro.md

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,6 @@ test('my test', async ({ page }) => {
256256
// Expect an attribute "to be strictly equal" to the value.
257257
expect(await page.getAttribute('text=Get Started', 'href')).toBe('/docs/intro');
258258

259-
// Expect an element "to be visible".
260-
expect(await page.isVisible('[aria-label="GitHub repository"]')).toBeTruthy();
261-
262259
await page.click('text=Get Started');
263260
// Expect some text to be visible on the page.
264261
expect(await page.waitForSelector('text=System requirements')).toBeTruthy();
@@ -296,61 +293,61 @@ Here are the most common options available in the [command line](./test-cli.md).
296293
297294
- Run tests in headed browsers
298295
```bash
299-
npx playwright test --headed
296+
npx playwright test -c tests --headed
300297
```
301298
302299
- Run tests in a particular browser
303300
```bash
304-
npx playwright test --browser=webkit
301+
npx playwright test -c tests --browser=webkit
305302
```
306303
307304
- Run tests in all browsers
308305
```bash
309-
npx playwright test --browser=all
306+
npx playwright test -c tests --browser=all
310307
```
311308
312309
- Run a single test file
313310
```bash
314-
npx playwright test tests/todo-page.spec.ts
311+
npx playwright test -c tests tests/todo-page.spec.ts
315312
```
316313
317314
- Run a set of test files
318315
```bash
319-
npx playwright test tests/todo-page/ tests/landing-page/
316+
npx playwright test -c tests tests/todo-page/ tests/landing-page/
320317
```
321318
322319
- Run a test with specific title
323320
```bash
324-
npx playwright test -g "add a todo item"
321+
npx playwright test -c tests -g "add a todo item"
325322
```
326323
327324
- Run tests [in parallel](./test-parallel.md) - that's the default
328325
```bash
329-
npx playwright test
326+
npx playwright test -c tests
330327
```
331328
332329
- Disable [parallelization](./test-parallel.md)
333330
```bash
334-
npx playwright test --workers=1
331+
npx playwright test -c tests --workers=1
335332
```
336333
337334
- Choose a [reporter](./test-reporters.md)
338335
```bash
339-
npx playwright test --reporter=dot
336+
npx playwright test -c tests --reporter=dot
340337
```
341338
342339
- Run in debug mode with [Playwright Inspector](./inspector.md)
343340
```bash
344341
# Linux/macOS
345-
PWDEBUG=1 npx playwright test
342+
PWDEBUG=1 npx playwright test -c tests
346343

347344
# Windows with cmd.exe
348345
set PWDEBUG=1
349-
npx playwright test
346+
npx playwright test -c tests
350347

351348
# Windows with PowerShell
352349
$env:PWDEBUG=1
353-
npx playwright test
350+
npx playwright test -c tests
354351
```
355352
356353
## Create a configuration file
@@ -407,11 +404,11 @@ import { PlaywrightTestConfig, devices } from '@playwright/test';
407404
const config: PlaywrightTestConfig = {
408405
projects: [
409406
{
410-
name: 'Desktop Chromium',
407+
name: 'Chrome Stable',
411408
use: {
412409
browserName: 'chromium',
413-
// Test against Chrome Beta channel.
414-
channel: 'chrome-beta',
410+
// Test against Chrome Stable channel.
411+
channel: 'chrome',
415412
},
416413
},
417414
{

0 commit comments

Comments
 (0)