Project Functional Testing


For purposes of this description, all URLs are relative to the base url of http://localhost:8080/lf2u

The JSON used for testing purposes will match the format desribed 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. The specific actions taken by the tester before beginning functional acceptance testing are described here.

So, here are the steps we'll take to test the functionality of your project.

  1. Verify that there is one manager account ( GET /managers/accounts )
  2. View the detail of the existing (default) manager account ( GET /managers/accounts/{mid} )
  3. Validate that the general catalog is empty ( GET /managers/catalog )
  4. Add product ("Potatoes") to general catalog ( POST /managers/catalog ); this is gcpid1
  5. Add product ("Tomatoes") to general catalog ( POST /managers/catalog ); this is gcpid2
  6. Add product ("Eggplant") to general catalog ( POST /managers/catalog ); this is gcpid3
  7. Add product ("Onions") to general catalog ( POST /managers/catalog ); this is gcpid4
  8. Verify that the catalog contains the four products added in the previous steps ( GET /managers/catalog )
  9. Update gcpid1 (from "Potatoes" to "Potatoes (red)")
  10. Verify that gppid1 has been updated ( GET /managers/catalog )
  11. Verify that there are no farmer accounts ( GET /farmers )
  12. Verify that there are no farmer accounts when a zip code is specified ( GET /farmers?zip=60010 )
  13. Create new farmer account ("SafeHouse Farm Alpacas", delivers to 60010, 60011, 60067) ( POST /farmers ); this is fid1. View JSON
  14. Verify that the farmer account has been created; there should be one farmer account ( GET /farmers )
  15. Validate the farmer account detail ( GET /farmers/{fid1} )
  16. Verify that there is one farmer account that delivers in zip code 60010 ( GET /farmers?zip=60010 )
  17. Verify that there is no farmer account that delivers in zip code 60616 ( GET /farmers?zip=60616 )
  18. Update the farmer account detail for fid1 as ("Tall Trees", delivers to 60010, 60011) ( PUT /farmers/{fid1} ). View JSON
  19. Validate the farmer account detail ( GET /farmers/{fid1} )
  20. Create new farmer account ("Tudor Oaks", delivers to 60010, 60616, 60067) ( POST /farmers ); this is fid2. View JSON
  21. Verify that the farmer account has been created, there should be two farmer accounts ( GET /farmers )
  22. Validate the farmer account detail ( GET /farmers/{fid2} )
  23. Verify that there are two farmer accounts that deliver in zip code 60010 ( GET /farmers?zip=60010 )
  24. Check the delivery charge for fid1, expected result is 0.00 ( GET /farmers/{fid1}/delivery_charge )
  25. Update the delivery charge for fid1 to 5.00 ( POST /farmers/{fid1}/delivery_charge ). View JSON
  26. Verify the delivery charge for fid1, expected result is 5.00 ( GET /farmers/{fid1}/delivery_charge )
  27. Check the delivery charge for fid2, expected result is 0.00 ( GET /farmers/{fid2}/delivery_charge )
  28. Update the delivery charge for fid2 to 9.95 ( POST /farmers/{fid2}/delivery_charge ). View JSON
  29. Verify the delivery charge for fid2, expected result is 9.95 ( GET /farmers/{fid2}/delivery_charge )
  30. Verify that the store for fid1 is empty ( GET /farmers/{fid1}/products )
  31. Add gcpid1 to fid1 store ( POST /farmers/{fid1}/products ); this will create fspid1. View JSON
  32. Verify that the store for fid1 has one product ( GET /farmers/{fid1}/products )
  33. Add a note to fspid1 and modify the price ( POST /farmers/{fid1}/products/{fspid1} ) View JSON
  34. Verify the detail for fspid1; the note and the price should be updated ( GET /farmers/{fid1}/products/{fspid1} )
  35. Add gcpid2 to fid1 store, ( POST /farmers/{fid1}/products ); this will create fspid2. View JSON
  36. Add gcpid3 to fid1 store, ( POST /farmers/{fid1}/products ); this will create fspid3. View JSON
  37. Review the products available in the fid1 store ( GET farmers/{fid1}/products ). View JSON response.
  38. Add gcpid2 to fid2 store, ( POST /farmers/{fid2}/products ); this will create fspid4. View JSON.
  39. Review the products available in the fid2 store ( GET farmers/{fid2}/products ). View JSON response.
  40. Review reports available for fid1. View response JSON
  41. Review reports available for fid2. They should be the exact same as available for fid1
  42. Execute the report identified by frid1 ( GET /farmers/{fid1}/reports/{frid1} ). View JSON response.
  43. Execute the report identified by frid2 ( GET /farmers/{fid1}/reports/{frid2} ). View JSON response.
  44. Verify that there are no customers ( GET /search?topic=customer&key= )
  45. Create customer account ( POST /customers); this is cid1. View JSON.
  46. Verify that there is one customer ( GET /search?topic=customer&key= ). View JSON response.
  47. View account information for cid1 ( GET /customers/{cid1} ). View JSON response.
  48. Attempt to update the user account with incomplete data in the PUT payload ( PUT /customers/{cid1} ). View JSON. Expect a 400 (Bad Request) from the server.
  49. Update the user account ( PUT /customers/{cid1} ). View JSON.
  50. Verify that the account information for cid1 has been updated ( GET /customers/{cid1} ). View JSON response.
  51. Verify that this user has no orders ( GET /customers/{cid1}/orders ). The response should be an empty array.
  52. Create an order ( POST /customers/{cid1}/orders ); specify a farm that doesn't deliver in cid1 zip code. View JSON. Expect a 422 (Unprocessable Entity) error.
  53. Update the user account ( PUT /customers/{cid1} ). View JSON.
  54. Create an order with fid1 ( POST /customers/{cid1}/orders ). This is oid1. View JSON. View JSON response.
  55. View all orders placed by cid1 ( GET /customers/{cid1}/orders). View JSON response. NOTE: in the JSON response <today> stands for the date when the project is being tested, e.g. 20161116, etc.
  56. Verify the detail for order oid1 placed by cid1 with farm fid1 ( GET /customers/{cid1}/orders/{oid1} ). View JSON response.
  57. Create an order with fid2 ( POST /customers/{cid1}/orders ). This is oid2. View JSON. View JSON response.
  58. View all orders placed by cid1 ( GET /customers/{cid1}/orders). View JSON response. NOTE: in the JSON response <today> stands for the date when the project is being tested, e.g. 20161116, etc.
  59. Verify the detail for order oid2 placed by cid1 with farm fid2 ( GET /customers/{cid1}/orders/{oid2} ). View JSON response.
  60. Get the report, for farm fid1, identified by frid2 ( GET /farmers/{fid1}/reports/{frid2} ). View JSON response.
  61. Generate the management report for orders placed today ( GET /managers/reports/{mrid1} ). View JSON response.
  62. ... This is work in progress, more will be added over the next few days.
Last update: Nov 14, 2016 Virgil Bistriceanu cs445 Computer Science

$Id: project-functional-testing-instructions.html,v 1.5 2016/11/15 05:07:27 virgil Exp $