Recall & Review
beginner
What is the Cypress CLI used for?
The Cypress CLI is used to run Cypress tests from the command line, allowing automation and integration with other tools.
Click to reveal answer
beginner
How do you open the Cypress Test Runner using the CLI?
Run the command
npx cypress open to launch the interactive Cypress Test Runner.Click to reveal answer
beginner
Which command runs Cypress tests in headless mode?
Use
npx cypress run to execute tests in headless mode without opening the Test Runner UI.Click to reveal answer
intermediate
How can you specify a browser when running Cypress tests via CLI?
Add the
--browser flag, for example: npx cypress run --browser chrome to run tests in Chrome.Click to reveal answer
intermediate
What does the
--spec flag do in Cypress CLI?The
--spec flag lets you run specific test files, e.g., npx cypress run --spec 'cypress/e2e/login.cy.js'.Click to reveal answer
Which command opens the Cypress Test Runner UI?
✗ Incorrect
The command
npx cypress open launches the interactive Test Runner UI.How do you run Cypress tests without the UI?
✗ Incorrect
The command
npx cypress run runs tests in headless mode without UI.What flag specifies which browser to use in Cypress CLI?
✗ Incorrect
Use
--browser to choose the browser for running tests.How do you run only a specific test file in Cypress CLI?
✗ Incorrect
The
--spec flag runs specific test files.What does running
npx cypress run do?✗ Incorrect
The command
npx cypress run runs tests in headless mode without opening the UI.Explain how to run Cypress tests from the command line including how to specify a browser and a test file.
Think about the main CLI command and useful flags.
You got /3 concepts.
Describe the difference between
npx cypress open and npx cypress run.Consider UI vs headless execution.
You got /3 concepts.