Package io.cucumber.core.plugin.report
Class FeatureExecutionMonitor
java.lang.Object
io.cucumber.core.plugin.report.FeatureExecutionMonitor
This class is responsible for monitoring the execution of feature files in a Cucumber test suite.
It keeps track of the currently executing feature file and clears test variables when a new
feature file starts executing.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThis method returns the URI of the currently executing feature file.voidstartTestCase(io.cucumber.plugin.event.TestCaseStarted testCaseStartedEvent) This method is called at the start of each test case.voidThis method is called at the start of the test run.voidThis method is called at the end of the test run.
-
Constructor Details
-
FeatureExecutionMonitor
public FeatureExecutionMonitor()
-
-
Method Details
-
startTestRun
public void startTestRun()This method is called at the start of the test run. It initializes the currentFeatureFile to null. -
getCurrentFeatureFile
This method returns the URI of the currently executing feature file.- Returns:
- Optional containing the URI of the current feature file, or an empty Optional if no feature file is currently executing.
-
startTestCase
public void startTestCase(io.cucumber.plugin.event.TestCaseStarted testCaseStartedEvent) This method is called at the start of each test case. It updates the currentFeatureFile to the URI of the feature file of the currently executing test case. If a new feature file starts executing, it clears the test variables.- Parameters:
testCaseStartedEvent- The event triggered at the start of a test case.
-
stopTestRun
public void stopTestRun()This method is called at the end of the test run. It clears the test variables.
-