|
1 |
| -# TODO |
| 1 | +# API Test Cases Documentation |
| 2 | + |
| 3 | +This document provides instructions on how to run the API test cases using Postman and Newman. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +Before running the test cases, make sure you have the following prerequisites installed: |
| 8 | + |
| 9 | +- [Postman](https://www.postman.com/downloads/) |
| 10 | +- [Node.js](https://nodejs.org/) (v20.x or higher) |
| 11 | + |
| 12 | +## Getting Started |
| 13 | + |
| 14 | +1. Clone the repository (if not already done): |
| 15 | + |
| 16 | + ```bash |
| 17 | + git clone git@github.com:OsmosysSoftware/osm-transcript-summarizer.git |
| 18 | + ``` |
| 19 | + |
| 20 | +2. Install Newman globally (for using Newman): |
| 21 | + |
| 22 | + ```bash |
| 23 | + npm install -g newman |
| 24 | + |
| 25 | + # Optional, for generating HTML reports |
| 26 | + npm install -g newman-reporter-html |
| 27 | + ``` |
| 28 | + |
| 29 | +3. Import the Postman collection: |
| 30 | + |
| 31 | + 1. Open Postman. |
| 32 | + 2. Click on the `Import` button. |
| 33 | + 3. Select the `apps/api/Transcript Summarization.postman_collection.json` file. |
| 34 | + |
| 35 | +## Running Test Cases |
| 36 | + |
| 37 | +### Using Postman |
| 38 | + |
| 39 | +1. Open Postman. |
| 40 | +2. Select the imported collection and click on the `Run` button near the top right. |
| 41 | + |
| 42 | + Alternatively, click the three dots beside the collection name and click `Run collection` |
| 43 | + |
| 44 | +3. Select the environment on top right. |
| 45 | +4. Click `Run Transcript Summarizer` to execute the test cases. |
| 46 | + |
| 47 | +### Using Newman |
| 48 | + |
| 49 | +1. Export the environment file from Postman. |
| 50 | +2. Open a terminal and run one of the following commands: |
| 51 | + |
| 52 | + 1. For console output |
| 53 | + |
| 54 | + ```bash |
| 55 | + newman run Transcript Summarizer.postman_collection.json -e Transcript Summarizer.postman_environment.json |
| 56 | + ``` |
| 57 | + |
| 58 | + 2. For HTML report |
| 59 | + |
| 60 | + ```bash |
| 61 | + newman run Transcript Summarizer.postman_collection.json -e Transcript Summarizer.postman_environment.json -r html |
| 62 | + ``` |
| 63 | + |
| 64 | + Specify the path to the collection and environment file as required. |
| 65 | + |
| 66 | +## Viewing Results |
| 67 | + |
| 68 | +Both Postman and Newman provide detailed reports after running the test cases. You can view: |
| 69 | + |
| 70 | +- **Run results (for Postman):** Check the results on the Run results page in Postman after testing is completed. |
| 71 | + |
| 72 | +  |
| 73 | + |
| 74 | +- **Console Output (for Newman):** Check the terminal/console for test execution details. |
| 75 | + |
| 76 | +  |
| 77 | + |
| 78 | +- **HTML Report (for Newman):** After running Newman with the `-r html` flag, an HTML report is generated. Open the `newman/` directory and find the HTML file. |
| 79 | + |
| 80 | +  |
0 commit comments