Command line tool for Apidog
npm install apidog-cliApidog CLI is a command line tool to run Test Case of Apidog
To run Apidog CLI, please make sure your Node.js >= 10. Install Node.js
Install Apidog CLI with the follow command
``console`
$ npm install -g apidog-cli
Export your test case data as a Apidog CLI formatted file from Apidog
`console`
$ apidog run examples/sample.apidog-cli.json -r cli,html
The test report will be saved in apidog-reports of current directory
- If you want to customize report, you can pass through the follow option -r cli,json to get the json formatted result
- -h, --help
Show command line help, including a list of options, and sample use cases.
- -v, --version
Displays the current Apidog CLI version
file-source is the file path of the export test case data from Apidog
Options:
``
--access-token
-t, --test-scenario
-f, --test-scenario-folder
-r, --reporters [reporters] Specify test report file extension, support cli, html, json, junit (default: ["cli"])
--out-dir
(default: "./apidog-reports")
--out-file
(default: "apidog-report-2022-10-25-15-03-50-160-0")
-e, --environment Specify the runtime environment. All test scenarios in this execution
--variables Specify the file path containing the environment/global variables. If it's not specified, the environment/global variables will use initial values by default.
-n, --iteration-count
-d, --iteration-data
--on-error
--env-var
--global-var
--notification
--notification-failed-event
--external-program-path
--database-connection
--ignore-redirects Prevent Apidog from automatically following 3XX redirect response
--silent Prevent Apidog CLI from showing output
--color
--delay-request [n] Specify the extent of delay between requests (milliseconds) (default: 0)
--timeout-request [n] Specify a timeout for requests (milliseconds) (default: 0)
--timeout-script [n] Specify a timeout for pre/post requests (milliseconds) (default: 0)
-k, --insecure Disables SSL validations
--ssl-client-cert-list
--ssl-client-cert
--ssl-client-key
--ssl-client-passphrase
--ssl-extra-ca-certs
--upload-report Upload the overview of this test report to the cloud, and you can view this test report in the app
-b, --bigint Compatible bigint (default: false)
--verbose Show detailed information of each request
--lang
-h, --help display help for command
#### Client Certificates
Apidog CLI supports SSL client certificates
#### Using a single SSL client certificate
- --ssl-client-cert
The path to the public client certificate file.
- --ssl-client-key
The path to the private client key (optional).
- --ssl-client-passphrase
The secret passphrase used to protect the private client key (optional).
#### Using SSL client certificates configuration file (supports multiple certificates per run)
- --ssl-client-cert-listssl-client-cert-list.json
The path to the SSL client certificate list configuration file (JSON format). See
`
ssl-client-cert-list.json
[
{
"name": "domain1",
"matches": ["https://test.domain1.com/", "https://www.domain1/"],
"key": {"src": "./client.domain1.key"},
"cert": {"src": "./client.domain1.crt"},
"passphrase": "changeme"
},
{
"name": "domain2",
"matches": ["https://domain2.com/*"],
"key": {"src": "./client.domain2.key"},
"cert": {"src": "./client.domain2.crt"},
"passphrase": "changeme"
}
]
`
This option allows setting different SSL client certificate according to URL or hostname. This option takes precedence over --ssl-client-cert, --ssl-client-key and --ssl-client-passphrase options. If there is no match for the URL in the list, these options are used as fallback.
Upgrade Apidog CLI with the follow command
`console``
$ npm install apidog-cli@latest -g
###