Cypress · Junior · Question 73 of 75
What is a common mistake when asserting on text that loads asynchronously?
- 1Reading text with
.then()and comparing without retry - 2Using
.should('contain', ...)on the element - 3Waiting for an aliased request before asserting
Show the answer
Correct answer: Reading text with .then() and comparing without retry
Explanation
.then() runs once with whatever text exists. .should() keeps retrying until the text arrives.