chore: perauset customer project
This commit is contained in:
105
e2e/tests/features/rooms.feature
Normal file
105
e2e/tests/features/rooms.feature
Normal file
@@ -0,0 +1,105 @@
|
||||
Feature: Room Management
|
||||
|
||||
Scenario: Create a room as coordinator
|
||||
Given I login as "admin@perauset.org"
|
||||
When I create a room with code "R101" name "Room 101" type "private" capacity 2
|
||||
Then the response status should be 200
|
||||
And I store the response field "roomId" as "roomId"
|
||||
|
||||
Scenario: Allocate room to a stay
|
||||
Given a user "member@test.org" exists with roles "community_member"
|
||||
And I login as "member@test.org"
|
||||
When I submit a stay request with type "guest" from "2026-06-01" to "2026-06-10"
|
||||
Then the response status should be 200
|
||||
And I store the response field "requestId" as "requestId"
|
||||
Given I login as "admin@perauset.org"
|
||||
When I approve the stay request
|
||||
Then the response status should be 200
|
||||
When I create a stay from the approved request
|
||||
Then the response status should be 200
|
||||
And I store the response field "stayId" as "stayId"
|
||||
When I create a room with code "R201" name "Room 201" type "shared" capacity 4
|
||||
Then the response status should be 200
|
||||
And I store the response field "roomId" as "roomId"
|
||||
When I allocate the room to the stay from "2026-06-01" to "2026-06-10"
|
||||
Then the response status should be 200
|
||||
And I store the response field "allocationId" as "allocationId"
|
||||
|
||||
Scenario: Double allocation for overlapping dates fails
|
||||
Given a user "member@test.org" exists with roles "community_member"
|
||||
And I login as "member@test.org"
|
||||
When I submit a stay request with type "guest" from "2026-07-01" to "2026-07-10"
|
||||
Then the response status should be 200
|
||||
And I store the response field "requestId" as "requestId"
|
||||
Given I login as "admin@perauset.org"
|
||||
When I approve the stay request
|
||||
Then the response status should be 200
|
||||
When I create a stay from the approved request
|
||||
Then the response status should be 200
|
||||
And I store the response field "stayId" as "stayId1"
|
||||
Given I login as "member@test.org"
|
||||
When I submit a stay request with type "volunteer" from "2026-07-05" to "2026-07-15"
|
||||
Then the response status should be 200
|
||||
And I store the response field "requestId" as "requestId"
|
||||
Given I login as "admin@perauset.org"
|
||||
When I approve the stay request
|
||||
Then the response status should be 200
|
||||
When I create a stay from the approved request
|
||||
Then the response status should be 200
|
||||
And I store the response field "stayId" as "stayId2"
|
||||
When I create a room with code "R301" name "Room 301" type "dorm" capacity 6
|
||||
Then the response status should be 200
|
||||
And I store the response field "roomId" as "roomId"
|
||||
When I allocate the room to stored stay "stayId1" from "2026-07-01" to "2026-07-10"
|
||||
Then the response status should be 200
|
||||
When I allocate the room to stored stay "stayId2" from "2026-07-05" to "2026-07-15"
|
||||
Then the response status should be 409
|
||||
|
||||
Scenario: Release room allocation
|
||||
Given a user "member@test.org" exists with roles "community_member"
|
||||
And I login as "member@test.org"
|
||||
When I submit a stay request with type "guest" from "2026-08-01" to "2026-08-10"
|
||||
Then the response status should be 200
|
||||
And I store the response field "requestId" as "requestId"
|
||||
Given I login as "admin@perauset.org"
|
||||
When I approve the stay request
|
||||
Then the response status should be 200
|
||||
When I create a stay from the approved request
|
||||
Then the response status should be 200
|
||||
And I store the response field "stayId" as "stayId"
|
||||
When I create a room with code "R401" name "Room 401" type "facilitator" capacity 1
|
||||
Then the response status should be 200
|
||||
And I store the response field "roomId" as "roomId"
|
||||
When I allocate the room to the stay from "2026-08-01" to "2026-08-10"
|
||||
Then the response status should be 200
|
||||
And I store the response field "allocationId" as "allocationId"
|
||||
Given the room allocation is active in the database
|
||||
When I release the room allocation
|
||||
Then the response status should be 200
|
||||
And the response body field "status" should be "completed"
|
||||
|
||||
Scenario: Unpermissioned user cannot create rooms
|
||||
Given a user "guest@test.org" exists with roles "guest"
|
||||
And I login as "guest@test.org"
|
||||
When I create a room with code "R501" name "Room 501" type "dorm" capacity 4
|
||||
Then the response status should be 403
|
||||
|
||||
Scenario: Unpermissioned user cannot allocate rooms
|
||||
Given a user "member@test.org" exists with roles "community_member"
|
||||
And I login as "member@test.org"
|
||||
When I submit a stay request with type "guest" from "2026-09-01" to "2026-09-10"
|
||||
Then the response status should be 200
|
||||
And I store the response field "requestId" as "requestId"
|
||||
Given I login as "admin@perauset.org"
|
||||
When I approve the stay request
|
||||
Then the response status should be 200
|
||||
When I create a stay from the approved request
|
||||
Then the response status should be 200
|
||||
And I store the response field "stayId" as "stayId"
|
||||
When I create a room with code "R501" name "Room 501" type "dorm" capacity 4
|
||||
Then the response status should be 200
|
||||
And I store the response field "roomId" as "roomId"
|
||||
Given a user "guest@test.org" exists with roles "guest"
|
||||
And I login as "guest@test.org"
|
||||
When I allocate the room to the stay from "2026-09-01" to "2026-09-10"
|
||||
Then the response status should be 403
|
||||
Reference in New Issue
Block a user