The testdriverai CLI is the primary interface for running, managing, and debugging TestDriver scripts. It provides commands to execute tests, validate configurations, and interact with the TestDriver framework.

Usage

npx testdriverai@latest <command> [options]

Available commands

CommandDescription
runExecutes a TestDriver script.
validateValidates the syntax and structure of a TestDriver script.
initInitializes a new TestDriver project in the current directory.
versionDisplays the current version of the TestDriver CLI.
helpDisplays help information for the CLI or a specific command.

Example usage

Running a test script

npx testdriverai@latest run path/to/testdriver.yaml

This command runs the specified TestDriver script, executing all steps defined in the file.

Validating a script

npx testdriverai@latest validate path/to/testdriver.yaml

This command checks the syntax and structure of the script to ensure it’s valid before execution.

Initializing a new project

npx testdriverai@latest init

This command sets up a new TestDriver project in the current directory, creating the necessary folder structure and configuration files.

Checking the version

npx testdriverai@latest version

This command displays the installed version of the TestDriver CLI.

Getting help

npx testdriverai@latest help

This command displays general help information. To get help for a specific command, use:

npx testdriverai@latest help <command>

Protips

  • Use validate before running a script to catch errors early.
  • Combine run with CI/CD pipelines to automate test execution.
  • Use the --debug flag with run to enable detailed logging for troubleshooting.

Running init will create a blank testdriver.yaml file in the current directory. You can then edit this file to define your test steps.

Notes

  • The testdriverai CLI is cross-platform and works on macOS, Windows, and Linux.
  • Ensure you have the required dependencies installed and configured before running scripts.
  • For more advanced usage, refer to the official TestDriver documentation.