Testcases and outcomes - ChandlerWeeks/Group2 GitHub Wiki
Tests:
Requirement 1: Authentication
test logging into and out of users, as well with creation of users so that they can login/out
-
test_register_page_status_code - tests that the registration page exists by asserting that the page should respond with a 200 status code. Result - True
-
test_register_page_contains_form - tests the validity of the form, that the middle ware properly communicates and is submit-able. Result - True
-
test_register_page_form_submission - tests creating a user by creating an account with valid credentials and that the object actually exists. Result - True
-
test_register_page_form_submission_invalid - tests that a user should NOT exist with invalid credentials. Assert that a a user with the invalid credentials should be false when searched for. Result - True
-
test_login_success - tests logging in with a user that does exist in the database, and that they should be redirected to home upon success. (redirect means successful login, otherwise invalid). Result - True
-
test_login_failure - tests logging in with a user that has invalid credentials. Should not redirect to home, but instead back to itself to indicated success. Result - True
-
test_logout_success - tests that a user can logout. logs the user in setup in, and then logs them out, and Asserts that they were redirected to "home". Results - True
Requirement 2: Administration
-
test_admin_login - tests that an admin can log in. creates an admin, goes to admin panel login view, and logs in as admin. Asserts that the admin is redirected to the admin panel. Results - True
-
test_admin_approve_user - tests that an admin can change a user's 'is_approved' attribute from None/False to True. creates an admin and user, logs in as admin, checks user is not approved, then sets is_approved to true and saves to database. Results - True
-
test_admin_disapprove_user - tests that an admin can change a user's 'is_approved' attribute from True to False. creates an admin and user, logs in as admin, checks that user is approved, then sets is_approved to false and saves to database. Results - True
-
test_approve_merch - tests that an admin can approve a merchandise item. creates admin and merchandise item (merch), asserts that merch exists and is not approved, sets 'is_approved' attribute to True and saves to database. Results - True
-
test_view_order_history - logs in as an admin and views the order history page. Asserts that admin is directed to the order history page. Results - True
Requirement 3: Seller
-
test_create_listing_view - tests that a seller can post an item. Creates a test item and asserts that it is added to the database. Results - True
-
test_view_my_merchandise_with_authenticated_user - tests that a seller can view their listings. Creates a test item and asserts that the seller can view it on their listings page. Results - True.
-
test_view_my_merchandise_with_unauthenticated_user - tests that users that are unauthenticated cannot view the listings page. Logs out of seller account and asserts that it is redirected upon attempting to view the page. Results - True.
-
test_view_my_sales_authenticated_user - tests that a seller can view their sales via the sales page. Asserts that the test message is present. Results - True.
-
test_view_my_sales_authenticated_user - tests that users that are unauthenticated cannot view the sales page. Logs out of seller account and asserts that it is rejected upon attempting to view the page. Results - True.
Requirement 4: Customer
-
test_add_to_cart - tests that an item can be added to a user's shopping cart. Logs in the user, adds the item to the cart, and asserts that the item is in the cart. Result - True
-
test_view_cart - tests that the user can view the view-cart page. Logs in the user, sends a request to the view-cart page, and asserts that the status code is 200 (OK). Result - True
-
test_checkout - tests that the user can checkout assuming they have an item in their cart. Logs in the user, adds an item to the cart, checks if user can successfully reach the checkout page, creates an order object and empties the cart, then checks if the cart is empty, and that the cart item information is stored in the order object. Result - True
-
test_edit_account_details - tests that the user can update their account details. Logs in the user, checks if we can access the edit-account page, sends dummy data to the page and checks that the info was submitted successfully
-
test_change_address - tests that the user can update their address. Logs in the user, checks if we can access the change-address page, sends dummy data to the page and checks that the info was submitted successfully