Skip to content

Commit 28553d0

Browse files
committed
Update analytics-test-case-insights documentation with WebHook usage and formatting improvements
1 parent e060fa7 commit 28553d0

File tree

1 file changed

+53
-28
lines changed

1 file changed

+53
-28
lines changed

docs/analytics-test-case-insights.md

Lines changed: 53 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -34,35 +34,60 @@ slug: analytics-test-case-insights/
3434
}}
3535
></script>
3636

37-
38-
3937
Analyzing the test case level insights of your test automation execution on LambdaTest is now easier than ever with the `Test Case Insights` module. The user can easily find information about the count, and type of the test cases through the highly customizable widgets.
4038

41-
## Prerequisites For Insights:
39+
## Prerequisites For Insights:
40+
4241
1. You should have an active LambdaTest account.
43-
2. You should han active subscription plan with HyperExecute or App Automation.
42+
2. You should han active subscription plan with HyperExecute or App Automation.
4443
3. You should have executed at least one test on the LambdaTest HyperExecute / App Automation platform.
4544

4645
## How To Access Test Case Insights?
47-
1. Go to the `Insights` tab on the left navigation bar and click on the `Create New`.
48-
2. Select the `Custom Dashboard` option from the menu.
49-
3. Now, search for `Test Case` widgets in the `App Automation & HyperExecute` products.
46+
47+
1. Go to the `Insights` tab on the left navigation bar and click on the `Create New`.
48+
2. Select the `Custom Dashboard` option from the menu.
49+
3. Now, search for `Test Case` widgets in the `Web Automation, App Automation & HyperExecute` products.
5050
4. Add the widgets to the dashboard by clicking on the `Add Widget` button.
5151

5252
<!-- <img loading="lazy" src={require('../assets/images/analytics/test-case-widgets-dashboard.webp').default} alt="cmd" width="800" height="400" className="doc_img"/> -->
5353

54+
## Capture Test Case Insights for Web Automation
55+
56+
### Capture by WebHook
57+
58+
You can use LambdaHooks to start and end a test case within a single Selenium session.
59+
60+
#### Test Case Start
61+
62+
To start a test case, use the `lambda-testCase-start` hook:
63+
64+
```java
65+
// To start a test case
66+
((JavascriptExecutor) driver).executeScript("lambda-testCase-start={Your Test Case Name}");
67+
```
68+
69+
#### Test Case End
70+
71+
To end a test case, use the `lambda-testCase-end` hook:
72+
73+
```java
74+
// To end a test case
75+
((JavascriptExecutor) driver).executeScript("lambda-testCase-end={Your Test Case Name}");
76+
```
77+
5478
## Capture Test Case Insights for App Automation
5579

5680
### Capture by WebHook
57-
You can use LambdaHooks to start and end a test case within a single Appium session.
81+
82+
You can use LambdaHooks to start and end a test case within a single Appium session.
5883

5984
#### Test Case Start
6085

6186
To start a test case, use the `lambda-testCase-start` hook:
6287

6388
```java
6489
// To start a test case
65-
((JavascriptExecutor) driver).executeScript("lambda-testCase-start=find Name");
90+
((JavascriptExecutor) driver).executeScript("lambda-testCase-start={Your Test Case Name}");
6691
```
6792

6893
#### Test Case End
@@ -71,17 +96,17 @@ To end a test case, use the `lambda-testCase-end` hook:
7196

7297
```java
7398
// To end a test case
74-
((JavascriptExecutor) driver).executeScript("lambda-testCase-end=find Name");
99+
((JavascriptExecutor) driver).executeScript("lambda-testCase-end={Your Test Case Name}");
75100

76101
```
77102

78103
To know more about the hooks and how to use them, you can refer to the [LambdaHooks for Appium](https://www.lambdatest.com/support/docs/appium-lambdatest-hooks/#differentiating-test-cases-in-single-session) documentation.
79104

80105
## Capture Test Case Insights for HyperExecute
81106

82-
### Capture by WebHook
107+
### Capture by WebHook
83108

84-
You can capture the test case insights by using the WebHook. You need to add the following `WebHook` in your test script.
109+
You can capture the test case insights by using the WebHook. You need to add the following `WebHook` in your test script.
85110

86111
```bash
87112
// For Stage of test case `START`
@@ -96,23 +121,24 @@ driver.executeScript(`lambda-testCase-end=${Name of test case}`)
96121
97122
You can capture the test case insights by using the NPM Package. You need to add the following `NPM Package` in your test script. Here is the link to the NPM package: [wdio-lambdatest-test-case-analytics-service](https://www.npmjs.com/package/wdio-lambdatest-test-case-analytics-service)
98123
99-
:::caution
124+
:::caution
100125
The package currently only supports for `WebdriverIO` framework. We will be adding support for other frameworks soon.
101126
:::
102127
103128
```bash
104129
npm i wdio-lambdatest-test-case-analytics-service
105130
```
131+
106132
Now, once the package has been installed, you need to add the following code in your `wdio.conf.js` file.
107133
108134
```javascript
109135
exports.config = {
110-
// ...
111-
services: [
112-
['lambdatest-test-case-analytics', {}], // Add the service
113-
// ... other services
114-
],
115-
// ...
136+
// ...
137+
services: [
138+
["lambdatest-test-case-analytics", {}], // Add the service
139+
// ... other services
140+
],
141+
// ...
116142
};
117143
```
118144
@@ -121,23 +147,22 @@ Once, you have completed the configuration and start executing your tests on the
121147
## Test Case Insights Widgets
122148
123149
### Test Case Health Snapshot
124-
You can analyze the health of your test cases by using the `Test Case Health Snapshot` widget. The widget will display the total number of test cases success, failed. The widget will be displayed in card view and you can also view the details of the test cases by clicking on the `View Details` button.
150+
151+
You can analyze the health of your test cases by using the `Test Case Health Snapshot` widget. The widget will display the total number of test cases success, failed. The widget will be displayed in card view and you can also view the details of the test cases by clicking on the `View Details` button.
125152
126153
<img loading="lazy" src={require('../assets/images/analytics/test-case-health-snapshot.webp').default} alt="cmd" width="800" height="400" className="doc_img"/>
127154
128155
### Test Case Group View
156+
129157
You can analyze the test cases by their group by using the `Test Case Group View` widget. The widget will display the total number of test cases in each group. The widget will be displayed in card view and you can also view the details of the test cases by clicking on the `View Details` button.
130158
131159
<img loading="lazy" src={require('../assets/images/analytics/test-cases-view.webp').default} alt="cmd" width="800" height="400" className="doc_img"/>
132160
133161
## Test Case Use Cases
134-
The user can use the `Test Case Insights` module to analyze the test case level insights of their test automation execution on LambdaTest. The user can use the module to analyze the following use cases:
135-
136-
* Analyze the test case level insights of your test automation execution on LambdaTest.
137-
* Check the health of your test cases.
138-
* Detect the test cases that are failing frequently.
139-
* Drill down to the test cases for faster debugging.
140-
141-
142162
163+
The user can use the `Test Case Insights` module to analyze the test case level insights of their test automation execution on LambdaTest. The user can use the module to analyze the following use cases:
143164
165+
- Analyze the test case level insights of your test automation execution on LambdaTest.
166+
- Check the health of your test cases.
167+
- Detect the test cases that are failing frequently.
168+
- Drill down to the test cases for faster debugging.

0 commit comments

Comments
 (0)