Appearance
TEST.stop()
Immediately stops the execution of the current test.
When TEST.stop() is called, no further commands are executed, and the test ends at that point.
This is useful when you want to:
- abort a test early based on a condition
- stop execution after a critical failure
- prevent unnecessary steps from running
Usage
js
TEST.stop()Example
js
// I.see$ is the same as I.see, but returns a boolean value without failing the test
if (I.see$("Out of stock")) {
TEST.stop()
}
// skipped if "Out of stock" is shown
I.click("Add to cart")This test checks whether the text "Out of stock" is visible using I.see$(). If the text is found, the test stops immediately and skips the remaining steps.