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
init
subparser was added to theArgumentParser
object via theadd_init_subparser()
method before parsing.The
init
subparser has optional arguments for each of this method’s prompts.package_name
is 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_name
isNone
but 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
Namespace
object returned byparser.parse_args()
. It is assumed that theinit
subparser was added to theArgumentParser
that returned thisNamespace
-
webdriver_test_tools.cmd.init.
add_init_subparser
(subparsers, parents=[])[source]¶ Add subparser for the
wtt init
command- Parameters
subparsers –
argparse._SubParsersAction
object for thewtt
ArgumentParser (i.e. the object returned by theadd_subparsers()
method)parents – (Default:
[]
) Parent parsers for the init subparser
- Returns
argparse.ArgumentParser
object for the newly addedinit
subparser
-
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