Skip to content

Commit 56612fe

Browse files
cypress cli commands
1 parent f00dab7 commit 56612fe

File tree

1 file changed

+87
-104
lines changed

1 file changed

+87
-104
lines changed

docs/cypress-cli-commands.md

Lines changed: 87 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,80 @@
11
---
22
id: cypress-cli-commands
33
title: List of LambdaTest Cypress CLI Commands
4-
hide_title: true
4+
hide_title: false
55
sidebar_label: Cypress CLI Commands
66
description: List of all the commands and arguments supported by LambdaTest-Cypress CLI.
77
keywords:
88
- cypress cli commands
99
- lambdatest cypress cli commands
1010
- lambdatest cypress cli flags
1111
- lambdatest cypress cli arguments
12-
1312
url: https://www.lambdatest.com/support/docs/cypress-cli-commands/
1413
site_name: LambdaTest
1514
slug: cypress-cli-commands/
1615
---
1716

18-
# List of LambdaTest Cypress CLI Commands
19-
---
20-
21-
22-
Check out the list of all the commands supported by LambdaTest-Cypress CLI.
23-
24-
Following is the syntax for using the LambdaTest-Cypress CLI commands.
25-
17+
<script type="application/ld+json"
18+
dangerouslySetInnerHTML={{ __html: JSON.stringify({
19+
"@context": "https://schema.org",
20+
"@type": "BreadcrumbList",
21+
"itemListElement": [{
22+
"@type": "ListItem",
23+
"position": 1,
24+
"name": "Home",
25+
"item": "https://www.lambdatest.com"
26+
},{
27+
"@type": "ListItem",
28+
"position": 2,
29+
"name": "Cypress",
30+
"item": "https://www.lambdatest.com/support/docs/"
31+
},{
32+
"@type": "ListItem",
33+
"position": 3,
34+
"name": "CLI Commands",
35+
"item": "https://www.lambdatest.com/support/docs/cypress-cli-commands/"
36+
}]
37+
})
38+
}}
39+
></script>
40+
The LambdaTest-Cypress CLI provides a set of commands to streamline and enhance your testing workflows on the LambdaTest platform. Below is a comprehensive list of supported commands and their usage.
41+
42+
## General Syntax
43+
To use any command in the LambdaTest-Cypress CLI, follow this basic syntax:
2644
```bash
2745
lambdatest-cypress <command> [options]
2846
```
2947

3048
| Command / Arg | Purpose |
3149
| -------------- | ------------------------------------------------------ |
32-
| **--help** | To get information of all the commands that can be run |
33-
| **init** | To create an initial config file |
34-
| **run** | To run tests on LambdaTest |
35-
| **build-info** | To get information about the build |
36-
| **build-stop** | To stop all the tests in the build |
37-
| **generate-report** | To generate the test session report |
38-
| **--vip **, **--vi-project** | To set the smart ui project name. <br /> The acceptable data type is `string` |
39-
| **--vib** , **--vi-build** | To set the smart ui build name. <br /> The acceptable data type is `string` |
40-
| **--vibase** , **--vi-base** | To set that build as baseline for smart ui. <br /> The acceptable data type is `boolean` |
41-
42-
43-
## init command
44-
---
45-
46-
The init command to generate a initial lambdatest configuration file.
50+
| `--help` | To get information of all the commands that can be run |
51+
| `init` | To create an initial config file |
52+
| `run` | To run tests on LambdaTest |
53+
| `build-info` | To get information about the build |
54+
| `build-stop` | To stop all the tests in the build |
55+
| `generate-report` | To generate the test session report |
56+
| `--vip, --vi-project` | To set the smart ui project name. <br /> The acceptable data type is `string` |
57+
| `--vib , --vi-build` | To set the smart ui build name. <br /> The acceptable data type is `string` |
58+
| `--vibase , --vi-base` | To set that build as baseline for smart ui. <br /> The acceptable data type is `boolean` |
59+
60+
## `init` command
61+
The `init` command to generate a initial lambdatest configuration file.
4762

4863
```
4964
lambdatest-cypress init
5065
```
5166

52-
**Example:**
67+
<img loading="lazy" src={require('../assets/images/cypressten/1.PNG').default} alt="Image" className="doc_img"/><br/><br/>
5368

54-
<img loading="lazy" src={require('../assets/images/cypressten/1.PNG').default} alt="Image" width="703" height="220" className="doc_img"/><br/><br/>
69+
On running the above command, it will generate `base_reporter_config.json`,`custom_support_file.js` and `lambdatest-config.json` files.
5570

56-
On running the above command, it will generate `base_reporter_config.json`,`custom_support_file.js` and `lambdatest-config.json ` files.
71+
- **`base_reporter_config.json`**: This 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.
5772

