0felicia0 / Shoetopia

0 stars 0 forks source link

Test Results - Ella Hagen #11

Open elhagen13 opened 11 months ago

elhagen13 commented 11 months ago

Test Results

Flow 1

A potential customer comes to our shop because the new shoe that just dropped from Nike is already sold out. First, they use the appropriate filters to get the availability across multiple shops. Then, after reviewing the potential sellers, they add the shoe to their cart and checkout. They can now track the status of the order.

POST/catalog/filter with filters like “brand” = Nike POST/cart/ POST/carts/set_item_quantity where product id is unique POST /carts/id/checkout

The seller will receive their percentage of the sale, and Shoetopia will receive a percentage of the sale. Now, the customer will wait for their new shoes.

  1. Post/carts/filter Curl:
    curl -X 'GET' \
    'https://shoetopia-avot.onrender.com/carts/filters?brand=Nike&min_price=1&sort_order=desc' \
    -H 'accept: application/json' \
    -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA'

    Response

    
    [
    {
    "listing_id": 15,
    "quantity": 1,
    "price": 550
    },
    {
    "listing_id": 13,
    "quantity": 1,
    "price": 450
    },
    {
    "listing_id": 14,
    "quantity": 1,
    "price": 450
    },
    {
    "listing_id": 17,
    "quantity": 1,
    "price": 350
    }
    ]

2. `Post /carts`
Curl:

curl -X 'POST' \ 'https://shoetopia-avot.onrender.com/carts/create_cart' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \ -H 'Content-Type: application/json' \ -d '{ "user_id": 10 }'

Response:

{ "cart_id": 23 }


3. `Post /carts/set_item/quantity`
Curl: 

curl -X 'POST' \ 'https://shoetopia-avot.onrender.com/carts/set_item_quantity?cart_id=23&listing_id=13&quantity=1' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \ -d ''

Response:

"OK"


4. `Post carts/checkout`
Curl:

curl -X 'POST' \ 'https://shoetopia-avot.onrender.com/carts/checkout?cart_id=23' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \ -d ''

Response:

true


## Flow 2

A shoe seller has collected various rare shoes over the years and is looking to list their shoes for sale on Shoetopia. They first need to make an account. From there they will create their shop before finally making their listing.

**POST shop/create_account to create a unique username and provide necessary account information
POST shop/create_shop is called so the seller can decide their store name.
POST listing/create_listing now that the store name is created they can upload their listing for their shoes by providing necessary information such as the name, size, brand, and meaningful tags that will be used for searching**

1. `Post/create_account`
Curl:

curl -X 'POST' \ 'https://shoetopia-avot.onrender.com/shop/create_account' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \ -H 'Content-Type: application/json' \ -d '{ "name": "test_person", "email": "test_person@gmail.com", "password": "string123" }'

Response:

"OK"


2. `POST shop/create_shop`
Curl: 

curl -X 'POST' \ 'https://shoetopia-avot.onrender.com/shop/create_shop?account_id=11' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \ -H 'Content-Type: application/json' \ -d '{ "store_name": "Shoe Store 4 Sure" } '

Response:

"OK"


3. `Post shop/create_listing`
Curl:

curl -X 'POST' \ 'https://shoetopia-avot.onrender.com/shop/create_listing' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \ -H 'Content-Type: application/json' \ -d '{ "shoe": { "brand": "Converse", "color": "Brown", "style": "High top" }, "listing": { "shop_id": 11, "quantity": 1, "price": 100, "size": 8 } }'

Response:

"OK"


## Flow 3

Sellers may apply for verification on Shoetopia to demonstrate to potential buyers that a particular seller is trustworthy and an established reputation. After providing their shop id to create an application request, administrators will run a background check on the profile. The seller will be able to check the status of the application, and if the application is successful, their status will be update accordingly.

**POST /seller/post-application to create an application request
POST /seller/verification-status to check the verified status of the seller and the outcome of the application
POST /admin/update-verification to set the seller's status to Verified or Unverified**

1. `Post shop/post-application`
Curl:

curl -X 'POST' \ 'https://shoetopia-avot.onrender.com/shop/post_application?shop_id=11' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \ -d ''

Response:

11


2. `Post shop/update_verification`
Curl:

curl -X 'POST' \ 'https://shoetopia-avot.onrender.com/shop/update_verification?shop_id=11&status=true' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \ -d ''

Response:

OK


3. `Post shop/verification_status`
Curl:

curl -X 'POST' \ 'https://shoetopia-avot.onrender.com/shop/verification_status?shop_id=11' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \ -d ''

Response:

true


# New Test Cases

## Test Case 1

Simon wants to make sure that his shoes are being displayed as sold as soon as a customer buys them. First he makes a listing, then checks the catalog to make sure it's there. He then buys his own listing, and then checks the catalog to see if they're gone.
**POST /shop/create_listing
GET /carts/filter
Post /carts/create_cart
POST /carts/set_item_quantity
POST /carts/checkout
GET /carts/filter**

