Skip to content
Merged
Show file tree
Hide file tree
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
Binary file modified assets/images/hyperexecute/knowledge-base/reports/cucumber.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 29 additions & 24 deletions docs/cucumber-report.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
---
id: cucumber-report
title: Cucumber Report on HyperExecute
hide_title: true
title: Cucumber Report
hide_title: false
sidebar_label: Cucumber
description: Learn how to generate Cucumber Report on lambdatest and download the reports from the dashboard
keywords:
- cucumber testing reports
- cucumber testing lambdatest

url: https://www.lambdatest.com/support/docs/cucumber-report/
site_name: LambdaTest
slug: cucumber-report/
Expand Down Expand Up @@ -35,41 +34,47 @@ slug: cucumber-report/
})
}}
></script>
Cucumber reporting is a way to visualize and analyze test results when using the Cucumber testing framework. Cucumber is widely used for Behavior-Driven Development (BDD), allowing tests to be written in plain language using Gherkin syntax. The reports generated from Cucumber tests provide a readable format for stakeholders to understand the results, which helps in understanding the behavior of the system being tested without requiring technical expertise.

# Cucumber Reports
Cucumber itself provides basic reporting in the command line, but additional plugins and tools can enhance the reporting experience, generating rich HTML or JSON reports.

Cucumber uses reporter plugins to produce reports that contain information about what scenarios have passed or failed.

## Built-in Reporters
There several pre-defined or built-in reporters for Cucumber. Each reporter may present the test results in a different way, suitable for specific needs or preferences. These built-in reporters offer different levels of detail and visualization options, helping developers to understand the test results and identify any potential issues more effectively.
## Steps to Generate Cucumber Reports on HyperExecute

Following are some of the built-in reporters:
- message
- progress
- pretty
- html
- json
- rerun
- junit
- testng
### Step 1: Configure the TestRunner File
In your `TestRunner` file, configure `@CucumberOptions` to specify report formats and output paths. Here’s an example configuration:

## Custom Reporters
Apart from the built-in reporters, Cucumber Test also allows developers to create custom reporters i.e. you have the flexibility to define your own format and layout for displaying test results. Custom reporters are beneficial when you have specific reporting requirements or when you want to integrate the test results seamlessly into your existing development workflow.
```javascript title="TestRunner.java"
@CucumberOptions(
features = "src/main/java/Features",
glue = {"Steps"},
tags = {"~@Ignore"},
format = {
"pretty",
"html:target/cucumber-reports/cucumber-pretty",
"json:target/cucumber-reports/CucumberTestReport.json",
"rerun:target/cucumber-reports/rerun.txt"
},plugin = "json:target/cucumber-reports/CucumberTestReport.json")
```

This involves creating a class that implements/extends the standard formatter interface.
Explanation of plugin Options:

## Steps to Generate Cucumber Reports on HyperExecute
- **pretty :** Outputs readable format in console.
- **html:target/cucumber-reports/cucumber-pretty :** Generates HTML report in the target directory.
- **json:target/cucumber-reports/CucumberTestReport.json :** Generates JSON report, often required for CI/CD and advanced reporting.
- **rerun:target/cucumber-reports/rerun.txt :** Logs any failed scenarios for rerun.

