testingtestcafe

How to continue executing the following script when an assertion fails in testcafe


enter image description here The picture is for reference 1.How to display a passing assertion on the console? 2.If the second assertion fails, how to continue executing the next assertion?

I do a lot of operations in the browser and then get some js objects from browser in the testcafe. I don't want to split the use case and check the values separately, because the operation is continuous and I don't want to repeat the code, so I try to check all the values in one use case.I just want to know which values are expected and which are not.


Solution

    1. TestCafe does not show passing assertions in console. If you need this functionality, call the console.log method manually.
    2. There is no official way to continue test execution after an assertion fails. You can wrap your assertion in the try/catch block. However, the TestCafe team does not recommend this approach.