2022-Spring-NYU-DevOps-Shopcarts / shopcarts

Shopcarts squad.
Apache License 2.0
2 stars 2 forks source link

UI of Create Items #91

Closed TimothyXu closed 2 years ago

TimothyXu commented 2 years ago

As a System Administrator I need to have a GUI to create a new item using user_id and item_id So that I can easily add a new item for a user's shopcart without using CLI

Details and Assumptions

Given a set of items | user_id | item_id | item_name | quantity | price | | 1001 | 1 | ring1 | 2 | 1998 | | 1001 | 2 | ring2 | 1 | 1.5 | | 1002 | 1 | ring1 | 3 | 3 | When we enter "1001" to the text box "User ID" And we enter "3" to the text box "Item ID" And we enter "ring3" to the text box "Item Name" And we enter "1" to the text box "Quantity" And we enter "2.5" to the text box "Price" And we press the button "Add to Shop Cart" Then we should see status code 201 When we enter "1001" to the text box "User ID" And we press the button "Retrieve" Then we should see "[1, ring1, 2, 1998]" in the results And we should see "[2, ring2, 1, 1.5]" in the results And we should see "[3, ring3, 1, 2]" in the results And we should not see "[1, ring1, 3, 3]" in the results

Given a set of items | user_id | item_id | item_name | quantity | price | | 1001 | 1 | ring1 | 2 | 1998 | | 1001 | 2 | ring2 | 1 | 1.5 | | 1002 | 1 | ring1 | 3 | 3 | When we enter "1003" to the text box "User ID" And we enter "1" to the text box "Item ID" And we enter "ring" to the text box "Item Name" And we enter "1" to the text box "Quantity" And we enter "2" to the text box "Price" And we press the button "Add to Shop Cart" Then we should see status code 201 When we enter "1003" to the text box "User ID" And we press the button "Retrieve" Then we should not see "[1, ring1, 2, 1998]" in the results And we should not see "[2, ring2, 1, 1.5]" in the results And we should not see "[1, ring1, 3, 3]" in the results And we should see "[1, ring, 1, 2]" in the results

Given a set of items | user_id | item_id | item_name | quantity | price | | 1001 | 1 | ring1 | 2 | 1998 | | 1001 | 2 | ring2 | 1 | 1.5 | | 1002 | 1 | ring1 | 3 | 3 | When we enter "1001" to the text box "User ID" And we enter "-1" to the text box "Item ID" And we enter "ring" to the text box "Item Name" And we enter "1" to the text box "Quantity" And we enter "2" to the text box "Price" And we press the button "Add to Shop Cart" Then we should see status code 400 When we enter "1001" to the text box "User ID" And we press the button "Retrieve" Then we should see "[1, ring1, 2, 1998]" in the results And we should see "[2, ring2, 1, 1.5]" in the results And we should not see "[1, ring1, 3, 3]" in the results And we should not see "[-1, ring, 1, 2]" in the results

Given a set of items | user_id | item_id | item_name | quantity | price | | 1001 | 1 | ring1 | 2 | 1998 | | 1001 | 2 | ring2 | 1 | 1.5 | | 1002 | 1 | ring1 | 3 | 3 | When we enter "1001" to the text box "User ID" And we enter "1" to the text box "User ID" And we enter "ring" to the text box "Item Name" And we enter "0" to the text box "Quantity" And we enter "2" to the text box "Price" And we press the button "Add to Shop Cart" Then we should see status code 400 When we enter "1001" to the text box "User ID" And we press the button "Retrieve" Then we should see "[1, ring1, 2, 1998]" in the results And we should see "[2, ring2, 1, 1.5]" in the results And we should not see "[1, ring1, 3, 3]" in the results And we should not see "[1, ring, 0, 2]" in the results

Given a set of items | user_id | item_id | item_name | quantity | price | | 1001 | 1 | ring1 | 2 | 1998 | | 1001 | 2 | ring2 | 1 | 1.5 | | 1002 | 1 | ring1 | 3 | 3 | When we enter "1003" to the text box "User ID" And we enter "1" to the text box "User ID" And we enter "ring" to the text box "Item Name" And we enter "1" to the text box "Quantity" And we enter "-1" to the text box "Price" And we press the button "Add to Shop Cart" Then we should see status code 400 When we enter "1001" to the text box "User ID" And we press the button "Retrieve" Then we should see "[1, ring1, 2, 1998]" in the results And we should see "[2, ring2, 1, 1.5]" in the results And we should not see "[1, ring1, 3, 3]" in the results And we should not see "[1, ring, 1, -1]" in the results