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
  • subparsersargparse._SubParsersAction object for the test package ArgumentParser (i.e. the object returned by the add_subparsers() method)

  • config_module – (Optional) The module object for <test_project>.config. Will use webdriver_test_tools.config if not specified if unspecified

  • parents – (Default: []) Parent parsers for the run subparser

  • formatter_class – (Default: argparse.RawTextHelpFormatter) Class to use for the formatter_class parameter

Returns

argparse.ArgumentParser object for the newly added run subparser

webdriver_test_tools.project.cmd.run.get_browser_config_classes(config_module)[source]

Get the BrowserConfig and BrowserStackConfig classes from a project.

Parameters

config_module – The module object for <test_project>.config

Returns

Tuple containing:

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 or webdriver_test_tools.config if not specified

  • browser_classes – (Optional) List of browser test classes from parsed arg for --browser command line argument

  • test_class_map – (Optional) Result of passing parsed arg for --test command line argument to parse_test_names()

  • skip_class_map – (Optional) Result of passing parsed arg for --skip command line argument to parse_test_names()

  • test_module_names – (Optional) Parsed arg for --module command line argument

  • skip_module_names – (Optional) Parsed arg for --skip-module command line argument

  • browserstack – (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