Hotel Booking Example
pytest 9.0.3 · pytest-given 0.1.0 ·
Module:
Carol picks a suite for the group
✓ passed 0ms
Given
our organizer Carol
the Deluxe Suite is listed as available
When
Carol searches for a Room
Carol selects the Deluxe Suite
Then
the Deluxe Suite is held for Carol
Carol completes the booking for both guests
✓ passed 0ms
Given
our organizer Carol
our guest Alice
our guest Bob
Carol has selected the Deluxe Suite
When
Carol adds Alice and Bob to the Booking
Carol submits the Payment for the Booking
Then
the Booking System confirms the Booking
the Booking System sends the Confirmation to Alice and Bob
Payment is declined — the booking is not finalized
✗ failed 9ms
Given
our organizer Carol
our guest Alice
our guest Bob
Carol has added Alice and Bob to the Booking
When
Carol submits the Payment by {payment_method} for the Booking
Then
the Booking System rejects the Payment because of {decline_reason}
the Booking stays pending and no Confirmation is sent to Alice or Bob
payment_method decline_reason status
credit card insufficient funds
debit card expired card
bank transfer fraud check failed
gift card partial balance
assert 'gift card' in {'bank transfer', 'credit card', 'debit card'}
examples/hotel-booking/test_hotel_booking.py:230: in test_payment_declined
    assert payment_method in SUPPORTED_PAYMENT_METHODS
E   AssertionError: assert 'gift card' in {'bank transfer', 'credit card', 'debit card'}
Alice cancels her booking and is refunded
✓ passed 0ms
Given
our guest Alice
Alice has a confirmed Booking she paid for
When
Alice cancels the Booking
Then
the Booking System refunds the Payment for the Booking
the Booking System sends a Confirmation to Alice
Book a Group Trip
7 activities · 3 scenarios
Carolsearches forRoom
1 scenario
CarolselectsDeluxe Suite
2 scenarios
CaroladdsAlicetoBooking
CaroladdsBobtoBooking
2 scenarios · 1 failing
CarolsubmitsPaymentforBooking
2 scenarios · 1 failing
Booking SystemconfirmsBooking
1 scenario
Booking SystemsendsConfirmationtoAlice
Booking SystemsendsConfirmationtoBob
1 scenario
Carolredeemsloyalty points
no coverage
Scenarios
✓ passed
Covers:
✓ passed
Covers:
✗ failed
Covers:
Cancel a Booking
3 activities · 1 scenario
AlicecancelsBooking
1 scenario
Booking SystemrefundsPaymentforBooking
1 scenario
Booking SystemsendsConfirmationtoAlice
1 scenario
Scenarios
✓ passed
Covers:
Glossary
18 terms · 3 actors · 5 work objects · 10 verbs
Actors
Organizer
Person booking accommodation on behalf of a group.
1 instance · 1 story · 3 scenarios
Guest
Individual traveler in the group.
2 instances · 2 stories · 3 scenarios
Booking System
Automated reservation back-end.
2 stories · 3 scenarios
Work Objects
Room
A bookable hotel room.
1 instance · 1 story · 2 scenarios
Booking
A reservation for one or more rooms.
2 stories · 3 scenarios
Payment
Money transferred for a booking.
2 stories · 3 scenarios
Confirmation
Notification of a successful booking.
2 stories · 3 scenarios
loyalty points
Undefined
1 story
Verbs
search
Look up available options.
1 story · 1 scenario
select
Choose one option from a set.
1 story · 2 scenarios
add
Attach a member to a collection.
1 story · 2 scenarios
submit
Send to the system for processing.
1 story · 2 scenarios
confirm
Finalize and acknowledge.
1 story · 1 scenario
send
Deliver to a recipient.
2 stories · 2 scenarios
reject
Refuse to process or accept.
1 scenario
cancel
Withdraw a booking before arrival.
1 story · 1 scenario
refund
Return money for a cancelled booking.
1 story · 1 scenario
redeems
Undefined
1 story
No terms match this filter.