Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 35 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,44 @@
# 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`
- `npm run test`

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":"<base url for user management>",
"adminUser":"<admin username>",
"adminPassword":"<password for admin>"
},

"system":{
"baseUrl":"<base URL for Gateway>",
"username":"<producer/poc username>",
"password":"<password>"
}
}

```


## Adding more test cases
- create a file in `src/__tests__` folder.
Expand All @@ -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', () => {
Expand All @@ -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
Expand Down