0
votes

I'm writing my tests the way cypress recommends in their documentation which is to have multiple assertions per test but there is one problem that occurs while writing tests this way which is that if an assertion fails the test execution stops.

I would like to have multiple assertions per test and that if one fails the test will fail but would continue the test execution so at the end I will be able to see all the assertions that failed in the test and not only the first assertion that fails.

I have tried to use soft-assert but I couldn't make it work with cypress and also my project is written in TS and soft-assert does not support typing.

Is there any way to have tests not stop test execution on the first assertion and yet still fail the test if any assertion fails?

Thanks in advance!

1

1 Answers

1
votes

had the same problem as you. I used a then to push in an array my result instead of assert with a should.
Then assert the result in another then. It worked, but I really feel to hack the Cypress API which isn't made for this, shame.