Cypress · Senior · Question 45 of 76

Why keep assertions in tests rather than inside custom commands?

Show the answer

Correct answer: Readers see what each test verifies

Explanation

Commands are good for actions and setup. Hidden checks make failures surprising and tests harder to read.

Further reading

Problem with a question

Cypress · Senior · question 45

Test yourself

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

Take this quiz