Ensure.that verifies that a value or state satisfies an expectation. In a submission flow, it can check that a toaster message includes the expected error text after Wait.until confirms the message is present. section 15.1.7
Directly placing Ensure.that, Wait.until, and Click.on in a Cucumber step works but exposes low-level interface interactions. Composing them into a business-specific verification task makes the step clearer and reusable. section 15.1.7
Checking a failed submission
An actor can attempt VerifySubmission.failedWith('Email exists'). The task can wait for the toaster, use Ensure.that to verify its message and error status, dismiss it, and wait for it to disappear.
