Class CucumberTestStepHelper

java.lang.Object
de.qytera.qtaf.cucumber.helper.CucumberTestStepHelper

public class CucumberTestStepHelper extends Object
Helper class for extracting information from Cucumber TestStep objects
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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
    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
    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
    static List<Integer>
    getTestStepPositions(List<io.cucumber.plugin.event.TestStep> testSteps)
    Get the positions of test steps (Given, When, Then).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public static List<Integer> getTestStepPositions(List<io.cucumber.plugin.event.TestStep> testSteps)
      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 steps
      testStep - 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 objects
      stepId - Look for this ID inside attributeName
      attributeName - Attribute name where to look for ID
      Returns:
      TestStep object on success, null otherwise