Feature: Money Transfer
Scenario: Successful money transfer
Given a user has $500 in their checking account
When they transfer $200 to a friend
Then their checking account balance should be $300
And the friend's account should reflect a $200 deposit
Feature: Shopping Cart Checkout
As a customer
I want to complete my purchase
So that I can receive my ordered items
Scenario: Successful checkout with valid credit card
Given I have items in my shopping cart
And I am logged into my account
When I enter valid credit card information
And I confirm the purchase
Then I should receive an order confirmation
And my credit card should be charged
And I should receive a confirmation email
Feature: Flight Booking
Scenario: Booking a flight with valid passport details
Given a user is on the flight booking page
And the user has entered valid passport information
When the user attempts to book a flight
Then the flight should be booked successfully
Scenario: Database validation
Given the user_orders table exists
When I execute INSERT INTO user_orders
Then the database should return status 200
Scenario: Order confirmation
Given Sarah has added a book to her cart
When she completes the checkout process
Then she should receive an order confirmation
Scenario: Secure authentication
Given the user’s credentials are hashed using SHA-256
When the credentials are validated
Then access should be granted
Scenario: User logs in securely
Given John has entered his username and password
When he successfully authenticates
Then he should be securely logged into his account
And he should see his account overview
Feature: Shopping Cart Checkout
Scenario: Successful checkout with valid credit card
Given I have items in my shopping cart
When I enter valid credit card information
Then I should receive an order confirmation
Feature: Ride Booking
Scenario: Successful ride booking
Given a user is logged into the app
And the user has selected a destination
When the user requests a ride
Then a driver should be assigned
And the user should see the estimated arrival time
Scenario: Database update after checkout
Given the orders table is available
When I insert a new order record
Then the table should contain the order details
Scenario: Successful checkout process
Given a customer has items in their cart
When they complete the checkout
Then they should receive a confirmation message
And their order status should be updated to "confirmed"
Scenario: Patient appointment booking
Given a patient has selected a time slot
When they confirm their appointment
Then they should receive an appointment confirmation
And the system should block that time slot for other patients
Feature: Shopping Cart Management
Background:
Given I am logged in as a customer
And I have an empty shopping cart
Scenario: Adding the first item to cart
When I add "JavaScript Basics" to my cart
Then my cart should contain 1 item
Scenario: Removing an item from the cart
Given I have added "JavaScript Basics" to my cart
When I remove it
Then my cart should be empty
Feature: Product Search
As a customer
I want to search for products
So that I can find items I want to purchase
Scenario: Search with filters
Given I am on the product search page
When I enter "laptop" in the search field
And I filter by price range "$500-$1000"
And I select brand "Dell"
Then I should see only Dell laptops
And all prices should be between $500 and $1000
// Step definition for visiting the product search page
Given('I am on the product search page', () => {
cy.visit('/products'); // Visits the product search page
});
// Step definition for entering a search term
When('I enter {string} in the search field', (searchTerm) => {
cy.get('#search-input').type(searchTerm); // Types the search term into the search input
});
// Step definition for filtering results by brand and price
When('I filter by price range {string}', (priceRange) => {
// Implement logic to apply the price filter
cy.get('#price-filter').select(priceRange);
});
When('I select brand {string}', (brand) => {
// Implement logic to apply the brand filter
cy.get('#brand-filter').select(brand);
});
// Step definition for verifying filtered results
Then('I should see only Dell laptops', () => {
// Checks that each product displayed contains the word 'Dell'
cy.get('.product-card').each(($card) => {
cy.wrap($card).should('contain', 'Dell');
});
});
Then('all prices should be between $500 and $1000', () => {
// Verifies that all product prices are within the specified range
cy.get('.product-price').each(($price) => {
const price = parseFloat($price.text().replace('$', ''));
expect(price).to.be.within(500, 1000);
});
});