0
0
Cypresstesting~10 mins

Cypress CLI execution - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to run Cypress tests in headless mode.

Cypress
npx cypress run --[1]
Drag options to blanks, or click blank then click option'
Adebug
Bopen
Cheadless
Dwatch
Attempts:
3 left
💡 Hint
Common Mistakes
Using --open runs Cypress with the UI, not headless.
Using --debug or --watch are not valid Cypress CLI flags.
2fill in blank
medium

Complete the command to specify the browser as Chrome when running Cypress tests.

Cypress
npx cypress run --browser [1]
Drag options to blanks, or click blank then click option'
Afirefox
Bedge
Csafari
Dchrome
Attempts:
3 left
💡 Hint
Common Mistakes
Selecting browsers not installed or unsupported may cause errors.
Using uppercase letters in browser name can cause issues; use lowercase.
3fill in blank
hard

Fix the error in the command to run Cypress tests with a specific spec file.

Cypress
npx cypress run --spec [1]
Drag options to blanks, or click blank then click option'
Acypress/integration/test_spec.js
B"cypress/integration/test_spec.js"
C'cypress/integration/test_spec.js'
Dcypress/integration/test_spec
Attempts:
3 left
💡 Hint
Common Mistakes
Including quotes around the spec path causes errors.
Omitting the file extension leads to file not found errors.
4fill in blank
hard

Fill both blanks to run Cypress tests in headed mode and record the run.

Cypress
npx cypress run --[1] --[2]
Drag options to blanks, or click blank then click option'
Aheaded
Brecord
Cheadless
Dopen
Attempts:
3 left
💡 Hint
Common Mistakes
Using --headless instead of --headed when UI is needed.
Forgetting to add --record when wanting to save test results.
5fill in blank
hard

Fill all three blanks to run Cypress tests with a specific config file, in headless mode, and using Firefox browser.

Cypress
npx cypress run --config-file [1] --[2] --browser [3]
Drag options to blanks, or click blank then click option'
Acypress.prod.json
Bheadless
Cfirefox
Dcypress.json
Attempts:
3 left
💡 Hint
Common Mistakes
Using default config file when a specific one is needed.
Mixing up browser names or modes.
Adding quotes around file names or flags.