Then the "Content" field should have the error "Post content is too short (10 characters minimum)"

Assert the error the form prints for a field after it was sent: the message the field's aria-describedby names, or the error line in the field's own group (.invalid-feedback, .form-error-message, the list next to it).

Examples

Then the "Content" field should have the error "Post content is too short (10 characters minimum)"
Then the "Current password" field should have the error "This value should be the user's current password."
And the "New password" field should have the error "The values do not match."
Then the "Summary" field should have the error "Give your post a summary!"
Then the "Title" field should have the error "This title was already used in another blog post, but they must be unique."

Pattern

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

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