rcereno / REDX

0 stars 0 forks source link

Test Results (Isaac Schiffler) #8

Open isaacschiffler opened 1 month ago

isaacschiffler commented 1 month ago

Example Workflows Provided

1.

Add Game to Wishlist User Story: As a gamer, I want to be able to wishlist games I want so that I can keep track of what I am interested in buying. Scenario: Lyon Forester wants to add "GOLF IT" to his wishlist for future purchases. Add to Wishlist Endpoint: PUT /accounts/21/wishlist/golf_it_0

Request: curl -X 'POST' \ 'https://redx-brri.onrender.com/accounts/21/wishlist/golf_it_0' \ -H 'accept: application/json' \ -H 'access_token: redx' \ -d ''

Response: { "success": True }

2.

View Account Details User Story: As a gamer, I want to be able to have my own account that keeps track of my owned games, wishlist, cart, billing (and other customer info). Scenario: Eugene Fitzherbert wants to check the details of his account, including his owned games and items on his wishlist.

Request: curl -X 'POST' \ 'https://redx-brri.onrender.com/accounts/23/view' \ -H 'accept: application/json' \ -H 'access_token: redx' \ -d ''

Response: { "customer_name": "Eugene Fitzherbert", "games_owned": [ "ANIMAL CROSSING: NEW HORIZONS", "IT TAKES TWO" ], "wishlist": [ "GOLF IT" ], "current_cart": "Games in cart: 0, Cost: 0" }

3.

Register Account / Purchase Games User Story: As a gamer, I want to be able to create my own account so that I can purchase games. Scenario: Eugene Fitzherbert wants to create an account and purchase two games.

Register account

Request: curl -X 'POST' \ 'https://redx-brri.onrender.com/accounts/{customer_id}/register' \ -H 'accept: application/json' \ -H 'access_token: redx' \ -H 'Content-Type: application/json' \ -d '{ "customer_name": "Eugene Fitzherbert", "customer_email": "efitz13@gmail.com" }'

Response: Internal Server Error

----- alternate naming in case where eugene was already in db...

Request: curl -X 'POST' \ 'https://redx-brri.onrender.com/accounts/{customer_id}/register' \ -H 'accept: application/json' \ -H 'access_token: redx' \ -H 'Content-Type: application/json' \ -d '{ "customer_name": "Eugene fit", "customer_email": "efitz99@gmail.com" }'

Response: "OK"

Get Catalog

Request: curl -X 'GET' \ 'https://redx-brri.onrender.com/catalog/' \ -H 'accept: application/json'

Reponse: Very long list of JSON objects, waste of space on this issue comment, but it matches the expected output provided

Search Catalog

Request: curl -X 'GET' \ 'https://redx-brri.onrender.com/catalog/search/?price=0&genre=Co-op&avg_review=0&sort_col=release_date&sort_order=desc' \ -H 'accept: application/json'

Response: [ { "sku": "overcooked_0", "name": "OVERCOOKED", "publisher": "Ghost Town Games", "price": 22, "genre": "Co-op", "platform": "PlayStation", "avg_review": "NOT YET REVIEWED", "rating": "E", "release_date": "2024-05-10" }, { "sku": "it_takes_two_0", "name": "IT TAKES TWO", "publisher": "Hazelight Studios", "price": 21, "genre": "Co-op", "platform": "PC", "avg_review": 5, "rating": "E10", "release_date": "2021-03-26" } ]

Create cart

Request: curl -X 'POST' \ 'https://redx-brri.onrender.com/carts/' \ -H 'accept: application/json' \ -H 'access_token: redx' \ -H 'Content-Type: application/json' \ -d '{ "account_id": 23 }'

Response: { "cart_id": 9 }

Cart view

Request: curl -X 'GET' \ 'https://redx-brri.onrender.com/carts/9' \ -H 'accept: application/json' \ -H 'access_token: redx'

Response: { "cart_id": 9, "customer_name": "Eugene Fitzherbert", "games_in_cart": [], "total_cost": 0, "checked_out": false }

Add to cart Part A

Request: curl -X 'POST' \ 'https://redx-brri.onrender.com/carts/9/items/it_takes_two_0' \ -H 'accept: application/json' \ -H 'access_token: redx' \ -d ''

Response: "OK"

Add to cart Part B

Request: curl -X 'POST' \ 'https://redx-brri.onrender.com/carts/9/items/animal_crossing_new_horizons_0' \ -H 'accept: application/json' \ -H 'access_token: redx' \ -d ''

Response: "OK"

Cart view 2

Request: curl -X 'GET' \ 'https://redx-brri.onrender.com/carts/9' \ -H 'accept: application/json' \ -H 'access_token: redx'

Response: { "cart_id": 9, "customer_name": "Eugene Fitzherbert", "games_in_cart": [ "ANIMAL CROSSING: NEW HORIZONS", "IT TAKES TWO" ], "total_cost": 81, "checked_out": false }

Checkout

Request: curl -X 'POST' \ 'https://redx-brri.onrender.com/carts/9/checkout' \ -H 'accept: application/json' \ -H 'access_token: redx' \ -d ''

Response: { "games_bought": 0, "total_price": 0 } --- This is incorrect, should be: { "games_bought": 2, "total_price": 81 }

Cart view 3

Request: curl -X GET' \ 'https://redx-brri.onrender.com/carts/9' \ -H 'accept: application/json' \ -H 'access_token: redx'

