Skip to content

API Integration Testing Plan

DotFreelance edited this page Apr 7, 2017 · 2 revisions

MVP API Testing Plan

All tests must validate the returned JSON format and Object format.

Expected format includes checking that:

  • The JSON format is valid
  • The appropriate plurality is returned ( a single object vs an array of objects )
  • The expected components for each Object are available, and the ones that should not be are not
  • Objects with children have the expected children ( e.g. Events have all the Services )
  • The children are delivered in an expected and valid JSON format
  • Do not validate the children’s Object format, do that in the tests for the children Objects ( e.g. don’t bother worrying about what a Service has or looks like when you’re testing Events, only check that the correct Services are there, probably by ID. Do the validation of Services when you’re testing Services! )

Events

Create new Event

POST api/events

  1. Create a new Event

List all Events

GET api/events

  1. List all Events

List a single Event

GET api/events/{event}

  1. List a single, specified Event, validate it is the correct Event by ID

Update an Event

PUT,PATCH api/events/{event}

  1. Update a single, specified Event, validate the update is correct and stored

Delete an Event

DELETE api/events/{event}

  1. Delete a single, specified Event, validate that:
  • Only that Event was deleted and not the Services or ServiceTags associated with it
  • No other Events were deleted

Get Services for an Event

GET api/events/{event}/services

  1. Get the Services attached to an Event, validate that:
  • the correct Services were retrieved by IDs
  • the correct number of Services are retrieved

Add Service to Event

POST api/events/{event}/services/{service}

  1. Add a known Service to an Event, validate that:
  • the correct Service was added by ID
  • only the correct Service was added

Remove Service from Event

DELETE api/events/{event}/services/{service}

  1. Remove a Service from an Event, validate that:
  • the correct Service was removed
  • only the correct Service was removed

Services

Create new Service

POST api/services

  1. Create a new Service

List all Services

GET api/services

  1. List all Services

List a single Service

GET api/services/{service}

  1. List a single, specified Service, validate it is the correct Service by ID

Update a Service

PUT,PATCH api/services/{service}

  1. Update a single, specified Service, validate the update is correct and stored

Delete a Service

DELETE api/services/{service}

  1. Delete a single, specified Service, validate that:
  • Only that Service was deleted and not the ServiceTags associated with it
  • No other Services were deleted

Get ServiceTags for a Service

GET api/services/{service}/service_tags

  1. Get the ServiceTags attached to a Service, validate that:
  • the correct ServiceTags were retrieved by IDs
  • the correct number of ServiceTags are retrieved

Add ServiceTag to Service

POST api/services/{service}/service_tags/{service_tag}

  1. Add a known ServiceTag to a Service, validate that:
  • the correct ServiceTag was added by ID
  • only the correct ServiceTag was added

Remove ServiceTag from Service

DELETE api/services/{service}/service_tags/{service_tag}

  1. Remove a ServiceTag from a Service, validate that:
  • the correct ServiceTag was removed
  • only the correct ServiceTag was removed

ServiceTags

Create new ServiceTag

POST api/service_tags

  1. Create a new ServiceTag

List all ServiceTags

GET api/service_tags

  1. List all ServiceTags

List a single ServiceTag

GET api/service_tags/{service_tag}

  1. List a single, specified ServiceTag, validate it is the correct ServiceTag by ID

Update a ServiceTag

PUT,PATCH api/service_tags/{service_tag}

  1. Update a single, specified ServiceTag, validate the update is correct and stored

Delete a ServiceTag

DELETE api/service_tags/{service_tag}

  1. Delete a single, specified ServiceTag, validate that:
  • No other ServiceTags were deleted

Filters & Ordering

Order Event

GET /api/events?order-by=<column_name>&order=<ASC|DESC>

  1. Default order test
  2. Alternate order test

Order Service

GET /api/services?order-by=<column_name>&order=<ASC|DESC>

  1. Default order test
  2. Alternate order test

Order ServiceTag

GET /api/service_tags?order-by=<column_name>&order=<ASC|DESC>

  1. Default order test
  2. Alternate order test

Filter Service By Id

GET /api/services?filter-ids=<id>

  1. Single service test
  2. Multiple service test
  3. Empty test

Filter ServiceTag by Id

GET /api/service_tags?filter-ids=<ids>

  1. Single serviceTag test
  2. Multiple serviceTags test
  3. Empty test

Filter Service By Except Id

GET /api/services?filter-except-ids=<ids>

  1. Single service filtered out test
  2. Multiple services filtered out test
  3. Empty test

Filter ServiceTag by Except Id

GET /api/service_tags?filter-except-ids=<ids>

  1. Single serviceTag filtered out test
  2. Multiple serviceTags filtered out test
  3. Empty test

Filter Service by Tag Id

GET /api/services?filter-tag-ids=<ids>

  1. Single service by serviceTag test
  2. Multiple services by serviceTag test
  3. Empty test

Multi Filter

  1. Any API, apply two or more filters and validate results

Filter Services on Event

GET /api/events/{event}/services?filter-ids=<ids>

  1. Filter by ID test
  2. Filter by except ID test
  3. Filter by ID of serviceTag test
  4. Ordering test

Filter ServiceTags on Service

GET /api/services/{service}/service_tags?filter-ids=<ids>

  1. Filter by ID test
  2. Filter by except ID test
  3. Ordering test