58-
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.
73+
- **`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.
5974

60-
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.
75+
- **`lambdatest-config.json`**: This file contains configurations like LambdaTest credentials, capabilities, run settings etc., that are required to run the test.
6176

62-
3. `lambdatest-config.json` - This file contains configurations like LambdaTest credentials, capabilities, run settings etc., that are required to run the test.
63-
64-
## Run command
65-
---
77+
## `run` command
6678

6779
:::info Note
6880
For detailed examples of each Cypress flag, please visit our guide [Configuring Cypress Test Execution](https://www.lambdatest.com/support/docs/run-settings/).
@@ -76,40 +88,38 @@ lambdatest-cypress run
7688

7789
Given below are the additional flags available with the `run` command.
7890

79-
| Flag | Purpose | Type |
80-
| ---------------------------------- | ------------------------------------------------------ | -----|
81-
| **--version** | Show version number |Boolean|
82-
| **--help** | Show help |Boolean|
83-
| **--ccf, --cypress-config-file** | Path of the config file |String |
84-
| **--lcf, –lambdatest-config-file** | Path of the LambdaTest config file |String |
85-
| **-s, --specs** | Path of the spec file or directory or pattern |String |
86-
| **--bn, --build-name** | Build name |String |
87-
| **-t, --tags** | Test tags |String |
88-
| **-p, --parallels** | No of parallel sessions |String |
89-
| **--envs, --env-variables** (For Cypress 9) | Set environment variables to configure before your test runs |String |
90-
| **--envs, --environment** ( For Cypress 10) | Set environment variables to configure before your test runs |String |
91-
| **--tun, --tunnel** | Configure LambdaTest tunnel |String |
92-
| **--tname, --tunnel_name** | Set the name of LambdaTest tunnel name |String |
93-
| **--brs, --browsers** | Test will be run on the specified browsers<br/> in the format: `platform:browser:version` <br /><br /> e.g. **`--brs="MacOS Catalina:chrome:latest"`** <br /><br /> **`--brs="MacOS Catalina:chrome:112.0,MacOS mojave:firefox:111.0"`** |String |
94-
| **--bi, --build-identifier** | Build identifier or build counter |String |
95-
| **--if, --ignore_files** | Files to ignore in the zip project |String |
96-
| **--sync, --sync-mode** | Wait on terminal to get the status of the tests |String |
97-
| **--autostart, --tat** | LambdaTest Tunnel auto Start |String |
98-
| **--headless, --headless-mode** | Run in Headless mode |Boolean |
99-
| **--net, --network** | To capture Network logs |String |
100-
| **--eof, --exit-on-failure** | Exit with Code 1 on failure |String |
101-
| **--cy, --cypress_settings** | Pass Cypress settings |String |
102-
| **--geo, --geo_location** | Pass Geo country code |String |
103-
| **--sof, --stop_on_failure** | Stop other tests if any test in session gets errored out |String |
104-
| **--ra, --reject_unauthorized** | Default rejects self signed certificates in external requests |String |
105-
| **--bt, --build-tags** | Build tags | String |
106-
| **--sys-envs, --sys-env-variables** | To set system variables during test run time |String |
107-
| **--npm-lpd=true, --legacy-peer-deps=true** | Ignore peer dependencies and proceed with the NPM installation | String |
108-
| **--npm-f=true, --npm-force=true** | Fetch remote resources even if a local copy already exists |String |
109-
110-
## Build info command
111-
---
112-
91+
| Flag | Purpose | Type |
92+
| ----------------------------------------- | ------------------------------------------------------ | -----|
93+
| `--version` | Show version number <br /> e.g. `lambdatest-cypress run -–version` |NA|
94+
| `--help` | Show help <br /> e.g. `lambdatest-cypress run -–help` |NA|
95+
| `--ccf, --cypress-config-file` | Path of the config file <br /> e.g. `lambdatest-cypress run --ccf="base_reporter_config.json"` |String |
96+
| `--lcf, –lambdatest-config-file` | Path of the LambdaTest config file <br /> e.g. `lambdatest-cypress run --lcf="lambdatest-config.json"` |String |
97+
| `-s, --specs` | Path of the spec file or directory or pattern <br /> e.g. `lambdatest-cypress run --s=”path_from_content_root"` |String |
98+
| `--bn, --build-name` | Build name |String |
99+
| `-t, --tags` | Test tags |String |
100+
| `-p, --parallels` | No of parallel sessions |String |
101+
| `--envs, --env-variables` (Cypress 9) | Set environment variables to configure before your test runs |String |
102+
| `--envs, --environment` (Cypress 10) | Set environment variables to configure before your test runs |String |
103+
| `--tun, --tunnel` | Configure LambdaTest tunnel <br /> e.g. `lambdatest-cypress run --tun="true" –tname="v3"` |String |
104+
| `--tname, --tunnel_name` | Set the name of LambdaTest tunnel name <br /> e.g. `lambdatest-cypress run --tun="true" –tname="v3"` |String |
105+
| `--brs, --browsers` | Test will be run on the specified browsers <br/> in the format: `platform:browser:version` <br /><br /> e.g. `--brs="MacOS Catalina:chrome:latest"` <br /><br /> `--brs="MacOS Catalina:chrome:112.0,MacOS mojave:firefox:111.0"` |String |
106+
| `--bi, --build-identifier` | Build identifier or build counter |String |
107+
| `--if, --ignore_files` | Files to ignore in the zip project <br /> e.g. `lambdatest-cypress run --if="cypress/e2e/1-getting-started/actions.cy.js"` |String |
108+
| `--sync, --sync-mode` | Wait on terminal to get the status of the tests <br /> e.g. `lambdatest-cypress run --sync=true` |String |
109+
| `--autostart, --tat` | LambdaTest Tunnel auto Start <br /> e.g. `lambdatest-cypress run --autostart=true` |String |
110+
| `--headless, --headless-mode` | Run in Headless mode <br /> e.g. `lambdatest-cypress run --headless=true` |Boolean |
111+
| `--net, --network` | To capture Network logs <br /> e.g. `lambdatest-cypress run --net="true"` |String |
112+
| `--eof, --exit-on-failure` | Exit with Code 1 on failure <br /> e.g. `lambdatest-cypress run ---exit-on-failure=”true”` |String |
113+
| `--cy, --cypress_settings` | Pass Cypress settings <br /> e.g. `lambdatest-cypress run --cy=viewportWidth=1000;viewportHeight=660;` |String |
114+
| `--geo, --geo_location` | Pass Geo country code <br /> e.g. `lambdatest-cypress run ---geo_location=AU` <br /> Check all the available Geolocations. |String |
115+
| `--sof, --stop_on_failure` | Stop other tests if any test in session gets errored out <br /> e.g. `lambdatest-cypress run --stop_on_failure=true` |String |
116+
| `--ra, --reject_unauthorized` | Default rejects self signed certificates in external requests <br /> e.g. `lambdatest-cypress run --reject_unauthorized=true` |String |
117+
| `--bt, --build-tags` | Build tags <br /> e.g. `lambdatest-cypress run --build-tags=tag1` | String |
118+
| `--sys-envs, --sys-env-variables` | To set system variables during test run time <br /> e.g. `lambdatest-cypress run --sys-envs="BASE_URL=https://lambdatest.com;"` |String |
119+
| `--npm-lpd=true, --legacy-peer-deps=true` | Ignore peer dependencies and proceed with the NPM installation | String |
120+
| `--npm-f=true, --npm-force=true` | Fetch remote resources even if a local copy already exists <br /> e.g. `lambdatest-cypress run --npm-force=true` |String |
121+
122+
## `build-info` command
113123
You can use the `build-info` command to get information on the build.
114124

