Package io.karatelabs.output
Class CucumberJsonReportListener
java.lang.Object
io.karatelabs.output.CucumberJsonReportListener
- All Implemented Interfaces:
ResultListener
A
ResultListener that generates Cucumber JSON reports.
This listener writes each feature's Cucumber JSON file as that feature completes.
Each feature produces a separate JSON file named
{packageQualifiedName}.json. This approach:
- Makes partial results available as tests complete
- Compatible with third-party tools (Allure, ReportPortal, etc.)
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCucumberJsonReportListener(Path outputDir) Create a new Cucumber JSON report listener. -
Method Summary
Modifier and TypeMethodDescriptionvoidonFeatureEnd(FeatureResult result) Called when a feature completes execution.voidonSuiteStart(Suite suite) Called when the suite starts execution.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.karatelabs.output.ResultListener
onFeatureStart, onScenarioEnd, onScenarioStart, onSuiteEnd
-
Field Details
-
SUBFOLDER
- See Also:
-
-
Constructor Details
-
CucumberJsonReportListener
Create a new Cucumber JSON report listener.- Parameters:
outputDir- the base output directory (subfolder will be created)
-
-
Method Details
-
onSuiteStart
Description copied from interface:ResultListenerCalled when the suite starts execution.- Specified by:
onSuiteStartin interfaceResultListener- Parameters:
suite- the suite about to run
-
onFeatureEnd
Description copied from interface:ResultListenerCalled when a feature completes execution.- Specified by:
onFeatureEndin interfaceResultListener- Parameters:
result- the feature result
-