Hi friends!!! Today, I would like to introduce vREST NG CLI which is the command line partner of vREST NG Application. With vREST NG CLI, you will be able to execute your API tests on the command line as well. It uses the same runner component as used by the vREST NG Application itself. So, whatever works in the vREST NG UI Application will seamlessly work on the command line as well using vREST NG CLI without any further hassle. It also provides beautiful and usable reports to debug your API failures quickly.
Follow the instructions to download and install this utility from this github link. vREST NG CLI provides the following two commands:
1. Run Command:
Run command will help you in the following tasks:
You can execute your test cases on the command line. Provide the vREST NG project directory path to the
vrest-ng-cli
command to execute the tests. For detailed instructions, please follow our guide link.
$ vrest-ng-cli run --projectdir=<VREST_NG_PROJECT_DIR_PATH>
You can monitor your APIs health at specific intervals by linking this command with any third party schedular or cron utility.
You can validate your application builds by integrating this command with any CI/CD servers like Jenkins, TeamCity, Azure DevOps, Gitlab CI, CircleCI, Bitbucket pipelines etc.
Run command provides the following loggers to provide the detailed execution report:
-
Console Logger: This is the default logger. This logger will output the test execution log on the console in a beautiful way. It will print the test summary, assertions results and diff report in case of test failure on the console.
Execution on the Command Line: If you execute the tests on the command line then
vrest-ng-cli
provides the report in the following way:And if you are executing the data driven tests, then it will show you the test case summary, iteration number and iteration summary to easily debug your API failures.
Execution in Jenkins: The same console report is also available in any CI/CD Servers like Jenkins server as shown below:
-
XUnit Logger: This XUnit logger will generate the xml report which can be used in any CI/CD servers like Jenkins to publish the report. The published reports using xunit logger provides the following two types of report:
a) Failed Test Cases List Report
b) Individual Test Case Failure Report
JSON Logger: This logger will generate the report in JSON format which you may consume by any other tool/script.
-
CSV Logger: This logger will generate the report in CSV format. So that you can visualise the report with Microsoft Excel Sheet, Numbers etc.
2. Import Command
Import command will help you in achieving the following tasks:
- It is helpful in importing tests from various sources like vREST Cloud, Postman, Swagger.
- It can also be used in syncing your tests automatically whenever there is some change in swagger schema file.
So, in this way, you may use vrest-ng-cli utility to continuously validate your application or sync your test cases with swagger definitions changes.
This post is just an introduction to vREST NG CLI utility. I will post detailed step by step instructions on integrating this with CI/CD servers later on. If you like this post helpful then do like, comment and share with your friends and colleagues. You can connect with me on LinkedIn and feel free to message me if you would like to discuss anything.
Top comments (0)