Package io.karatelabs.output
Class CucumberJsonReportListener
java.lang.Object
io.karatelabs.output.CucumberJsonReportListener
- All Implemented Interfaces:
ResultListener
A
ResultListener that generates Cucumber JSON reports asynchronously.
This listener writes per-feature Cucumber JSON files as features complete using
a single-thread executor. Each feature produces a separate JSON file named
{packageQualifiedName}.json. This approach:
- Does not block test execution during report generation
- 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.voidonSuiteEnd(SuiteResult result) Called when the suite 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
-
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
-
onSuiteEnd
Description copied from interface:ResultListenerCalled when the suite completes execution.- Specified by:
onSuiteEndin interfaceResultListener- Parameters:
result- the final suite result
-