pytest-given
pytest 9.0.3 · pytest-given 0.1.0 ·
Term:
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
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
Payment is declined — the booking is not finalized
✗ failed 36ms
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'}
Book a Group Trip
7 activities · 3 scenarios
1
Carolsearches forRoom
1 scenario
2
CarolselectsDeluxe Suite
2 scenarios
3
CaroladdsAlicetoBooking
CaroladdsBobtoBooking
2 scenarios · 1 failing
4
CarolsubmitsPaymentforBooking
2 scenarios · 1 failing
5
Booking SystemconfirmsBooking
1 scenario
6
Booking SystemsendsConfirmationtoAlice
Booking SystemsendsConfirmationtoBob
1 scenario
7
Carolredeemsloyalty points
no coverage
Scenarios
Carol picks a suite for the group
✓ passed
Covers: 1 2
Carol completes the booking for both guests
✓ passed
Covers: 2 3 4 5 6
Payment is declined — the booking is not finalized
✗ failed
Covers: 3 4
Cancel a Booking
3 activities · 1 scenario
1
AlicecancelsBooking
1 scenario
2
Booking SystemrefundsPaymentforBooking
1 scenario
3
Booking SystemsendsConfirmationtoAlice
1 scenario
Scenarios
Alice cancels her booking and is refunded
✓ passed
Covers: 1 2 3
Glossary
18 terms · 3 actors · 5 work objects · 10 verbs
Actors 3 terms
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 5 terms
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 10 terms
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