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> run
command- Parameters
subparsers –
argparse._SubParsersAction
object 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.config
if not specified if unspecifiedparents – (Default:
[]
) Parent parsers for the run subparserformatter_class – (Default:
argparse.RawTextHelpFormatter
) Class to use for theformatter_class
parameter
- Returns
argparse.ArgumentParser
object for the newly addedrun
subparser
-
webdriver_test_tools.project.cmd.run.
get_browser_config_classes
(config_module)[source]¶ Get the
BrowserConfig
andBrowserStackConfig
classes from a project.- Parameters
config_module – The module object for
<test_project>.config
- Returns
Tuple containing:
config_module.BrowserConfig
(orwebdriver_test_tools.config.BrowserConfig
if not present inconfig_module
)config_module.BrowserStackConfig
(orwebdriver_test_tools.config.BrowserStackConfig
if 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>.tests
config_module – The module object for
<test_project>.config
args – 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>.tests
config_module – The module object for
<test_project>.config
orwebdriver_test_tools.config
if not specifiedbrowser_classes – (Optional) List of browser test classes from parsed arg for
--browser
command line argumenttest_class_map – (Optional) Result of passing parsed arg for
--test
command line argument toparse_test_names()
skip_class_map – (Optional) Result of passing parsed arg for
--skip
command line argument toparse_test_names()
test_module_names – (Optional) Parsed arg for
--module
command line argumentskip_module_names – (Optional) Parsed arg for
--skip-module
command 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