Skip to content

Commit 2ae592e

Browse files
committed
refine playwright module
1 parent 950f86b commit 2ae592e

11 files changed

+7
-283
lines changed

learn-pr/advocates/build-with-playwright/7-create-test-specification-with-codegen.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

learn-pr/advocates/build-with-playwright/8-exercise-manually-create-test-specification.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

learn-pr/advocates/build-with-playwright/11-summary.yml renamed to learn-pr/advocates/build-with-playwright/8-summary.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ metadata:
1111
ms.topic: unit
1212
durationInMinutes: 2
1313
content: |
14-
[!include[](includes/11-summary.md)]
14+
[!include[](includes/8-summary.md)]

learn-pr/advocates/build-with-playwright/9-solution-manually-create-test-specification.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

learn-pr/advocates/build-with-playwright/includes/4-understand-test-configuration.md

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -54,26 +54,15 @@ We can refer to the [Basic Configuration](https://playwright.dev/docs/test-confi
5454
- [`use`](https://playwright.dev/docs/api/class-testconfig) = set _[global options](https://playwright.dev/docs/test-use-options)_ for all tests (can be overridden at project or test scope)
5555
- [`projects`](https://playwright.dev/docs/api/class-testconfig) = run tests in multiple configurations (think browsers, emulators, options)
5656

57-
## Configure Test Dir
57+
## Run the demo todo app tests
5858

59-
The `testDir` property tells Playwright where to look for test files. By default, it's set to `./tests`, which means that Playwright looks for test files in the `tests` folder. If you have your test files in a different folder, you can change this property to point to that folder.
60-
61-
Let's change the testDir property so that Playwright looks for test files in the root of the project.
62-
63-
```js
64-
export default defineConfig({
65-
testDir: '.',
66-
..
67-
});
68-
```
69-
70-
Now that we updated the testDir property, let's run the tests again and see what happens.
59+
The example-tests folder contains tests for a demo todo app. Let's copy that spec file and paste it into our tests folder. Let's run our tests
7160

7261
```bash
7362
npx playwright test
7463
```
7564

76-
This time, Playwright would look for test files in the root of the project and run the tests.
65+
This time, Playwright will run tests from both spec files in our tests folder.
7766

7867
```bash
7968
Running 78 tests using 5 workers
@@ -91,16 +80,7 @@ npx playwright show-report
9180

9281
:::image type="content" source="../media/run-report.png" alt-text="A screenshot of an HTML report showing 2 test files.":::
9382

94-
The report tells us that tests were run in tests/example.spec.ts and tests-examples/demo-todo-app.spec.ts and on the three different browser engines - `Chromium`, `Firefox`, and `Webkit`. As we set the testDir to the root of the project, Playwright found all the test files in the project and ran them.
95-
96-
Let's set the `testDir` back to `./tests` so we can move on to the next exercise.
97-
98-
```js
99-
export default defineConfig({
100-
testDir:* *'./tests',
101-
..
102-
});
103-
```
83+
The report tells us that all tests were run on the three different browser engines - `Chromium`, `Firefox`, and `Webkit`.
10484

10585
## Configure Projects
10686

learn-pr/advocates/build-with-playwright/includes/7-create-test-specification-with-codegen.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

learn-pr/advocates/build-with-playwright/includes/8-exercise-manually-create-test-specification.md

Lines changed: 0 additions & 34 deletions
This file was deleted.

learn-pr/advocates/build-with-playwright/includes/11-summary.md renamed to learn-pr/advocates/build-with-playwright/includes/8-summary.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ In this module you learned the core concepts of Playwright for automated end to
88
* Explored the trace viewer
99
* Took a detailed view of the tests to understand how tests are written using fixtures, locators and assertions
1010
* Installed the VS Code extension and learned how to run our tests, debug our tests and generate our tests all from VS Code
11-
* Created a test using Playwrights test generator, Codegen
12-
* Manually created a test spec and used a describe block, beforeEach hook, a baseURL and created a reusable locator.
1311

1412

1513

learn-pr/advocates/build-with-playwright/includes/9-solution-manually-create-test-specification.md

Lines changed: 0 additions & 161 deletions
This file was deleted.

0 commit comments

Comments
 (0)