Cypress · Senior · Question 20 of 76
What makes a good custom command in a large Cypress codebase?
- 1Commands that hide all assertions from the tests
- 2Small, well-named, typed and doing one thing
- 3One giant command that sets up every possible state
Show the answer
Correct answer: Small, well-named, typed and doing one thing
Explanation
Large commands with many options become hard to reason about. Prefer composition of small commands and plain helper functions.