def waitForTestStatusToRunSuccessfully(self, runTestOperationsId): timer = 180 for counter in range(1,timer+1): response = self.getTestStatus(runTestOperationsId) currentStatus = response.json()['status'] self.logInfo('waitForTestStatusToRunSuccessfully %s/%s secs:\n\tCurrentTestStatus: %s\n\tExpecting: Successful' % ( counter, str(timer), currentStatus)) if currentStatus == 'Error': return 1 if currentStatus != 'Successful' and counter < timer: time.sleep(1) continue if currentStatus == 'Successful' and counter < timer: return 0 if currentStatus != 'Successful' and counter == timer: raise IxLoadRestApiException('Test status failed to run')