Then the "Email" field should have the error "The Email field is required."

Assert the validation message next to a field (found by its label), as the page's own checks or the app's write it ("The Email field is required.", "The password and confirmation password do not match.").

Examples

Then the "Email" field should have the error "The Email field is required."
Then the "Confirm Password" field should have the error "The password and confirmation password do not match."
And the "Title" field should have the error "The field Title must be a string with a minimum length of 3 and a maximum length of 60."
Then the "Phone number" field should have the error "The Phone number field is not a valid phone number."
And the "Price" field should have the error "The field Price must be between 1 and 100."

Pattern

Then(/^the "([^"]*)" field should have the error "([^"]*)"$/, …)

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