Assertion Steps

Page level text and element assertions. The verifications most stakeholders care about: did the user see the right thing.

Step phrasings in this group

The book sidebar lists each individual step page under this group.

Then I should see "Welcome"

Assert that text is or is not present on the page.

Then I should see text matching "^T\w+"

Assert that page contains or does not contain text matching a regex pattern.

Then I should see "Active" in the "John Smith" row

Assert text is or is not visible inside a table row identified by text.

Then I should see a "Username" element

Assert that an element with a given label exists (or does not) on the page.

Then I should see a "uname" element by its "id" attr

Assert that an element, identified by attribute, exists (or does not) on the page.

Then I should see "John Smith" in the "Username" element

Assert that an element (found by its label) contains or does not contain text.

Then I should see "John Smith" in the "uname" element by its "id" attr

Assert that an element (found by its attribute) contains or does not contain text.

Then I should see text matching "\d{4}" in the "#year" element

Assert that an element's text content does or does not match a regex.

Then the "body" element should contain "color:white;"

Assert that an element has or does not have a specific CSS property.

Then I should see 3 "li" elements

Assert the exact number of elements matching a CSS selector.

Then the "Login" link should contain "/log-in"

Assert that a link (located by its visible text) contains the given URL.

Then the "#about-us-id" link should contain "about" by attr

Assert that a link located by its attribute contains the given URL.

Then the response should contain "Welcome visitor"

Assert that the rendered HTML response contains or does not contain text.

Then the response status code should be 200

Assert that the current page's response status is or is not a given code.

Back to all step groups