AndreiBanu1 / Amazon_Testing_Framework

0 stars 0 forks source link

Create test cases for Cart Module #7

Open AndreiBanu1 opened 1 year ago

AndreiBanu1 commented 1 year ago

Cart Module: Test the cart functionality, including adding products to the cart, updating quantities, removing items, and verifying the total price and availability. Test both guest user and logged-in user scenarios.

AndreiBanu1 commented 1 year ago
  1. Test adding a product to the cart:

    • Preconditions: User is on a product page.
    • Steps:
      1. Add the product to the cart.
      2. Navigate to the cart page.
    • Expected Results: The product should be successfully added to the cart, and the cart page should display the added product.
  2. Test updating the quantity of a product in the cart:

    • Preconditions: User has products in the cart.
    • Steps:
      1. Navigate to the cart page.
      2. Update the quantity of a product.
      3. Verify that the quantity has been updated.
    • Expected Results: The quantity of the product should be successfully updated in the cart.
  3. Test removing a product from the cart:

    • Preconditions: User has products in the cart.
    • Steps:
      1. Navigate to the cart page.
      2. Remove a product from the cart.
      3. Verify that the product has been removed.
    • Expected Results: The product should be successfully removed from the cart.
  4. Test verifying the total price in the cart:

    • Preconditions: User has products in the cart.
    • Steps:
      1. Navigate to the cart page.
      2. Calculate the expected total price based on the individual product prices and quantities.
      3. Retrieve the displayed total price from the cart page.
      4. Compare the expected total price with the displayed total price.
    • Expected Results: The displayed total price should match the expected total price based on the product prices and quantities.
  5. Test verifying the availability of products in the cart:

    • Preconditions: User has products in the cart.
    • Steps:
      1. Navigate to the cart page.
      2. Check the availability status of each product in the cart.
      3. Verify that all products are marked as available.
    • Expected Results: All products in the cart should be marked as available.
  6. Test the cart functionality for a guest user:

    • Preconditions: User is not logged in and has products in the cart.
    • Steps:
      1. Navigate to the cart page.
      2. Proceed to checkout as a guest user.
    • Expected Results: The guest user should be able to proceed to the checkout process successfully.
  7. Test the cart functionality for a logged-in user:

    • Preconditions: User is logged in and has products in the cart.
    • Steps:
      1. Navigate to the cart page.
      2. Proceed to checkout as a logged-in user.
    • Expected Results: The logged-in user should be able to proceed to the checkout process successfully.
  8. Test applying a discount code:

    • Preconditions: User has products in the cart and a valid discount code is available.
    • Steps:
      1. Navigate to the cart page.
      2. Enter a valid discount code.
      3. Apply the discount code.
      4. Verify that the discount has been applied and the total price reflects the discounted amount.
    • Expected Results: The discount code should be successfully applied, and the total price should reflect the discounted amount.
  9. Test removing all products from the cart:

    • Preconditions: User has products in the cart.
    • Steps:
      1. Navigate to the cart page.
      2. Remove all products from the cart.
      3. Verify that the cart is empty.
    • Expected Results: All products should be successfully removed from the cart, and the cart should be empty.
  10. Test checking out with different shipping options:

    • Preconditions: User has products in the cart.
    • Steps:
      1. Navigate to the cart page.
      2. Select different shipping options (e.g., standard, express).
      3. Proceed to the checkout process.
      4. Verify that the selected shipping option is displayed on the checkout page.
    • Expected Results: The selected shipping option should be successfully applied during the checkout process.
  11. Test verifying the cart across multiple sessions:

    • Preconditions: User has products in the cart in a previous session.
    • Steps:
      1. Close the browser and open a new session.
      2. Navigate to the cart page.
      3. Verify that the previously added products are still present in the cart.
    • Expected Results: The previously added products should be retained in the cart across multiple sessions.
  12. Test adding a product to the cart from a product listing page:

    • Preconditions: User is on a product listing page.
    • Steps:
      1. Select a product from the listing page.
      2. Add the product to the cart.
      3. Verify that the product is added to the cart and displayed on the cart page.
    • Expected Results: The product should be successfully added to the cart from the product listing page.