Skip to main content

List of LambdaTest Cypress CLI Commands


Check out the list of all the commands supported by LambdaTest-Cypress CLI.

Following is the syntax for using the LambdaTest-Cypress CLI commands.

lambdatest-cypress <command> [options]
Command / ArgPurpose
--helpTo get information of all the commands that can be run
initTo create an initial config file
runTo run tests on LambdaTest
build-infoTo get information about the build
build-stopTo stop all the tests in the build
generate-reportTo generate the test session report

init command


The init command to generate a initial lambdatest configuration file.

lambdatest-cypress init

Example:

Image

On running the above command, it will generate base_reporter_config.json,custom_support_file.js and lambdatest-config.json files.

  1. base_reporter_config.json - It is the configuration file for mochawesome reporter, that LambdaTest uses to generate mochawesome reports which in turn is used to generate the commands section on the LambdaTest dashboard. For Cypress 10, the absence of this file may lead to the commands section not being visible on the dashboard.

  2. custom_support_file.js - By default, Cypress automatically captures screenshots when a test fails. For Cypress 10, in order to make the screenshot visible with the failed tests on our dashboard, we recommend you move and import this file as recommended.

  3. lambdatest-config.json - This file contains configurations like LambdaTest credentials, capabilities, run settings etc., that are required to run the test.

Run command


Note

For detailed examples of each Cypress flag, please visit our guide Configuring Cypress Test Execution.

To start running the test build, you can use the given-below command.

lambdatest-cypress run

Given below are the additional flags available with the run command.

FlagPurposeType
--versionShow version numberBoolean
--helpShow helpBoolean
--ccf, --cypress-config-filePath of the config fileString
--lcf, –lambdatest-config-filePath of the LambdaTest config fileString
-s, --specsPath of the spec file or directory or patternString
--bn, --build-nameBuild nameString
-t, --tagsTest tagsString
-p, --parallelsNo of parallel sessionsString
--envs, --env-variables (For Cypress 9)Set environment variables to configure before your test runsString
--envs, --environment ( For Cypress 10)Set environment variables to configure before your test runsString
--tun, --tunnelConfigure LambdaTest tunnelString
--tname, --tunnel_nameSet the name of LambdaTest tunnel nameString
--brs, --browsersTest will be run on the specified browsers
in the format: platform:browser:version

e.g. --brs="MacOS Catalina:chrome:latest"

--brs="MacOS Catalina:chrome:112.0,MacOS mojave:firefox:111.0"
String
--bi, --build-identifierBuild identifier or build counterString
--if, --ignore_filesFiles to ignore in the zip projectString
--sync, --sync-modeWait on terminal to get the status of the testsString
--autostart, --tatLambdaTest Tunnel auto StartString
--headless, --headless-modeRun in Headless modeBoolean
--net, --networkTo capture Network logsString
--eof, --exit-on-failureExit with Code 1 on failureString
--cy, --cypress_settingsPass Cypress settingsString
--geo, --geo_locationPass Geo country codeString
--sof, --stop_on_failureStop other tests if any test in session gets errored outString
--ra, --reject_unauthorizedDefault rejects self signed certificates in external requestsString
--bt, --build-tagsBuild tagsString
--sys-envs, --sys-env-variablesTo set system variables during test run timeString
--npm-lpd=true, --legacy-peer-deps=trueIgnore peer dependencies and proceed with the NPM installationString
--npm-f=true, --npm-force=trueFetch remote resources even if a local copy already existsString

Build info command


You can use the build-info command to get information on the build.

lambdatest-cypress build-info

Given below are the additional arguments available with the build-info command.

FlagPurposeType
--id, --build-idBuild IdentifierString, Required
--user, --usernameYour LambdaTest usernameString
--ak, --access_keyYour LambdaTest access keyString

Example:

Image

Build stop command


You can use the build-stop command to stop all the test in the build.

lambdatest-cypress build-stop

Given below are the additional arguments available with the build-stop command.

FlagPurpose
--id, --session_idIdentifies the session
--sls, --stop_last_sessionStop the last test session

Example: --stop_last_session

Image

Example: --session_id

Image

Test across 3000+ combinations of browsers, real devices & OS.

Book Demo

Help and Support

Related Articles