Skip to content

Commit ecdf0c8

Browse files
updated the HyperExecute documentation
1 parent cd35c30 commit ecdf0c8

File tree

6 files changed

+122
-79
lines changed

6 files changed

+122
-79
lines changed
102 KB
Loading

docs/cypress-detailed-command-logs.md

Lines changed: 58 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,45 @@ slug: cypress-detailed-command-logs/
4141
></script>
4242

4343
# Detailed Command Logs for Cypress
44+
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.
4445

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.
4647

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.
4850

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:
5053

51-
## For Cypress version Below 10
54+
### For Cypress < 10:
5255

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+
```
5475

55-
**Step 2:** Add the below-mentioned code to your *index.js* file.
76+
## For Cypress v9 and previous versions.
5677

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:
81+
82+
```javascript
5883
const installLogsPrinter = require('cypress-terminal-report/src/installLogsPrinter')
5984

6085
module.exports = (on, config) => {
@@ -70,38 +95,40 @@ module.exports = (on, config) => {
7095
})
7196
}
7297
```
73-
> 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.
7498

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
76103
module.exports = (on, config) => {
77-
// `on` is used to hook into various events Cypress emits
78-
// `config` is the resolved Cypress config
79104
installLogsPrinter(on, {
80-
printLogsToConsole: 'always'
105+
printLogsToConsole: 'always', // Enables logs in the terminal
81106
printLogsToFile: 'always',
82107
outputRoot: 'cypress/results/detailCommandLogs',
83108
outputTarget: {
84109
'detailCommandLogs.json': 'json',
85110
},
86-
})
87-
}
111+
});
112+
};
88113
```
89114

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:
91118

92-
```java
119+
```javascript
93120
const installLogsCollector = require('cypress-terminal-report/src/installLogsCollector')
94121

95122
installLogsCollector()
96123
```
97124

98-
## For Cypress version 10 and Above
99-
100-
**Step 1:** Go to *cypress.config.js* in your repository.
125+
## For Cypress v10 and later versions.
101126

102-
**Step 2:** Add the below-mentioned code to your *config.js* file.
127+
### Step 1: Configure the Plugin
128+
- Open `cypress.config.js` in your project.
129+
- Add the following code to configure the plugin:
103130

104-
```java
131+
```javascript
105132
const { defineConfig } = require("cypress");
106133
const installLogsPrinter = require("cypress-terminal-report/src/installLogsPrinter");
107134
module.exports = defineConfig({
@@ -120,9 +147,10 @@ module.exports = defineConfig({
120147
});
121148
```
122149

123-
> 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:
124152

125-
```java
153+
```javascript
126154
const { defineConfig } = require("cypress");
127155
const installLogsPrinter = require("cypress-terminal-report/src/installLogsPrinter");
128156
module.exports = defineConfig({
@@ -142,55 +170,19 @@ module.exports = defineConfig({
142170
});
143171
```
144172

145-
**Step 3:** Go to the following file: *cypress/support/e2e.js*. Add the below-mentioned code.
173+
### Step 3: Install Logs Collector
174+
- Open `cypress/support/e2e.js`.
175+
- Add the following code to install the log collector:
146176

147-
```java
177+
```javascript
148178
import installLogsCollector from 'cypress-terminal-report/src/installLogsCollector'
149179

150180
installLogsCollector()
151181
```
152182

153-
**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/).
163-
164-
```bash
165-
"run_settings": {
166-
"reporter_config_file":"base_reporter_config.json",
167-
# highlight-next-line
168-
"downloads": "./cypress/results",
169-
"build_name": "Cypress 10",
170-
"parallels": 1,
171-
"specs": "cypress/e2e/1-getting-started/todo.cy.js",
172-
"ignore_files": "",
173-
"network": false,
174-
"headless": false,
175-
"npm_dependencies": {
176-
"cypress": "12.17.0",
177-
"mocha-junit-reporter": "latest",
178-
"playwright-webkit":"1.27.0",
179-
"cypress-terminal-report": "^5.3.2"
180-
},
181-
# highlight-next-line
182-
"detailed_command_logs" : true
183-
},
184-
```
185-
186183
## View Generated Logs
184+
Once the Cypress tests are executed, you can view the detailed command logs in the **"Detailed Command Logs"** tab on the test details page.
187185

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.
191-
192-
<img loading="lazy" src={require('../assets/images/cypress-doc/detailed_log.png').default} alt="Image" style={{width: '700px',}} className="doc_img"/>
193-
194-
Now you can effectively capture and analyze detailed command logs for your Cypress tests, helping you identify and debug issues with ease.
186+
For more information, visit [Artefacts For A Cypress Project](https://www.lambdatest.com/support/docs/download-artefacts-cypress/)
195187

196-
> **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
188+
<img loading="lazy" src={require('../assets/images/cypress/detailed-cypress-logs.png').default} alt="Image" className="doc_img"/>

docs/cypressv10-on-hyperexecute.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,8 +494,21 @@ cypressOps:
494494
You can download network logs via the Automate Dashboard. You can visualize HAR files using the [HAR Viewer](http://www.softwareishard.com/har/viewer/).
495495
:::
496496

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.
511+
:::
499512

500513
<nav aria-label="breadcrumbs">
501514
<ul className="breadcrumbs">

docs/cypressv9-on-hyperexecute.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,6 @@ env:
460460
```
461461

462462
### HAR Logs
463-
464463
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
465464

466465
HAR logs offer a comprehensive view of your application's network activity during testing. This can be helpful for:
@@ -481,8 +480,21 @@ cypressOps:
481480
You can download network logs via the Automate Dashboard. You can visualize HAR files using the [HAR Viewer](http://www.softwareishard.com/har/viewer/).
482481
:::
483482

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.
497+
:::
486498

487499
<nav aria-label="breadcrumbs">
488500
<ul className="breadcrumbs">

docs/deep-dive-into-hyperexecute-yaml.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,31 @@ matrix:
197197

198198
***
199199

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+
200225
### `combineTasksInMatrixMode`
201226

202227
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.

docs/hyperexecute-matrix-multiplexing-strategy.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ Let’s take a case where the test scenarios are implemented in Java. Files File
102102

103103
## Exclusion in Matrix Strategy
104104
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
106107
#runson defines the OS of your test execution node.
107108
runson: ${matrix.os}
108109
@@ -112,14 +113,14 @@ matrix:
112113
# OS name sepataed by Coma
113114
os: ["win", "mac", "linux"]
114115
# Browser name separated by Comma
115-
browser: ["Chrome", "Firefox", "brave"]
116+
browser: ["Chrome", "Firefox", "Safari"]
116117
# Test Files separated by Comma
117-
files: ["@File1","@File2"]
118-
exclusionMatrix:
119-
# this would exclude the combination of brave browser, linux OS and File2
120-
browser: ["brave"]
121-
files: ["@File2"]
122-
os: [linux]
118+
files: ["@File1","@File2","@File3","@File4"]
119+
120+
exclusionMatrix:
121+
- os: [win]
122+
browser: ["Safari"]
123+
files: ["@File2","@File3"]
123124
```
124125

125126
<nav aria-label="breadcrumbs">

0 commit comments

Comments
 (0)