Installing and running Apidog CLI
Apidog CLI is designed to run Apidog test scenarios in the command line. To get started using Apidog CLI, install Node.js, then Apidog CLI. Then you can run your test scenarios.
Installing Apidog CLI
Apidog CLI is built on Node.js. To run Apidog CLI, Please install Node.js before using it.
The Apidog CLI relies on Node.js version number >= v16.
Install Apidog CLI from npm globally on your system, enabling you to run it from anywhere:
npm install -g apidog-cli
Here are some commands to verify if Apidog CLI is installed successfully.
node -v && apidog -v && which node && which npm && which apidog
If installed successfully, it will directly print the version number and installation path after executing commands above.
Updating Apidog CLI
Use the command below to upgrade Apidog CLI.
$ npm install apidog-cli@latest -g
Running Apidog CLI
To run test scenarios using the Apidog CLI, you first need to create and orchestrate a test scenario. Then, you can run the test scenario from the command line using the Apidog CLI, just like running it in the visual interface, and get a test report.
The Apidog CLI supports two ways of running:
- Running with online data: This is suitable for live scenarios.
- Running with exported test scenarios: This is suitable for offline scenarios.
Running with online data
:::highlight purple
Learn more about access token.
:::
Click the command to copy it.
Paste and run the command in the command line. You'll get a test report in command line.
:::tip[]
When running with online data, all variables will use their INITIAL values.
:::
Running with exported test scenarios
:::tip[]
When exporting and running with local data, all variables will use their CURRENT values.
:::
CLI test report
After running the CLI, you will receive a command-line test report that includes execution statistics for test scenarios and validation and assertions for failed requests.
You can also find the /apidog-reports/ directory in the folder where you ran the CLI. This directory contains the CLI test report in HTML format.
Options
Apidog CLI provides a rich set of options to customize a collection run. Learn more at Apidog CLI Options.
Using Apidog CLI with CI/CD
Apidog CLI supports integration with various pipeline tools, such as Jenkins, GitLab, GitHub Actions, and more. Learn more about integrating CI/CD.