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 provides beautiful and usable reports to debug your API failures quickly.
You may download 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. Simply provide the vREST NG project directory path to the CLI 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, CircleCI, Bitbucket pipelines etc.
Run command provides the following loggers to provide the detailed execution report:
1. Console 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:
Execution in Jenkins: The same console report is also available in any CI/CD Servers like Jenkins server as shown below:
2. 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
3. JSON Logger: This logger will generate the report in JSON format which you may consume by any other tool/script.
4. 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.
One real world use case of import command is, suppose you are maintaining the API specifications in swagger files and your specs keeps changing over a period of time. So, instead of updating the schema definitions manually for your API tests, you may schedule the import command which automatically updates your tests by re-importing the swagger files at scheduled intervals.
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.
If you are facing any issues related to API Automated testing in your organization, then do contact us. We will arrange the live meeting to discuss your needs and will also provide you the demo of our product vREST NG showcasing its capabilities.
If you like this post helpful then do like, comment and share with your friends and colleagues. You can connect with me, follow me for amazing articles on API Test Automation and feel free to message me if you would like to discuss anything.