1. `Post shop/create_listing`
Curl:

curl -X 'POST' \ 'https://shoetopia-avot.onrender.com/shop/create_listing' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \ -H 'Content-Type: application/json' \ -d '{ "shoe": { "brand": "Converse", "color": "Brown", "style": "High top" }, "listing": { "shop_id": 11, "quantity": 1, "price": 100, "size": 8 } }'

Response:

"OK"


2. `Get carts/filter`
Curl:

curl -X 'GET' \ 'https://shoetopia-avot.onrender.com/carts/filters?brand=Converse&color=Brown&min_price=1&sort_order=desc' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA'

Response:

[ { "listing_id": 28, "quantity": 1, "price": 100 } ]


3.  `Post cart/create_cart`
Curl:

curl -X 'POST' \ 'https://shoetopia-avot.onrender.com/carts/create_cart' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \ -H 'Content-Type: application/json' \ -d '{ "user_id": 11 }'

Response:

{ "cart_id": 24 }

4. `Post cart/set_item_quantity`
Curl:

curl -X 'POST' \ 'https://shoetopia-avot.onrender.com/carts/set_item_quantity?cart_id=24&listing_id=28&quantity=1' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \ -d ''

Response:

"OK"


5. `Post cart/checkout`
Curl:

curl -X 'POST' \ 'https://shoetopia-avot.onrender.com/carts/checkout?cart_id=24' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \ -d ''

Response:

true


6. `Post cart/filter`
Curl:

curl -X 'GET' \ 'https://shoetopia-avot.onrender.com/carts/filters?brand=Converse&color=Brown&min_price=1&sort_order=desc' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA'

Response:

[ { "listing_id": 28, "quantity": 1, "price": 100 } ]

**This test case needs to be fixed**

## Test Case 2

A customer has been saving up, and so they decided to buy multiple pairs of shoes. First they will create a cart, and then add multiple pairs of shoes. If checkout is successful, then if another customer tries to add it to the cart, it should say insufficient quantity for both pairs.

**POST cart/create_cart
POST cart/set_item_quantity
POST cart/set_item_quantity
POST cart/checkout
POST cart/create_cart
POST cart/set_item_quantity
POST cart/set_item_quantity**

1. `Post cart/create_cart`
Curl:

curl -X 'POST' \ 'https://shoetopia-avot.onrender.com/carts/create_cart' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \ -H 'Content-Type: application/json' \ -d '{ "user_id": 11 }'

Response:

{ "cart_id": 25 }


2. `Post cart/set_item_quantity`
For both items:
Curl:

curl -X 'POST' \ 'https://shoetopia-avot.onrender.com/carts/set_item_quantity?cart_id=25&listing_id=29&quantity=1' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \ -d ''

curl -X 'POST' \ 'https://shoetopia-avot.onrender.com/carts/set_item_quantity?cart_id=25&listing_id=30&quantity=1' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \ -d ''

Response:

"OK"


3. `Post cart/checkout`
Curl:

curl -X 'POST' \ 'https://shoetopia-avot.onrender.com/carts/checkout?cart_id=25' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \ -d ''

Response:

true


4. `POST cart/create_cart`
Curl:

curl -X 'POST' \ 'https://shoetopia-avot.onrender.com/carts/create_cart' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \ -H 'Content-Type: application/json' \ -d '{ "user_id": 11 }'

Response:

{ "cart_id": 26 }


5. `Post cart/set_item_quantity`
Curl:

curl -X 'POST' \ 'https://shoetopia-avot.onrender.com/carts/set_item_quantity?cart_id=26&listing_id=29&quantity=1' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \ -d ''

Response:

"insufficient quantity"


6. `Post cart/set_item_quantity`
Curl:

curl -X 'POST' \ 'https://shoetopia-avot.onrender.com/carts/set_item_quantity?cart_id=26&listing_id=30&quantity=1' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \ -d ''

Response:

"OK"

**This test case needs to be fixed**

## Test Case 3
A customer attempts to buy a quantity greater than the shop offers. First create cart is called, then set item quantity. Insufficient quantity should be returned.

**POST cart/create_cart
POST cart/set_item_quantity**

1. `Post cart/create_cart`
Curl:

curl -X 'POST' \ 'https://shoetopia-avot.onrender.com/carts/create_cart' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \ -H 'Content-Type: application/json' \ -d '{ "user_id": 11 }'

Response:

{ "cart_id": 27 }


2. `Post cart/set_item_quantity`
Curl:

curl -X 'POST' \ 'https://shoetopia-avot.onrender.com/carts/set_item_quantity?cart_id=27&listing_id=31&quantity=5' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \ -d ''

Response:

"insufficient quantity"