Skip to content

Commit f8cebf2

Browse files
authored
Merge pull request #1057 from Aman1905/stage
cucumber reports
2 parents 63b4067 + 7acf1e3 commit f8cebf2

File tree

2 files changed

+29
-24
lines changed

2 files changed

+29
-24
lines changed
11.4 KB
Loading

docs/cucumber-report.md

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
---
22
id: cucumber-report
3-
title: Cucumber Report on HyperExecute
4-
hide_title: true
3+
title: Cucumber Report
4+
hide_title: false
55
sidebar_label: Cucumber
66
description: Learn how to generate Cucumber Report on lambdatest and download the reports from the dashboard
77
keywords:
88
- cucumber testing reports
99
- cucumber testing lambdatest
10-
1110
url: https://www.lambdatest.com/support/docs/cucumber-report/
1211
site_name: LambdaTest
1312
slug: cucumber-report/
@@ -35,41 +34,47 @@ slug: cucumber-report/
3534
})
3635
}}
3736
></script>
37+
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.
3838

39-
# Cucumber Reports
39+
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.
4040

41-
Cucumber uses reporter plugins to produce reports that contain information about what scenarios have passed or failed.
42-
43-
## Built-in Reporters
44-
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.
41+
## Steps to Generate Cucumber Reports on HyperExecute
4542

46-
Following are some of the built-in reporters:
47-
- message
48-
- progress
49-
- pretty
50-
- html
51-
- json
52-
- rerun
53-
- junit
54-
- testng
43+
### Step 1: Configure the TestRunner File
44+
In your `TestRunner` file, configure `@CucumberOptions` to specify report formats and output paths. Here’s an example configuration:
5545

56-
## Custom Reporters
57-
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.
46+
```javascript
47+
@CucumberOptions(
48+
features = "src/main/java/Features",
49+
glue = {"Steps"},
50+
tags = {"~@Ignore"},
51+
format = {
52+
"pretty",
53+
"html:target/cucumber-reports/cucumber-pretty",
54+
"json:target/cucumber-reports/CucumberTestReport.json",
55+
"rerun:target/cucumber-reports/rerun.txt"
56+
},plugin = "json:target/cucumber-reports/CucumberTestReport.json")
57+
```
5858

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

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

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

65-
```bash
69+
```yaml title="hyperexecute.yaml"
6670
report: true
6771
partialReports:
6872
location: target/cucumber-reports/
6973
frameworkName: cucumber
7074
type: json
7175
```
7276
73-
**Step 2:** Now execute your job by triggering the HyperExecute CLI. You can visit the HyperExecute dashboard to download the report after job completion.
77+
### Step 3: Execute Your Tests
78+
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.
7479
7580
<img loading="lazy" src={require('../assets/images/hyperexecute/knowledge-base/reports/cucumber.png').default} alt="Image" className="doc_img"/>

0 commit comments

Comments
 (0)