# HG changeset patch # User Nicholas Jillings # Date 1428674693 -3600 # Node ID 1ecb22de07b13f21e207cdfc0b689a352ab39e00 # Parent d6e5c09300803f45e73b95f9342e93797dcabe76 Completed State Machine diff -r d6e5c0930080 -r 1ecb22de07b1 ape.js --- a/ape.js Fri Apr 10 14:52:39 2015 +0100 +++ b/ape.js Fri Apr 10 15:04:53 2015 +0100 @@ -396,10 +396,44 @@ // Start the test var testId = currentState.substr(11,currentState.length-10); currentState = 'testRun-'+testId; + } else if (currentState.substr(0,7) == 'testRun') + { + var testId = currentState.substr(8,currentState.length-7); + // Check if we have any post tests to perform + var postXML = testXMLSetups.find('PostTest')[testId]; + if (postXML.children.length > 0) + { + console.log('POST TEST') + } + // else + + + // No post tests, check if we have another test to perform instead + if (testXMLSetups.length-1 > testId) + { + // Yes we have another test to perform + currentState = 'testRun-'+Number(testId)+1; + loadTest(testId+1); + } else { + console.log('Testing Completed!'); + // Check for any post tests + var xmlSetup = projectXML.find('setup'); + var postTest = xmlSetup.find('PostTest'); + console.log(postTest); + } } console.log(currentState); } +function buttonSubmitClick() +{ + // This function is called when the submit button is clicked. Will check for any further tests to perform, or any post-test options + if (currentState.substr(0,7) == 'testRun') + { + advanceState(); + } +} + // Only other global function which must be defined in the interface class. Determines how to create the XML document. function interfaceXMLSave(){ // Create the XML string to be exported with results