Serenity BDD Report
Home > Requirements > Stufe5 > Terminplanung > Booking an appointment by schedule reference (@appointment-book-by-schedule)
Report generated 01-09-2026 07:01

Feature: Booking an appointment by schedule reference (@appointment-book-by-schedule)

Scenarios

Given the Test Description: "The system under test MUST support booking appointments by schedule reference."

Given the Preconditions: A Slot resource in the schedule from the Schedule-Read test case must have been created manually with the following properties:

  • Status: free
  • Name:
  • Start time: 31.03.2027 10:05 (or set your own value in the configuration variable 'appointment-book-by-schedule-datetime-start' - must be in the future)
  • End time: 31.03.2027 10:55 (or set your own value in the configuration variable 'appointment-book-by-schedule-datetime-end' - must be in the future)
  • Treatment type: same as from the Schedule-Read test case

In addition, no other non-free slot may overlap the configured time window in the same schedule.
After a successful execution, the selected time window may no longer be reusable. Therefore, use a fresh free window or reset the test data before re-running this scenario.

Given Get FHIR resource at "http://fhirserver/Slot/?schedule=${data.appointment-book-by-schedule-schedule-id}&start=${data.appointment-book-by-schedule-date}" with content type "json"

And FHIR current response body evaluates the FHIRPath 'entry.resource.ofType(Slot).count() } 0' with error message 'No slots were found for the configured schedule and booking date'

And FHIR current response body evaluates the FHIRPath "entry.resource.ofType(Slot).where(status = 'free' and start {= @${data.appointment-book-by-schedule-datetime-start} and end }= @${data.appointment-book-by-schedule-datetime-end}).count() }= 1" with error message 'The configured schedule does not contain a free slot covering the requested appointment window'

And FHIR current response body evaluates the FHIRPath "entry.resource.ofType(Slot).where(status != 'free' and start { @${data.appointment-book-by-schedule-datetime-end} and end } @${data.appointment-book-by-schedule-datetime-start}).count() = 0" with error message 'The configured appointment window overlaps with at least one non-free slot in the selected schedule. Choose a different free time window before executing the happy-path scenario.'

And TGR set default header "Content-Type" to "application/fhir+json"

And TGR send POST request to "http://fhirserver/Appointment/$book" with body "!{file('src/test/resources/features/Stufe5/Terminplanung/fixtures/Appointment-Appointment-Book-By-Schedule-Parameters-Fixture.json')}"

Then TGR find the last request

And TGR current response with attribute "$.responseCode" matches "20\d"

And FHIR current response body evaluates the FHIRPath '($this is Appointment) or ($this is Parameters)' with error message 'The response contains neither an Appointment nor a Parameters resource'

And FHIR current response body evaluates the FHIRPath '($this is Appointment) implies id.exists()' with error message 'No ID was assigned to the appointment'

And FHIR current response body evaluates the FHIRPath "($this is Appointment) implies status.toString().matches('^booked|pending$')" with error message 'Appointment status is neither booked nor pending'

And FHIR current response body evaluates the FHIRPath "($this is Appointment) implies slot.exists()" with error message 'Appointment does not contain a slot reference'

And FHIR current response body evaluates the FHIRPath "($this is Parameters) implies parameter.where(name = 'return' and resource is Appointment).resource.id.exists()" with error message 'No ID was assigned to the Appointment'

And FHIR current response body evaluates the FHIRPath "($this is Parameters) implies parameter.where(name = 'return' and resource is Appointment).resource.status.toString().matches('^booked|pending$')" with error message 'the Appointment status is neither booked nor pending'

And FHIR current response body evaluates the FHIRPath "($this is Parameters) implies parameter.where(name = 'return' and resource is Appointment).resource.slot.exists()" with error message 'Appointment does not contain a slot reference'

Feature Coverage By Scenario

Test Outcomes

Test Performance

Key Statistics

Number of Scenarios 2 Total Duration 8s
Total Number of Test Cases 2 Fastest Test 419ms
Number of Manual Test Cases 0 Slowest Test 8s
Tests Started Sep 01, 2026 07:01:56 Average Execution Time 4s
Tests Finished Sep 01, 2026 07:02:05 Cumulative Test Time
(sum of all individual test durations)
8s

Automated Tests

feature Scenario Context Steps Started Total Duration Result
Booking an appointment by schedule reference (@Appointment-Book-By-Schedule) Precondition 2 07:01:56 419ms SUCCESS
Booking an appointment by schedule reference (@Appointment-Book-By-Schedule) Book an appointment by schedule reference 15 07:01:57 8s 342ms SUCCESS

Manual Tests

No manual tests were recorded

Evidence

Scenario Title Details
Precondition RBellog 0  Download Evidence
Book an appointment by schedule reference INFO - entry.resource.ofType(Slot).count() > 0  Details
Book an appointment by schedule reference INFO - entry.resource.ofType(Slot).where(status = 'free' and start <= @2027-03-31T10:05:00Z and end >= @2027-03-31T10:55:00Z).count() >= 1  Details
Book an appointment by schedule reference INFO - entry.resource.ofType(Slot).where(status != 'free' and start < @2027-03-31T10:55:00Z and end > @2027-03-31T10:05:00Z).count() = 0  Details
Book an appointment by schedule reference INFO - ($this is Appointment) or ($this is Parameters)  Details
Book an appointment by schedule reference INFO - ($this is Appointment) implies id.exists()  Details
Book an appointment by schedule reference INFO - ($this is Appointment) implies status.toString().matches('^booked|pending$')  Details
Book an appointment by schedule reference INFO - ($this is Appointment) implies slot.exists()  Details
Book an appointment by schedule reference INFO - ($this is Parameters) implies parameter.where(name = 'return' and resource is Appointment).resource.id.exists()  Details
Book an appointment by schedule reference INFO - ($this is Parameters) implies parameter.where(name = 'return' and resource is Appointment).resource.status.toString().matches('^booked|pending$')  Details
Book an appointment by schedule reference INFO - ($this is Parameters) implies parameter.where(name = 'return' and resource is Appointment).resource.slot.exists()  Details
Book an appointment by schedule reference RBellog 0  Download Evidence
Book an appointment by schedule reference Evidence Report  Download Evidence
Serenity BDD version 5.3.10