The Then I should see group collects every step that checks whether text, elements, or patterns are present or absent on the current page. These steps live in assertion.steps.js and cover the most common assertions in a test suite: plain text on the page, text inside a specific element, regex matches, element existence by label or attribute, and the rendered HTML response.
All steps in this group accept both I and we as the subject pronoun, and since 2.0.12 I should see "text" waits up to five seconds for the text to come and I should not see "text" up to five seconds for it to go. Both read the page text as Playwright's text matching reads it: letter case is ignored, runs of white space are collapsed, and the text of hidden elements counts, but not the text of <script>, <noscript> or <style>; the value of a field, the text of an image and the content of an iframe are not page text. For the text a visitor can see, with its letter case, use I wait for the text "text" to appear or to disappear.
Steps in this group
- Then I should see "text" - plain page text (positive)
- Then I should not see "text" - plain page text (negative)
- Then I should see text matching "pattern" - regex on full page
- Then I should not see text matching "pattern" - regex on full page (negative)
- Then I should see text matching "pattern" in element
- Then I should not see text matching "pattern" in element
- Then I should see a/an "label" element
- Then I should not see a/an "label" element
- Then I should see "text" in the "element" element
- Then I should not see "text" in the "element" element