Testing · Senior · Question 55 of 75

Why does this custom check not retry, and how do you fix it?

cy.get(".total").then(($el) => {
  expect(parseFloat($el.text())).to.be.greaterThan(100);
});

Explanation

The .should callback must be free of side effects, since it may run many times.

Further reading

Problem with a question

Testing · Senior · question 55

Test yourself

Take the Testing · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz