assertFailure
Asserts that executing block fails with an AssertionError containing messageContains.
Useful for testing negative scenarios or verifying custom validation errors.
Example Usage
assertFailure("Expected 'Submit' to be visible") {
click("Submit")
}Content copied to clipboard
Parameters
messageContains
Substring expected in the thrown error message.
block
Test code block expected to fail.