You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The **Detailed Command Logs** feature provides a comprehensive record of all Cypress commands and their results, both in the console and in a file. This functionality is ideal for debugging and troubleshooting, enabling you to pinpoint specific logs quickly and effectively.
44
45
45
-
The **Detailed Command Logs** functionality can be used to generate an extensive record of all the Cypress commands and their results, both to the console and to a file. This can be very useful for debugging and troubleshooting Cypress tests as it will narrow down the logs to find specific information.
46
+
The logs are presented in an easy-to-read, human-readable format using the [cypress-terminal-report](https://www.npmjs.com/package/cypress-terminal-report) plugin. Below are the steps to implement this feature for Cypress versions below and above 10.
46
47
47
-
The logs are formatted in a human-readable format, making them easy to read and understand. It makes use of the **cypress-terminal-report** plugin internally.
48
+
## Prerequisite: Install Cypress and Cypress Terminal Report
49
+
Before proceeding, ensure that you have installed Cypress and the cypress-terminal-report plugin.
48
50
49
-
To implement this plugin in your Cypress test, follow the below-mentioned procedure:
51
+
- Open your `package.json` or `lambdatest-config.json` file.
52
+
- Add the appropriate version of [cypress-terminal-report](https://www.npmjs.com/package/cypress-terminal-report) as a dependency:
50
53
51
-
## For Cypress version Below 10
54
+
###For Cypress < 10:
52
55
53
-
**Step 1:** Go to *cypress/plugins/index.js* in your repository.
56
+
```javascript
57
+
"cypress-terminal-report":"4.1.3"
58
+
```
59
+
60
+
### For Cypress >= 10:
61
+
62
+
```javascript
63
+
"cypress-terminal-report":"^5.3.2"
64
+
```
65
+
66
+
- In the `lambdatest-config.json`, enable detailed command logs by adding the following setting:
67
+
> **NOTE:-** You will be able to see this tab only when you use this capability **detailed_command_logs** in run_settings in lambdatest-config.json
68
+
69
+
```javascript
70
+
"run_settings": {
71
+
"detailed_command_logs":true,
72
+
"downloads":"./cypress/results"
73
+
}
74
+
```
54
75
55
-
**Step 2:** Add the below-mentioned code to your *index.js* file.
76
+
## For Cypress v9 and previous versions.
56
77
57
-
```java
78
+
### Step 1: Configure the Plugin
79
+
- Open the `cypress/plugins/index.js` file in your project.
80
+
- Add the following code to install and configure the cypress-terminal-report plugin:
> To get the detailed report in the terminal logs, simply add the **printLogsToConsole: 'always'** hook in the **installLogsPrinter** as shown in the below-mentioned code.
74
98
75
-
```java
99
+
### Step 2: Enable Logs in the Console (Optional)
100
+
To display detailed logs in the terminal, update the `installLogsPrinter` with the `printLogsToConsole: 'always'` code:
101
+
102
+
```javascript
76
103
module.exports= (on, config) => {
77
-
// `on` is used to hook into various events Cypress emits
78
-
// `config` is the resolved Cypress config
79
104
installLogsPrinter(on, {
80
-
printLogsToConsole:'always'
105
+
printLogsToConsole:'always', // Enables logs in the terminal
81
106
printLogsToFile:'always',
82
107
outputRoot:'cypress/results/detailCommandLogs',
83
108
outputTarget: {
84
109
'detailCommandLogs.json':'json',
85
110
},
86
-
})
87
-
}
111
+
});
112
+
};
88
113
```
89
114
90
-
**Step 3:** Go to the following file: *cypress/support/index.js*. Add the below-mentioned code.
115
+
### Step 3: Install Logs Collector
116
+
- Navigate to `cypress/support/index.js`.
117
+
- Add the following code to install the log collector:
> To get the detailed report in the terminal logs, simply add the **printLogsToConsole: 'always'** hook in the **installLogsPrinter** as shown in the below-mentioned code.
150
+
### Step 2: Enable Logs in the Console (Optional)
151
+
If you need logs in the terminal, update the code like this:
**Step 4:** If you are passing npm dependencies through package.json, then add the **"cypress-terminal-report"** dependency there, or if you are using **"lambdatest-config.json"** to pass the dependency, add it there.
154
-
155
-
- for **cypress < 10** use this version "cypress-terminal-report": "4.1.3"
156
-
- for **cypress >= 10** use "cypress-terminal-report": "^5.3.2"
157
-
158
-
- Make sure to set this key **"detailed_command_logs"** to **'true'** in **run_settings** in *lambdatest-config.json* like below:
159
-
160
-
- You can download the logs as usual by passing **"downloads": "./cypress/results"**
161
-
162
-
> For comprehensive details on downloading reports, please refer to the following [resource](https://www.lambdatest.com/support/docs/download-artefacts-cypress/).
Once the Cypress tests are executed, you can view the detailed command logs in the **"Detailed Command Logs"** tab on the test details page.
187
185
188
-
After running your Cypress tests with the **cypress-terminal-report** plugin, you can view the detailed command logs in the **"detailed command logs"** tab on the test details page.
189
-
190
-
Refer to the [Artefacts For A Cypress Project](https://www.lambdatest.com/support/docs/download-artefacts-cypress/) for detailed understanding in logs and accessing artefacts.
Copy file name to clipboardExpand all lines: docs/cypressv10-on-hyperexecute.md
+15-2Lines changed: 15 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -494,8 +494,21 @@ cypressOps:
494
494
You can download network logs via the Automate Dashboard. You can visualize HAR files using the [HAR Viewer](http://www.softwareishard.com/har/viewer/).
495
495
:::
496
496
497
-
>For any query or doubt, please feel free to contact us via <span className="doc__lt" onClick={() => window.openLTChatWidget()}>**24×7 chat support**</span> or you can also drop a mail to **[email protected]**.<br />
498
-
Happy testing!
497
+
### Detailed Cypress Command Logs
498
+
> To enable it for your organization, please contact us via <span className="doc__lt" onClick={() => window.openLTChatWidget()}>**24×7 chat support**</span> or you can also drop a mail to **[email protected]**.<br />
499
+
500
+
The **Detailed Command Logs** feature can be used to generate a comprehensive record of all Cypress commands and their results, both in the console and in a file. This can be extremely useful for debugging and troubleshooting Cypress tests because it narrows down the logs to reveal specific information. The logs are presented in a human-readable format, making them simple to read and comprehend.
501
+
502
+
Prerequisite to get the detailed logs in HyperExecute:
503
+
504
+
```yaml
505
+
pre:
506
+
- npm install cypress-terminal-report --save-dev
507
+
```
508
+
509
+
:::tip
510
+
For in detailed information on how to configure it properly, visit [Cypress Detailed Command Logs](https://www.lambdatest.com/support/docs/cypress-detailed-command-logs/#for-cypress-v10-and-later-versions) documentation.
Copy file name to clipboardExpand all lines: docs/cypressv9-on-hyperexecute.md
+15-3Lines changed: 15 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -460,7 +460,6 @@ env:
460
460
```
461
461
462
462
### HAR Logs
463
-
464
463
HAR files are a standardized format for archiving HTTP Archive data. They provide a detailed record of all network requests and responses made by a web browser, including information like URLs, headers, timings, and response data
465
464
466
465
HAR logs offer a comprehensive view of your application's network activity during testing. This can be helpful for:
@@ -481,8 +480,21 @@ cypressOps:
481
480
You can download network logs via the Automate Dashboard. You can visualize HAR files using the [HAR Viewer](http://www.softwareishard.com/har/viewer/).
482
481
:::
483
482
484
-
>For any query or doubt, please feel free to contact us via <span className="doc__lt" onClick={() => window.openLTChatWidget()}>**24×7 chat support**</span> or you can also drop a mail to **[email protected]**.<br />
485
-
Happy testing!
483
+
### Detailed Cypress Command Logs
484
+
> To enable it for your organization, please contact us via <span className="doc__lt" onClick={() => window.openLTChatWidget()}>**24×7 chat support**</span> or you can also drop a mail to **[email protected]**.<br />
485
+
486
+
The **Detailed Command Logs** feature can be used to generate a comprehensive record of all Cypress commands and their results, both in the console and in a file. This can be extremely useful for debugging and troubleshooting Cypress tests because it narrows down the logs to reveal specific information. The logs are presented in a human-readable format, making them simple to read and comprehend.
487
+
488
+
Prerequisite to get the detailed logs in HyperExecute:
489
+
490
+
```yaml
491
+
pre:
492
+
- npm install cypress-terminal-report --save-dev
493
+
```
494
+
495
+
:::tip
496
+
For in detailed information on how to configure it properly, visit [Cypress Detailed Command Logs](https://www.lambdatest.com/support/docs/cypress-detailed-command-logs/#for-cypress-v9-and-previous-versions) documentation.
Copy file name to clipboardExpand all lines: docs/deep-dive-into-hyperexecute-yaml.md
+25Lines changed: 25 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -197,6 +197,31 @@ matrix:
197
197
198
198
***
199
199
200
+
### `exclusionMatrix`
201
+
The [exclusion matrix](https://www.lambdatest.com/support/docs/hyperexecute-matrix-multiplexing-strategy/#exclusion-in-matrix-strategy) allows you to omit specific combinations of parameters from being tested. For instance, if Safari on Windows is not a valid combination, you can exclude it using the exclusionMatrix parameter, ensuring that invalid or irrelevant test combinations are skipped.
202
+
203
+
```yaml
204
+
#runson defines the OS of your test execution node.
205
+
runson: ${matrix.os}
206
+
207
+
matrix:
208
+
# Browser version(s) separated by Comma
209
+
version: ["latest"]
210
+
# OS name sepataed by Coma
211
+
os: ["win", "mac", "linux"]
212
+
# Browser name separated by Comma
213
+
browser: ["Chrome", "Firefox", "Safari"]
214
+
# Test Files separated by Comma
215
+
files: ["@File1","@File2","@File3","@File4"]
216
+
217
+
exclusionMatrix:
218
+
- os: [win]
219
+
browser: ["Safari"]
220
+
files: ["@File2","@File3"]
221
+
```
222
+
223
+
***
224
+
200
225
### `combineTasksInMatrixMode`
201
226
202
227
In matrix mode, the [concurrency](/support/docs/deep-dive-into-hyperexecute-yaml/#concurrency) flag is not recognized. Therefore, in order to use the limited concurrencies that come with your license for a matrix-mode job, you need to set `combineTasksInMatrixMode` to `true`. This will run the (matrix-multiplied) combinations as scenarios in the number of HyperExecute machines that was specified in concurrency, as opposed to using one machine per matrix combination.
Copy file name to clipboardExpand all lines: docs/hyperexecute-matrix-multiplexing-strategy.md
+9-8Lines changed: 9 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -102,7 +102,8 @@ Let’s take a case where the test scenarios are implemented in Java. Files File
102
102
103
103
## Exclusion in Matrix Strategy
104
104
Assuming that you created a matrix but there is one specific combination that you don't want the system to consider. This can happen for instance if you have a combination of Safari and Windows which won't be a valid combination, in such cases you can exclude such a combination using the `exclusionMatrix` parameter as shown below.
105
-
``` yaml
105
+
106
+
```yaml
106
107
#runson defines the OS of your test execution node.
107
108
runson: ${matrix.os}
108
109
@@ -112,14 +113,14 @@ matrix:
112
113
# OS name sepataed by Coma
113
114
os: ["win", "mac", "linux"]
114
115
# Browser name separated by Comma
115
-
browser: ["Chrome", "Firefox", "brave"]
116
+
browser: ["Chrome", "Firefox", "Safari"]
116
117
# Test Files separated by Comma
117
-
files: ["@File1","@File2"]
118
-
exclusionMatrix:
119
-
# this would exclude the combination of brave browser, linux OS and File2
0 commit comments