Skip to content
Merged

PR 1273 #1274

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 53 additions & 28 deletions docs/analytics-test-case-insights.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,35 +34,60 @@ slug: analytics-test-case-insights/
}}
></script>



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.

## Prerequisites For Insights:
## Prerequisites For Insights:

1. You should have an active LambdaTest account.
2. You should han active subscription plan with HyperExecute or App Automation.
2. You should han active subscription plan with HyperExecute or App Automation.
3. You should have executed at least one test on the LambdaTest HyperExecute / App Automation platform.

## How To Access Test Case Insights?
1. Go to the `Insights` tab on the left navigation bar and click on the `Create New`.
2. Select the `Custom Dashboard` option from the menu.
3. Now, search for `Test Case` widgets in the `App Automation & HyperExecute` products.

1. Go to the `Insights` tab on the left navigation bar and click on the `Create New`.
2. Select the `Custom Dashboard` option from the menu.
3. Now, search for `Test Case` widgets in the `Web Automation, App Automation & HyperExecute` products.
4. Add the widgets to the dashboard by clicking on the `Add Widget` button.

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

## Capture Test Case Insights for Web Automation

### Capture by WebHook

You can use LambdaHooks to start and end a test case within a single Selenium session.

#### Test Case Start

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

```java
// To start a test case
((JavascriptExecutor) driver).executeScript("lambda-testCase-start={Your Test Case Name}");
```

#### Test Case End

To end a test case, use the `lambda-testCase-end` hook:

```java
// To end a test case
((JavascriptExecutor) driver).executeScript("lambda-testCase-end={Your Test Case Name}");
```

## Capture Test Case Insights for App Automation

### Capture by WebHook
You can use LambdaHooks to start and end a test case within a single Appium session.

You can use LambdaHooks to start and end a test case within a single Appium session.

#### Test Case Start

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

```java
// To start a test case
((JavascriptExecutor) driver).executeScript("lambda-testCase-start=find Name");
((JavascriptExecutor) driver).executeScript("lambda-testCase-start={Your Test Case Name}");
```

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

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

```

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.

## Capture Test Case Insights for HyperExecute

### Capture by WebHook
### Capture by WebHook

You can capture the test case insights by using the WebHook. You need to add the following `WebHook` in your test script.
You can capture the test case insights by using the WebHook. You need to add the following `WebHook` in your test script.

```bash
// For Stage of test case `START`
Expand All @@ -96,23 +121,24 @@ driver.executeScript(`lambda-testCase-end=${Name of test case}`)

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)

:::caution
:::caution
The package currently only supports for `WebdriverIO` framework. We will be adding support for other frameworks soon.
:::

```bash
npm i wdio-lambdatest-test-case-analytics-service
```

Now, once the package has been installed, you need to add the following code in your `wdio.conf.js` file.

```javascript
exports.config = {
// ...
services: [
['lambdatest-test-case-analytics', {}], // Add the service
// ... other services
],
// ...
// ...
services: [
["lambdatest-test-case-analytics", {}], // Add the service
// ... other services
],
// ...
};
```

Expand All @@ -121,23 +147,22 @@ Once, you have completed the configuration and start executing your tests on the
## Test Case Insights Widgets

### Test Case Health Snapshot
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.

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.

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

### Test Case Group View

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.

<img loading="lazy" src={require('../assets/images/analytics/test-cases-view.webp').default} alt="cmd" width="800" height="400" className="doc_img"/>

## Test Case Use Cases
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:

* Analyze the test case level insights of your test automation execution on LambdaTest.
* Check the health of your test cases.
* Detect the test cases that are failing frequently.
* Drill down to the test cases for faster debugging.



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:

- Analyze the test case level insights of your test automation execution on LambdaTest.
- Check the health of your test cases.
- Detect the test cases that are failing frequently.
- Drill down to the test cases for faster debugging.
Loading