Closed Adora2401 closed 2 years ago
for these BDD tests if you need to adjust something (you probably will), please make sure you check for status message confirmation before checking for results in tables. Otherwise they may fail on deployment since our real website has much worse latency than localhost.
Per the latest bug issue, also need to make sure the right error messages are being shown when e.g. user id input is not a number.
As a System Administrator I need to have a GUI to update quantity and/or price of the item in a shopcart So that I can easily change quantity and/or price of a certain item in a certain shopcart without using CLI
Details and Assumptions
[EDIT: please fix the below BDD testing by adding a HOLD column whenever you do this story thank you :) ]
Acceptance Criteria
Scenario: Update an item when the shopcart doesn't exist When we enter "1003" to the text box "User_ID" And we enter "1" to the text box "Item_ID" And we enter "3" to the text box "quantity" And we enter "2.5" to the text box "price" And we press the button "Update-Item" Then we should see message "Shopcart with id 1003 was not found."
Scenario: Update an item that doesn't When we enter "1001" to the text box "User_ID" And we enter "3" to the text box "Item_ID" And we enter "3" to the text box "quantity" And we enter "2.5" to the text box "price" And we press the button "Update-Item" Then we should see message "item with id 3 was not found."
Scenario: Update an item with a invalid quantity number When we enter "1001" to the text box "User_ID" And we enter "1" to the text box "Item_ID" And we enter "-1" to the text box "quantity" And we enter "2.5" to the text box "price" And we press the button "Update-Item" Then we should see message "Invalid quantity."
Scenario: Update an item with a invalid price number When we enter "1001" to the text box "User_ID" And we enter "1" to the text box "Item_ID" And we enter "1" to the text box "quantity" And we enter "-5.0" to the text box "price" And we press the button "Update-Item" Then we should see message "Invalid price."
Scenario: Update an item's quantity only When we enter "1001" to the text box "User_ID" And we enter "1" to the text box "Item_ID" And we enter "1" to the text box "quantity" And we enter "" to the text box "price" And we press the button "Update-Item" Then we should see message "Successfully updated the item" And we should not see "ring2" in the results And we should see "1 ring1 1 1998" in the results
Scenario: Update an item's quantity only with bad quantity When we enter "1001" to the text box "User_ID" And we enter "1" to the text box "Item_ID" And we enter "0" to the text box "quantity" And we enter "" to the text box "price" And we press the button "Update-Item" Then we should see message "Successfully updated the item" And we should not see "ring2" in the results Then we should see message "Invalid quantity."
Scenario: Update an item's price only When we enter "1001" to the text box "User_ID" And we enter "1" to the text box "Item_ID" And we enter "" to the text box "quantity" And we enter "2000" to the text box "price" And we press the button "Update-Item" Then we should see message "Successfully updated the item" And we should not see "ring2" in the results And we should see "1 ring1 2 2000" in the results
Scenario: Update an item's price only with bad price When we enter "1001" to the text box "User_ID" And we enter "1" to the text box "Item_ID" And we enter "" to the text box "quantity" And we enter "-1" to the text box "price" And we press the button "Update-Item" Then we should see message "Invalid price"