Cypress · Senior · Question 45 of 76
Why keep assertions in tests rather than inside custom commands?
- 1Custom commands can't contain assertions
- 2Readers see what each test verifies
- 3Assertions in commands run twice
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.