Project Functional Testing
3/28/20, at noon: minor changes are still possible, mainly for bug fixes.
New test cases are unlikely to be added.
For purposes of this API description, all URLs are relative to the base url of
http://localhost:8080/sar
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
"pid": "<pid1>" it means that the test
will expect to see something like "pid": "79"
when it runs, where 79 is the value that was returned in a previous response
that we denoted as pid1.
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, your TA has developed a script that automates the testing of your
project. The script takes 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.
Download the data to be submitted and expected responses
here.
-
Validate that there are no accounts to be returned when the applicatin runs
for the first time ( GET /accounts ). The response
should be an empty JSON array.
-
Validate that there are no rides to be returned when the applicatin runs
for the first time ( GET /rides ). The response
should be an empty JSON array.
-
Verify that bad data POST-ed ( POST /accounts )
in order to create an account will return a 400 (Bad Request) error. View the
data for the POST.
Here is the
expected response.
-
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/<aid1>.
View data for the POST.
Here is the
expected response.
-
Update the account identified by <aid1>
( PUT /accounts/<aid1> ).
View
data for the PUT.
The HTTP response should be 204 (No content) with an empty body.
-
Try to create a ride with account <aid1>
( POST /rides ). The HTTP response should be
400 (Bad Request) because account <aid1> is not active. View the
data for the POST.
Here is the
expected response.
-
Activate account <aid1>
( PUT /accounts/<aid1>/status ).
The HTTP response should be 204 (No content) with an empty body.
View
data for the PUT
request.
-
Try again to create a ride with account <aid1>
( POST /rides ). The HTTP response
should be 201 (Created) because account <aid1> is now active,
and the HTTP header should contain
a 'Location' link to /rides/<rid1>. View the
data for the POST.
Here is the
expected response.
-
Create a second account ( POST /accounts ).
The request should return 201 (Created) and the HTTP header should contain
a 'Location' link to /accounts/<aid2>.
View data for the POST.
Here is the
expected response.
-
Create a third account ( POST /accounts ).
The request should return 201 (Created) and the HTTP header should contain
a 'Location' link to /accounts/<aid3>.
View data for the POST.
Here is the
expected response.
-
Search rides ( GET /rides?from=barrington&to=&date= ).
The HTTP response should be
200 (OK). Here is the
expected response.
-
Request a resource that doesn't exist
( GET /rides/1073807359 ).
The HTTP response should be 404 (Not Found).
-
View ride detail
( GET /rides/<rid1> ).
The HTTP response should be
200 (OK). Here is the
expected response.
-
Try to create a join ride request with account <aid2>
( POST /rides/<rid1>/join_requests ).
The HTTP response should be 400 (Bad Request) because account <aid2>
is not active. View the
data for the POST.
Here is the
expected response.
-
Activate account <aid2>
( PUT /accounts/<aid2>/status ).
The HTTP response should be 204 (No content) with an empty body.
View
data for the PUT
request.
-
Try again to create a join ride request with account <aid2>
( POST /rides/<rid1>/join_requests ).
The HTTP response should be 201 (Created) because account <aid2>
is now active, and the HTTP header should contain
a 'Location' link to /rides/<rid1>/join_requests/<jid1>.
View the
data for the POST.
Here is the
expected response.
-
View <rid1> messages
( GET /rides/<rid1>/messages ).
The request should return 200 (OK). The body of the response should be
an empty JSON array.
-
Account <aid2> adds a message to <rid1>
( POST /rides/<rid1>/messages ).
The request should return 201 (Created) and the HTTP header should contain
a 'Location' link to /rides/<rid1>/messages/<mid1>.
View data for the POST.
Here is the
expected response.
-
Account <aid1> adds a message to <rid1>
( POST /rides/<rid1>/messages ).
The request should return 201 (Created) and the HTTP header should contain
a 'Location' link to /rides/<rid1>/messages/<mid1>.
View data for the POST.
Here is the
expected response.
-
View <rid1> messages
( GET /rides/<rid1>/messages ).
The request should return 200 (OK). Here is the
expected response.
-
Check rider ratings
( GET /accounts/<aid2>/rider ).
The request should return 200 (OK). Here is the
expected response.
-
Approve join ride request <jid1>
( PATCH /rides/<rid1>/join_requests/<jid1> ).
The request should return 200 (OK) with an empty body. View
data for the PATCH.
-
Confirm passenger pickup <jid1>
( PATCH /rides/<rid1>/join_requests/<jid1> ).
The request should return 200 (OK) with an empty body. View
data for the PATCH.
-
Check driver ratings
( GET /accounts/<aid1>/driver ).
The request should return 200 (OK). Here is the
expected response.
-
Rate account (as the driver)
( POST /accounts/<aid2>/ratings ).
The request should return 201 (Created) and the HTTP header should contain
a 'Location' link to /accounts/<aid2>/ratings/<sid1>.
View data for the POST.
Here is the
expected response.
-
Attempt to rate an account (as a rider) but for a ride the passenger was not
a part of.
( POST /accounts/<aid1>/ratings ).
The request should return 400 (Bad Request) because "sent_by_id" didn't
participate in <rid1>.
View data for the POST.
Here is the
expected response.
-
Rate account (as the rider)
( POST /accounts/<aid1>/ratings ).
The request should return 201 (Created) and the HTTP header should contain
a 'Location' link to /accounts/<aid1>/ratings/<sid2>.
View data for the POST.
Here is the
expected response.
-
Check rider ratings
( GET /accounts/<aid2>/rider ).
The request should return 200 (OK). Here is the
expected response.
-
Check driver ratings
( GET /accounts/<aid1>/driver ).
The request should return 200 (OK). Here is the
expected response.
-
Create a new ride with account <aid1>
( POST /rides ). The HTTP response
should be 201 (Created) and the HTTP header should contain
a 'Location' link to /rides/<rid2>. View the
data for the POST.
Here is the
expected response.
-
View ride detail
( GET /rides/<rid2> ).
The HTTP response should be 200 (OK). Here is the
expected response.
-
View all rides
( GET /rides ).
The HTTP response should be 200 (OK). Here is the
expected response.
-
Search accounts
( GET /accounts?key= ).
The request should return 200 (OK). Here is the
expected response.
-
Search accounts with a different "key"
( GET /accounts?key=312 ).
The request should return 200 (OK). Here is the
expected response.
-
View a list of available reports
( GET /reports ).
Make a note of <pid1> (Rides posted between two dates)
and <pid2> (Rides taken between two dates). Here is the
expected response.
-
Get the "Rides posted between two dates" (<pid1>) report
( GET /reports/<pid1> ).
Here is the
expected response.
-
Get the "Rides posted between two dates" (<pid1>) report with
date filtering
( GET /reports/<pid1>?start_date=15-Apr-2020&end_date= ).
Here is the
expected response.
-
Get the "Rides taken between two dates" (<pid2>) report
( GET /reports/<pid2>?start_date=14-Apr-2020&end_date=14-Apr-2020 ).
Here is the
expected response.
-
Delete ride <rid2>
( DELETE /rides/<rid2> ).
The request should return 204 (No Content).
-
View ride detail for <rid2>
( GET /rides/<rid2> ).
The HTTP response should be 404 (Not Found).
|