Hard Assertion
An assertion that immediately halts the current test when it fails, rather than continuing to check further conditions.
What is Hard Assertion?
What is Hard Assertion?
A hard assertion stops the test the moment it fails—if the expected condition isn't met, execution ends and the failure is reported right away. This is the right default when later steps depend on the checked condition, since continuing would only produce misleading, cascading errors. Its counterpart, the soft assertion, records the failure but keeps going to collect more information. Choosing between them thoughtfully makes failures clearer: hard assertions for prerequisites, soft ones when you want a full picture of what's wrong on a page.