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.
- 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.
- 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.
- 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.
- 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
- cypress run --env <environment>: When specified with the environment on which to run, this option will do that
- cypress run --group: This option runs group recorded tests together in a single run.
- cypress run --headed: Displays the browser and runs the test.
- cypress run --headless: Runs tests headlessly, unlike the headed option.
- cypress run --parallel: This option is used to run tests parallel across multiple machines.
- cypress run --no-exit: This option prevents the cypress test runner from exiting after running tests in a spec file.
- cypress run --project -path: Doorway to the project path.
- cypress run --record: Records videos of the tests running.
- cypress run --reporter <reporter>: This option is used to specify a mocha reporter.
- cypress run --spec <spec>: This option is used to run a specific spec file instead of all tests.
- cypress run --tag: This identifies a recorded run by branding it a tag to isolate it separately when displayed in the dashboard.