|
1 | 1 | --- |
2 | 2 | id: cucumber-report |
3 | | -title: Cucumber Report on HyperExecute |
4 | | -hide_title: true |
| 3 | +title: Cucumber Report |
| 4 | +hide_title: false |
5 | 5 | sidebar_label: Cucumber |
6 | 6 | description: Learn how to generate Cucumber Report on lambdatest and download the reports from the dashboard |
7 | 7 | keywords: |
8 | 8 | - cucumber testing reports |
9 | 9 | - cucumber testing lambdatest |
10 | | - |
11 | 10 | url: https://www.lambdatest.com/support/docs/cucumber-report/ |
12 | 11 | site_name: LambdaTest |
13 | 12 | slug: cucumber-report/ |
@@ -35,41 +34,47 @@ slug: cucumber-report/ |
35 | 34 | }) |
36 | 35 | }} |
37 | 36 | ></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. |
38 | 38 |
|
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. |
40 | 40 |
|
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 |
45 | 42 |
|
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: |
55 | 45 |
|
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 | +``` |
58 | 58 |
|
59 | | -This involves creating a class that implements/extends the standard formatter interface. |
| 59 | +Explanation of plugin Options: |
60 | 60 |
|
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. |
62 | 65 |
|
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: |
64 | 68 |
|
65 | | -```bash |
| 69 | +```yaml title="hyperexecute.yaml" |
66 | 70 | report: true |
67 | 71 | partialReports: |
68 | 72 | location: target/cucumber-reports/ |
69 | 73 | frameworkName: cucumber |
70 | 74 | type: json |
71 | 75 | ``` |
72 | 76 |
|
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. |
74 | 79 |
|
75 | 80 | <img loading="lazy" src={require('../assets/images/hyperexecute/knowledge-base/reports/cucumber.png').default} alt="Image" className="doc_img"/> |
0 commit comments