Cypress · Junior · Question 70 of 75

How do you run one spec file from the command line?

Show the answer

Correct answer: npx cypress run --spec cypress/e2e/login.cy.ts

Explanation

Glob patterns work too, e.g. --spec 'cypress/e2e/cart/*'.

Further reading

Problem with a question

Cypress · Junior · question 70

Test yourself

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

Take this quiz