Open veerpatil opened 7 months ago
Hello @jennifer-shehane . I've been exploring this feature and was wondering if you were open to implementing it into Cypress.
Hi @jennifer-shehane! Me and @migueldsol are working on this feature and we have encountered some issues while implementing it. We thought that changing how Cypress handles errors in assertions would be enough to implement soft assertions. Right now we can defer the errors thrown when a soft assertion fails but we lose Cypress ability to retry the assertion before the timeout ends. We would like to use all of Cypress assertion capabilities and i was wondering if you could guide us to handling errors the correct way!
As pointed out by a Discord community member, Playwright already offers an implementation of soft assertions:
By default, failed assertion will terminate test execution. Playwright also supports soft assertions: failed soft assertions do not terminate test execution, but mark the test as failed.
What would you like?
Overview: Soft assertions are a critical feature in test automation frameworks, enabling testers to continue executing test cases even after encountering failures, thus providing comprehensive insights into application behavior. As of the current version of Cypress, soft assertions are not natively supported. This feature request proposes the implementation of soft assertions within Cypress to enhance its capabilities and provide a more robust testing experience.
Problem Statement: In traditional test automation frameworks, soft assertions allow testers to validate multiple conditions within a single test case, providing a more comprehensive understanding of application behavior. However, Cypress lacks native support for soft assertions, limiting testers' ability to perform such validations effectively. Presently, encountering a failed assertion in Cypress halts the test execution, preventing subsequent assertions from being evaluated within the same test case.
Proposed Solution: Introducing soft assertions in Cypress would involve enhancing its assertion mechanism to handle failures gracefully without terminating the entire test execution. This enhancement would allow testers to continue evaluating subsequent assertions even after encountering failures, thereby providing a more detailed report of test results. Additionally, incorporating a mechanism to aggregate and report all failed assertions at the end of the test execution would further improve test visibility and debugging.
Why is this needed?
In traditional test automation frameworks, soft assertions allow testers to validate multiple conditions within a single test case, providing a more comprehensive understanding of application behavior. However, Cypress lacks native support for soft assertions, limiting testers' ability to perform such validations effectively. Presently, encountering a failed assertion in Cypress halts the test execution, preventing subsequent assertions from being evaluated within the same test case.
Other
No response