Skip to content

Instantly share code, notes, and snippets.

@coopmoney
Created September 15, 2025 15:09
Show Gist options
  • Select an option

  • Save coopmoney/4b3abf6f12282517e4516c21696c335f to your computer and use it in GitHub Desktop.

Select an option

Save coopmoney/4b3abf6f12282517e4516c21696c335f to your computer and use it in GitHub Desktop.
Feature: Shopping cart
As a shopper
I want to be able to add and remove items from my shopping cart
So that I can manage the items I want to purchase
Scenario: Add an item to the shopping cart
Given I am on the product page for a shirt
When I click the "add to cart" button
And I select the size and quantity of the shirt
And I click the "add to cart" button again
Then I should see a notification that says "Shirt added to cart"
And the shopping cart icon should show the correct number of items
Scenario: Remove an item from the shopping cart
Given I am on the shopping cart page
And there is at least one item in the cart
When I click the "remove" button for an item
Then I should see a notification that says "Item removed from cart"
And the shopping cart icon should show the updated number of items
And the item should no longer be listed in the shopping cart
Scenario: Empty the shopping cart
Given I am on the shopping cart page
And there are multiple items in the cart
When I click the "empty cart" button
Then I should see a notification that says "Shopping cart emptied"
And the shopping cart icon should show 0 items
And the shopping cart should be empty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment