Class XrayConfigHelper

java.lang.Object
de.qytera.qtaf.xray.config.XrayConfigHelper

public class XrayConfigHelper extends Object
Xray configuration helper.
  • Field Details

    • XRAY_ENABLED

      public static final String XRAY_ENABLED
      The selector describing whether the Xray plugin is enabled or disabled.
      See Also:
    • XRAY_SERVICE

      public static final String XRAY_SERVICE
      The selector describing whether to use an Xray cloud or an Xray server instance.
      See Also:
    • URL_XRAY_SELECTOR

      public static final String URL_XRAY_SELECTOR
      The selector for accessing the configured Xray URL.
      See Also:
    • URL_JIRA_SELECTOR

      public static final String URL_JIRA_SELECTOR
      The selector for accessing the configured Jira URL.
      See Also:
    • PROJECT_KEY

      public static final String PROJECT_KEY
      The selector for accessing the configured Jira project key.
      See Also:
    • AUTHENTICATION_XRAY_CLIENT_ID

      public static final String AUTHENTICATION_XRAY_CLIENT_ID
      The selector for accessing the configured Xray client ID.
      See Also:
    • AUTHENTICATION_XRAY_CLIENT_SECRET

      public static final String AUTHENTICATION_XRAY_CLIENT_SECRET
      The selector for accessing the configured Xray client secret.
      See Also:
    • AUTHENTICATION_XRAY_BEARER_TOKEN

      public static final String AUTHENTICATION_XRAY_BEARER_TOKEN
      The selector for accessing the configured Xray PAT.
      See Also:
    • AUTHENTICATION_JIRA_USERNAME

      public static final String AUTHENTICATION_JIRA_USERNAME
      The selector for accessing the configured Jira username.
      See Also:
    • AUTHENTICATION_JIRA_API_TOKEN

      public static final String AUTHENTICATION_JIRA_API_TOKEN
      The selector for accessing the configured Jira PAT.
      See Also:
    • RESULTS_UPLOAD_ASSIGNEE

      public static final String RESULTS_UPLOAD_ASSIGNEE
      The selector for accessing the configured assignee to assign text execution issues to.
      See Also:
    • RESULTS_UPLOAD_TEST_PLAN_KEY

      public static final String RESULTS_UPLOAD_TEST_PLAN_KEY
      The selector for accessing the configured test plan key to assign text execution issues to.
      See Also:
    • RESULTS_UPLOAD_SCENARIO_REPORT_EVIDENCE

      public static final String RESULTS_UPLOAD_SCENARIO_REPORT_EVIDENCE
      The selector for accessing whether to upload HTML reports as evidence to test execution issues.
      See Also:
    • RESULTS_UPLOAD_SCENARIO_IMAGE_EVIDENCE

      public static final String RESULTS_UPLOAD_SCENARIO_IMAGE_EVIDENCE
      The selector for accessing whether to upload screenshots as evidence to test execution issues.
      See Also:
    • RESULTS_UPLOAD_CUSTOM_STATUS_TEST_EXECUTION_ISSUE_PASSED

      public static final String RESULTS_UPLOAD_CUSTOM_STATUS_TEST_EXECUTION_ISSUE_PASSED
      The selector for accessing the custom status for passed test executions.
      See Also:
    • RESULTS_UPLOAD_CUSTOM_STATUS_TEST_EXECUTION_ISSUE_FAILED

      public static final String RESULTS_UPLOAD_CUSTOM_STATUS_TEST_EXECUTION_ISSUE_FAILED
      The selector for accessing the custom status for failed test executions.
      See Also:
    • RESULTS_UPLOAD_CUSTOM_STATUS_TEST_PASSED

      public static final String RESULTS_UPLOAD_CUSTOM_STATUS_TEST_PASSED
      The selector for accessing the custom status for passed tests.
      See Also:
    • RESULTS_UPLOAD_CUSTOM_STATUS_TEST_FAILED

      public static final String RESULTS_UPLOAD_CUSTOM_STATUS_TEST_FAILED
      The selector for accessing the custom status for failed tests.
      See Also:
    • RESULTS_UPLOAD_CUSTOM_STATUS_TEST_PENDING

      public static final String RESULTS_UPLOAD_CUSTOM_STATUS_TEST_PENDING
      The selector for accessing the custom status for pending tests.
      See Also:
    • RESULTS_UPLOAD_CUSTOM_STATUS_TEST_SKIPPED

      public static final String RESULTS_UPLOAD_CUSTOM_STATUS_TEST_SKIPPED
      The selector for accessing the custom status for skipped tests.
      See Also:
    • RESULTS_UPLOAD_CUSTOM_STATUS_STEP_PASSED

      public static final String RESULTS_UPLOAD_CUSTOM_STATUS_STEP_PASSED
      The selector for accessing the custom status for passed steps.
      See Also:
    • RESULTS_UPLOAD_CUSTOM_STATUS_STEP_FAILED

      public static final String RESULTS_UPLOAD_CUSTOM_STATUS_STEP_FAILED
      The selector for accessing the custom status for failed steps.
      See Also:
    • RESULTS_UPLOAD_CUSTOM_STATUS_STEP_PENDING

      public static final String RESULTS_UPLOAD_CUSTOM_STATUS_STEP_PENDING
      The selector for accessing the custom status for pending steps.
      See Also:
    • RESULTS_UPLOAD_CUSTOM_STATUS_STEP_SKIPPED

      public static final String RESULTS_UPLOAD_CUSTOM_STATUS_STEP_SKIPPED
      The selector for accessing the custom status for skipped steps.
      See Also:
    • RESULTS_UPLOAD_CUSTOM_STATUS_STEP_UNDEFINED

      public static final String RESULTS_UPLOAD_CUSTOM_STATUS_STEP_UNDEFINED
      The selector for accessing the custom status for undefined steps.
      See Also:
    • RESULTS_UPLOAD_TESTS_INFO_STEPS_UPDATE

      public static final String RESULTS_UPLOAD_TESTS_INFO_STEPS_UPDATE
      The selector for accessing whether test steps should be updated.
      See Also:
    • RESULTS_UPLOAD_TESTS_INFO_STEPS_MERGE

      public static final String RESULTS_UPLOAD_TESTS_INFO_STEPS_MERGE
      The selector for accessing whether test steps should be merged.
      See Also:
    • RESULTS_UPLOAD_TESTS_INFO_KEEP_JIRA_SUMMARY

      public static final String RESULTS_UPLOAD_TESTS_INFO_KEEP_JIRA_SUMMARY
      The selector for accessing whether test issue summaries should be pulled from Jira.
      See Also:
    • RESULTS_UPLOAD_TESTS_ITERATIONS_PARAMETERS_MAX_LENGTH_NAME

      public static final String RESULTS_UPLOAD_TESTS_ITERATIONS_PARAMETERS_MAX_LENGTH_NAME
      The selector for accessing the maximum name length of test iteration parameters.
      See Also:
    • RESULTS_UPLOAD_TESTS_ITERATIONS_PARAMETERS_MAX_LENGTH_VALUE

      public static final String RESULTS_UPLOAD_TESTS_ITERATIONS_PARAMETERS_MAX_LENGTH_VALUE
      The selector for accessing the maximum value length of test iteration parameters.
      See Also:
    • XRAY_SERVICE_CLOUD

      public static final String XRAY_SERVICE_CLOUD
      The value the plugin uses to determine that Xray cloud should be targeted.
      See Also:
    • XRAY_SERVICE_SERVER

      public static final String XRAY_SERVICE_SERVER
      The value the plugin uses to determine that Xray server should be targeted.
      See Also:
  • Method Details

    • isEnabled

      public static boolean isEnabled()
      Returns whether the Xray plugin is enabled. Defaults to false if the value has not been specified.
      Returns:
      whether the plugin is enabled or false by default
    • getAuthenticationXrayBearerToken

      public static String getAuthenticationXrayBearerToken()
      Returns the bearer token for authenticating against Xray server.
      Returns:
      the bearer token or null if undefined
    • getAuthenticationXrayClientId

      public static String getAuthenticationXrayClientId()
      Returns the client id for authenticating against Xray cloud.
      Returns:
      the client id or null if undefined
    • getAuthenticationXrayClientSecret

      public static String getAuthenticationXrayClientSecret()
      Returns the client secret for authenticating against Xray cloud.
      Returns:
      the client secret or null if undefined
    • getAuthenticationJiraUsername

      public static String getAuthenticationJiraUsername()
      Returns the username for authenticating against the Jira instance's REST API.
      Returns:
      the username or null if undefined
    • getAuthenticationJiraAPIToken

      public static String getAuthenticationJiraAPIToken()
      Returns the API token used during authentication against the Jira instance's REST API.
      Returns:
      the API token or null if undefined
    • getServerUrl

      public static String getServerUrl()
      Get Xray server URL.
      Returns:
      Xray server URL
    • getJiraUrl

      public static String getJiraUrl()
      Returns the URL of the underlying Jira instance.
      Returns:
      the Jira URL or null if undefined
    • getResultsUploadCustomStatusTestExecutionIssuePassed

      public static String getResultsUploadCustomStatusTestExecutionIssuePassed()
      Returns the Jira test execution issue status for successful test runs.
      Returns:
      the status if configured, otherwise null
    • getResultsUploadCustomStatusTestExecutionIssueFailed

      public static String getResultsUploadCustomStatusTestExecutionIssueFailed()
      Returns the Jira test execution issue status for test runs containing failed tests.
      Returns:
      the status if configured, otherwise null
    • getTestStatusPassed

      public static String getTestStatusPassed()
      Get Xray status name for passed tests.
      Returns:
      the status name if configured, otherwise null
    • getTestStatusFailed

      public static String getTestStatusFailed()
      Get Xray status name for failed tests.
      Returns:
      the status name if configured, otherwise null
    • getTestStatusPending

      public static String getTestStatusPending()
      Get Xray status name for pending tests.
      Returns:
      the status name if configured, otherwise null
    • getTestStatusSkipped

      public static String getTestStatusSkipped()
      Get Xray status name for skipped tests.
      Returns:
      the status name if configured, otherwise null
    • getStepStatusPassed

      public static String getStepStatusPassed()
      Get Xray status name for passed test steps.
      Returns:
      the status name if configured, otherwise null
    • getStepStatusFailed

      public static String getStepStatusFailed()
      Get Xray status name for failed test steps.
      Returns:
      the status name if configured, otherwise null
    • getStepStatusPending

      public static String getStepStatusPending()
      Get Xray status name for pending test steps.
      Returns:
      the status name if configured, otherwise null
    • getStepStatusSkipped

      public static String getStepStatusSkipped()
      Get Xray status name for skipped test steps.
      Returns:
      the status name if configured, otherwise null
    • getStepStatusUndefined

      public static String getStepStatusUndefined()
      Get Xray status name for undefined test steps.
      Returns:
      the status name if configured, otherwise null
    • getXrayService

      public static String getXrayService()
      Get xray service (cloud | server).
      Returns:
      xray service (cloud | server)
    • isXrayServerService

      public static boolean isXrayServerService()
      Check if Xray server is enabled.
      Returns:
      true if enabled, false otherwise
    • isXrayCloudService

      public static boolean isXrayCloudService()
      Check if Xray cloud is enabled.
      Returns:
      true if enabled, false otherwise
    • isScenarioReportEvidenceEnabled

      public static boolean isScenarioReportEvidenceEnabled()
      Check if HTML report should be attached as evidence to Xray test execution import.
      Returns:
      true if enabled, false otherwise
    • isScenarioImageEvidenceEnabled

      public static boolean isScenarioImageEvidenceEnabled()
      Check if images should be attached as evidence to Xray test execution import.
      Returns:
      true if enabled, false otherwise
    • getTestsIterationsParametersNameMaxLength

      public static Integer getTestsIterationsParametersNameMaxLength()
      Returns the maximum allowed length of iteration parameter names.
      Returns:
      the maximum length or null if there is no maximum length
    • getTestsIterationsParametersValueMaxLength

      public static Integer getTestsIterationsParametersValueMaxLength()
      Returns the maximum allowed length of iteration parameter values.
      Returns:
      the maximum length or null if there is no maximum length
    • shouldResultsUploadTestsInfoStepsMerge

      public static boolean shouldResultsUploadTestsInfoStepsMerge()
      Returns whether test issue steps should be merged into a single step during results upload.
      Returns:
      whether they should be merged
    • shouldResultsUploadTestsInfoStepsUpdate

      public static boolean shouldResultsUploadTestsInfoStepsUpdate()
      Returns whether test issue steps should be updated during results upload of tests.
      Returns:
      whether they should be updated
    • shouldResultsUploadTestsInfoKeepJiraSummary

      public static boolean shouldResultsUploadTestsInfoKeepJiraSummary()
      Returns whether test issue summaries should be kept as they are in Jira instead of replacing them using Test.testName() during results upload.
      Returns:
      whether summaries should be kept
    • getProjectKey

      public static String getProjectKey()
      Returns the project key.
      Returns:
      the configured project key
    • getResultsUploadTestPlanKey

      public static String getResultsUploadTestPlanKey()
      Returns the test plan key to attach execution results to.
      Returns:
      the configured test plan key or null if no test plan has been defined
    • getResultsUploadAssignee

      public static String getResultsUploadAssignee()
      Returns the user to assign the created test execution issue to.
      Returns:
      the configured user or null if no user has been configured