Company
Date Published
Author
Jennifer Shehane
Word count
310
Language
English
Hacker News points
None

Summary

The introduction of Cypress.stop() provides a simple way to halt test runs programmatically, allowing for faster feedback and increased flexibility in testing. This command enables users to stop tests immediately upon failure or based on other conditions, making testing more efficient and predictable. Cypress.stop() works by halting execution within the current spec file on the current machine with a single command, and can be used in various scenarios, such as stopping tests on failure or when certain conditions are not met. While Cypress.stop() offers in-spec control and debugging capabilities, it is distinct from Auto Cancellation in Cypress Cloud, which provides global scope, failure thresholds, and better resource allocation, making it a better choice for complete run-level control. Overall, Cypress.stop() is a powerful tool that can be used to improve testing efficiency and is now available for use, with more details available in the official documentation.