Package com.qcefast.util
Class ProcessXMLDriver
- java.lang.Object
-
- com.qcefast.util.ProcessXMLDriver
-
public class ProcessXMLDriver extends java.lang.Object
This class processes Fast drivers and uses them to execute tests- Since:
- 1.0.0
-
-
Constructor Summary
Constructors Constructor Description ProcessXMLDriver()
-
Method Summary
Modifier and Type Method Description static void
dataGeneration(TestStep tStep)
Used to generate various sorts of datastatic void
dataSetProcessor(TestStep tStep)
Updates the testStep with information from a dataSetRowstatic 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 failTypestatic void
executeStep(TestStep tStep)
Executes a testStepstatic void
executeTest(Fast fastHub)
Executes tests using the passed inFast
objectstatic int
failedTests(HTMLReport htmlReport)
Returns the number of tests that failed or resulted in an errorstatic void
finalizeLogs(HTMLReport htmlReport, java.lang.String resultsFolder, int numOfTests, int passedTests, int failedTests, int skippedTests)
Sets overall status for html reportstatic 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 instatic java.lang.String
getRefData(java.lang.String data, java.util.Map<java.lang.String,java.lang.String> references)
Returns data with all references resolvedstatic java.util.Set<java.lang.String>
getTags(java.lang.String propertyTags)
Converts the passed in propertyTags from a single string to a Setstatic int
passedTests(HTMLReport htmlReport)
Returns the number of tests that passedstatic void
resolveReferences(TestStep tStep)
Resolves references in a teststepstatic void
runTheScripts(FastXml fastXml, Fast fastHub)
Used to execute fastXmlsstatic int
skippedTests(HTMLReport htmlReport)
Returns the number of tests that were skippedstatic 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 teststepstatic void
updateFields(TestStep tStep, DataFields field)
Updates the token and references of a teststep for the passed in fieldstatic void
updateFunctionalStepStatus(FunctionalStepLog fStepLog, java.util.Set<Status> testStepStatuses, java.util.Set<Status> functionalStepStatuses)
Updates the status of aFunctionalStepLog
and theFunctionalTestStep
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 aTestFileLog
and theTestScript
it tracks using the worst status among a set of functionalStepStatuses.static void
waitForExecution(long waitTime)
Pause the script for the designated amount of timestatic void
writeRemainingTSteps(java.lang.String detailedStepPath, FunctionalTestStep fStep)
Writes remaining test cases if a tests run is interrupted due to a FAIL_FSTEP failType
-
-
-
Method Detail
-
executeTest
public static void executeTest(Fast fastHub) throws FastException
Executes tests using the passed inFast
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 withTestScript
s 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 aFunctionalStepLog
and theFunctionalTestStep
it tracks using the worst status among a set of testStepStatuses.- Parameters:
fStepLog
- Log whose status is being updatedtestStepStatuses
- Statuses fromTestStep
functionalStepStatuses
- Used to trackStatus
for functionalTestSteps in aTestScript
. 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 aTestFileLog
and theTestScript
it tracks using the worst status among a set of functionalStepStatuses.- Parameters:
testFileLog
- - Log whose status is being updatedfunctionalStepStatuses
- - Statuses fromFunctionalTestStep
testFileLogStatuses
- - Used to trackStatus
for testscripts in aFastXml
. 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 finalizedresultsFolder
- The test evidence pathnumOfTests
- Total number of testspassedTests
- Total number of tests that passedfailedTests
- Total number of tests that failedskippedTests
- 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 totestFileLog
- A log keeping track of the status of a testscriptfSteps
- 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 pathfStep
- 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 teststepfield
- 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 resolvedreferences
- 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 resolvedfastRunProperties
- The properties a teststep is being run withdataType
- Determines what part of the date to extractreferences
- 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
-
-