Testcases and outcomes - jacbroberts/IntroToSEGroup6 GitHub Wiki
Login Feature
Test Cases
Test Case 1: Correct username and password
- create a user with username of testuser and password of testpassword
- send a post response that contains username of testuser and password of testpassword
- check for 302 response
- test login function with username of testuser and password of testpassword
- check that function returns true
Test Case 2: correct username, incorrect password
- create a user with username of testuser and password of testpassword
- send a post response that contains username of testuser and password of wrongpassword
- check for 200 response
- test login function with username of testuser and password of testpassword
- check that function returns false
Test Case 3: Correct username, no password
- create a user with username of testuser and password of testpassword
- send a post response that contains username of testuser
- check for 200 response
- test login function with username of testuser and empty string password
- check that function returns false
Test Case 4: no username, with password
- create a user with username of testuser and password of testpassword
- send a post response that contains password of testpassword
- check for 200 response
- test login function with empty string username and password of testpassword
- check that function returns false
Test Case 5: empty post
- create a user with username of testuser and password of testpassword
- send a post response with no data
- check for 200 response
- test login function with empty string username and empty string password
- check that function returns false
Test Outcomes
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
Search Feature
Test Cases
Test Case 1: Test Search None
- force a user to login
- go to products page
- all products should appear
Test Case 2: Test Search for product in database
- force a user to login
- create a product with name iPhone
- Search for iPhone by navigating to "/store/products/?search=iPhone"
- Check that iPhone appears in page
Test Case 3: Test Search for product not in database
- force a user to login
- create a product with name iPhone
- create a product with name Samsung
- Search for iPhone by navigating to "/store/products/?search=iPhone"
- Check that Samsung does not appear on page
Test Case 4: Test Search User Logged Out
- create products
- navigate to search page
- Check that user is redirected away from page
Test Case 5: Test No Search
- force a user to login
- Add products
- Check that all products appear when navigating to products page
Test Outcomes
Payment Validation
Test Cases
Test Case 1: Valid payment information
- send a post response that contains the sample valid information
- check for 200 response
- check for proper status code and "Payment processed successfully."
Test Case 2: Invalid card number
- rewrite card number in valid sample to an invalid value
- send a post response that contains the sample invalid information
- check for 200 response
- check for correct error response
Test Case 3: Invalid cvv
- rewrite cvv in valid sample to an invalid value
- send a post response that contains the sample invalid information
- check for 200 response
- check for correct error response
Test Case 4: Invalid expiration date
- rewrite expiry date in valid sample to an invalid value
- send a post response that contains the sample invalid information
- check for 200 response
- check for correct error response
Test Case 5: Invalid billing address
- remove billing address in valid sample
- send a post response that contains the sample invalid information
- check for 200 response
- check for correct error response
Test Outcomes
Sell Feature
Test Cases
Test Case 1: Successful sell
- force a user to login
- create a product
- add item to cart
- navigate to process payment page
- check that success message appears in response
- 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
- force a user to login
- create a product
- add item to cart
- check that item does not appear in sellers /store/sold/
Test Case 3: Payment Info Verification
- force a user to login
- create a product
- add item to cart
- process payment
- check that card information is correctly displayed to seller
Test Case 4: Payment Quantity verification
- force a user to login
- add a product
- add quantity 2 of product to cart
- checkout
- check that seller has correct quantity shown
Test Case 5: Seller Shipped product
--checks that seller can remove sold items
- force a user to login
- create a product
- add product to cart
- checkout
- check that item appears in sellers sold list
- seller removes item
- check that item is removed
Test Outcomes
Add Product Feature
Test Cases
Test Case 1: Successful add
- force a user to login
- create a product
- 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
- force a user to login
- create a product with a higher price than allowed
- 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
- force a user to login
- create a product with a higher quantity than allowed
- check if the page stayed the same
Test Case 4: No description
- force a user to login
- create a product with no description
- check if page changed to home if it did it is successful
Test Case 5: No name
- force a user to login
- create a product with no name
- check if page stayed the same, if it did it is successful