Interface ITestManagementService


public interface ITestManagementService
Since:
3.6.0
Author:
Miroslav Ruza
  • Field Details

  • Method Details

    • createOrFindTestCaseWorkItem

      IWorkItem createOrFindTestCaseWorkItem(String projectId, String testCaseId, IWorkItem template)
      Finds a Work Item in the specified project with the type specified by TestsConfiguration.getTestCaseWorkItemType() that has the same value in the custom field specified by TestsConfiguration.getTestCaseIdCustomField() as the testCaseId parameter. When there is no such Work Item, then the method creates a new Work Item and sets the value of the testCaseId parameter to the above mentioned custom field.
      Parameters:
      projectId - The id of the project that the Work Item should be searched/created in.
      testCaseId - The id of the test case, for example from an xUnit file, not the ID of the Work Item.
      template - When null, then the template defined in configuration is used.
      Returns:
      never returns null or an unresolvable Work Item.
      See Also:
    • isAutomatedTestCase

      boolean isAutomatedTestCase(IWorkItem workItem)
      Checks if the given Work Item was created by the createOrFindTestCaseWorkItem(String, String, IWorkItem) method by checking if it has a populated custom field that is fille-in by the createOrFindTestCaseWorkItem(String, String, IWorkItem) method.
      See Also:
    • createTestsFileProcessor

      ITestsFileProcessor createTestsFileProcessor(String projectId, String id)
      Creates a tests file processor.
      Parameters:
      projectId - The project where the test run will be created.
      id - The id of the processor.
      Returns:
      returns null when a processor with the given id does not exist.
      See Also:
    • getTestRun

      ITestRun getTestRun(String projectId, String id)
      Returns a Test Run from the specified project with the specified id.
      Parameters:
      projectId -
      id -
      Returns:
      never returns null, but the returned Test Run might be unresolvable.
    • getTestRun

      @NotNull ITestRun getTestRun(@NotNull String projectId, @NotNull String id, @Nullable String revision)
      Returns a Test Run from the specified project with the specified id and revision.
      Parameters:
      projectId -
      id -
      revision - - The Test Run's revision. If null then the head revision.
      Returns:
      never returns null, but the returned Test Run might be unresolvable.
      Since:
      3.10.0
    • getLightweightTestRun

      @Deprecated ITestRun getLightweightTestRun(String projectId, String id)
      Deprecated.
      Since 3.10.3, now equivalent to getTestRun(String, String). The system property DO_NOT_USE_LIGHTWEIGHT_TESTRUN no longer has an effect.
    • createTestRun

      @NotNull ITestRun createTestRun(@NotNull String projectId, @NotNull String id, @Nullable String templateId)
      Creates an unsaved Test Run in the specified project with the specified id and initializes it from the specified template. IPObject.save() must be called on the returned object after the caller has finished setting the fields.
      Parameters:
      projectId -
      id - Is ignored when the generated id functionality is turned on.
      templateId - The id of the Test Run template. Can be null.
    • createTestRun

      @NotNull ITestRun createTestRun(@NotNull String projectId, @NotNull String id, @Nullable String templateId, boolean asTemplate)
      Creates an unsaved Test Run in the specified project with the specified id and initializes it from the specified template. IPObject.save() must be called on the returned object after the caller is finished setting the fields.
      Parameters:
      projectId -
      id - Is ignored when the generated id functionality is turned on.
      templateId - The id of the Test Run template. Can be null.
      asTemplate -
      Since:
      3.9.1
    • searchTestRuns

      List<ITestRun> searchTestRuns(String query, String sort, int resultLimit)
      Searches for Test Runs matching the query.
      Parameters:
      query -
      sort -
      resultLimit - The maximum size of the returned list. A negative number means that there is no limit.
      Returns:
      a IPObjectList containing the result of the query.
      See Also:
    • searchTestRunTemplates

      List<ITestRun> searchTestRunTemplates(String query, String sort, int resultLimit)
      Searches for Test Run templates matching the query.
      Parameters:
      query -
      sort -
      resultLimit - The maximum size of the returned list. A negative number means that there is no limit.
      Returns:
      a IPObjectList containing the result of the query.
      See Also:
    • searchTestRecords

      @Deprecated List<ITestRecord> searchTestRecords(String query, String sort, int limit)
      Deprecated.
      since 3.8.1 with no direct replacement.
    • getLastTestRecords

      List<ITestRecord> getLastTestRecords(IWorkItem testCase, int count)
      Returns the latest Test Records by execution time for the test case. (The most recent are first.)
      Parameters:
      testCase -
      count - How many of the latest Test Records should be returned. Must be greater than zero.
    • createTestResultsImportJobUnit

      ITestResultsImportJobUnit createTestResultsImportJobUnit()
    • getRunningTestResultsImportJobUnit

      ITestResultsImportJobUnit getRunningTestResultsImportJobUnit(ITestRun testRun)
      Finds the Test Run's currently running, but incomplete, Test Results import job. Returns null if no such job is running.
      Parameters:
      testRun -
      Returns:
      job unit or null
    • isConfigurationDefined

      boolean isConfigurationDefined(@Nullable String projectId)
      Parameters:
      projectId - The project id, or null for the global configuration.
      Returns:
      true if a test configuration is defined.
    • getConfiguration

      @NotNull TestsConfiguration getConfiguration(@Nullable String projectId)
      Returns the test configuration that also contains the generic TestRunsConfiguration. Use getTestRunsConfiguration(String, String) to get the type-specific Test Runs configuration.
      Parameters:
      projectId - The project id, or null for the global configuration.
    • saveConfiguration

      void saveConfiguration(@Nullable String projectId, @Nullable TestsConfiguration configuration)
      Saves the tests configuration and the contained generic TestRunsConfiguration.
      Parameters:
      projectId - The project id, or null for the global configuration.
      configuration -
    • getTestRunsConfiguration

      @NotNull TestRunsConfiguration getTestRunsConfiguration(@Nullable String projectId, @Nullable String typeId)
      Returns the Test Run configuration for the given Test Run type.
      Parameters:
      projectId - The project id, or null for the global configuration.
      typeId - The Test Run type id, or null for the generic configuration.
      Since:
      3.10.1
    • getTestRecordResultEnum

      IEnumeration getTestRecordResultEnum(String projectId)
      Returns:
      configured enumeration for ITestRecord.KEY_RESULT
    • getTestRunTypeEnum

      IEnumeration getTestRunTypeEnum(String projectId)
      Returns:
      configured enumeration for IWorkflowObject.KEY_TYPE
    • getTestRunStatusEnum

      IEnumeration getTestRunStatusEnum(String projectId)
      Returns:
      configured enumeration for IWorkflowObject.KEY_TYPE
    • getConfiguredDefectToTestCaseLinkRole

      ILinkRoleOpt getConfiguredDefectToTestCaseLinkRole(String projectId)
      Returns:
      configured enumeration for ILinkedWorkItemStruct.KEY_ROLE of the link from defect to test case
    • getPolicy

    • getTestSteps

      ITestSteps getTestSteps(IWorkItem testCase)
      Since:
      3.6.3
    • setTestSteps

      void setTestSteps(IWorkItem testCase, ITestSteps testSteps)
      Since:
      3.6.3
    • getTestStepsCustomField

      ICustomField getTestStepsCustomField(IWorkItem testCase)
      Since:
      3.6.3
    • getTestStepsCustomField

      ICustomField getTestStepsCustomField(String projectId, String wiType)
      Since:
      3.6.3
    • getTestStepsKeys

      @NotNull List<ITestStepKeyOpt> getTestStepsKeys(@Nullable String projectId)
      Returns the default Test Step keys for all Work Item types.
      Since:
      3.6.3
    • getTestStepsKeys

      @NotNull List<ITestStepKeyOpt> getTestStepsKeys(@Nullable String projectId, @Nullable String wiType)
      Returns Test Step keys for a specific Work Item type.
      Since:
      3.23.10
    • deleteTestRuns

      void deleteTestRuns(@NotNull Collection<ITestRun> testRuns)
      Deletes the Test Runs specified in the input set.
      Parameters:
      testRuns - A set of Test Runs to be deleted. Does not accept null
      Since:
      3.8.1
    • testParametersLibrary

      @NotNull IScopeSelector<IParametersLibrary> testParametersLibrary()
      Returns the project level test parameter library.

      The global library is not supported, so using IScopeSelector.global() or IScopeSelector.forProject(String) with a null value returns an empty library.
      Since:
      3.9.2
    • trackDefectByRules

      @NotNull ITrackDefectByRulesBuilder trackDefectByRules()
      Creates a builder for the processing of test failures into tracked defects.
      Since:
      3.17.3