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()
540
542
})
541
-
})
543
+
})
542
544
})
543
545
```
544
546
@@ -693,7 +695,7 @@ describe('Note app', () => {
693
695
})
694
696
695
697
// ...
696
-
)}
698
+
})
697
699
```
698
700
699
701
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.
@@ -718,11 +720,11 @@ We could refine the test to ensure that the error message is printed exactly in
So the test uses the [page.locator](https://playwright.dev/docs/api/class-page#page-locator) method to find the component containing the CSS class <i>error</i> and stores it in a variable. The correctness of the text associated with the component can be verified with the expectation [toContainText](https://playwright.dev/docs/api/class-locatorassertions#locator-assertions-to-contain-text). Note that the [CSS class selector](https://developer.mozilla.org/en-US/docs/Web/CSS/Class_selectors) starts with a dot, so the <i>error</i> class selector is <i> .error</i>.
@@ -731,13 +733,13 @@ It is possible to test the application's CSS styles with matcher [toHaveCSS](htt
0 commit comments