Assert a field of a form is (or is not) marked as invalid after a failed submission. The field is found by its label; the form framework marks its wrapper with .is-invalid (Bootstrap 5 themes) or .has-error, and the input with aria-invalid="true".
Examples
Then the "Email" field should be marked as invalid
And the "Full name and surname" field should be marked as invalid
Then the "Company" field should not be marked as invalid
And the "Message" field should be marked as invalid
Then the "Subject" field should not be marked as invalid
Pattern
Then(/^the "([^"]*)?" field should( not)* be marked as invalid$/, …)
Part of @webship-js/typo3-steps (github.com/webship/typo3-steps), a step pack for Webship-js 2.0.x.