Description
Type of feature
- Add a new command
- Extend a default Cypress command
- Change a Cypress-commands command
- Other
What do you want to accomplish?
When an assertion fails the previous command will be retried until the assertion passes. Only one command will be retried. I want to find a way to make Cypress retry 2 or more commands instead.
Why?
This can be very useful for improving tests stability when building custom commands or when added to certain commands like for example text()
.
Describe possible implementations
The only existing thing in Cypress that resembles this behaviour is the should(fn)
. Creating an alias for should is a last resort to get this behaviour. It would be a lot better if we can hook into the underlying logic of should
instead to bypass the default chaining logic.
Additional context
The first step would be to find out if this is even possible. Next step would be to find out if this behaviour can be added to existing commands with an option.