Testcases and outcomes - jacbroberts/IntroToSEGroup6 GitHub Wiki

Login Feature

Test Cases

Test Case 1: Correct username and password

  1. create a user with username of testuser and password of testpassword
  2. send a post response that contains username of testuser and password of testpassword
  3. check for 302 response
  4. test login function with username of testuser and password of testpassword
  5. check that function returns true

Test Case 2: correct username, incorrect password

  1. create a user with username of testuser and password of testpassword
  2. send a post response that contains username of testuser and password of wrongpassword
  3. check for 200 response
  4. test login function with username of testuser and password of testpassword
  5. check that function returns false

Test Case 3: Correct username, no password

  1. create a user with username of testuser and password of testpassword
  2. send a post response that contains username of testuser
  3. check for 200 response
  4. test login function with username of testuser and empty string password
  5. check that function returns false

Test Case 4: no username, with password

  1. create a user with username of testuser and password of testpassword
  2. send a post response that contains password of testpassword
  3. check for 200 response
  4. test login function with empty string username and password of testpassword
  5. check that function returns false

Test Case 5: empty post

  1. create a user with username of testuser and password of testpassword
  2. send a post response with no data
  3. check for 200 response
  4. test login function with empty string username and empty string password
  5. check that function returns false

Test Outcomes

image

Registration Feature

Test Cases

Test Case 1: correct username, passwords

Test Case 2: username already taken

Test Case 3: password too short

Test Case 4: make customer profile

Test Case 5: make seller profile

Test Outcomes

image

Search Feature

Test Cases

Test Case 1: Test Search None

  1. force a user to login
  2. go to products page
  3. all products should appear

Test Case 2: Test Search for product in database

  1. force a user to login
  2. create a product with name iPhone
  3. Search for iPhone by navigating to "/store/products/?search=iPhone"
  4. Check that iPhone appears in page

Test Case 3: Test Search for product not in database

  1. force a user to login
  2. create a product with name iPhone
  3. create a product with name Samsung
  4. Search for iPhone by navigating to "/store/products/?search=iPhone"
  5. Check that Samsung does not appear on page

Test Case 4: Test Search User Logged Out

  1. create products
  2. navigate to search page
  3. Check that user is redirected away from page

Test Case 5: Test No Search

  1. force a user to login
  2. Add products
  3. Check that all products appear when navigating to products page

Test Outcomes

image

Payment Validation

Test Cases

Test Case 1: Valid payment information

  1. send a post response that contains the sample valid information
  2. check for 200 response
  3. check for proper status code and "Payment processed successfully."

Test Case 2: Invalid card number

  1. rewrite card number in valid sample to an invalid value
  2. send a post response that contains the sample invalid information
  3. check for 200 response
  4. check for correct error response

Test Case 3: Invalid cvv

  1. rewrite cvv in valid sample to an invalid value
  2. send a post response that contains the sample invalid information
  3. check for 200 response
  4. check for correct error response

Test Case 4: Invalid expiration date

  1. rewrite expiry date in valid sample to an invalid value
  2. send a post response that contains the sample invalid information
  3. check for 200 response
  4. check for correct error response

Test Case 5: Invalid billing address

  1. remove billing address in valid sample
  2. send a post response that contains the sample invalid information
  3. check for 200 response
  4. check for correct error response

Test Outcomes

All Test Cases

Sell Feature

Test Cases

Test Case 1: Successful sell

  1. force a user to login
  2. create a product
  3. add item to cart
  4. navigate to process payment page
  5. check that success message appears in response
  6. check that /store/sold/ shows product purchase

Test Case 2: No Buyer

--checks that items in carts do not go straight to sellers sold list

  1. force a user to login
  2. create a product
  3. add item to cart
  4. check that item does not appear in sellers /store/sold/

Test Case 3: Payment Info Verification

  1. force a user to login
  2. create a product
  3. add item to cart
  4. process payment
  5. check that card information is correctly displayed to seller

Test Case 4: Payment Quantity verification

  1. force a user to login
  2. add a product
  3. add quantity 2 of product to cart
  4. checkout
  5. check that seller has correct quantity shown

Test Case 5: Seller Shipped product

--checks that seller can remove sold items

  1. force a user to login
  2. create a product
  3. add product to cart
  4. checkout
  5. check that item appears in sellers sold list
  6. seller removes item
  7. check that item is removed

Test Outcomes

image

Add Product Feature

Test Cases

Test Case 1: Successful add

  1. force a user to login
  2. create a product
  3. check that the page returns to home on success

Test Case 2: Price too high

--checks that attempted product addition does not go through if price is too high

  1. force a user to login
  2. create a product with a higher price than allowed
  3. check if the page stayed the same

Test Case 3: Product Quantity too high

--checks that attempted product addition does not go through if quantity is too high

  1. force a user to login
  2. create a product with a higher quantity than allowed
  3. check if the page stayed the same

Test Case 4: No description

  1. force a user to login
  2. create a product with no description
  3. check if page changed to home if it did it is successful

Test Case 5: No name

  1. force a user to login
  2. create a product with no name
  3. check if page stayed the same, if it did it is successful

Test Outcomes