webdriver_test_tools.project.cmd.run module¶
-
webdriver_test_tools.project.cmd.run.add_run_subparser(subparsers, config_module=None, parents=[], formatter_class=<class 'argparse.RawTextHelpFormatter'>)[source]¶ Add subparser for the
<test_package> runcommand- Parameters
subparsers –
argparse._SubParsersActionobject for the test package ArgumentParser (i.e. the object returned by theadd_subparsers()method)config_module – (Optional) The module object for
<test_project>.config. Will usewebdriver_test_tools.configif not specified if unspecifiedparents – (Default:
[]) Parent parsers for the run subparserformatter_class – (Default:
argparse.RawTextHelpFormatter) Class to use for theformatter_classparameter
- Returns
argparse.ArgumentParserobject for the newly addedrunsubparser
-
webdriver_test_tools.project.cmd.run.get_browser_config_classes(config_module)[source]¶ Get the
BrowserConfigandBrowserStackConfigclasses from a project.- Parameters
config_module – The module object for
<test_project>.config- Returns
Tuple containing:
config_module.BrowserConfig(orwebdriver_test_tools.config.BrowserConfigif not present inconfig_module)config_module.BrowserStackConfig(orwebdriver_test_tools.config.BrowserStackConfigif not present inconfig_module)
-
webdriver_test_tools.project.cmd.run.parse_run_args(tests_module, config_module, args)[source]¶ Parse arguments and run the ‘run’ command
- Parameters
tests_module – The module object for
<test_project>.testsconfig_module – The module object for
<test_project>.configargs – The namespace returned by parser.parse_args()
- Returns
Exit code, 0 if tests were successful, 1 otherwise
-
webdriver_test_tools.project.cmd.run.run_tests(tests_module, config_module, browser_classes=None, test_class_map=None, skip_class_map=None, test_module_names=None, skip_module_names=None, browserstack=False, headless=False, verbosity=None)[source]¶ Run tests using parsed args and project modules
- Parameters
tests_module – The module object for
<test_project>.testsconfig_module – The module object for
<test_project>.configorwebdriver_test_tools.configif not specifiedbrowser_classes – (Optional) List of browser test classes from parsed arg for
--browsercommand line argumenttest_class_map – (Optional) Result of passing parsed arg for
--testcommand line argument toparse_test_names()skip_class_map – (Optional) Result of passing parsed arg for
--skipcommand line argument toparse_test_names()test_module_names – (Optional) Parsed arg for
--modulecommand line argumentskip_module_names – (Optional) Parsed arg for
--skip-modulecommand line argumentbrowserstack – (Default = False) If True, generated test cases should run on BrowserStack
headless – (Default = False) If True, configure driver to run tests in a headless browser. Tests will only be generated for drivers that support running headless browsers
verbosity – (Optional) Output verbosity level for the test runner.
- Returns
Exit code, 0 if tests were successful, 1 otherwise