Class ProcessXMLDriver


  • public class ProcessXMLDriver
    extends java.lang.Object
    This class processes Fast drivers and uses them to execute tests
    Since:
    1.0.0
    • Method Summary

      Modifier and Type Method Description
      static void dataGeneration​(TestStep tStep)
      Used to generate various sorts of data
      static void dataSetProcessor​(TestStep tStep)
      Updates the testStep with information from a dataSetRow
      static void defaultRemainingFSteps​(HTMLReport htmlReport, TestFileLog testFileLog, java.util.List<FunctionalTestStep> fSteps)
      Writes remaining functional steps if a tests run is interrupted due to a FAIL_TCASE or FAIL_TSUITE failType
      static void executeStep​(TestStep tStep)
      Executes a testStep
      static void executeTest​(Fast fastHub)
      Executes tests using the passed in Fast object
      static int failedTests​(HTMLReport htmlReport)
      Returns the number of tests that failed or resulted in an error
      static void finalizeLogs​(HTMLReport htmlReport, java.lang.String resultsFolder, int numOfTests, int passedTests, int failedTests, int skippedTests)
      Sets overall status for html report
      static java.lang.String getDOBRefdata​(java.lang.String dob, FastRunProperties fastRunProperties, AutoGenerateDataType dataType, java.util.Map<java.lang.String,​java.lang.String> references)
      Retrieves time period from the string date of birth passed in
      static java.lang.String getRefData​(java.lang.String data, java.util.Map<java.lang.String,​java.lang.String> references)
      Returns data with all references resolved
      static java.util.Set<java.lang.String> getTags​(java.lang.String propertyTags)
      Converts the passed in propertyTags from a single string to a Set
      static int passedTests​(HTMLReport htmlReport)
      Returns the number of tests that passed
      static void resolveReferences​(TestStep tStep)
      Resolves references in a teststep
      static void runTheScripts​(FastXml fastXml, Fast fastHub)
      Used to execute fastXmls
      static int skippedTests​(HTMLReport htmlReport)
      Returns the number of tests that were skipped
      static void tStepProcessor​(TestStep tStep)
      Processes the current teststep before the step will be executed.
      static void updateAllFields​(TestStep tStep)
      Used to update token references for all fields of a teststep
      static void updateFields​(TestStep tStep, DataFields field)
      Updates the token and references of a teststep for the passed in field
      static void updateFunctionalStepStatus​(FunctionalStepLog fStepLog, java.util.Set<Status> testStepStatuses, java.util.Set<Status> functionalStepStatuses)
      Updates the status of a FunctionalStepLog and the FunctionalTestStep it tracks using the worst status among a set of testStepStatuses.
      static void updateTestScriptStatus​(TestFileLog testFileLog, java.util.Set<Status> functionalStepStatuses, java.util.Set<Status> testFileLogStatuses)
      Updates the status of a TestFileLog and the TestScript it tracks using the worst status among a set of functionalStepStatuses.
      static void waitForExecution​(long waitTime)
      Pause the script for the designated amount of time
      static void writeRemainingTSteps​(java.lang.String detailedStepPath, FunctionalTestStep fStep)
      Writes remaining test cases if a tests run is interrupted due to a FAIL_FSTEP failType
      • Methods inherited from class java.lang.Object

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

      • ProcessXMLDriver

        public ProcessXMLDriver()
    • Method Detail

      • executeTest

        public static void executeTest​(Fast fastHub)
                                throws FastException
        Executes tests using the passed in Fast object
        Parameters:
        fastHub - Contains the properties from fast.properties
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • runTheScripts

        public static void runTheScripts​(FastXml fastXml,
                                         Fast fastHub)
                                  throws FastException
        Used to execute fastXmls
        Parameters:
        fastXml - A fastXml file with TestScripts to execute.
        fastHub - Used to aid in execution of fastXml, as well as sendStatuses back to eFast
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • updateFunctionalStepStatus

        public static void updateFunctionalStepStatus​(FunctionalStepLog fStepLog,
                                                      java.util.Set<Status> testStepStatuses,
                                                      java.util.Set<Status> functionalStepStatuses)
        Updates the status of a FunctionalStepLog and the FunctionalTestStep it tracks using the worst status among a set of testStepStatuses.
        Parameters:
        fStepLog - Log whose status is being updated
        testStepStatuses - Statuses from TestStep
        functionalStepStatuses - Used to track Status for functionalTestSteps in a TestScript. This parameter can be set to null
        Since:
        1.0.0
      • updateTestScriptStatus

        public static void updateTestScriptStatus​(TestFileLog testFileLog,
                                                  java.util.Set<Status> functionalStepStatuses,
                                                  java.util.Set<Status> testFileLogStatuses)
        Updates the status of a TestFileLog and the TestScript it tracks using the worst status among a set of functionalStepStatuses.
        Parameters:
        testFileLog - - Log whose status is being updated
        functionalStepStatuses - - Statuses from FunctionalTestStep
        testFileLogStatuses - - Used to track Status for testscripts in a FastXml. This parameter can be set to null
        Since:
        1.0.0
      • getTags

        public static java.util.Set<java.lang.String> getTags​(java.lang.String propertyTags)
        Converts the passed in propertyTags from a single string to a Set
        Parameters:
        propertyTags - The tags from fast.properties
        Returns:
        A set of tags from the fast.properties file
        Since:
        1.0.0
      • dataSetProcessor

        public static void dataSetProcessor​(TestStep tStep)
        Updates the testStep with information from a dataSetRow
        Parameters:
        tStep - A teststep
        Since:
        1.0.0
      • resolveReferences

        public static void resolveReferences​(TestStep tStep)
                                      throws FastException
        Resolves references in a teststep
        Parameters:
        tStep - The current testStep
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • dataGeneration

        public static void dataGeneration​(TestStep tStep)
                                   throws FastException
        Used to generate various sorts of data
        Parameters:
        tStep - The current teststep
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • tStepProcessor

        public static void tStepProcessor​(TestStep tStep)
                                   throws FastException
        Processes the current teststep before the step will be executed. Updates tokens and references
        Parameters:
        tStep - The current teststep
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • updateAllFields

        public static void updateAllFields​(TestStep tStep)
                                    throws FastException
        Used to update token references for all fields of a teststep
        Parameters:
        tStep - The current teststep
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • finalizeLogs

        public static void finalizeLogs​(HTMLReport htmlReport,
                                        java.lang.String resultsFolder,
                                        int numOfTests,
                                        int passedTests,
                                        int failedTests,
                                        int skippedTests)
        Sets overall status for html report
        Parameters:
        htmlReport - The htmlReport being finalized
        resultsFolder - The test evidence path
        numOfTests - Total number of tests
        passedTests - Total number of tests that passed
        failedTests - Total number of tests that failed
        skippedTests - Total number of tests that were skipped
        Since:
        1.0.0
      • defaultRemainingFSteps

        public static void defaultRemainingFSteps​(HTMLReport htmlReport,
                                                  TestFileLog testFileLog,
                                                  java.util.List<FunctionalTestStep> fSteps)
                                           throws FastException
        Writes remaining functional steps if a tests run is interrupted due to a FAIL_TCASE or FAIL_TSUITE failType
        Parameters:
        htmlReport - Report being written to
        testFileLog - A log keeping track of the status of a testscript
        fSteps - The functional steps in testscript
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • writeRemainingTSteps

        public static void writeRemainingTSteps​(java.lang.String detailedStepPath,
                                                FunctionalTestStep fStep)
                                         throws FastException
        Writes remaining test cases if a tests run is interrupted due to a FAIL_FSTEP failType
        Parameters:
        detailedStepPath - DetailedReport file path
        fStep - The current functionalstep
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • failedTests

        public static int failedTests​(HTMLReport htmlReport)
        Returns the number of tests that failed or resulted in an error
        Parameters:
        htmlReport - Htmlreport containing containing the testFileLogs
        Returns:
        Number of failed tests
        Since:
        1.0.0
      • skippedTests

        public static int skippedTests​(HTMLReport htmlReport)
        Returns the number of tests that were skipped
        Parameters:
        htmlReport - Htmlreport containing containing the testFileLogs
        Returns:
        Number of skipped tests
        Since:
        1.0.0
      • passedTests

        public static int passedTests​(HTMLReport htmlReport)
        Returns the number of tests that passed
        Parameters:
        htmlReport - Htmlreport containing containing the testFileLogs
        Returns:
        number of passed tests
        Since:
        1.0.0
      • executeStep

        public static void executeStep​(TestStep tStep)
                                throws FastException
        Executes a testStep
        Parameters:
        tStep - - The current teststep
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • updateFields

        public static void updateFields​(TestStep tStep,
                                        DataFields field)
                                 throws FastException
        Updates the token and references of a teststep for the passed in field
        Parameters:
        tStep - The current teststep
        field - The field of the teststep that needs to be updated
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • getRefData

        public static java.lang.String getRefData​(java.lang.String data,
                                                  java.util.Map<java.lang.String,​java.lang.String> references)
                                           throws FastException
        Returns data with all references resolved
        Parameters:
        data - The data that needs references resolved
        references - Saved references
        Returns:
        Data that has had its references resolved
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • getDOBRefdata

        public static java.lang.String getDOBRefdata​(java.lang.String dob,
                                                     FastRunProperties fastRunProperties,
                                                     AutoGenerateDataType dataType,
                                                     java.util.Map<java.lang.String,​java.lang.String> references)
                                              throws FastException
        Retrieves time period from the string date of birth passed in
        Parameters:
        dob - Data that needs its references resolved
        fastRunProperties - The properties a teststep is being run with
        dataType - Determines what part of the date to extract
        references - Saved references
        Returns:
        Data with its references resolved
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • waitForExecution

        public static void waitForExecution​(long waitTime)
        Pause the script for the designated amount of time
        Parameters:
        waitTime - Time in seconds
        Since:
        1.0.0