10 automation test cases for https://www.saucedemo.com/ (Sauce Demo)
Here are 10 automation test cases for https://www.saucedemo.com/ (Sauce Demo), each with detailed steps and expected results. These are designed to simulate realistic user scenarios and we would be implemented using tools like Selenium, Cypress, or Playwright later.
๐น Test Case 1: Valid Login
-
Objective: Verify successful login with valid credentials.
-
Steps:
-
Navigate to
https://www.saucedemo.com/
-
Enter Username:
standard_user
-
Enter Password:
secret_sauce
-
Click the Login button
-
-
Expected Result: User is redirected to the inventory page (
/inventory.html
) with a list of products displayed.
๐น Test Case 2: Invalid Login
-
Objective: Validate error handling with incorrect credentials.
-
Steps:
-
Navigate to the login page
-
Enter Username:
invalid_user
-
Enter Password:
wrong_password
-
Click the Login button
-
-
Expected Result: Error message displayed:
"Epic sadface: Username and password do not match any user in this service"
๐น Test Case 3: Locked Out User Login
-
Objective: Check behavior for locked out users.
-
Steps:
-
Go to login page
-
Enter Username:
locked_out_user
-
Enter Password:
secret_sauce
-
Click Login
-
-
Expected Result: Error message displayed:
"Epic sadface: Sorry, this user has been locked out."
๐น Test Case 4: Add Item to Cart
-
Objective: Verify that an item can be added to the shopping cart.
-
Steps:
-
Log in as
standard_user
-
Click Add to cart for any product (e.g., “Sauce Labs Backpack”)
-
Click the shopping cart icon
-
-
Expected Result: Cart page shows the selected product listed.
๐น Test Case 5: Remove Item from Cart
-
Objective: Ensure items can be removed from the cart.
-
Steps:
-
Log in and add any item to cart
-
Click the cart icon
-
Click the Remove button next to the product
-
-
Expected Result: The product is removed and no longer listed in the cart.
๐น Test Case 6: Checkout Process - Happy Path
-
Objective: Test a complete successful checkout.
-
Steps:
-
Log in and add an item to cart
-
Go to cart and click Checkout
-
Enter valid info:
-
First Name:
John
-
Last Name:
Doe
-
Postal Code:
12345
-
-
Click Continue
-
Click Finish
-
-
Expected Result: Checkout complete page shows message:
"Thank you for your order!"
๐น Test Case 7: Checkout Form Validation
-
Objective: Verify error handling when required fields are missing.
-
Steps:
-
Log in, add item to cart, go to checkout
-
Leave one or more fields (e.g., Postal Code) blank
-
Click Continue
-
-
Expected Result: Error message like:
"Error: Postal Code is required"
๐น Test Case 8: Sort Products by Price (Low to High)
-
Objective: Ensure sorting by price (low to high) works correctly.
-
Steps:
-
Log in and navigate to the inventory page
-
Click the sort dropdown and select
Price (low to high)
-
-
Expected Result: Products are reordered so the one with the lowest price appears first.
๐น Test Case 9: Verify Social Media Links
-
Objective: Check if social media links navigate to correct pages.
-
Steps:
-
Log in and scroll to the page footer
-
Click on the Twitter icon
-
-
Expected Result: A new tab opens to Sauce Labs’ Twitter profile (verify correct URL).
๐น Test Case 10: Logout Functionality
-
Objective: Verify that user can successfully log out.
-
Steps:
-
Log in
-
Click the menu (≡) icon on the top left
-
Click Logout
-
-
Expected Result: Redirected to login page (
https://www.saucedemo.com/
)
Comments
Post a Comment