Response: { "cart_id": 9, "customer_name": "Eugene Fitzherbert", "games_in_cart": [ "ANIMAL CROSSING: NEW HORIZONS", "IT TAKES TWO" ], "total_cost": 81, "checked_out": false } --- this is incorrect, should be: { "cart_id": 9, "customer_name": "Eugene Fitzherbert", "games_in_cart": [ "ANIMAL CROSSING: NEW HORIZONS", "IT TAKES TWO" ], "total_cost": 81, "checked_out": true } --- Seems like the checkout failed...

Add review

Request: curl -X 'POST' \ 'https://redx-brri.onrender.com/accounts/23/reviews/it_takes_two_0' \ -H 'accept: application/json' \ -H 'access_token: redx' \ -H 'Content-Type: application/json' \ -d '{ "rating": 5 }'

Response: "OK"

Given Example workflows complete. Only one prominent error in cart checkout.

isaacschiffler commented 1 month ago

Three new test flows

1. I want to find the oldest game offered and buy it.

Create Account

Request: curl -X 'POST' \ 'https://redx-brri.onrender.com/accounts/{customer_id}/register' \ -H 'accept: application/json' \ -H 'access_token: redx' \ -H 'Content-Type: application/json' \ -d '{ "customer_name": "Isaac Schiffler", "customer_email": "isaac@email.com" }'

Response: "OK"

--- my new account id is unknown from this so I will use account_id = 23 for now since that is what was used in their test flows

Search Catalog for oldest game

Request: curl -X 'GET' \ 'https://redx-brri.onrender.com/catalog/search/?price=0&avg_review=0&sort_col=release_date&sort_order=asc' \ -H 'accept: application/json'

Response: [ { "sku": "loom_0", "name": "LOOM", "publisher": "Lucasfilm Games", "price": 3, "genre": "Adventure", "platform": "Nintendo", "avg_review": "NOT YET REVIEWED", "rating": "E", "release_date": "1990-04-29" }, ... ] ( lots of json objects, not needed to display all here ) --- We see LOOM is the oldest game. Want to buy it.

Create cart

Request: curl -X 'POST' \ 'https://redx-brri.onrender.com/carts/' \ -H 'accept: application/json' \ -H 'access_token: redx' \ -H 'Content-Type: application/json' \ -d '{ "account_id": 23 }'

Response: { "cart_id": 10 }

Add item to cart

Request: curl -X 'POST' \ 'https://redx-brri.onrender.com/carts/10/items/loom_0' \ -H 'accept: application/json' \ -H 'access_token: redx' \ -d ''

Response: "OK"

Check to make sure the game is in cart

Request: curl -X 'GET' \ 'https://redx-brri.onrender.com/carts/10' \ -H 'accept: application/json' \ -H 'access_token: redx'

Response: { "cart_id": 10, "customer_name": "Eugene Fitzherbert", "games_in_cart": [ "LOOM" ], "total_cost": 3, "checked_out": false }

Checkout cart

Request: curl -X 'POST' \ 'https://redx-brri.onrender.com/carts/10/checkout' \ -H 'accept: application/json' \ -H 'access_token: redx' \ -d ''

Response: { "games_bought": 1, "total_price": 3 }

Successfully checked out our cart and bought the game

2. Add a new game to the shop inventory

Request: curl -X 'POST' \ 'https://redx-brri.onrender.com/games/add' \ -H 'accept: application/json' \ -H 'access_token: redx' \ -H 'Content-Type: application/json' \ -d '[ { "sku": "sea_of_thieves_0", "name": "Sea of Thieves", "publisher": "", "price": 135, "platform": "Computer", "genre": "RPG", "family_rating": "", "release_date": "2020-05-21" } ]'

Response: "Game added"

Success, added new game to inventory

3. Add a game to the wishlist of a new customer

Create account

Request: curl -X 'POST' \ 'https://redx-brri.onrender.com/accounts/{customer_id}/register' \ -H 'accept: application/json' \ -H 'access_token: redx' \ -H 'Content-Type: application/json' \ -d '{ "customer_name": "Isaac Schiffler", "customer_email": "isaac@email.com" }'

Response: "OK"

--- my new account id is unknown from this so I will use account_id = 21 for now since that is what was used in their test flows

Add new game to wishlist

Request: curl -X 'POST' \ 'https://redx-brri.onrender.com/accounts/21/wishlist/sea_of_thieves_0' \ -H 'accept: application/json' \ -H 'access_token: redx' \ -d ''

Response: { "success": true }

Check account details to see if its in my wishlist

Request: curl -X 'POST' \ 'https://redx-brri.onrender.com/accounts/21/view' \ -H 'accept: application/json' \ -H 'access_token: redx' \ -d ''

Response: { "customer_name": "Lyon Forester", "games_owned": [], "wishlist": [ "GOLF IT", "Sea of Thieves" ], "current_cart": "Games in cart: 0, Cost: 0" }

Success, new game added to wishlist

4. Try to review a game I do not own

Request: curl -X 'POST' \ 'https://redx-brri.onrender.com/accounts/21/reviews/sea_of_thieves_0' \ -H 'accept: application/json' \ -H 'access_token: redx' \ -H 'Content-Type: application/json' \ -d '{ "rating": 3 }'

Response: "Cannot review a game you do not own."

Success, couldn't review game I don't own

Was somewhat restricted in creating new test flows because I was unable to determine the account_id of the new account I registered...