Class HTMLReport


  • public class HTMLReport
    extends java.lang.Object
    This class is used to create the html reports that show the status of test runs
    Since:
    1.0.0
    • Constructor Summary

      Constructors 
      Constructor Description
      HTMLReport()
      Default constructor
      HTMLReport​(java.lang.String resultsFolder)
      Instantiates a new HtmlReport using a results folder filepath
    • Method Summary

      Modifier and Type Method Description
      Status getOverallStatus()
      Returns the overall status of a test run
      java.lang.String getOverAllSumFilePath()
      Gets path of the overall summary file
      java.util.List<TestFileLog> getTestFileLogs()
      Returns a list of all the test file logs
      void reset()
      Clears testFileLogs
      void setOverallStatus​(Status status)
      Sets the overall status of a test run
      void setOverallSumFilePath​(java.lang.String path)
      Sets overAllSumFilePath
      void setTestFileLogs​(java.util.List<TestFileLog> testFileLogs)
      Sets testFileLogs
      static void updateFStepResultHeader​(java.lang.String detailedReportPath, FunctionalStepLog fStepLog)
      Updates the execution status of the functional step header from RUNNING to the appropriate value
      static void updateTestScriptResultHeader​(TestFileLog fileLog)
      Updates the execution status in the detailed report of a testscript from running the appropriate status
      void updateTestSuiteResultFile​(java.lang.String path, double totalTests, double passedTests, double failedTests, double skippedTests)
      Updates the overall summary file after all tests have been completed
      static void writeDebugLog​(java.lang.String testRunPath, java.lang.String debugLine)
      Used to write to the debug log
      static void writeDivFooter​(java.lang.String resultPath)
      Writes closing tag for an html div
      void writeOverAllTestScriptHeader()
      Writes the headers for the overall summary of a testscript to the overall summary report
      static void writeTblFooter​(java.lang.String resultPath)
      Writes closing tag for an html table
      void writeTCOverAllStatus​(TestFileLog log)
      Writes the overall summary of a testscript to the overall summary report
      static void writeTestScriptResultHeader​(TestFileLog fileLog)
      Writes the header of the detailed report file for a testscript
      void writeTestSuiteResultHeader​(FastXml fastXml, java.util.Set<java.lang.String> scenarioTagsToRun, java.util.Set<java.lang.String> scenarioTagsToSkip, java.util.Set<java.lang.String> functionalTagsToRun, java.util.Set<java.lang.String> functionalTagsToSkip)
      Writes the overall summary report
      static void writeTScriptResultHeader​(java.lang.String detailedReportPath, FunctionalStepLog fStepLog)
      Writes the header for a functional step
      static void writeTStepException​(TestStep tStep)
      Writes an exception to the specified path for the current teststep
      static void writeTStepResult​(java.lang.String detailedReportPath, int fStepNum, TestStep tStep)
      Writes the results of the completed test step to the detailed report
      static void writeTStepResultHeader​(java.lang.String detailedReportPath, int ftsNumber)
      Writes the table header for the teststeps in the detailed report
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • overallStatus

        public Status overallStatus
    • Constructor Detail

      • HTMLReport

        public HTMLReport()
        Default constructor
        Since:
        1.0.0
      • HTMLReport

        public HTMLReport​(java.lang.String resultsFolder)
        Instantiates a new HtmlReport using a results folder filepath
        Parameters:
        resultsFolder - A filepath
        Since:
        1.0.0
    • Method Detail

      • getOverallStatus

        public Status getOverallStatus()
        Returns the overall status of a test run
        Returns:
        The status
        Since:
        1.0.0
      • setOverallStatus

        public void setOverallStatus​(Status status)
        Sets the overall status of a test run
        Parameters:
        status - A Status
        Since:
        1.0.0
      • getOverAllSumFilePath

        public java.lang.String getOverAllSumFilePath()
        Gets path of the overall summary file
        Returns:
        a filepath
        Since:
        1.0.0
      • setOverallSumFilePath

        public void setOverallSumFilePath​(java.lang.String path)
        Sets overAllSumFilePath
        Parameters:
        path - a filepath
        Since:
        1.0.0
      • getTestFileLogs

        public java.util.List<TestFileLog> getTestFileLogs()
        Returns a list of all the test file logs
        Returns:
        A list of TestFileLog
        Since:
        1.0.0
      • setTestFileLogs

        public void setTestFileLogs​(java.util.List<TestFileLog> testFileLogs)
        Sets testFileLogs
        Parameters:
        testFileLogs - A list of TestFileLog
        Since:
        1.0.0
      • writeDebugLog

        public static void writeDebugLog​(java.lang.String testRunPath,
                                         java.lang.String debugLine)
                                  throws FastException
        Used to write to the debug log
        Parameters:
        testRunPath - The path of the debug file
        debugLine - The content being written to the file
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • writeTestSuiteResultHeader

        public void writeTestSuiteResultHeader​(FastXml fastXml,
                                               java.util.Set<java.lang.String> scenarioTagsToRun,
                                               java.util.Set<java.lang.String> scenarioTagsToSkip,
                                               java.util.Set<java.lang.String> functionalTagsToRun,
                                               java.util.Set<java.lang.String> functionalTagsToSkip)
                                        throws FastException
        Writes the overall summary report
        Parameters:
        fastXml - A driver
        scenarioTagsToRun - Scenario tags that a test was running
        scenarioTagsToSkip - Scenario tags that a test was skipping
        functionalTagsToRun - Functional tags that a test was running
        functionalTagsToSkip - Functional tags that a test was skipping
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • updateTestSuiteResultFile

        public void updateTestSuiteResultFile​(java.lang.String path,
                                              double totalTests,
                                              double passedTests,
                                              double failedTests,
                                              double skippedTests)
                                       throws FastException
        Updates the overall summary file after all tests have been completed
        Parameters:
        path - The path of the overall summary file
        totalTests - The total number of tests
        passedTests - The total number of tests that passed
        failedTests - The total number of tests that failed
        skippedTests - The total number of tests that were skipped
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • writeOverAllTestScriptHeader

        public void writeOverAllTestScriptHeader()
                                          throws FastException
        Writes the headers for the overall summary of a testscript to the overall summary report
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • writeTCOverAllStatus

        public void writeTCOverAllStatus​(TestFileLog log)
                                  throws FastException
        Writes the overall summary of a testscript to the overall summary report
        Parameters:
        log - The log containing the results of a testscript
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • writeTestScriptResultHeader

        public static void writeTestScriptResultHeader​(TestFileLog fileLog)
                                                throws FastException
        Writes the header of the detailed report file for a testscript
        Parameters:
        fileLog - The log containing the results of a testscript
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • updateTestScriptResultHeader

        public static void updateTestScriptResultHeader​(TestFileLog fileLog)
                                                 throws FastException
        Updates the execution status in the detailed report of a testscript from running the appropriate status
        Parameters:
        fileLog - The log containing the results of a testscript
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • writeTScriptResultHeader

        public static void writeTScriptResultHeader​(java.lang.String detailedReportPath,
                                                    FunctionalStepLog fStepLog)
                                             throws FastException
        Writes the header for a functional step
        Parameters:
        detailedReportPath - The path to the detailed report
        fStepLog - The log containing the results of a functional step
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • updateFStepResultHeader

        public static void updateFStepResultHeader​(java.lang.String detailedReportPath,
                                                   FunctionalStepLog fStepLog)
                                            throws FastException
        Updates the execution status of the functional step header from RUNNING to the appropriate value
        Parameters:
        detailedReportPath - The path to the detailed report
        fStepLog - The log containing the results of a functional step
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • writeTStepResultHeader

        public static void writeTStepResultHeader​(java.lang.String detailedReportPath,
                                                  int ftsNumber)
                                           throws FastException
        Writes the table header for the teststeps in the detailed report
        Parameters:
        detailedReportPath - The path to the detailed report
        ftsNumber - The functional step number the current teststep is in
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • writeTStepResult

        public static void writeTStepResult​(java.lang.String detailedReportPath,
                                            int fStepNum,
                                            TestStep tStep)
                                     throws FastException
        Writes the results of the completed test step to the detailed report
        Parameters:
        detailedReportPath - The path to the detailed report
        fStepNum - The functional step number the current teststep is in
        tStep - The current teststep
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • writeTStepException

        public static void writeTStepException​(TestStep tStep)
                                        throws FastException
        Writes an exception to the specified path for the current teststep
        Parameters:
        tStep - The current teststep
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • writeTblFooter

        public static void writeTblFooter​(java.lang.String resultPath)
                                   throws FastException
        Writes closing tag for an html table
        Parameters:
        resultPath - Path of the file to write to
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • writeDivFooter

        public static void writeDivFooter​(java.lang.String resultPath)
                                   throws FastException
        Writes closing tag for an html div
        Parameters:
        resultPath - Path of the file to write to
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • reset

        public void reset()
        Clears testFileLogs
        Since:
        1.0.0