Cypress · Junior · Question 70 of 75
How do you run one spec file from the command line?
- 1
npx cypress spec cypress/e2e/login.cy.ts - 2
npx cypress run --spec cypress/e2e/login.cy.ts - 3
npx cypress run login.cy.ts --only-this-file
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/*'.