Postman is a tool used for API Testing. Postman allows to send requests and receive responses through the API protocols. Based on the response received, we can verify the status codes to see if the protocols are working. KEEP doesn’t have a GUI but using Postman, we can test the KEEP APIs.
In Postman, we can create collections, environments and user defined folders. For each API, there are JSON files. Additionally, you can also import an existing JSON file in Postman application using the Import button. The API’s can be tested under different environments, like UAT.
To carry out end-to-end Acceptance Testing of KEEP, we have provided collection and environment JSONs in the KEEP directory. These files are available at /domino-keep\keep-core\src\test\downstream-openclient. Import these files into Postman. In the test collections, there are 4 folders, corresponding to the following 4 KEEP core APIs:
Before you run the tests, make sure that auth is running in Postman i.e. if you send a request, you should receive a response. If you get an error, make sure that the docker is running. Follow one of the below methods to execute the KEEP tests.
- In the domino-keep directory, is the collection_runner.cmd.
- In the command prompt, navigate to domino-keep directory and run collection_runner.cmd, as administrator.
- Select which API you want to run.
- Select the json file.
- After the tests have run, you’ll get an HTML report. This report gets saved under newman folder in domino-keep. The generated report shows the total iterations, assertions, failed tests and skipped tests. You can also find additional details in the report. The ‘Failed Tests’ tab on the top shows the assertions that failed, along with the error message.
- Once you have imported the collection and environment JSON files, you can run the test by hitting the Runner button in Postman.
- Select the collection and the folders to run. (You can also run the full collection.)
- Select the environment.
- Select ‘Save Response’.
- Run KEEP Acceptance. On the result window, you can see the assertions that failed. You can also export the results from here.