Class Fast


  • public class Fast
    extends java.lang.Object
    This class is used as a hub for the FAST framework. Used to convert xml drivers into FastXml java objects, run drivers, create html reports, etc.
    Since:
    1.0.0
    • Constructor Detail

      • Fast

        public Fast()
        Default constructor
        Since:
        1.0.0
      • Fast

        public Fast​(java.io.File... runProperties)
             throws FastException
        Constructs a Fast object using multiple properties files
        Parameters:
        runProperties - Properties files
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • Fast

        public Fast​(java.lang.String callerIdentityLocation,
                    java.io.File... runProperties)
             throws FastException
        Constructs a Fast object using properties files. Also uses the callerIdentityLocation parameter to instantiate the notificationService
        Parameters:
        callerIdentityLocation - The directory of the caller-identity.json file that the notificationService will use
        runProperties - Properties files
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • Fast

        public Fast​(FastRunProperties fastRunProperties)
        Constructs a Fast object using FastRunProperties
        Parameters:
        fastRunProperties - properties that will be used to run the FAST framework
        Since:
        1.0.0
    • Method Detail

      • getCallerIdentityLocation

        public java.lang.String getCallerIdentityLocation()
        Gets the callerIdentityLocation. If null or empty, either use the appropriate constructor, or set this value using the setter method
        Returns:
        The callerIdentityLocation
        Since:
        1.0.0
      • setCallerIdentityLocation

        public void setCallerIdentityLocation​(java.lang.String callerIdentityLocation)
        Sets the callerIdentityLocation that will be used by the notificationService to send statuses
        Parameters:
        callerIdentityLocation - The directory of the caller-identity.json
        Since:
        1.0.0
      • marshallFastXml

        public void marshallFastXml​(FastXml fastXml,
                                    java.lang.String filePath)
                             throws FastException
        Writes a fastXml java object as a .xml file to the specified location
        Parameters:
        fastXml - A FastXml java object
        filePath - The location and name to write the .xml representation of the passed in fastXml java object
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • marshallFastXml

        public void marshallFastXml​(TestFileLog testFileLog)
                             throws FastException
        Writes updated TestScript to the testEvidence folder
        Parameters:
        testFileLog - Contains updated testscript that is to be marshalled
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • parseFastXml

        public FastXml parseFastXml​(java.io.File file)
                             throws FastException
        Creates a FastXml java object using xml driver
        Parameters:
        file - The xml driver
        Returns:
        A FastXml object
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • parseFastXml

        public FastXml parseFastXml​(java.lang.String filePath)
                             throws FastException
        Creates a FastXml java object using xml driver
        Parameters:
        filePath - The path to the xml driver
        Returns:
        A FastXml object
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • runFastXml

        public void runFastXml​(FastXml fastXml)
                        throws FastException
        Execute the passed in FastXml object
        Parameters:
        fastXml - A FastXml java object
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • runFastXmls

        public void runFastXmls​(java.util.List<FastXml> fastXmls)
                         throws FastException
        Execute the passed in FastXml objects
        Parameters:
        fastXmls - FastXml java objects
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • runFastXmlWithReport

        public void runFastXmlWithReport​(FastXml fastXml,
                                         FastRunProperties fastRunProperties)
                                  throws FastException
        Execute the passed in FastXml object, and write out htmlReport
        Parameters:
        fastXml - A FastXml java object
        fastRunProperties - The properties to run the driver with
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • writeHtmlReport

        public void writeHtmlReport​(FastXml fastXml,
                                    FastRunProperties fastRunProperties)
                             throws FastException
        Writes the html report for the designated fastXml
        Parameters:
        fastXml - A FastXml java object
        fastRunProperties - The properties to run the driver with
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • skipTags

        public boolean skipTags​(java.util.Set<java.lang.String> propertyTags,
                                java.util.Set<java.lang.String> sectionTags)
        Returns true if the run should be skipped, false if it shouldn't
        Parameters:
        propertyTags - The tags from the fast.properties file
        sectionTags - The tags from the .feature file
        Returns:
        true if the run should be skipped, false if it shouldn't
        Since:
        1.0.0
      • runTags

        public boolean runTags​(java.util.Set<java.lang.String> propertyTags,
                               java.util.Set<java.lang.String> sectionTags)
        Returns true if we should run based on the tags passed in
        Parameters:
        propertyTags - The tags from the fast.properties file
        sectionTags - The tags from the .feature file
        Returns:
        true if it should run, false if it shouldn't
        Since:
        1.0.0
      • setFastRunProperties

        public void setFastRunProperties​(FastRunProperties fastRunProperties)
        Set the fastRunProperties of this object. If you are using this method, you will need to manually add the properties to the FastRunProperties object
        Parameters:
        fastRunProperties - Properties to run Fast with
        Since:
        1.0.0
      • setStartTime

        public void setStartTime​(FastXml fastXml)
                          throws FastException
        Sets the start time in the fastXml. Also sets the tempStartTime field in fastRunProperties so that testSteps have access to it.
        Parameters:
        fastXml - A FastXml java object
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • getCurrentDateTime

        public java.util.Date getCurrentDateTime()
        Returns the current datetime
        Returns:
        The current datetime
        Since:
        1.0.0
      • getCurrentDateTimeAsString

        public java.lang.String getCurrentDateTimeAsString()
        Returns the current datetime in yyyy-MM-dd HH:mm:ss format
        Returns:
        The current datetime
        Since:
        1.0.0
      • getAllActions

        public java.util.Set<java.lang.String> getAllActions()
        Returns a set containing each action within Fast
        Returns:
        A set containing every value from the Action enum
        Since:
        1.0.0
      • writeException

        public void writeException​(TestStep tStep)
                            throws FastException
        Writes an exception to a text file relative to the tStep's detailedResultFolder
        Parameters:
        tStep - A TestStep
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • closeDrivers

        public void closeDrivers()
                          throws FastException
        This method will eventually be removed. Drivers will eventually be added to FastRunProperties, and will be closed from there.
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • sendTestStepStatus

        public java.lang.Boolean sendTestStepStatus​(TestStep tStep,
                                                    boolean sendStatuses)
                                             throws FastException
        This method sends status of test step to server/cloud via API
        Parameters:
        tStep - The TestStep whose status will be sent
        sendStatuses - true if status should be sent
        Returns:
        true if the status was successfully sent
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • sendFunctionalStepStatus

        public java.lang.Boolean sendFunctionalStepStatus​(FunctionalTestStep fStep,
                                                          boolean sendStatuses)
                                                   throws FastException
        This method sends status of functional step to server/cloud via API
        Parameters:
        fStep - The FunctionalTestStep whose status will be sent
        sendStatuses - true if status should be sent
        Returns:
        true if the status was successfully sent
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • sendTestScriptStatus

        public java.lang.Boolean sendTestScriptStatus​(TestScript tScript,
                                                      boolean sendStatuses)
                                               throws FastException
        This method sends status of test script to server/cloud via API
        Parameters:
        tScript - The TestScript whose status will be sent
        sendStatuses - true if status should be sent
        Returns:
        true if the status was successfully sent
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • sendTestSuiteStatus

        public java.lang.Boolean sendTestSuiteStatus​(FastXml fastXml,
                                                     boolean sendStatuses)
                                              throws FastException
        This method sends the status of the test suite to server/cloud via API
        Parameters:
        fastXml - The FastXml whose status will be sent
        sendStatuses - true if status should be sent
        Returns:
        true if the status was successfully sent
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • getWorstTestStepStatus

        public Status getWorstTestStepStatus​(java.util.List<TestStep> tSteps)
        Returns the worst Status among a list of TestStep
        Parameters:
        tSteps - - Teststeps to get the worst status from
        Returns:
        The worst Status
        Since:
        1.0.0
      • getWorstFunctionalTestStepStatus

        public Status getWorstFunctionalTestStepStatus​(java.util.List<FunctionalTestStep> fSteps)
        Returns the worst Status among a list of FunctionalTestStep
        Parameters:
        fSteps - - Functional test steps to get the worst status from
        Returns:
        The worst Status
        Since:
        1.0.0
      • getWorstTestScriptStatus

        public Status getWorstTestScriptStatus​(java.util.List<TestScript> tScripts)
        Returns the worst Status among a list of TestScript
        Parameters:
        tScripts - - Test Scripts to get the worst status from
        Returns:
        The worst Status
        Since:
        1.0.0
      • getAppVersion

        public java.lang.String getAppVersion()
                                       throws FastException
        Gets the current version for the FAST framework from the value inside the .pom xml file
        Returns:
        The current version for the FAST framework
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0