Assert that the rendered HTML response contains or does not contain text.
Reads the entire <html> text — useful for checking text that lives in<head> (meta descriptions, JSON-LD), <noscript>, or hidden regions.
Step pattern
Then (the )*response should( not)* contain "([^"]*)?"Examples
Example #1
Then the response should contain "Welcome visitor"Example #2
Then the response should not contain "Access denied"Example #3
And the response should contain "<title>Home</title>"Example #4
Then the response should contain "<html"Example #5
When I am on "/about"
Then the response should contain "Our mission"
And the response should not contain "TODO"