0% found this document useful (0 votes)
7 views5 pages

Example Shooping Cart

The document outlines detailed use cases for an online shopping cart system, including functionalities such as adding items to the cart, viewing the cart, editing items, removing items, applying discount codes, proceeding to checkout, and saving the cart for later. Each use case includes preconditions, triggers, main flows, postconditions, and alternative flows. Additionally, it presents a test case for the 'Add Item to Cart' functionality, including objectives, test steps, expected results, and negative test scenarios.

Uploaded by

AhmadNadeem Khan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views5 pages

Example Shooping Cart

The document outlines detailed use cases for an online shopping cart system, including functionalities such as adding items to the cart, viewing the cart, editing items, removing items, applying discount codes, proceeding to checkout, and saving the cart for later. Each use case includes preconditions, triggers, main flows, postconditions, and alternative flows. Additionally, it presents a test case for the 'Add Item to Cart' functionality, including objectives, test steps, expected results, and negative test scenarios.

Uploaded by

AhmadNadeem Khan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Here are detailed use cases for an online shopping cart system, presented in a structured format:

Use Case 1: Add Item to Cart

Use Case ID UC01

Use Case Name Add Item to Cart

Actor(s) Customer

Precondition The user is logged in or browsing as a guest.

Trigger The user clicks the "Add to Cart" button.

1. User navigates to a product page.2. User selects product options (e.g., size, color).3.
Main Flow
User clicks "Add to Cart".

Postcondition The item is added to the cart, and the cart count updates.

Alternative 1a. If product options are not selected, prompt the user to choose options.2a. If the
Flows item is out of stock, display an error message.

Use Case 2: View Cart

Use Case ID UC02

Use Case Name View Cart

Actor(s) Customer

Precondition The user has items in the cart.

Trigger The user clicks on the "Cart" icon or link.

1. User clicks on the cart icon.2. The system displays the cart with a list of added items,
Main Flow
quantities, and prices.3. User can review the total price and edit quantities.

Postcondition The user sees all items in the cart and can proceed to checkout.

Alternative
1a. If the cart is empty, display a message like "Your cart is empty".
Flows

Use Case 3: Edit Cart Item


Use Case ID UC03

Use Case Name Edit Cart Item

Actor(s) Customer

Precondition The user has added items to the cart.

Trigger The user selects an item to edit.

1. User clicks the "Edit" button for an item in the cart.2. User modifies quantity or
Main Flow
options.3. User confirms the changes.4. The system updates the cart.

Postcondition The cart reflects the updated item details.

Alternative
1a. If the requested quantity exceeds stock, display a warning message.
Flows

Use Case 4: Remove Item from Cart

Use Case ID UC04

Use Case Name Remove Item from Cart

Actor(s) Customer

Precondition The user has added items to the cart.

Trigger The user clicks the "Remove" button for an item.

1. User clicks the "Remove" button.2. The system removes the item from the cart.3.
Main Flow
The cart updates with a new total price.

Postcondition The item is removed from the cart.

Alternative
1a. If the cart is empty after removal, display an "Empty Cart" message.
Flows

Use Case 5: Apply Discount Code


Use Case ID UC05

Use Case Name Apply Discount Code

Actor(s) Customer

Precondition The user has items in the cart and a valid discount code.

Trigger The user enters a discount code in the cart page.

1. User enters a discount code.2. User clicks "Apply".3. The system validates the code
Main Flow
and recalculates the total price.

Postcondition The discount is applied, and the new total is displayed.

Alternative
1a. If the code is invalid, display an error message like "Invalid code".
Flows

Use Case 6: Proceed to Checkout

Use Case ID UC06

Use Case Name Proceed to Checkout

Actor(s) Customer

Precondition The user has at least one item in the cart.

Trigger The user clicks the "Checkout" button.

1. User clicks "Checkout".2. System redirects to the checkout page.3. User reviews
Main Flow
order details, enters shipping and payment info.4. User confirms the order.

Postcondition The order is placed, and the user receives a confirmation message.

Alternative
1a. If payment fails, display an error and allow the user to retry.
Flows

Use Case 7: Save Cart for Later


Use Case ID UC07

Use Case Name Save Cart for Later

Actor(s) Customer

Precondition The user is logged in and has items in the cart.

Trigger The user clicks "Save for Later".

1. User clicks "Save for Later".2. System saves the cart and displays a success
Main Flow
message.

Postcondition The cart is saved for future retrieval.

Alternative Flows 1a. If the user is not logged in, prompt them to log in.

Here’s a detailed test case for the Add Item to Cart functionality, presented in a table format:

Test Case ID TC01: Add Item to Cart

Test Case
Add Item to Cart
Name

Objective Verify that items can be successfully added to the shopping cart.

Precondition The user is on the product page, and the item is in stock.

1. Navigate to the product page.2. Select product options (if any).3. Click on the "Add to
Test Steps
Cart" button.4. Check the cart icon or cart page.

Expected The item is added to the cart.The cart count is updated.The item is listed on the cart
Result page with the correct details (e.g., name, price, options).

Test Data - Product name: "Sample Product"- Size: "Medium"- Color: "Red"- Quantity: 1

Priority High

Severity Critical

Pass Criteria The item is added to the cart successfully, with the correct details displayed.

- The item is not added to the cart.- Incorrect details are displayed.- Cart count does not
Fail Criteria
update.

Negative Test Cases

Here are additional test scenarios to include edge cases:


Test Case
Scenario Expected Result
ID

Add item without selecting System displays an error message like "Please select all
TC01A
required options options".

TC01B Add item that is out of stock System displays an error message like "Item out of stock".

The item is added to the cart, and cart persists during


TC01C Add item to cart as a guest
session.

Add multiple items of the same The cart updates the quantity or adds multiple instances as
TC01D
product per implementation.

You might also like