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
awaitexpect(page.getByText('a note created by playwright')).toBeVisible()
523
525
})
524
-
})
526
+
})
525
527
})
526
528
```
527
529
@@ -676,7 +678,7 @@ describe('Note app', () => {
676
678
})
677
679
678
680
// ...
679
-
)}
681
+
})
680
682
```
681
683
682
684
The test verifies with the method [page.getByText](https://playwright.dev/docs/api/class-page#page-get-by-text) that the application prints an error message.
We could refine the test to ensure that the error message is printed exactly in the right place, i.e. in the element containing the CSS class <i>error</i>:
@@ -713,13 +715,13 @@ So the test uses the [page.locator](https://playwright.dev/docs/api/class-page#p
713
715
It is possible to test the application's CSS styles with matcher [toHaveCSS](https://playwright.dev/docs/api/class-locatorassertions#locator-assertions-to-have-css). We can, for example, make sure that the color of the error message is red, and that there is a border around it:
0 commit comments