Interface ITestRun

    • Method Detail

      • getCreated

        java.util.Date getCreated()
      • getTitle

        @Nullable
        java.lang.String getTitle()
        Returns:
        title of Test Run if set.
        Since:
        3.10.1
      • setTitle

        void setTitle​(@Nullable
                      java.lang.String value)
        Sets new Test Run title.
        Since:
        3.10.1
      • getUpdated

        @Nullable
        java.util.Date getUpdated()
        Since:
        3.10.0
      • getAuthor

        IUser getAuthor()
      • getGroupId

        java.lang.String getGroupId()
      • setGroupId

        void setGroupId​(java.lang.String groupId)
      • isTemplate

        boolean isTemplate()
      • setIsTemplate

        void setIsTemplate​(boolean isTemplate)
      • getQuery

        @Nullable
        java.lang.String getQuery()
      • setQuery

        void setQuery​(java.lang.String query)
      • getDocument

        IModule getDocument()
        Since:
        3.6.2
      • setDocument

        void setDocument​(IModule document)
        Since:
        3.6.2
      • setStatus

        void setStatus​(@Nullable
                       IStatusOpt status)
      • getFinishedOn

        java.util.Date getFinishedOn()
      • setFinishedOn

        void setFinishedOn​(java.util.Date finishedOn)
      • getSummaryDefect

        IWorkItem getSummaryDefect()
      • createSummaryDefect

        IWorkItem createSummaryDefect​(IWorkItem defectTemplate)
        Creates a summary defect based on the given template and stores it to the KEY_SUMMARY_DEFECT field of the Test Run if it does not exist yet. Otherwise it just returns the existing summary defect. IPObject.save() does not need to be called on this Test Run or IPObject.save() on the returned object.
        Parameters:
        defectTemplate - When null, then a Work Item configured by TestsConfiguration.getDefectTemplate() for the project is used.
        Returns:
        the created defect Work Item.
      • updateSummaryDefect

        IWorkItem updateSummaryDefect​(java.lang.String source,
                                      int totalFailures,
                                      int totalErrors,
                                      int totalTests,
                                      IWorkItem defectTemplate)
        Updates the description of the summary defect by appending a standard text about the number of tests and the various results. Creates a new summary defect using the createSummaryDefect(IWorkItem) method if it does not exist yet. IPObject.save() does not need to be called on the returned object.
        Parameters:
        source - The string description of the automated test import source. For example, the name of the input file.
        totalFailures - The number of failed tests.
        totalErrors - The number of tests with errors.
        totalTests - The total number of tests.
        defectTemplate - passed to method createSummaryDefect(IWorkItem) when it is called.
      • getRecords

        java.util.List<ITestRecord> getRecords()
        Returns all executed Test Records.
      • getAllRecords

        java.util.List<ITestRecord> getAllRecords()
        Returns all Test Records, even those that are paused or have not been executed yet. (That represent planned Test Cases.) The returned list is live, so it can be used to add or remove Test Records.
        Since:
        3.6.2
      • getRecordsForResult

        java.util.List<ITestRecord> getRecordsForResult​(java.lang.String resultId)
        Returns records with a specified result. (Can be more effective than iterating over the records collection.)
        Parameters:
        resultId -
      • addRecord

        ITestRecord addRecord()
        Adds a new empty Test Record to the Test Run. IPObject.save() must be called after the fields of the record are filled in.
        Returns:
        The added record.
      • getRecordsForTestCase

        @NotNull
        @Deprecated
        java.util.List<ITestRecord> getRecordsForTestCase​(@NotNull
                                                          java.lang.String testCaseId)
        Deprecated.
        Returns executed Test Records for the Test Case.
      • getRecordsForTestCase

        @NotNull
        java.util.List<ITestRecord> getRecordsForTestCase​(@NotNull
                                                          IWorkItem testCase)
        Returns executed Test Records for the Test Case.
        Since:
        3.10.1
      • getAllRecordsForTestCase

        @Deprecated
        @NotNull
        java.util.List<ITestRecord> getAllRecordsForTestCase​(@NotNull
                                                             java.lang.String testCaseId)
        Deprecated.
        Returns all Test Records for the Test Case, even those that are paused or have not been executed yet. (That represent planned Test Cases.)
        Since:
        3.9.2
      • getAllRecordsForTestCase

        @NotNull
        java.util.List<ITestRecord> getAllRecordsForTestCase​(@NotNull
                                                             IWorkItem testCase)
        Returns all Test Records for the Test Case, even those that are paused or have not been executed yet. (That represent planned Test Cases.)
        Since:
        3.10.1.
      • removeRecordsForTestCase

        @Deprecated
        void removeRecordsForTestCase​(java.lang.String testCaseId)
        Deprecated.
        Since:
        3.6.2
      • removeRecordsForTestCase

        void removeRecordsForTestCase​(@NotNull
                                      IWorkItem testCase)
        Removes the records from the given Test Case.
        Since:
        3.10.1
      • getRecordsCount

        int getRecordsCount()
        Returns a records count. (Can be more effective than resolving the whole Test Run.)
      • getRecordsCount

        int getRecordsCount​(java.lang.String resultId)
        Returns a records count with a specified result. (Can be more effective than iterating over the records collection.)
        Parameters:
        resultId -
      • delete

        void delete()
        Deletes this Test Run.
      • createQueryForAllExecutedTestCases

        java.lang.String createQueryForAllExecutedTestCases()
        Creates a query for the Test Cases that are executed in this Test Run.
        Returns:
        the created query
      • createQueryForExecutedTestCases

        java.lang.String createQueryForExecutedTestCases​(java.lang.String resultId)
        Creates query for the Test Cases that are executed in this Test Run with the given result.
        Parameters:
        resultId - Can not be null.
        Returns:
        The created query.
      • createQueryForNotExecutedTestCases

        java.lang.String createQueryForNotExecutedTestCases()
        Creates a query for the Test Cases of this Test Run that have not been executed yet.
        Returns:
        The created query.
      • createFilterForNotExecutedTestCases

        java.lang.String createFilterForNotExecutedTestCases()
        Creates a Document filter that can be used to filter the Test Case Document for unexecuted Test Cases. Valid only if the Test Case Document is set.
        Since:
        3.6.2
        See Also:
        getDocument()
      • createQueryForAllTestCases

        @NotNull
        java.lang.String createQueryForAllTestCases()
        Creates a query for all the Test Cases in the Test Run. (The Test Cases that are executed, paused or planned.)
        See Also:
        getSelectTestCasesBy(), getQuery(), getDocument()
      • getLabel

        java.lang.String getLabel()
        Returns the Test Run label.
        Returns:
        label
      • setKeepInHistory

        void setKeepInHistory​(boolean keepInHistory)
        A Test run that has the 'keep in history' flag switched on will be available when browsing a baseline, even if it has already been deleted.
      • setSelectTestCasesBy

        void setSelectTestCasesBy​(java.lang.String selectTestCasesById)
        Since:
        3.6.2
      • createAttachment

        @NotNull
        ITestRunAttachment createAttachment​(@NotNull
                                            java.lang.String fileName,
                                            @Nullable
                                            java.lang.String title,
                                            @NotNull
                                            java.io.InputStream data)
        Description copied from interface: IWithAttachments
        Creates the (temporary) attachment object, which can be manipulated by the client. However, the attachment is not persisted until it's explicitly saved.

        The author field is automatically pre-filled with the current user.

        Specified by:
        createAttachment in interface IWithAttachments<ITestRunAttachment>
        Parameters:
        fileName - The file name, can not be null.
        title - The title (can be null - file name is used then).
        data - The content input stream, can not be null
        Returns:
        the temporary IAttachement created
        Since:
        3.7.1
      • getWikiContent

        Text getWikiContent()
        Since:
        3.7.1
      • setWikiContent

        void setWikiContent​(Text content)
        Since:
        3.7.1
      • setIdPrefix

        void setIdPrefix​(@NotNull
                         java.lang.String prefix)
        Since:
        3.9.1 Used as a prefix for the Test Run Id of Test Runs created from this Template.
      • getIdPrefix

        @Nullable
        java.lang.String getIdPrefix()
        Since:
        3.9.1
      • isRichPageTestRun

        boolean isRichPageTestRun()
        Returns:
        true if this Test Run report is Rich Page based. Always returns true if isUseReportFromTemplate() is true.
        Since:
        3.10.0
      • getHomePageContent

        @Nullable
        Text getHomePageContent()
        Since:
        3.10.0
      • setHomePageContent

        void setHomePageContent​(@Nullable
                                Text value)
        Since:
        3.10.0
      • isUseReportFromTemplate

        boolean isUseReportFromTemplate()
        true indicates that the Test Run's Report (KEY_HOMEPAGECONTENT) from this Test Run should be ignored and instead it should be read from the (KEY_TEMPLATE) template . Only works for Rich Page Test Runs.
        Since:
        3.10.0
      • setUseReportFromTemplate

        void setUseReportFromTemplate​(boolean value)
        Since:
        3.10.0
      • getProjectSpan

        @NotNull
        java.util.List<IProject> getProjectSpan()
        Returns the IProject list where Test Cases for this Test Run can be planned. If the list is empty, only Test Cases from the current project can be planned.
        Since:
        3.10.1