Skip to content

Commit ab7d551

Browse files
committed
fix finished exercise texts
1 parent 0620293 commit ab7d551

File tree

3 files changed

+14
-23
lines changed
  • exercises/03.guides

3 files changed

+14
-23
lines changed

exercises/03.guides/02.solution.test-annotations/README.mdx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
11
# Test annotations
22

3-
Goal: Enhance test failures so you are one click away from learning more about the tested behavior. Put a link to the specification document your manager has written, or a GitHub/Linear/JIRA ticket if it's a test for regression. Help your future self and your teammates to navigate test failures easier.
3+
Good job! 👏
44

5-
- `tag` (let's group user-related tests);
6-
- `annotation.type` + `annotation.description` (let's provide metadata about the test case).
5+
Please wait for the others to finish so we could go through the solution to this exercise together.
6+
7+
---
78

89
Things you can do with tags:
910

1011
1. Run a subset of tests:
1112

12-
````sh
13+
```sh
1314
npm run test:e2e -- --grep=@user
1415
npm run test:e2e -- --grep=@user|@profile
15-
``
16+
```
1617

1718
2. You can also filter and run subset of tests from the UI mode (the "Filter" input at the top left).
18-
2. You can filter the test results in the test report (`show-report`) by tags.
19+
3. You can filter the test results in the test report (`show-report`) by tags.
1920

2021
Things you can do with annotations:
2122

2223
```sh
2324
npx playwright show-report
2425
# And then click on the failing test.
2526
# Custom annotataions will list extra info to help you debug.
26-
````
27+
```
2728

2829
## Related materials
2930

exercises/03.guides/03.problem.blocking-unneeded-requests/README.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Blocking unneeded requests
22

3+
Our application now has [One Dollar Stats](https://onedollarstats.com/) for very simple analytics. That's useful in production but we don't need this analytics script running in our tests. It only creates unnecessary requests and takes time.
4+
5+
Let's block this kind of requests in Playwright!
6+
37
## Your task
48

59
👨‍💼 In this one, your task is to block a certain HTTP request fired by the app. I'm talking about this analytics script:
Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,5 @@
11
# Blocking unneeded requests
22

3-
Our application now has [One Dollar Stats](https://onedollarstats.com/) for very simple analytics. That's useful in production but we don't need this in our tests. It only creates unnecessary requests and takes time.
3+
Good job! 👏
44

5-
Let's block this kind of requests in Playwright!
6-
7-
```ts
8-
// test-extend.ts
9-
test.beforeAll(({ network }) => {
10-
network.use(
11-
http.get('https://assets.onedollarstats.com/*', () => {
12-
return Response.error()
13-
}),
14-
)
15-
})
16-
```
17-
18-
- Belongs to the test setup, not fixtures? If a test doesn't use the custom `test()` function from `fixtures.ts`, it won't have those requests blocked.
19-
- Consider responding with an _empty response_. Responding with a network error will print an error to the browser console, creating noise. Mocking 3rd-party side-effect requests with empty responses should have no effect on the app (cause we want to exclude them, in the first place).
5+
Please wait for the others to finish so we could go through the solution to this exercise together.

0 commit comments

Comments
 (0)