Files
2026-07-11 08:35:17 +02:00

123 lines
6.0 KiB
Gherkin

Feature: Boat Management
Scenario: Create route, boat, and trip as coordinator
Given I login as "admin@perauset.org"
When I create a boat route with name "Main Ferry" origin "Mainland" destination "Island"
Then the response status should be 200
And I store the response field "routeId" as "routeId"
When I create a boat with name "Sea Spirit" capacity 20
Then the response status should be 200
And I store the response field "boatId" as "boatId"
When I create a boat trip for the route and boat departing "2026-06-15T08:00:00Z"
Then the response status should be 200
And the response body field "status" should be "planned"
And I store the response field "tripId" as "tripId"
Scenario: Open trip for requests
Given I login as "admin@perauset.org"
When I create a boat route with name "Express Route" origin "Port A" destination "Port B"
Then the response status should be 200
And I store the response field "routeId" as "routeId"
When I create a boat with name "Wave Runner" capacity 15
Then the response status should be 200
And I store the response field "boatId" as "boatId"
When I create a boat trip for the route and boat departing "2026-07-01T09:00:00Z"
Then the response status should be 200
And I store the response field "tripId" as "tripId"
When I open the boat trip
Then the response status should be 200
And the response body field "status" should be "open"
Scenario: Request seat as community member
Given I login as "admin@perauset.org"
When I create a boat route with name "Shuttle" origin "Dock A" destination "Dock B"
Then the response status should be 200
And I store the response field "routeId" as "routeId"
When I create a boat with name "Island Hopper" capacity 10
Then the response status should be 200
And I store the response field "boatId" as "boatId"
When I create a boat trip for the route and boat departing "2026-08-01T07:00:00Z"
Then the response status should be 200
And I store the response field "tripId" as "tripId"
When I open the boat trip
Then the response status should be 200
Given a user "member@test.org" exists with roles "community_member"
And I login as "member@test.org"
When I request a seat on the boat trip
Then the response status should be 200
And the response body field "status" should be "submitted"
And I store the response field "requestId" as "boatRequestId"
Scenario: Confirm boat request as coordinator
Given I login as "admin@perauset.org"
When I create a boat route with name "Confirm Route" origin "Harbor" destination "Cove"
Then the response status should be 200
And I store the response field "routeId" as "routeId"
When I create a boat with name "Coral Cruiser" capacity 12
Then the response status should be 200
And I store the response field "boatId" as "boatId"
When I create a boat trip for the route and boat departing "2026-09-01T10:00:00Z"
Then the response status should be 200
And I store the response field "tripId" as "tripId"
When I open the boat trip
Then the response status should be 200
Given a user "member@test.org" exists with roles "community_member"
And I login as "member@test.org"
When I request a seat on the boat trip
Then the response status should be 200
And I store the response field "requestId" as "boatRequestId"
Given I login as "admin@perauset.org"
When I confirm the boat request
Then the response status should be 200
And the response body field "status" should be "confirmed"
Scenario: Cancel a trip
Given I login as "admin@perauset.org"
When I create a boat route with name "Cancel Route" origin "Pier" destination "Bay"
Then the response status should be 200
And I store the response field "routeId" as "routeId"
When I create a boat with name "Sunset Sailor" capacity 8
Then the response status should be 200
And I store the response field "boatId" as "boatId"
When I create a boat trip for the route and boat departing "2026-10-01T06:00:00Z"
Then the response status should be 200
And I store the response field "tripId" as "tripId"
When I open the boat trip
Then the response status should be 200
When I cancel the boat trip
Then the response status should be 200
And the response body field "status" should be "cancelled"
Scenario: Unpermissioned user cannot create trips
Given I login as "admin@perauset.org"
When I create a boat route with name "Forbidden Route" origin "X" destination "Y"
Then the response status should be 200
And I store the response field "routeId" as "routeId"
Given a user "guest@test.org" exists with roles "guest"
And I login as "guest@test.org"
When I create a boat trip for the route without boat departing "2026-06-15T08:00:00Z"
Then the response status should be 403
Scenario: Unpermissioned user cannot confirm requests
Given I login as "admin@perauset.org"
When I create a boat route with name "Perm Route" origin "North" destination "South"
Then the response status should be 200
And I store the response field "routeId" as "routeId"
When I create a boat with name "Perm Boat" capacity 10
Then the response status should be 200
And I store the response field "boatId" as "boatId"
When I create a boat trip for the route and boat departing "2026-11-01T08:00:00Z"
Then the response status should be 200
And I store the response field "tripId" as "tripId"
When I open the boat trip
Then the response status should be 200
Given a user "member@test.org" exists with roles "community_member"
And I login as "member@test.org"
When I request a seat on the boat trip
Then the response status should be 200
And I store the response field "requestId" as "boatRequestId"
Given a user "guest@test.org" exists with roles "guest"
And I login as "guest@test.org"
When I confirm the boat request
Then the response status should be 403