Package io.karatelabs.core
Interface RunEvent
- All Known Implementing Classes:
ErrorRunEvent,FeatureRunEvent,HttpRunEvent,OutlineRunEvent,ProgressRunEvent,ScenarioRunEvent,StepRunEvent,SuiteRunEvent
public interface RunEvent
Base interface for runtime events fired during test execution.
Extensible - plugins and extensions can implement this interface to contribute
custom events to the central event bus.
Usage with pattern matching:
listener = event -> switch (event) {
case FeatureRunEvent e -> handleFeature(e.source(), e.result());
case ScenarioRunEvent e -> handleScenario(e.source(), e.result());
case StepRunEvent e -> handleStep(e.step(), e.result());
default -> true; // Handle unknown event types gracefully
};
-
Method Details
-
getType
RunEventType getType()Returns the event type. -
getTimeStamp
long getTimeStamp()Returns the timestamp when this event occurred (epoch milliseconds). -
toJson
Serializes this event to a map for JSONL output.
-