You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test('front page can be opened', async ({ page }) => {
219
-
awaitpage.goto('http://localhost:5173')
220
-
221
-
constlocator=awaitpage.getByText('Notes')
222
-
awaitexpect(locator).toBeVisible()
223
-
awaitexpect(page.getByText('Note app, Department of Computer Science, University of Helsinki 2024')).toBeVisible() // highlight-line
224
-
})
225
-
```
226
-
227
-
As expected, the test fails. Playwright opens the test report in the browser and it becomes clear that Playwright has actually performed the tests with three different browsers: Chrome, Firefox and Webkit, i.e. the browser engine used by Safari:
210
+
The test fails because an old year ended up in the test. Playwright opens the test report in the browser and it becomes clear that Playwright has actually performed the tests with three different browsers: Chrome, Firefox and Webkit, i.e. the browser engine used by Safari:
228
211
229
212

230
213
@@ -238,9 +221,7 @@ In the big picture, it is of course a very good thing that the testing takes pla
238
221
npm test ----project chromium
239
222
```
240
223
241
-
Now let's correct the outdated year in the frontend code that caused the error.
242
-
243
-
Before we continue, let's add a _describe_ block to the tests:
224
+
Now let's fix the test with the correct year and let's add a _describe_ block to the tests:
awaitexpect(page.getByText('Note app, Department of Computer Science, University of Helsinki 2024')).toBeVisible()
235
+
awaitexpect(page.getByText('Note app, Department of Computer Science, University of Helsinki 2025')).toBeVisible()
255
236
})
256
237
})
257
238
```
@@ -262,14 +243,15 @@ When developing tests, it may be wiser to reduce the waiting time to a few secon
262
243
263
244
```js
264
245
module.exports=defineConfig({
265
-
timeout:3000,
246
+
// ...
247
+
timeout:3000, // highlight-line
266
248
fullyParallel:false, // highlight-line
267
249
workers:1, // highlight-line
268
250
// ...
269
251
})
270
252
```
271
253
272
-
We also made two other changes to the file, and specified that all tests [be executed one at a time](https://playwright.dev/docs/test-parallel). With the default configuration, the execution happens in parallel, and since our tests use a database, parallel execution causes problems.
254
+
We also made two other changes to the file, specifying that all tests [be executed one at a time](https://playwright.dev/docs/test-parallel). With the default configuration, the execution happens in parallel, and since our tests use a database, parallel execution causes problems.
273
255
274
256
### Writing on the form
275
257
@@ -284,7 +266,7 @@ describe('Note app', () => {
284
266
test('login form can be opened', async ({ page }) => {
0 commit comments