Difference between revisions of "stoney core: REST API (Testing)"
[unchecked revision] | [unchecked revision] |
(→Tests) |
(→Tests) |
||
Line 25: | Line 25: | ||
= Tests = | = Tests = | ||
− | == Basic Helper == | + | == Basic Helper Files == |
The jasmin-node framework automatically includes all script files which contain helper or helpers. Therefore we can put all boiler plate code into this/these script files. Currently we have on file: | The jasmin-node framework automatically includes all script files which contain helper or helpers. Therefore we can put all boiler plate code into this/these script files. Currently we have on file: | ||
spec_helper.js | spec_helper.js |
Revision as of 15:29, 8 August 2014
Contents
- 1 Overview
- 2 stoney core resources
- 3 Testing Naming Schema
- 4 Tests
Overview
This page describes, how and what to test. The goal is to automate all tests with Frisby. Frisby is a REST API testing framework built on node.js and Jasmine.
stoney core resources
The following stoney core resources have automated Frisby tests:
- stoney core: Authentication Resource - REST API
- stoney core: Resellers Resource - REST API
- stoney core: Customers Resource - REST API
- stoney core: People Resource - REST API
- stoney core: Search Resource - REST API
Testing Naming Schema
The automated Frisby tests test all resources and sorted based on users and their relationships. As described in stoney core: REST API, the relationships are hierarchical:
Service Provider Person > Reseller Employee > Customer Employee > Reseller Person and Customer Person
The further down you go, the less rights a person has. Therefore the same tests can be run for all the users, just the expectations change. To make sure, that the tests are executed in the proper order, the following naming schema applies:
- 00xx Header and basic JSON validation
- 01xx Authentication
- 02xx Service Provider Person (SPP)
- 03xx Reseller Employee (RE)
- 04xx Reseller Person (PP)
- 05xx Customer Employee (CE)
- 06xx Customer Person (CP)
Tests
Basic Helper Files
The jasmin-node framework automatically includes all script files which contain helper or helpers. Therefore we can put all boiler plate code into this/these script files. Currently we have on file:
spec_helper.js
00xx Header and basic JSON validation
0000 Header Checks
0000_header_spec.js
0001 Basic JSON validation Checks
0001_basic_json_validation_spec.js
What do we want to test?
- Check for valid JSON in resellers, customers and people resources (POST, PUT or PATCH).
- Check input validation in random resources (POST, PUT or PATCH).
01xx Authentication
0100 Authentication Checks
0100_auth_spec.js
02xx Service Provider Person (SPP)
0200_service_provider_person_resellers_collection_retrieval_spec.js
0201_service_provider_person_resellers_element_retrieval_spec.js
0202_service_provider_person_customers_collection_retrieval_spec.js
0203_service_provider_person_customers_element_retrieval_spec.js
0204_service_provider_person_people_collection_retrieval_spec.js
0205_service_provider_person_people_element_retrieval_spec.js
0207_service_provider_person_search_resellers_spec.js
0208_service_provider_person_search_customers_spec.js
0209_service_provider_person_search_people_spec.js