Project Functional Testing
For purposes of this API description, all URLs are relative to the base url of
http://localhost:8080/bn/api
The JSON used for testing purposes will match the format described in the
project API.
Functional testing will begin only after the tester was able to build
the project following your build instructions and then deploy the resulting
.war file to a tomcat server. If your build scripts generate something
else other than a .war file that's fine too, as long as the build & deploy
instructions are clear and work as expected.
The specific actions taken by the tester before beginning functional
acceptance testing are described here.
Values (in the expected response files) that are enclosed between angle
brackets will be substituted with actual values we recorded in the previous
testing steps. For example, if you see in the expected response
"uid": "<uid1>" it means that the test
will expect to see something like "uid": "79"
when it runs, where 79 is the value that was returned in a previous response
that we denoted as 'uid1'.
If you think that what you see below is a lot of testing, then you should
consider the fact that we're just scratching the surface testing:
for instance, we have very few tests that validate how your application
responds to invalid data in the request, and only one test for
submitting requests that violate application logic. In fact, all the tests
below represent a pretty minimalistic set of tests.
Below are the steps we'll take to test the functionality of your project.
NOTE: the testers reserve the right to do more extensive testing than
the tests below, by either adding more tests or by changing the request
payloads.
Lastly, we are developing a Postman script that automates the testing of
your project. The script performs the actions described in each test
(GET, POST, PUT, DELETE), using the payload that needs to be submitted,
as needed, and compares the output returned by your application with the
expected output.
Read more about how to run the script.
Test 'accounts'
-
Validate that there are exactly three accounts returned when the applicatin runs
for the first time ( GET /accounts ).
-
The HTTP status should be 200 (OK).
-
Here is the
expected response.
-
NOTE: the accounts with <uid0> and <uid1> are Regular User
accounts. The account with <uid2> is a Customer Service Representative
account. All three accounts will be used for testing.
-
NOTE: the actual values for 'date_created' will be those when the account
are first created, that's the date when we test the project.
-
Create an account ( POST /accounts ) using valid
data.
-
The request should return 201 (Created) and the HTTP header should contain
a 'Location' link to /accounts/<uid3>.
-
View data for the POST.
-
Here is the expected response.
-
Retain <uid3> and <date3> for subsequent tests.
-
Update the account identified by <uid3>
( PUT /accounts/<uid3> )
-
The HTTP status should be 204 (No content) and the body of the response empty.
-
View data for the PUT.
-
Verify that account <uid3> has been updated properly, i.e. the name has
been changed and date_created (returned as <date4>) is the same
as <date3> ( GET /accounts/<uid3> ).
-
Attempt to activate the account identified by <uid3> using PUT
( PUT /accounts/<uid3> ).
-
Activate account <uid3> ( GET /accounts/<uid3>/activate ).
-
View all accounts ( GET /accounts ).
-
Search accounts ( GET /accounts?key=main ).
-
Search accounts again with a different keyword
( GET /accounts?key=60616 ).
-
Search accounts with a date range
( GET /accounts?key=60616&start_date=31-Dec-2000&end_date=31-Dec-2001 ).
Test 'asks'
-
Create ask ( POST /accounts/<uid3>/asks ).
-
The request should return 201 (Created) and the HTTP header should contain
a 'Location' link to /accounts/<uid3>/asks/<aid1>
-
View data for the POST.
-
View the
expected response.
-
Retain <aid1> and <date5> for subsequent tests.
-
View ask <aid1> ( GET /asks/<aid1> )
-
Update ask <aid1> ( PUT /accounts/<uid3>/asks/<aid1> ).
-
The HTTP status should be 204 (No content) and the body of the response empty.
-
View data for the PUT.
-
Create ask ( POST /accounts/<uid3>/asks ).
-
The request should return 201 (Created) and the HTTP header should contain
a 'Location' link to /accounts/<uid3>/asks/<aid2>
-
View data for the POST.
-
View the
expected response.
-
Retain <aid2> and <date6> for subsequent tests.
-
Create ask ( POST /accounts/<uid3>/asks ).
-
The request should return 201 (Created) and the HTTP header should contain
a 'Location' link to /accounts/<uid3>/asks/<aid3>
-
View data for the POST.
-
View the
expected response.
-
Retain <aid3> for subsequent tests.
-
Deactivate <aid3>
( GET /accounts/<uid3>/asks/<aid3>/deactivate )
-
View my asks ( GET /accounts/<uid3>/asks )
-
View my active asks ( GET /accounts/<uid3>/asks?is_active=true )
-
Delete ask <aid3>
( DELETE /accounts/<uid3>/asks/<aid3> )
-
Expected HTTP status: 204 (No content). Response body empty.
- Verify that ask <aid3> has been deleted
( GET /asks/<aid3> )
-
Expected HTTP status: 404 (Not Found).
-
Create ask ( POST /accounts/<uid1>/asks ).
-
Create ask ( POST /accounts/<uid0>/asks ).
-
The request should return 201 (Created) and the HTTP header should contain
a 'Location' link to /accounts/<uid0>/asks/<aid5>
-
View data for the POST.
-
View the
expected response.
-
Retain <aid5> for subsequent tests.
-
Create an account ( POST /accounts ).
-
The request should return 201 (Created) and the HTTP header should contain
a 'Location' link to /accounts/<uid4>.
-
View data for the POST.
-
Here is the
expected response.
-
Retain <uid4> for subsequent tests.
-
Activate account <uid4> ( GET /accounts/<uid4>/activate ).
-
Create ask ( POST /accounts/<uid4>/asks ).
-
The request should return 201 (Created) and the HTTP header should contain
a 'Location' link to /accounts/<uid4>/asks/<aid6>
-
View data for the POST.
-
View the
expected response.
-
Retain <aid6> for subsequent tests.
-
View all asks
( GET /asks?v_by=<uid1>&is_active= ).
-
View all asks
( GET /asks?v_by=<uid2>&is_active= ).
NOTE: this request should return all asks, whether active or not, because
<uid2> is a CSR.
Test 'gives'
-
Create an account ( POST /accounts ).
-
The request should return 201 (Created) and the HTTP header should contain
a 'Location' link to /accounts/<uid5>.
-
View data for the POST.
-
Here is the
expected response.
-
Retain <uid5> for subsequent tests.
-
Activate account <uid5> ( GET /accounts/<uid5>/activate ).
-
Create give ( POST /accounts/<uid3>/gives ).
-
The request should return 201 (Created) and the HTTP header should contain
a 'Location' link to /accounts/<uid3>/gives/<gid1>
-
View data for the POST.
-
View the
expected response.
-
Retain <gid1> for subsequent tests.
-
Update <gid1>
( PUT /accounts/<uid3>/gives/<gid1> ).
-
The HTTP status should be 204 (No content) and the body of the response empty.
-
View data for the PUT.
-
Verify that the <gid1> update is successful
( GET /gives/<gid1> ).
-
Create give ( POST /accounts/<uid3>/gives ).
-
The request should return 201 (Created) and the HTTP header should contain
a 'Location' link to /accounts/<uid3>/gives/<gid2>
-
View data for the POST.
-
View the
expected response.
-
Retain <gid2> for subsequent tests.
-
Attempt to create give ( POST /accounts/<uid1>/gives ).
-
Activate account <uid1> ( GET /accounts/<uid1>/activate ).
-
Create give ( POST /accounts/<uid1>/gives ).
-
The request should return 201 (Created) and the HTTP header should contain
a 'Location' link to /accounts/<uid1>/gives/<gid3>
-
View data for the POST.
-
View the
expected response.
-
Retain <gid3> for subsequent tests.
-
Create give ( POST /accounts/<uid5>/gives ).
-
The request should return 201 (Created) and the HTTP header should contain
a 'Location' link to /accounts/<uid5>/gives/<gid4>
-
View data for the POST.
-
View the
expected response.
-
Retain <gid4> for subsequent tests.
-
Create give ( POST /accounts/<uid4>/gives ).
-
The request should return 201 (Created) and the HTTP header should contain
a 'Location' link to /accounts/<uid4>/gives/<gid5>
-
View data for the POST.
-
View the
expected response.
-
Retain <gid5> for subsequent tests.
-
Deactivate <gid3>
( GET /accounts/<uid1>/gives/<gid3>/deactivate )
-
View my gives ( GET /accounts/<uid3>/gives )
-
View my inactive gives ( GET /accounts/<uid3>/gives?is_active=false )
-
View all gives
( GET /gives?v_by=<uid1>&is_active= ).
NOTE: this request should return all gives visible to <uid1>,
whether active or not, because <uid1> is a Regular User (RU).
-
View all gives
( GET /gives?v_by=<uid2>&is_active= ).
NOTE: this request should return all gives, whether active or not, because
<uid2> is a CSR.
-
View all active gives
( GET /gives?v_by=<uid2>&is_active=true ).
NOTE: this request should return all active gives because
<uid2> is a CSR.
Test 'thanks'
-
Create an account ( POST /accounts ).
-
The request should return 201 (Created) and the HTTP header should contain
a 'Location' link to /accounts/<uid6>.
-
View data for the POST.
-
Here is the
expected response.
-
Retain <uid6> for subsequent tests.
-
Activate account <uid6> ( GET /accounts/<uid6>/activate ).
-
Create thank ( POST /accounts/<uid6>/thanks ).
-
The request should return 201 (Created) and the HTTP header should contain
a 'Location' link to /accounts/<uid6>/thanks/<tid1>
-
View data for the POST.
-
View the
expected response.
-
Retain <tid1> for subsequent tests.
-
Create thank ( POST /accounts/<uid6>/thanks ).
-
The request should return 201 (Created) and the HTTP header should contain
a 'Location' link to /accounts/<uid6>/thanks/<tid3>
-
View data for the POST.
-
View the
expected response.
-
Retain <tid3> for subsequent tests.
-
Create an account ( POST /accounts ).
-
The request should return 201 (Created) and the HTTP header should contain
a 'Location' link to /accounts/<uid7>.
-
View data for the POST.
-
Here is the
expected response.
-
Retain <uid7> for subsequent tests.
-
Activate account <uid7> ( GET /accounts/<uid7>/activate ).
-
Create thank ( POST /accounts/<uid7>/thanks ).
-
The request should return 201 (Created) and the HTTP header should contain
a 'Location' link to /accounts/<uid7>/thanks/<tid2>
-
View data for the POST.
-
View the
expected response.
-
Retain <tid2> for subsequent tests.
-
View my thanks ( GET /accounts/<uid6>/thanks )
-
View thanks for user ( GET /thanks/received/<uid4> )
Test 'notes'
-
Create note ( POST /notes ).
-
The request should return 201 (Created) and the HTTP header should contain
a 'Location' link to /notes/<nid1>
-
View data for the POST.
-
View the
expected response.
-
Retain <nid1> for subsequent tests.
-
Create note ( POST /notes ).
-
The request should return 201 (Created) and the HTTP header should contain
a 'Location' link to /notes/<nid2>
-
View data for the POST.
-
View the
expected response.
-
Retain <nid2> for subsequent tests.
-
Create note ( POST /notes ).
-
The request should return 201 (Created) and the HTTP header should contain
a 'Location' link to /notes/<nid3>
-
View data for the POST.
-
View the
expected response.
-
Retain <nid3> for subsequent tests.
-
Create note ( POST /notes ).
-
The request should return 201 (Created) and the HTTP header should contain
a 'Location' link to /notes/<nid4>
-
View data for the POST.
-
View the
expected response.
-
Retain <nid4> for subsequent tests.
-
Update note ( PUT /notes/<nid3> ).
-
The HTTP status should be 204 (No content) and the body of the response empty.
-
View data for the PUT.
-
Create note ( POST /notes ).
-
The request should return 201 (Created) and the HTTP header should contain
a 'Location' link to /notes/<nid5>
-
View data for the POST.
-
View the
expected response.
-
Retain <nid5> for subsequent tests.
-
Create note ( POST /notes ).
-
The request should return 201 (Created) and the HTTP header should contain
a 'Location' link to /notes/<nid6>
-
View data for the POST.
-
View the
expected response.
-
Retain <nid6> for subsequent tests.
-
Create note ( POST /notes ).
-
The request should return 201 (Created) and the HTTP header should contain
a 'Location' link to /notes/<nid7>
-
View data for the POST.
-
View the
expected response.
-
Retain <nid7> for subsequent tests.
-
View all notes organized as conversation threads
( GET /notes ).
-
View all notes created by <uid3> and visible to <uid7>
( GET /notes?c_by=<uid3>&v_by=<uid7>&type=&agid= ).
-
View all notes visible to <uid7>
( GET /notes?c_by=&v_by=<uid7>&type=&agid= ).
Test 'reports'
-
View available reports
( GET /reports ).
-
Get report <rid1> viewed by <uid2>
( GET /reports/<rid1>?c_by=&v_by=<uid2>&start_date=&end_date= ).
NOTE: The response must include all asks and gives created since the value
of 'c_by' is empty, the value of 'v_by' identifies a CSR user,
and no values are specified for start_date and end_date.
-
Get report <rid2> viewed by <uid2>
( GET /reports/<rid2>?c_by=<uid4>&v_by=<uid2>&start_date=&end_date= ).
NOTE: The response must include all asks and gives created by <uid4>&,
and all related communications since the value of 'v_by' identifies a CSR user,
and no values are specified for start_date and end_date.
-
Get report <rid2> viewed by <uid2> with dates
( GET /reports/<rid2>?c_by=&v_by=<uid2>&start_date=1-Jan-2122&end_date=31-Dec-2122 ).
NOTE: The response must include all asks and gives created by all users
and all related communications since the value of 'v_by' identifies a CSR user,
between 1-Jan-2122 and 31-Dec-2122.
Varia
-
Delete ask <aid2>
( DELETE /accounts/<uid3>/asks/<aid2> ).
-
Expected HTTP status: 204 (No content). Response body empty.
-
Verify that the ask <aid2> has been removed
( GET /asks/<aid2> ).
-
Expected HTTP status: 404 (Not Found).
-
Verify that the conversation associated with ask <aid2> has been removed
( GET /notes?c_by=&v_by=<uid2>&type=ask&agid=<aid2> ).
-
Expected HTTP status: 404 (Not Found).
-
Search notes
( GET /notes?key=Ikea ).
|