Package de.qytera.qtaf.cucumber.helper
Class CucumberTestStepHelper
java.lang.Object
de.qytera.qtaf.cucumber.helper.CucumberTestStepHelper
Helper class for extracting information from Cucumber TestStep objects
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic io.cucumber.plugin.event.TestStepfindByTestStepIdInAttribute(List<io.cucumber.plugin.event.TestStep> testSteps, UUID stepId, String attributeName) Find the TestStep object that has another TestStep object with in a List stored in its 'attributeName' Attributestatic List<io.cucumber.plugin.event.PickleStepTestStep>getPickleStepTestSteps(List<io.cucumber.plugin.event.TestStep> testSteps) Get all test steps that are derived from the PickleStepTestStep class which represents Given / When / Then stepsstatic intgetTestStepPosition(List<io.cucumber.plugin.event.TestStep> testSteps, io.cucumber.plugin.event.TestStep testStep) Get the positions of the given test step in a list of test stepsgetTestStepPositions(List<io.cucumber.plugin.event.TestStep> testSteps) Get the positions of test steps (Given, When, Then).
-
Constructor Details
-
CucumberTestStepHelper
public CucumberTestStepHelper()
-
-
Method Details
-
getPickleStepTestSteps
public static List<io.cucumber.plugin.event.PickleStepTestStep> getPickleStepTestSteps(List<io.cucumber.plugin.event.TestStep> testSteps) Get all test steps that are derived from the PickleStepTestStep class which represents Given / When / Then steps- Parameters:
testSteps- List of TestStep objects- Returns:
- List of PickleStepTestStep objects
-
getTestStepPositions
Get the positions of test steps (Given, When, Then). All test steps that are defined in a feature file are represented by the PickleStepTestStep class. This functions finds these classes and returns their positions.- Parameters:
testSteps- List of test steps- Returns:
- List of positions
-
getTestStepPosition
public static int getTestStepPosition(List<io.cucumber.plugin.event.TestStep> testSteps, io.cucumber.plugin.event.TestStep testStep) Get the positions of the given test step in a list of test steps- Parameters:
testSteps- List of test stepstestStep- Single test steps- Returns:
- TestStep position
-
findByTestStepIdInAttribute
public static io.cucumber.plugin.event.TestStep findByTestStepIdInAttribute(List<io.cucumber.plugin.event.TestStep> testSteps, UUID stepId, String attributeName) Find the TestStep object that has another TestStep object with in a List stored in its 'attributeName' Attribute- Parameters:
testSteps- List of TestStep objectsstepId- Look for this ID inside attributeNameattributeName- Attribute name where to look for ID- Returns:
- TestStep object on success, null otherwise
-