Class XrayImporter

java.lang.Object
de.qytera.qtaf.xray.importer.XrayImporter

public class XrayImporter extends Object
Class that imports Test definitions from Xray API and saves them locally.
  • Method Details

    • createFeatureFileFromSingleTest

      public static void createFeatureFileFromSingleTest(XrayTestDto testDto, String filePath) throws IOException
      Create a feature file from a single test.
      Parameters:
      testDto - the test
      filePath - the feature file path
      Throws:
      IOException - if the feature file cannot be created
    • createFeatureFileFromTestSet

      public static void createFeatureFileFromTestSet(String testSetId, XrayTestDtoCollection collection, String filePath) throws IOException
      Create a feature file from a test set.
      Parameters:
      testSetId - the test set ID
      collection - the test collection
      filePath - the feature file path
      Throws:
      IOException - if the feature file cannot be created
    • getFeatureFileContentFromTestSet

      public static String getFeatureFileContentFromTestSet(String testSetId, XrayTestDtoCollection testDtoCollection, boolean newDriver)
      Get the content of a feature file corresponding to the collection of tests.
      Parameters:
      testSetId - the test set ID
      testDtoCollection - the test collection
      newDriver - the feature file path
      Returns:
      the content
    • getFeatureFileContentFromSingleTest

      public static String getFeatureFileContentFromSingleTest(XrayTestDto testDto)
      Get the content of a feature file corresponding to the test.
      Parameters:
      testDto - the test
      Returns:
      the content
    • addScenarioDefinition

      public static String addScenarioDefinition(String scenarioName, String testDefinition)
      Add a scenario definition to the content of a feature file.
      Parameters:
      scenarioName - the scenario name
      testDefinition - the test definition
      Returns:
      the content
    • addFeatureDefinition

      public static String addFeatureDefinition(String featureName, String testDefinition)
      Add a feature definition to the content of a feature file.
      Parameters:
      featureName - the feature name
      testDefinition - the feature definition
      Returns:
      the content
    • addTag

      public static String addTag(String key, String gherkin)
      Add a tag to feature file content.
      Parameters:
      key - the tag key
      gherkin - the gherkin element
      Returns:
      the tagged content
    • addTag

      public static String addTag(String key, String value, String gherkin)
      Add a tag with a value to feature file content.
      Parameters:
      key - the tag key
      value - the tag value
      gherkin - the gherkin element
      Returns:
      the tagged content
    • addGroupTagToFeatureDefinition

      public static String addGroupTagToFeatureDefinition(String featureName, String featureDefinition)
      Add a group tag to feature file content.
      Parameters:
      featureName - the feature name
      featureDefinition - the feature definition
      Returns:
      the group content