Expect and assert not failing the test in 'each' method #26870
Harshith2695
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all, I stumbled upon this behaviour while using each method to validate if price is within specified range .
I am expecting test to fail while using expect in each method but the test is passing when it shouldn't but if I use use expect in forEach method its failing.
This is the code
The prices are less than 20,000 and I am expecting the test to fail but
However if I change the code to store the price in array and then if I use expect/ assert in foreach method,the tests are failing
Would be appreciated if anyone could help me understand why assert or expect is not working inside each method (https://docs.cypress.io/api/commands/each#docusaurus_skipToContent_fallback) ?
Beta Was this translation helpful? Give feedback.
All reactions