def RunnerFactory(device, shard_index): return test_runner.TestRunner(device, options.test_suite, options.test_arguments, options.timeout, options.cleanup_test_files, options.tool, options.build_type, options.webkit, constants.GTEST_TEST_PACKAGE_NAME, constants.GTEST_TEST_ACTIVITY_NAME, constants.GTEST_COMMAND_LINE_FILE)
def CreateShardedTestRunner(self, device, index): """Creates a sharded test runner. Args: device: Device serial where this shard will run. index: Index of this device in the pool. Returns: A TestRunner object. """ return test_runner.TestRunner(self.options, device, None, False, index, self.apks, [])
def run(self): while not self.thread_stop: #print 'Thread Object(%d), Time:%s\n' %(self.thread_num, time.ctime()) if not self.task.getState() and len(self.task.getTestData()) > 0: dbm = sqlite.DBManager(self.db_path) #integer runner = test_runner.TestRunner(db=dbm, task=self.task) self.task.start() runner.run(self.task.getTestSuite()) else: self.stop() time.sleep(5)
def __init__(self, source_dir, data_dir, build_url, hadoop): self.hadoop = hadoop logging.debug("Analyzer(%s, %s, %s)", source_dir, data_dir, build_url) self.source_dir = source_dir self.data_dir = data_dir self.build_url = build_url self.source_hash = self.__get_build_hash() self.__prepare_data_dir() self.result_writer = result_writer.ResultWriter(self.data_dir, self.build_url) self.__download_data() self.failed_test_cases = self.__get_test_cases() self.test_runner = test_runner.TestRunner(self.source_dir, self.data_dir, self.source_hash, hadoop)
def test_results_html(self): mock_port = Mock() mock_port._filesystem = filesystem_mock.MockFileSystem() mock_port.relative_test_filename = lambda name: name mock_port.filename_to_uri = lambda name: name runner = test_runner.TestRunner(port=mock_port, options=Mock(), printer=Mock()) expected_html = u"""<html> <head> <title>Layout Test Results (time)</title> </head> <body> <h2>Title (time)</h2> <p><a href='test_path'>test_path</a><br /> </p> </body></html> """ html = runner._results_html(["test_path"], {}, "Title", override_time="time") self.assertEqual(html, expected_html)
def TestRunnerFactory(device, shard_index): return test_runner.TestRunner( test_options, device, shard_index, test_pkg)
def main(): runner = test_runner.TestRunner('corpus') runner.SetEnforceExpectedImages(True) runner.SetOneShotRenderer(True) return runner.Run()
def TestRunnerFactory(device, shard_index): return test_runner.TestRunner(test_options, device, tests_dict, flaky_steps)
def main(): runner = test_runner.TestRunner('pixel') runner.SetEnforceExpectedImages(True) return runner.Run()
def TestRunnerFactory(device, shard_index): return test_runner.TestRunner( options, device, shard_index, test_pkg, [], is_uiautomator_test)
def main(): runner = test_runner.TestRunner('javascript') return runner.Run()
def main(): runner = test_runner.TestRunner('corpus') return runner.Run()
def zopkio(self): """ This invokes a test_runner.TestRunner for this ZtestSuite """ runner = test_runner.TestRunner(ztestsuite=self) runner.run()
def main(): runner = test_runner.TestRunner('pixel') return runner.Run()
def main(): if len(sys.argv) == 2: """ checks for xpath directory and file, if it is does not exist,script wont continue further since it is a mandatory directory.. """ config = Prerequisite(sys.argv[1]) if config == None: print( "INFO - Xpath directory/file doesn't exist which is mandatory, hence terminated." ) #Returns nothing and Exit main function return 0 loglocation = config['Selenium Config Parameters'][ 'seleniumDir'] + config['Selenium Config Parameters'][ 'log_location'] reportlocation = config['Selenium Config Parameters'][ 'seleniumDir'] + config['Selenium Config Parameters'][ 'report_location'] devicedir = config['Selenium Config Parameters'][ 'seleniumDir'] + config['Selenium Config Parameters'][ 'devices_folder'] testResourceDir = config['Selenium Config Parameters'][ 'seleniumDir'] + config['Selenium Config Parameters'][ 'inputfilesDir'] Global.downloadFolder = config['Selenium Config Parameters'][ 'downloadFolder'] #Configure the logging to write into the location given by seleniumDir+log_folder_location ConfigureLoggingAndTestReport(testResourceDir, devicedir, loglocation, reportlocation) if not (GenerateXPATHDictionary( config['Selenium Config Parameters']['seleniumDir'] + '/xpaths')): printFP( "INFO - Improper XPATHS Folder path given. XPATHS Path: %s" % (config['seleniumDir'] + '/xpaths')) return 0 #Replace Sensor Gateway and Network Group keywords with actual names inside the CSV files if not (ReplaceDeviceSGWandNG(devicedir, config)): printFP( "INFO - Did not successfully replace Sensor Gateway Names and/or Network Group Names in device CSV files." ) return 0 #Starts the Tests StartTests(config) #Replace SGW and Network Group names within the CSV files with Sensor Gateway and Network Group keywords if not (UndoReplaceSGWandNG(devicedir, config)): printFP( "INFO - Did not successfully replace Sensor Gateway Names and/or Network Group Names back to keywords in device CSV files." ) return 0 #If HipTest Publishing is enabled, open the report file and then proceed to parse it and publish the results. if config['HipTest Parameters']['hiptest_result_publish']: hiptestRun = test_runner.TestRunner(config) dictResults = { "PASS": '******', "FAIL": 'failed', "EXCEPTION": 'retest' } with open(Global.reportPath, 'r') as report: csvFile = csv.reader(report) for line in csvFile: if len(line) > 4 and line[0] != 'Hip Test Name': hiptestresults = test_runner.Result( dictResults[line[3]], line[4]) name = line[0].lower() hiptest_name = '_'.join(name.split()).replace('-', '') hiptestRun.run_publishresult(hiptestresults, hiptest_name) if config['Email Parameters']['email_enable']: EmailAttachment(Global.reportPath, config['Email Parameters']['email_recipients'], config['Email Parameters']['email_subject_line']) else: print 'Missing input file' print 'Not enough arguments.' print 'python SeleniumMain.py [maininputfile.json]'