115125
```bash
@@ -120,17 +130,13 @@ Given below are the additional arguments available with the `build-info` command
120130

121131
| Flag | Purpose | Type |
122132
| --------| -----------| -----|
123-
| **--id, --build-id** | Build Identifier | String, Required |
124-
| **--user, --username** | Your LambdaTest username | String |
125-
| **--ak, --access_key** | Your LambdaTest access key | String |
126-
127-
**Example:**
133+
| `--id, --build-id` | Build Identifier | String, Required |
134+
| `--user, --username` | Your LambdaTest username | String |
135+
| `--ak, --access_key` | Your LambdaTest access key | String |
128136

129137
<img loading="lazy" src={require('../assets/images/cypressten/2.png').default} alt="Image" width="710" height="224" className="doc_img"/>
130138

131-
## Build stop command
132-
---
133-
139+
## `build-stop` command
134140
You can use the `build-stop` command to stop all the test in the build.
135141

136142
```bash
@@ -141,36 +147,13 @@ Given below are the additional arguments available with the `build-stop` command
141147

142148
| Flag | Purpose |
143149
| -------------------- | --------- |
144-
| **--id, --session_id** | Identifies the session |
145-
| **--sls, --stop_last_session** | Stop the last test session |
150+
| `--id, --session_id` | Identifies the session |
151+
| `--sls, --stop_last_session` | Stop the last test session |
146152

147-
**Example**: `--stop_last_session`
153+
- `--stop_last_session`
148154

149155
<img loading="lazy" src={require('../assets/images/cypressten/build_stop.png').default} alt="Image" width="710" height="224" className="doc_img"/>
150156

151-
**Example**: `--session_id`
152-
153-
<img loading="lazy" src={require('../assets/images/cypressten/id_build_stop.png').default} alt="Image" width="710" height="224" className="doc_img"/>
154-
155-
156-
157-
<nav aria-label="breadcrumbs">
158-
<ul className="breadcrumbs">
159-
<li className="breadcrumbs__item">
160-
<a className="breadcrumbs__link" href="https://www.lambdatest.com">
161-
Home
162-
</a>
163-
</li>
164-
<li className="breadcrumbs__item">
165-
<a className="breadcrumbs__link" target="_self" href="https://www.lambdatest.com/support/docs/">
166-
Support
167-
</a>
168-
</li>
169-
<li className="breadcrumbs__item breadcrumbs__item--active">
170-
<span className="breadcrumbs__link">
171-
Cypress CLI Commands
172-
</span>
173-
</li>
174-
</ul>
175-
</nav>
157+
- `--session_id`
176158

159+
<img loading="lazy" src={require('../assets/images/cypressten/id_build_stop.png').default} alt="Image" width="710" height="224" className="doc_img"/>

0 commit comments

Comments
 (0)