Cypress run Command

Profile picture for user arilio666

Cypress has a run command which runs cypress tests to completion, and simply asking cypress to run without any options will run all tests headlessly.

cypress run [options]

Let us see brief varieties of options that can be added besides the run command in cypress.

  1. cypress run --browser <browser name>: This command runs cypress in the browser with the given browser name in the place of the browser name field. It also runs the browser if a file path is supplied too. Cypress used the browser at that specified path.
  2. cypress run --ci-build-id <id>: This command specifies a unique identifier for a run to enable grouping or parallelization. This is only valid when provided with a --group or --parallel flag.
  3. cypress run --config <config>: This command option sets configuration values separated by multiple values with a comma. The values developed here override any values set in the configuration file.
  4. cypress run --config-file <config-file path>: When specified with the path to the JSON file we want to run, it runs it where the configuration values are set, and by default, it is the aim of cypress.json
  5. cypress run --env <environment>: When specified with the environment on which to run, this option will do that
  6. cypress run --group: This option runs group recorded tests together in a single run.
  7. cypress run --headed: Displays the browser and runs the test.
  8. cypress run --headless: Runs tests headlessly, unlike the headed option.
  9. cypress run --parallel: This option is used to run tests parallel across multiple machines.
  10. cypress run --no-exit: This option prevents the cypress test runner from exiting after running tests in a spec file.
  11. cypress run --project -path: Doorway to the project path.
  12. cypress run --record: Records videos of the tests running.
  13. cypress run --reporter <reporter>: This option is used to specify a mocha reporter.
  14. cypress run --spec <spec>: This option is used to run a specific spec file instead of all tests.
  15. cypress run --tag: This identifies a recorded run by branding it a tag to isolate it separately when displayed in the dashboard.