Then I should see the error "This field is mandatory." for the "Email" field

Assert the validation message shown (or not shown) for a field of a form. The message is the .invalid-feedback of the field (.help-block or .error on older themes), matched case-sensitively as a phrase.

Examples

Then I should see the error "This field is mandatory." for the "Email" field
And I should see the error "You must enter a valid email address." for the "Email" field
Then we should see the error "This field is mandatory." for the "Message" field
And I should not see the error "This field is mandatory." for the "Company" field
Then should see the error "This field is mandatory." for the "Subject" field

Pattern

Then(/^(I |we )*should( not)* see the error "([^"]*)?" for the "([^"]*)?" field$/, …)

Part of @webship-js/typo3-steps (github.com/webship/typo3-steps), a step pack for Webship-js 2.0.x.