**Step 1:** Configure the report parameters in the HyperExecute YAML file.
### Step 2: Configure the HyperExecute YAML File
In your HyperExecute YAML configuration, define the [`report`](https://www.lambdatest.com/support/docs/deep-dive-into-hyperexecute-yaml/#report) parameters like this:

```bash
```yaml title="hyperexecute.yaml"
report: true
partialReports:
location: target/cucumber-reports/
frameworkName: cucumber
type: json
```

**Step 2:** Now execute your job by triggering the HyperExecute CLI. You can visit the HyperExecute dashboard to download the report after job completion.
### Step 3: Execute Your Tests
Run your tests on HyperExecute using the CLI. After your job completes, you can visit the HyperExecute dashboard to download and view the Cucumber report.

<img loading="lazy" src={require('../assets/images/hyperexecute/knowledge-base/reports/cucumber.png').default} alt="Image" className="doc_img"/>
99 changes: 63 additions & 36 deletions docs/extent-report.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
id: extent-report
title: Extent Report on HyperExecute
hide_title: true
title: Extent Report
hide_title: false
sidebar_label: Extent
description: Learn how to generate Extent Report on lambdatest and download the reports from the dashboard
keywords:
Expand Down Expand Up @@ -35,53 +35,84 @@ slug: extent-report/
})
}}
></script>
Extent Reports is a powerful reporting library used in test automation frameworks to generate visually appealing and detailed test reports. It provides insights into the status of each test case, including whether they passed, failed, or were skipped, along with additional information such as logs, screenshots, and system/environment details. This makes it especially popular in Selenium, Appium, and API testing frameworks.

# HyperExecute Extent Report

Extent Reports is a popular reporting framework for Java, TestNG, and Selenium tests. It provides a comprehensive set of features for reporting test results, including detailed test case summaries, screenshots and videos of test execution, execution logs, and charts and graphs to analyze test results..
## Steps to Generate Extent Reports `(Version <= 2)` on HyperExecute
Follow these steps to enable Extent Reports for your HyperExecute job:

### Prerequisites
### Step 1: Add Dependency
If using Maven, add the following dependency to your `pom.xml` file:

1. Upgrade to extent reporting version 5 in the `pom.xml` file.
2. Update import statements in the codebase from `com.relevantcodes` (version 2) to `com.aventstack` (version 5).
```xml title="pom.xml"
<dependency>
<groupId>com.relevantcodes</groupId>
<artifactId>extentreports</artifactId>
<version>2.41.2</version>
</dependency>
```

## Implementation Steps
### Step 2: Create an Extent Report Listener
Create a class, e.g., `ExtentReportListenerV2.java`, to initialize and flush Extent Reports during test execution. This listener will log each test case’s status to the report.

```java title="ExtentReportListenerV2.java"
import com.relevantcodes.extentreports.ExtentReports;
import com.relevantcodes.extentreports.ExtentTest;
import com.relevantcodes.extentreports.LogStatus;
import org.testng.ITestContext;
import org.testng.ITestListener;
import org.testng.ITestResult
public class ExtentReportListenerV2 implements ITestListener {
private static ExtentReports extent;
private static ThreadLocal<ExtentTest> test = new ThreadLocal<>()
@Override
public void onStart(ITestContext context) {
// Initialize ExtentReports with the report path
extent = new ExtentReports("extent-report.html", true);
extent.addSystemInfo("Environment", "QA").addSystemInfo("User", "Tester");
}
```
---
## Steps to Generate Extent Reports `(Version > 2)` on HyperExecute
Follow these steps to enable Extent Reports for your HyperExecute job:

### 1. Upgrade Extent Reporting Version

Update the `pom.xml` file to include the latest version of the Extent Reporting library (version 5). Ensure that the necessary dependencies are correctly configured.
### Step 1: Add Dependency
If using Maven, add the latest extentreports dependency to `pom.xml` file:

```xml
```xml title="pom.xml"
<dependency>
<groupId>com.aventstack</groupId>
<artifactId>extentreports</artifactId>
<version>5.0.0</version>
<groupId>com.aventstack</groupId>
<artifactId>extentreports</artifactId>
<version>5.0.9</version> <!-- Use latest version available -->
</dependency>
```

### 2. Modify Import Statements
### Step 2: Create an Extent Report Listener
For Extent Reports > 2, use `ExtentHtmlReporter` to generate and customize the HTML report. Create `ExtentReportListener.java`:

Update import statements in your codebase to reflect the new package structure in Extent Reporting version 5. Replace `com.relevantcodes` with `com.aventstack`.

```java
// Before
import com.relevantcodes.extentreports.ExtentReports;
import com.relevantcodes.extentreports.ExtentTest;

// After
```java title="ExtentReportListener.java"
import com.aventstack.extentreports.ExtentReports;
import com.aventstack.extentreports.ExtentTest;
import com.aventstack.extentreports.reporter.ExtentHtmlReporter;
import com.aventstack.extentreports.reporter.configuration.Theme;
import org.testng.ITestContext;
import org.testng.ITestListener;
import org.testng.ITestResult
public class ExtentReportListener implements ITestListener {
private static ExtentReports extent;
private static ThreadLocal<ExtentTest> test = new ThreadLocal<>()
@Override
public void onStart(ITestContext context) {
ExtentHtmlReporter htmlReporter = new ExtentHtmlReporter("extent-report.html");
htmlReporter.config().setTheme(Theme.STANDARD);
htmlReporter.config().setDocumentTitle("Test Report");
htmlReporter.config().setReportName("Automation Test Results")
extent = new ExtentReports();
extent.attachReporter(htmlReporter);
}
```

### 3. Generate JSON Reports

Make changes in your codebase to generate individual JSON reports. These reports will serve as the source for the Extent Reports.

### 4. Update HyperExecute YAML Configuration

In the HyperExecute YAML configuration, add the following section to instruct the HyperExecute systems to generate Extent Reports:
## Configure the HyperExecute YAML File
In your HyperExecute YAML configuration, define the [`report`](https://www.lambdatest.com/support/docs/deep-dive-into-hyperexecute-yaml/#report) parameters like this:

```yaml
report: true
Expand All @@ -92,7 +123,3 @@ partialReports:
```

<img loading="lazy" src={require('../assets/images/hyperexecute/knowledge-base/reports/extent.png').default} alt="Image" className="doc_img"/>

## Conclusion

By following these steps, your HyperExecute job will generate Extent Reports, providing a consolidated HTML report derived from individual JSON reports. This enhancement allows customers to access comprehensive and standardized reports conveniently at the conclusion of their HyperExecute jobs.
7 changes: 2 additions & 5 deletions docs/native-extent-report.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
id: native-extent-report
title: Native Extent Report on HyperExecute
hide_title: true
title: Native Extent Report
hide_title: false
sidebar_label: Extent Native
description: Learn how to generate Native Extent Report on lambdatest and download the reports from the dashboard
keywords:
Expand Down Expand Up @@ -37,9 +37,6 @@ slug: native-extent-report/
})
}}
></script>

# HyperExecute Extent Native Report

The Extent Native Reports offer a standardized and easily accessible summary of information extracted from raw Extent reports per Virtual Machine (VM) at the end of a HyperExecute job.

### Prerequisites
Expand Down
8 changes: 2 additions & 6 deletions docs/specflow-report.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
id: specflow-report
title: SpecFlow Report on HyperExecute
hide_title: true
title: SpecFlow Report
hide_title: false
sidebar_label: SpecFlow
description: Learn how to generate SpecFlow Report on lambdatest and download the reports from the dashboard
keywords:
Expand Down Expand Up @@ -35,11 +35,7 @@ slug: specflow-report/
})
}}
></script>

# SpecFlow Reports

SpecFlow is a free tool for automating tests using BDD. It's often used to create automation scripts for .NET projects.

This technical document provides a guide on generating SpecFlow reports after executing tests on HyperExecute.

## Steps to Generate Cucumber Reports on HyperExecute
Expand Down
Loading