webdriver_test_tools.cmd.init module¶
-
webdriver_test_tools.cmd.init.main(args)[source]¶ Command line dialogs for initializing a test project
This method takes the parsed command line arguments as a parameter. It’s assumed that the
initsubparser was added to theArgumentParserobject via theadd_init_subparser()method before parsing.The
initsubparser has optional arguments for each of this method’s prompts.package_nameis the only argument required to create the package, so this method will attempt to bypass input prompts if it’s set to something other thanNone.If
package_nameisNonebut one or more of the other parameters are notNone, this method will attempt to bypass their corresponding input prompts if the value passed as a parameter is valid.- Parameters
args – The
Namespaceobject returned byparser.parse_args(). It is assumed that theinitsubparser was added to theArgumentParserthat returned thisNamespace
-
webdriver_test_tools.cmd.init.add_init_subparser(subparsers, parents=[])[source]¶ Add subparser for the
wtt initcommand- Parameters
subparsers –
argparse._SubParsersActionobject for thewttArgumentParser (i.e. the object returned by theadd_subparsers()method)parents – (Default:
[]) Parent parsers for the init subparser
- Returns
argparse.ArgumentParserobject for the newly addedinitsubparser
-
webdriver_test_tools.cmd.init.validate_project_title(project_title)[source]¶ Sanitizes string to avoid syntax errors when inserting the title into template files
- Parameters
project_title – The desired project title
- Returns
Modifed project_title with only alphanumeric characters, spaces, underscores, and hyphens