Package com.qcefast.util
Class Fast
- java.lang.Object
-
- com.qcefast.util.Fast
-
public class Fast extends java.lang.Object
This class is used as a hub for the FAST framework. Used to convert xml drivers intoFastXml
java objects, run drivers, create html reports, etc.- Since:
- 1.0.0
-
-
Constructor Summary
Constructors Constructor Description Fast()
Default constructorFast(FastRunProperties fastRunProperties)
Constructs a Fast object usingFastRunProperties
Fast(java.io.File... runProperties)
Constructs a Fast object using multiple properties filesFast(java.lang.String callerIdentityLocation, java.io.File... runProperties)
Constructs a Fast object using properties files.
-
Method Summary
Modifier and Type Method Description void
closeDrivers()
This method will eventually be removed.java.util.Set<java.lang.String>
getAllActions()
Returns a set containing each action within Fastjava.lang.String
getAppVersion()
Gets the current version for the FAST framework from the value inside the .pom xml filejava.lang.String
getCallerIdentityLocation()
Gets the callerIdentityLocation.java.util.Date
getCurrentDateTime()
Returns the current datetimejava.lang.String
getCurrentDateTimeAsString()
Returns the current datetime in yyyy-MM-dd HH:mm:ss formatFastRunProperties
getFastRunProperties()
Returns theFastRunProperties
in this objectjava.util.List<FastXml>
getFastXmlDrivers()
Returns a list ofFastXml
using the driverPath or relativeDriverPath specified inFastRunProperties
Status
getWorstFunctionalTestStepStatus(java.util.List<FunctionalTestStep> fSteps)
Returns the worstStatus
among a list ofFunctionalTestStep
Status
getWorstTestScriptStatus(java.util.List<TestScript> tScripts)
Returns the worstStatus
among a list ofTestScript
Status
getWorstTestStepStatus(java.util.List<TestStep> tSteps)
void
marshallFastXml(FastXml fastXml, java.lang.String filePath)
Writes a fastXml java object as a .xml file to the specified locationvoid
marshallFastXml(TestFileLog testFileLog)
Writes updated TestScript to the testEvidence folderFastXml
parseFastXml(java.io.File file)
Creates a FastXml java object using xml driverFastXml
parseFastXml(java.lang.String filePath)
Creates a FastXml java object using xml drivervoid
runFastXml(FastXml fastXml)
Execute the passed in FastXml objectvoid
runFastXmls(java.util.List<FastXml> fastXmls)
Execute the passed in FastXml objectsvoid
runFastXmlWithReport(FastXml fastXml, FastRunProperties fastRunProperties)
Execute the passed in FastXml object, and write out htmlReportboolean
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 injava.lang.Boolean
sendFunctionalStepStatus(FunctionalTestStep fStep, boolean sendStatuses)
This method sends status of functional step to server/cloud via APIjava.lang.Boolean
sendTestScriptStatus(TestScript tScript, boolean sendStatuses)
This method sends status of test script to server/cloud via APIjava.lang.Boolean
sendTestStepStatus(TestStep tStep, boolean sendStatuses)
This method sends status of test step to server/cloud via APIjava.lang.Boolean
sendTestSuiteStatus(FastXml fastXml, boolean sendStatuses)
This method sends the status of the test suite to server/cloud via APIvoid
setCallerIdentityLocation(java.lang.String callerIdentityLocation)
Sets the callerIdentityLocation that will be used by the notificationService to send statusesvoid
setFastRunProperties(FastRunProperties fastRunProperties)
Set the fastRunProperties of this object.void
setStartTime(FastXml fastXml)
Sets the start time in the fastXml.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'tvoid
writeException(TestStep tStep)
Writes an exception to a text file relative to the tStep's detailedResultFoldervoid
writeHtmlReport(FastXml fastXml, FastRunProperties fastRunProperties)
Writes the html report for the designated fastXml
-
-
-
Field Detail
-
NOTAGS
public final java.lang.String NOTAGS
- See Also:
- Constant Field Values
-
ALL
public final java.lang.String ALL
- See Also:
- Constant Field Values
-
-
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 userunProperties
- Properties files- Throws:
FastException
- If an error occurs during execution- Since:
- 1.0.0
-
Fast
public Fast(FastRunProperties fastRunProperties)
Constructs a Fast object usingFastRunProperties
- 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
- AFastXml
java objectfilePath
- 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
-
getFastXmlDrivers
public java.util.List<FastXml> getFastXmlDrivers() throws FastException
Returns a list ofFastXml
using the driverPath or relativeDriverPath specified inFastRunProperties
- Returns:
- List of
FastXml
- 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
- AFastXml
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
- AFastXml
java objectfastRunProperties
- 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
- AFastXml
java objectfastRunProperties
- 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 filesectionTags
- 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 filesectionTags
- The tags from the .feature file- Returns:
- true if it should run, false if it shouldn't
- Since:
- 1.0.0
-
getFastRunProperties
public FastRunProperties getFastRunProperties() throws FastException
Returns theFastRunProperties
in this object- Returns:
FastRunProperties
- Throws:
FastException
- If an error occurs during execution- 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 theFastRunProperties
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
- AFastXml
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
- ATestStep
- 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
- TheTestStep
whose status will be sentsendStatuses
- 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
- TheFunctionalTestStep
whose status will be sentsendStatuses
- 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
- TheTestScript
whose status will be sentsendStatuses
- 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
- TheFastXml
whose status will be sentsendStatuses
- 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)
- 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 worstStatus
among a list ofFunctionalTestStep
- 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 worstStatus
among a list ofTestScript
- 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
-
-