Class CucumberTagHelper

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

public class CucumberTagHelper extends Object
Class that provides helper methods for extracting information from cucumber tags
  • Constructor Details

    • CucumberTagHelper

      public CucumberTagHelper()
  • Method Details

    • isKeyValuePair

      public static boolean isKeyValuePair(String s)
      Check if a given string is a key-value-pair (matches keyValueRegex)
      Parameters:
      s - string
      Returns:
      true if string is a key-value-pair, false otherwise
    • isTag

      public static boolean isTag(String s)
      Check if a given string is a tag
      Parameters:
      s - string
      Returns:
      true if string is a tag
    • getKeyAndValueMatch

      public static Matcher getKeyAndValueMatch(String s)
      Extract hey and value from a string
      Parameters:
      s - string
      Returns:
      Matcher object
    • getKeyValuePairsFromTagList

      public static Map<String,String> getKeyValuePairsFromTagList(List<io.cucumber.messages.types.Tag> tags)
      Get a list of key-value pairs from a list of cucumber tag objects
      Parameters:
      tags - List of cucumber tag objects
      Returns:
      Map of key-value-pairs
    • getKeyValuePairs

      public static Map<String,String> getKeyValuePairs(List<String> tags)
      Get a list of key-value pairs from a list of cucumber tag strings
      Parameters:
      tags - List of cucumber tag strings
      Returns:
      Map of key-value-pairs
    • getKeyValueListPairs

      public static Map<String,List<String>> getKeyValueListPairs(List<String> tags)
      Get a key-value-list pairs from a list of cucumber tag strings
      Parameters:
      tags - List of cucumber tag strings
      Returns:
      Map of key-value-lists
    • getTestId

      public static String getTestId(List<String> tags)
      Find the tag that represents the test ID and extracts the test ID
      Parameters:
      tags - List of cucumber tags
      Returns:
      test ID