Force Fail
Use forceFail() to intentionally fail a test with a custom message. This is useful for marking incomplete tests, flagging known issues, or creating conditional failures.
forceFail()
Forces a test failure and reports it in the execution report.
ForceFailExample.java
// Force fail with a custom message
Validations.assertThat().forceFail()
.withCustomReportMessage("This feature is not yet implemented");
// Soft force fail — collects the failure and continues execution
Validations.verifyThat().forceFail()
.withCustomReportMessage("Known issue: JIRA-1234");
withCustomReportMessage()
Sets a business-readable message that appears in the Allure execution report instead of the default technical log message.
CustomMessageExample.java
// Works with any validation type
Validations.assertThat().object(actualValue)
.isEqualTo(expectedValue)
.withCustomReportMessage("Verify user name matches expected value");
driver.assertThat().element(loginButton)
.isVisible()
.withCustomReportMessage("Verify login button is displayed");
Eager execution
Validation chains execute eagerly when the validation condition is selected. A terminal .perform() call is no longer required for assertions or verifications.
PerformExample.java
Validations.assertThat().file("src/test/resources", "data.json").exists();
Validations.assertThat().number(count).isGreaterThan(0);
Validations.assertThat().object(name).isEqualTo("John");
driver.assertThat().element(locator).exists();