Assert an error message (.messages--error) is, or is not, visible — the markup core renders for failed validation, rejected credentials and access notices alike — and, when a text is given, that it contains that text.
Examples
Then I should see an error message
And we should see a validation error
Then should see a form error
And I should see a login error "Unrecognized username or password."
Then we should not see an error message
Pattern
Then(/^(I |we )*should( not)* see an? (?:validation |form |login |sign-?in |authentication )?error(?: message)?(?: "([^"]*)")?$/, …)
Part of @webship-js/drupal-core-steps (github.com/webship/drupal-core-steps), a step pack for Webship-js 2.0.x.