https://cypress.io logo
How to check all assertions before failing test ex...
# i-need-help
b
Hello, I have some steps, all steps assert one value to deeply equal another one. But my problem is that if one assert fail, the next one will not be checked. And I would like to check ALL assertion before failing my test. Any idea on how to achieve this ?
g
Use cy-spok plugin for checking objects, it will report all passing properties plus the first failing, which lets you know a lot more
b
But does it continue after the failing one ? In my case i’m checking data from a big JSON file to be equal to some value
And if the first tested value is wrong, I would like to know that the 10 values after are good (or not)
But it’s not working like that 🥲
I do that for API testing, don’t know if it can help
g
and it should not work like that (although you could read https://glebbahmutov.com/blog/cypress-soft-assertions/) Because if one thing is wrong (assertion fails), it kind of invalidates the rest
b
Yes I know but I would like to be sure not all the steps after the first failing are not wrong too
g
but you don't know if they are wrong because they are wrong, or because they depend on the previous step (that failed)
2 Views