From cc015ad006f07b43623eb4e8b0da5b10a403f639 Mon Sep 17 00:00:00 2001 From: Naresh Kumar D Date: Thu, 25 May 2023 10:35:27 +0530 Subject: [PATCH] Update README.md --- README.md | 41 +++++++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 84045fd..fe9f849 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,17 @@ # TDEI-api-tester -API tester for the client-API received from swagger +API tester for the client-API received from swagger. -# Steps +This component helps in testing the Gateway APIs by running tests on all the APIs that the gateway exposes. + +The Gateway API are exposed as [Swagger](https://tdei-gateway-dev.azurewebsites.net/swagger-ui/index.html) + +For Seeding the initial data on tests, this component also makes use of usermanagement portal that is hosted [here](https://tdei-usermanagement-ts-stage.azurewebsites.net). The `seeder.ts` class takes care of generation of org, station, service details appropriately. + +The component runs by importing the generated API classes of APIs and testing each of the functions. + +The API methods are autogenerated and are available in [API-Client](https://github.com/TaskarCenterAtUW/TDEI-api-client). + +# Steps to run tests - The testing rig is currently configured based on `test-harness.json` file. - An example of the file is already given as `test-harness.example.json` - `npm i` @@ -9,6 +19,26 @@ API tester for the client-API received from swagger The above code runs the tests and generates a `test-report.html` (already included for reference) +## Test harness format (json) +The `test-harness.json` file is used for getting the credentials of the system. + +```json +{ + "seed":{ + "baseUrl":"", + "adminUser":"", + "adminPassword":"" + }, + + "system":{ + "baseUrl":"", + "username":"", + "password":"" + } +} + +``` + ## Adding more test cases - create a file in `src/__tests__` folder. @@ -26,7 +56,7 @@ The above code runs the tests and generates a `test-report.html` (already includ > Then - Assert result -``` +```typescript describe('my-awesome-test', () => { const getTestData => return {}; it('should validate schema response', () => { @@ -42,10 +72,9 @@ describe('my-awesome-test', () => { ``` -## TODO: - Document on what the component is and where it helps -## Seeder requirements + +## Seeder requirements (for implementation) - To enhance the testing with different personas and varied systems, it is imperative that we generate some scripts that allow generation of users and other seed data required for testing. - Here are the requirements for seed data generation