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 92ms
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'}
.nox/examples/Lib/site-packages/_pytest/runner.py:353: in from_call
    result: TResult | None = func()
                             ^^^^^^
.nox/examples/Lib/site-packages/_pytest/runner.py:245: in <lambda>
    lambda: runtest_hook(item=item, **kwds),
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.nox/examples/Lib/site-packages/pluggy/_hooks.py:512: in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.nox/examples/Lib/site-packages/pluggy/_manager.py:120: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.nox/examples/Lib/site-packages/_pytest/logging.py:850: in pytest_runtest_call
    yield
.nox/examples/Lib/site-packages/_pytest/capture.py:900: in pytest_runtest_call
    return (yield)
            ^^^^^
.nox/examples/Lib/site-packages/_pytest/skipping.py:268: in pytest_runtest_call
    return (yield)
            ^^^^^
.nox/examples/Lib/site-packages/_pytest/runner.py:179: in pytest_runtest_call
    item.runtest()
.nox/examples/Lib/site-packages/_pytest/python.py:1720: in runtest
    self.ihook.pytest_pyfunc_call(pyfuncitem=self)
.nox/examples/Lib/site-packages/pluggy/_hooks.py:512: in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.nox/examples/Lib/site-packages/pluggy/_manager.py:120: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.nox/examples/Lib/site-packages/_pytest/python.py:166: in pytest_pyfunc_call
    result = testfunction(**testargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^
src/pytest_given/capture/decorators.py:223: in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
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/1
3
CaroladdsAlicetoBooking
CaroladdsBobtoBooking
1/2
5
Booking SystemconfirmsBooking
1/1
6
Booking SystemsendsConfirmationtoAlice
Booking SystemsendsConfirmationtoBob
1/1
7
Carolredeemsloyalty points
0/3
Cancel a Booking
3 activities · 1 scenario
1
AlicecancelsBooking
1/1
2
Booking SystemrefundsPaymentforBooking
1/1
3
Booking SystemsendsConfirmationtoAlice
1/1
Glossary
18 terms · 3 actors · 5 work objects · 10 verbs
Actors 3 terms
Organizer
Person booking accommodation on behalf of a group.
1 instance · used in 1 story
Guest
Individual traveler in the group.
2 instances · used in 2 stories
Booking System
Automated reservation back-end.
used in 2 stories
Work Objects 5 terms
Room
A bookable hotel room.
1 instance · used in 1 story
Booking
A reservation for one or more rooms.
used in 2 stories
Payment
Money transferred for a booking.
used in 2 stories
Confirmation
Notification of a successful booking.
used in 2 stories
loyalty points
Undefined
used in 1 story
Verbs 10 terms
search
Look up available options.
used in 1 story
select
Choose one option from a set.
used in 1 story
add
Attach a member to a collection.
used in 1 story
submit
Send to the system for processing.
used in 1 story
confirm
Finalize and acknowledge.
used in 1 story
send
Deliver to a recipient.
used in 2 stories
reject
Refuse to process or accept.
cancel
Withdraw a booking before arrival.
used in 1 story
refund
Return money for a cancelled booking.
used in 1 story
redeems
Undefined
used in 1 story