Command Line
|
This is a command line tool for TestRigor. It allows you to run TestRigor tests from the command line.
Installation
- Install Node.js (version 18 or higher)
-
Install TestRigor CLI:
npm install -g testrigor-cli
Usage
testrigor test-suite run <testSuiteId> --token <token> [OPTIONS]
Executes all tests in a testRigor test suite.
Options
Option | Description | Precondition |
---|---|---|
--verbose |
Enable detailed output during command execution | |
--async |
Start test execution without waiting for completion | |
--url |
Override default test URL with custom URL | |
--branch |
Specify Git branch name for test execution | Requires --commit |
--commit |
Specify Git commit hash for test execution | Requires --branch |
--localhost --url |
Enable localhost tunneling for local application testing on the specified URL. | Requires --url |
--file-path |
Upload local file for testing (ignored if URL provided) | |
--variables-path |
Load test variables from JSON file path | |
--test-cases-path |
Load test cases from specified file glob pattern | testcases/*.{yaml,yml,txt} |
--rules-path |
Load custom rules from specified file path | rules/*.{yaml,yml,txt} |
--settings-path |
Load test suite settings from YAML or JSON file | |
--test-case-uuid |
Run single specific test case by UUID | Requires --url |
--auto-create-ai-rules |
Enable automatic AI-based rule generation during test execution | |
--explicit-mutations |
Allow this run to update and merge the test suite with data from local files. | Requires --test-cases-path |
--labels |
Filter tests to run only those with specified labels | Comma-separated values |
--excluded-labels |
Exclude tests with specified labels from execution | Comma-separated values |
--junit-report-save-path |
Save JUnit XML report to specified file path | Works only in sync mode |
Examples
-
Basic
testrigor test-suite run <test-suite-id> --token <token>
-
With new URL
testrigor test-suite run <test-suite-id> --token <token> --url <url>
-
With file upload
testrigor test-suite run <test-suite-id> --token <token> --file-path <path-to-file>
-
With branch
testrigor test-suite run <test-suite-id> --token <token> --branch <branch> --commit <commit>
-
With variables
testrigor test-suite run <test-suite-id> --token <token> --variables-path file.json
-
Localhost mode
testrigor test-suite run <test-suite-id> --token <token> --localhost --url <url>
-
With test cases
testrigor test-suite run <test-suite-id> --token <token> --test-cases-path test_cases/**/*.{yaml,txt}
-
With rules
testrigor test-suite run <test-suite-id> --token <token> --rules-path rules/**/*.yaml
-
With settings (can be JSON or YAML)
testrigor test-suite run <test-suite-id> --token <token> --settings-path settings.yaml
-
Run single test case
testrigor test-suite run <test-suite-id> --token <token> --test-case-uuid <id> --url <url>
-
Run single test case in localhost mode
testrigor test-suite run <test-suite-id> --token <token> --test-case-uuid <id> --localhost --url <url>
-
Run with auto create ai rules enabled
testrigor test-suite run <test-suite-id> --token <token> --test-cases-path test_cases/**/*.{yaml,txt} --auto-create-ai-rules
-
Run with explicit mutations enabled
testrigor test-suite run <test-suite-id> --token <token> --test-cases-path test_cases/**/*.{yaml,txt} --explicit-mutations
-
With all options
testrigor test-suite run <test-suite-id> --token <token> --localhost --url <url> --branch <branch> --commit <commit> --variables-path file.json --test-cases-path test_cases/**/*.{yaml,txt} --rules-path rules/**/*.{yaml,txt} --auto-create-ai-rules --explicit-mutations
-
Don’t wait for the test suite run to finish
testrigor test-suite run <test-suite-id> --token <token> --async
-
Save JUnit report (works only in sync mode)
testrigor test-suite run <test-suite-id> --token <token> --junit-report-save-path ./report.xml
-
With comma-separated labels
testrigor test-suite run <test-suite-id> --token <token> --labels <labels>
-
Excluding comma-separated labels
testrigor test-suite run <test-suite-id> --token <token> --excluded-labels <excluded-labels>