本文整理汇总了Python中utilities.Utilities.connect_device方法的典型用法代码示例。如果您正苦于以下问题:Python Utilities.connect_device方法的具体用法?Python Utilities.connect_device怎么用?Python Utilities.connect_device使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类utilities.Utilities
的用法示例。
在下文中一共展示了Utilities.connect_device方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
# 需要导入模块: from utilities import Utilities [as 别名]
# 或者: from utilities.Utilities import connect_device [as 别名]
def run(self):
"""
Custom runner for OWD initiative
It takes as arguments the parameters that gaiatest command would need
For example:
python ffox_test_runner_py --testvars=<testvars path> --address=localhost:2828 <tests path |\
test suite path>
"""
# Preprocess
parser = BaseMarionetteOptions(usage='%prog [options] test_file_or_dir <test_file_or_dir> ...')
structured.commandline.add_logging_group(parser)
options, tests = parser.parse_args(self.args[1:])
parser.verify_usage(options, tests)
# Traverse the tbpl logs option list and create directories if required
for f in options.log_tbpl:
d = f[:f.rfind('/')]
if not os.path.exists(d):
os.makedirs(d)
logger = structured.commandline.setup_logging(options.logger_name, options)
options.logger = logger
# Remove default stdout logger from mozilla logger
to_delete = filter(lambda h: h.stream.name == '<stdout>', logger.handlers)
for d in to_delete:
logger.remove_handler(d)
location = self.parse_toolkit_location(self.args)
options.toolkit_location = location
# Hit the runner
Utilities.connect_device()
self.runner = self.start_test_runner(self.runner_class, options, tests)
# Show the results via console and prepare the details
self.process_runner_results()
self.edit_html_results()
self.edit_test_details()
self.display_results()
if self.runner.testvars['graphics']['enabled']:
total_results_count = [self.passed, self.unexpected_failures, self.automation_failures,
self.expected_failures, self.unexpected_passed, self.skipped]
self.graphics = Graphics(results_by_suite=self.results_by_suite, total_results_count=total_results_count,
output_dir=self.runner.testvars['graphics']['graphics_dir'])
self.graphics.generate_all_graphics()
# Generate CSV results (if required)
is_cert = self.runner.testvars['general']['is_cert_device']
Utilities.generate_csv_reports(self, is_cert)