Difference between revisions of "stoney core: REST API (Testing)"

From stoney cloud
Jump to: navigation, search
[unchecked revision][checked revision]
(Testing Naming Schema)
(02xx Service Provider Person (SPP))
 
(22 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
= Overview =
 
= Overview =
This page describes, how and what to test. The goal is to automate all tests with [http://frisbyjs.com/ Frisby]. Frisby is a REST API testing framework built on node.js and Jasmine.
+
This page describes, how and what to test. The goal is to automate all tests with [http://frisbyjs.com/ Frisby]. Frisby is a REST API testing framework built on [http://nodejs.org/ node.js] and [http://jasmine.github.io/ Jasmine].
  
 
= stoney core resources =
 
= stoney core resources =
Line 15: Line 15:
 
'''Service Provider Person''' > '''Reseller Employee''' > '''Customer Employee''' > '''Reseller Person''' and '''Customer Person'''
 
'''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.
+
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 [[stoney_core:_REST_API#Service_Provider_Person_.28SPP.29 | Service Provider Person (SPP)]]
 +
* 03xx [[stoney_core:_REST_API#Reseller_Employee_.28RE.29 | Reseller Employee (RE)]]
 +
* 04xx [[stoney_core:_REST_API#Reseller_Person_.28P.29_and_Customer_Person_.28P.29 | Reseller Person (PP)]]
 +
* 05xx [[stoney_core:_REST_API#Customer_Employee_.28CE.29 | Customer Employee (CE)]]
 +
* 06xx [[stoney_core:_REST_API#Reseller_Person_.28P.29_and_Customer_Person_.28P.29 | Customer Person (CP)]]
  
To make sure, that the tests are executed in the proper order, the following naming schema applies:
+
= Tests =
* 0000_header_spec_js: Header (these tests will probably also be integrated into the tests based on the relationships)
+
== Basic Helper Files ==
* 0100_authentication_abc_spec_js: Authentication (these tests will probably also be integrated into the tests based on the relationships)
+
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:
* 0200_service_provider_person_spec.js: [[stoney_core:_REST_API#Service_Provider_Person_.28SPP.29 | Service Provider Person (SPP)]]
+
spec_helper.js
* 0300_reseller_employee_spec_js: [[stoney_core:_REST_API#Reseller_Employee_.28RE.29 | Reseller Employee (RE)]]
+
* 0400_reseller_person_spec_js: [[stoney_core:_REST_API#Reseller_Person_.28P.29_and_Customer_Person_.28P.29 | Reseller Person (PP)]]
+
* 0500_customer_employee_spec_js: [[stoney_core:_REST_API#Customer_Employee_.28CE.29 | Customer Employee (CE)]]
+
* 0600_customer_person_spec_js: [[stoney_core:_REST_API#Reseller_Person_.28P.29_and_Customer_Person_.28P.29 | Customer Person (CP)]]
+
  
= What are we testing? =
+
== 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_reseller_element_retrieval_spec.js
 +
 +
0202_service_provider_person_customers_collection_retrieval_spec.js
 +
 +
0203_service_provider_person_customer_element_retrieval_spec.js
 +
 +
0204_service_provider_person_people_collection_retrieval_spec.js
 +
 +
0205_service_provider_person_person_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
 +
 +
== 03xx Reseller Employee (RE) ==
 +
=== 0300 Reseller Employee (RE) Reseller collection retrieval (GET) ===
 +
0300_reseller_employee_resellers_collection_retrieval_spec.js
 +
 +
What do we want to test?
 +
* Do the two reseller employees each only see their own reseller when retrieving a reseller collection (GET)?
 +
 +
== 04xx Reseller Person (PP) ==
 +
=== 0400 Reseller Person (PP) Reseller collection retrieval (GET) ===
 +
0400_reseller_person_resellers_collection_retrieval_spec.js
 +
 +
What do we want to test?
 +
* Do the two reseller people (non-employees) not see any resellers when retrieving a reseller collection (GET)?
 +
 +
== 05xx Customer Employee (CE) ==
 +
=== 0500 Customer Employee (CE) Reseller collection retrieval (GET) ===
 +
0500_customer_employee_resellers_collection_retrieval_spec.js
 +
 +
What do we want to test?
 +
* Do the two customer employees not see any resellers when retrieving a reseller collection (GET)?
 +
 +
== 06xx Customer Person (CP) ==
 +
=== 0600 Customer Person (CP) Reseller collection retrieval (GET) ===
 +
0600_customer_person_resellers_collection_retrieval_spec.js
 +
 +
What do we want to test?
 +
* Do the two customer people (non-employees) not see any resellers when retrieving a reseller collection (GET)?
  
  
 
[[Category:REST API]][[Category:stoney core]]
 
[[Category:REST API]][[Category:stoney core]]

Latest revision as of 10:44, 10 August 2014

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:

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:

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_reseller_element_retrieval_spec.js
0202_service_provider_person_customers_collection_retrieval_spec.js
0203_service_provider_person_customer_element_retrieval_spec.js
0204_service_provider_person_people_collection_retrieval_spec.js
0205_service_provider_person_person_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

03xx Reseller Employee (RE)

0300 Reseller Employee (RE) Reseller collection retrieval (GET)

0300_reseller_employee_resellers_collection_retrieval_spec.js

What do we want to test?

  • Do the two reseller employees each only see their own reseller when retrieving a reseller collection (GET)?

04xx Reseller Person (PP)

0400 Reseller Person (PP) Reseller collection retrieval (GET)

0400_reseller_person_resellers_collection_retrieval_spec.js

What do we want to test?

  • Do the two reseller people (non-employees) not see any resellers when retrieving a reseller collection (GET)?

05xx Customer Employee (CE)

0500 Customer Employee (CE) Reseller collection retrieval (GET)

0500_customer_employee_resellers_collection_retrieval_spec.js

What do we want to test?

  • Do the two customer employees not see any resellers when retrieving a reseller collection (GET)?

06xx Customer Person (CP)

0600 Customer Person (CP) Reseller collection retrieval (GET)

0600_customer_person_resellers_collection_retrieval_spec.js

What do we want to test?

  • Do the two customer people (non-employees) not see any resellers when retrieving a reseller collection (GET)?