def run(self): ''' The Execution of the test script's cases listed in the Test params file will be done here then update each test case result. This method will return main.TRUE if it executed all the test cases successfully, else will retun main.FALSE ''' self.testCaseResult = {} self.TOTAL_TC = 0 self.TOTAL_TC_RUN = 0 self.TOTAL_TC_PLANNED = 0 self.TOTAL_TC_NORESULT = 0 self.TOTAL_TC_FAIL = 0 self.TOTAL_TC_PASS = 0 self.TEST_ITERATION = 0 # NOTE: number of main.step statements in the # outer most level of the test case. used to # execute code in smaller steps self.stepCount = 0 self.CASERESULT = self.NORESULT import testparser test = testparser.TestParser(main.testFile) self.testscript = test.testscript self.code = test.getStepCode() repeat = int(self.params.get('repeat', 1)) self.TOTAL_TC_PLANNED = len(self.testcases_list) * repeat result = self.TRUE while repeat: for self.CurrentTestCaseNumber in self.testcases_list: result = self.runCase(self.CurrentTestCaseNumber) repeat -= 1 return result
def run(self): ''' The Execution of the test script's cases listed in the Test params file will be done here. And Update each test case result. This method will return TRUE if it executed all the test cases successfully, else will retun FALSE ''' self.testCaseResult = {} self.TOTAL_TC = 0 self.TOTAL_TC_RUN = 0 self.TOTAL_TC_PLANNED = 0 self.TOTAL_TC_NORESULT = 0 self.TOTAL_TC_FAIL = 0 self.TOTAL_TC_PASS = 0 self.TEST_ITERATION = 0 self.stepCount = 0 self.CASERESULT = self.TRUE import testparser testFile = self.tests_path + "/" + self.TEST + "/" + self.TEST + ".py" test = testparser.TestParser(testFile) self.testscript = test.testscript self.code = test.getStepCode() repeat = int(self.params['repeat']) if ('repeat' in self.params) else 1 main.TOTAL_TC_PLANNED = len(self.testcases_list) * repeat result = self.TRUE while (repeat): for self.CurrentTestCaseNumber in self.testcases_list: result = self.runCase(self.CurrentTestCaseNumber) repeat -= 1 return result