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 the ArgumentParser object via the add_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 than None.

If package_name is None but one or more of the other parameters are not None, 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 by parser.parse_args(). It is assumed that the init subparser was added to the ArgumentParser that returned this Namespace

webdriver_test_tools.cmd.init.add_init_subparser(subparsers, parents=[])[source]

Add subparser for the wtt init command

Parameters
  • subparsersargparse._SubParsersAction object for the wtt ArgumentParser (i.e. the object returned by the add_subparsers() method)

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

Returns

argparse.ArgumentParser object for the newly added init 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