chore: perauset customer project
This commit is contained in:
14
e2e/tests/features/audit-log.feature
Normal file
14
e2e/tests/features/audit-log.feature
Normal file
@@ -0,0 +1,14 @@
|
||||
Feature: Audit Log
|
||||
|
||||
Scenario: Audit log captures changes
|
||||
Given I login as "admin@perauset.org"
|
||||
When I update my profile with displayName "Audited Admin"
|
||||
And I send a GET request to "/audit-log?tableName=user"
|
||||
Then the response status should be 200
|
||||
And the audit log should contain an "UPDATE" entry for table "user"
|
||||
|
||||
Scenario: Unpermissioned user cannot view audit log
|
||||
Given a user "noaudit@test.org" exists with roles "guest"
|
||||
And I login as "noaudit@test.org"
|
||||
When I send a GET request to "/audit-log"
|
||||
Then the response status should be 403
|
||||
10
e2e/tests/features/auth.feature
Normal file
10
e2e/tests/features/auth.feature
Normal file
@@ -0,0 +1,10 @@
|
||||
Feature: Authentication
|
||||
|
||||
Scenario: Unauthenticated request to protected endpoint
|
||||
When I send a GET request to "/users"
|
||||
Then the response status should be 403
|
||||
|
||||
Scenario: Login and get session
|
||||
Given I login as "admin@perauset.org"
|
||||
When I send a GET request to "/api/auth/get-session"
|
||||
Then the response status should be 200
|
||||
122
e2e/tests/features/boats.feature
Normal file
122
e2e/tests/features/boats.feature
Normal file
@@ -0,0 +1,122 @@
|
||||
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
|
||||
14
e2e/tests/features/browser/finance.feature
Normal file
14
e2e/tests/features/browser/finance.feature
Normal file
@@ -0,0 +1,14 @@
|
||||
Feature: Finance UI
|
||||
|
||||
Background:
|
||||
Given I am logged in as "admin@perauset.org"
|
||||
|
||||
Scenario: Create finance record
|
||||
When I navigate to "/finance"
|
||||
And I click "Add Record"
|
||||
And I fill in "Name" with "Kitchen Supplies"
|
||||
And I fill in "Amount" with "150"
|
||||
And I select "Expense" from "Type"
|
||||
And I select "Kitchen" from "Category"
|
||||
And I click "Create Record"
|
||||
Then I should see "Kitchen Supplies"
|
||||
16
e2e/tests/features/browser/inventory.feature
Normal file
16
e2e/tests/features/browser/inventory.feature
Normal file
@@ -0,0 +1,16 @@
|
||||
Feature: Inventory Management UI
|
||||
|
||||
Background:
|
||||
Given I am logged in as "admin@perauset.org"
|
||||
|
||||
Scenario: Add inventory item
|
||||
When I navigate to "/inventory"
|
||||
Then I should see heading "Inventory"
|
||||
And I click "Add Item"
|
||||
And I fill in "Item Name" with "Olive Oil"
|
||||
And I fill in "Unit" with "liter"
|
||||
And I fill in "Current Quantity" with "20"
|
||||
And I fill in "Minimum Quantity" with "5"
|
||||
And I select "Kitchen" from "Category"
|
||||
And I click "Create Item"
|
||||
Then I should see "Olive Oil"
|
||||
15
e2e/tests/features/browser/login.feature
Normal file
15
e2e/tests/features/browser/login.feature
Normal file
@@ -0,0 +1,15 @@
|
||||
Feature: Login
|
||||
|
||||
Scenario: Login with valid credentials
|
||||
Given I am on the login page
|
||||
Then I should see "PerAuset"
|
||||
And I should see "Sign in to your account"
|
||||
When I fill in "Email" with "admin@perauset.org"
|
||||
And I fill in "Password" with "test"
|
||||
And I click "Sign in"
|
||||
Then I should see heading "Dashboard"
|
||||
And the sidebar should show "Dashboard"
|
||||
|
||||
Scenario: Login page pre-fills demo credentials
|
||||
Given I am on the login page
|
||||
Then the "Email" field should contain "admin@perauset.org"
|
||||
63
e2e/tests/features/browser/navigation.feature
Normal file
63
e2e/tests/features/browser/navigation.feature
Normal file
@@ -0,0 +1,63 @@
|
||||
Feature: Navigation
|
||||
|
||||
Background:
|
||||
Given I am logged in as "admin@perauset.org"
|
||||
|
||||
Scenario: Dashboard loads
|
||||
Then I should see heading "Dashboard"
|
||||
And I should see "Stays"
|
||||
|
||||
Scenario: Navigate to Boats
|
||||
When I click "Boats" in the sidebar
|
||||
Then I should see heading "Boat Trips"
|
||||
|
||||
Scenario: Navigate to Kitchen
|
||||
When I click "Kitchen" in the sidebar
|
||||
Then I should see heading "Kitchen"
|
||||
|
||||
Scenario: Navigate to Inventory
|
||||
When I click "Inventory" in the sidebar
|
||||
Then I should see heading "Inventory"
|
||||
|
||||
Scenario: Navigate to Finance
|
||||
When I click "Finance" in the sidebar
|
||||
Then I should see heading "Finance"
|
||||
|
||||
Scenario: Navigate to Retreats
|
||||
When I click "Retreats" in the sidebar
|
||||
Then I should see heading "Retreats"
|
||||
|
||||
Scenario: Navigate to Rooms
|
||||
When I click "Rooms" in the sidebar
|
||||
Then I should see heading "Rooms"
|
||||
|
||||
Scenario: Navigate to Boat Management
|
||||
When I click "Boat Management" in the sidebar
|
||||
Then I should see heading "Fleet Management"
|
||||
|
||||
Scenario: Navigate to Users
|
||||
When I click "Users" in the sidebar
|
||||
Then I should see heading "Users & Roles"
|
||||
|
||||
Scenario: Navigate to Audit Log
|
||||
When I click "Audit Log" in the sidebar
|
||||
Then I should see heading "Audit Log"
|
||||
|
||||
Scenario: Navigate to My Stays
|
||||
When I click "My Stays" in the sidebar
|
||||
Then I should see heading "My Stays"
|
||||
|
||||
Scenario: Navigate to My Profile
|
||||
When I click "My Profile" in the sidebar
|
||||
Then I should see heading "My Profile"
|
||||
|
||||
# The Operations "Stays" and "Tasks" sidebar links share their labels with the
|
||||
# personal "My Stays"/"My Tasks" links (i18n: nav.stays == nav.my_stays), so
|
||||
# they are exercised via direct URL navigation instead of the ambiguous sidebar.
|
||||
Scenario: Open the Stays operations page
|
||||
When I navigate to "/stays"
|
||||
Then I should see heading "Stays"
|
||||
|
||||
Scenario: Open the Tasks operations page
|
||||
When I navigate to "/tasks"
|
||||
Then I should see heading "Tasks"
|
||||
15
e2e/tests/features/browser/rooms.feature
Normal file
15
e2e/tests/features/browser/rooms.feature
Normal file
@@ -0,0 +1,15 @@
|
||||
Feature: Room Management UI
|
||||
|
||||
Background:
|
||||
Given I am logged in as "admin@perauset.org"
|
||||
|
||||
Scenario: Create a room
|
||||
When I navigate to "/rooms"
|
||||
Then I should see heading "Rooms"
|
||||
And I click "Create Room"
|
||||
And I fill in "Room Code" with "R-101"
|
||||
And I fill in "Room Name" with "Sunrise Room"
|
||||
And I select "Private" from "Room Type"
|
||||
And I fill in "Capacity" with "2"
|
||||
And I click "Save Room"
|
||||
Then I should see "Sunrise Room"
|
||||
15
e2e/tests/features/browser/stays.feature
Normal file
15
e2e/tests/features/browser/stays.feature
Normal file
@@ -0,0 +1,15 @@
|
||||
Feature: Stay Management UI
|
||||
|
||||
Background:
|
||||
Given I am logged in as "admin@perauset.org"
|
||||
|
||||
Scenario: Stay request drawer opens
|
||||
When I navigate to "/stays"
|
||||
Then I should see heading "Stays"
|
||||
When I click "Request a Stay"
|
||||
Then I should see "Request Type"
|
||||
|
||||
Scenario: View stay requests tab
|
||||
When I navigate to "/stays"
|
||||
And I click tab "Requests"
|
||||
Then I should see "No stay requests found."
|
||||
58
e2e/tests/features/finance.feature
Normal file
58
e2e/tests/features/finance.feature
Normal file
@@ -0,0 +1,58 @@
|
||||
Feature: Finance Management
|
||||
|
||||
Scenario: Create finance record as admin
|
||||
Given I login as "admin@perauset.org"
|
||||
When I create a finance record "Office Supplies" with amount 150 and type "expense"
|
||||
Then the response status should be 200
|
||||
And the response body field "name" should be "Office Supplies"
|
||||
And the response body field "recordType" should be "expense"
|
||||
And I store the response field "financeId" as "financeId"
|
||||
|
||||
Scenario: List finance records
|
||||
Given I login as "admin@perauset.org"
|
||||
When I create a finance record "Boat Fuel" with amount 200 and type "expense"
|
||||
Then the response status should be 200
|
||||
When I list finance records
|
||||
Then the response status should be 200
|
||||
And the response body field "items" should be truthy
|
||||
|
||||
Scenario: Update finance record
|
||||
Given I login as "admin@perauset.org"
|
||||
When I create a finance record "Garden Tools" with amount 75 and type "expense"
|
||||
Then the response status should be 200
|
||||
And I store the response field "financeId" as "financeId"
|
||||
When I update the finance record with name "Garden Tools (Updated)"
|
||||
Then the response status should be 200
|
||||
And the response body field "name" should be "Garden Tools (Updated)"
|
||||
|
||||
Scenario: Link finance record to entity
|
||||
Given I login as "admin@perauset.org"
|
||||
When I create a finance record "Kitchen Equipment" with amount 500 and type "expense"
|
||||
Then the response status should be 200
|
||||
And I store the response field "financeId" as "financeId"
|
||||
When I create an inventory item "Blender" with unit "pieces" quantity 2 and minimum 1
|
||||
Then the response status should be 200
|
||||
And I store the response field "itemId" as "itemId"
|
||||
When I link the finance record to entity type "inventory_item"
|
||||
Then the response status should be 200
|
||||
And the response body field "linkId" should be truthy
|
||||
|
||||
Scenario: List links for finance record
|
||||
Given I login as "admin@perauset.org"
|
||||
When I create a finance record "Retreat Supplies" with amount 300 and type "expense"
|
||||
Then the response status should be 200
|
||||
And I store the response field "financeId" as "financeId"
|
||||
When I create an inventory item "Yoga Mats" with unit "pieces" quantity 10 and minimum 2
|
||||
Then the response status should be 200
|
||||
And I store the response field "itemId" as "itemId"
|
||||
When I link the finance record to entity type "inventory_item"
|
||||
Then the response status should be 200
|
||||
When I list finance links for the current finance record
|
||||
Then the response status should be 200
|
||||
And the response body field "items" should be truthy
|
||||
|
||||
Scenario: Unpermissioned user cannot create finance records
|
||||
Given a user "guest@test.org" exists with roles "guest"
|
||||
And I login as "guest@test.org"
|
||||
When I create a finance record "Forbidden Record" with amount 100 and type "expense"
|
||||
Then the response status should be 403
|
||||
6
e2e/tests/features/health-check.feature
Normal file
6
e2e/tests/features/health-check.feature
Normal file
@@ -0,0 +1,6 @@
|
||||
Feature: Health Check
|
||||
The health check endpoint should return service status
|
||||
|
||||
Scenario: Health check returns ok
|
||||
When I send a GET request to "/health-check"
|
||||
Then the response status should be 200
|
||||
77
e2e/tests/features/inventory.feature
Normal file
77
e2e/tests/features/inventory.feature
Normal file
@@ -0,0 +1,77 @@
|
||||
Feature: Inventory Management
|
||||
|
||||
Scenario: Create inventory item as admin
|
||||
Given I login as "admin@perauset.org"
|
||||
When I create an inventory item "Rice" with unit "kg" quantity 100 and minimum 10
|
||||
Then the response status should be 200
|
||||
And the response body field "name" should be "Rice"
|
||||
And the response body field "unit" should be "kg"
|
||||
And the response body field "isActive" should be truthy
|
||||
And I store the response field "itemId" as "itemId"
|
||||
|
||||
Scenario: Update inventory item as admin
|
||||
Given I login as "admin@perauset.org"
|
||||
When I create an inventory item "Flour" with unit "kg" quantity 50 and minimum 5
|
||||
Then the response status should be 200
|
||||
And I store the response field "itemId" as "itemId"
|
||||
When I update the inventory item with name "Whole Wheat Flour"
|
||||
Then the response status should be 200
|
||||
And the response body field "name" should be "Whole Wheat Flour"
|
||||
|
||||
Scenario: List inventory items
|
||||
Given I login as "admin@perauset.org"
|
||||
When I create an inventory item "Olive Oil" with unit "liters" quantity 20 and minimum 5
|
||||
Then the response status should be 200
|
||||
When I list inventory items
|
||||
Then the response status should be 200
|
||||
And the response body field "items" should be truthy
|
||||
|
||||
Scenario: Request inventory item as community member
|
||||
Given I login as "admin@perauset.org"
|
||||
When I create an inventory item "Sugar" with unit "kg" quantity 30 and minimum 5
|
||||
Then the response status should be 200
|
||||
And I store the response field "itemId" as "itemId"
|
||||
Given a user "member@test.org" exists with roles "community_member"
|
||||
And I login as "member@test.org"
|
||||
When I request inventory for item with quantity 5 unit "kg" and purpose "Baking"
|
||||
Then the response status should be 200
|
||||
And the response body field "status" should be "submitted"
|
||||
And I store the response field "requestId" as "requestId"
|
||||
|
||||
Scenario: Review inventory request as admin
|
||||
Given I login as "admin@perauset.org"
|
||||
When I create an inventory item "Salt" with unit "kg" quantity 20 and minimum 2
|
||||
Then the response status should be 200
|
||||
And I store the response field "itemId" as "itemId"
|
||||
Given a user "member@test.org" exists with roles "community_member"
|
||||
And I login as "member@test.org"
|
||||
When I request inventory for item with quantity 3 unit "kg" and purpose "Cooking"
|
||||
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 review the inventory request with status "approved"
|
||||
Then the response status should be 200
|
||||
And the response body field "status" should be "approved"
|
||||
|
||||
Scenario: Fulfill inventory request as admin
|
||||
Given I login as "admin@perauset.org"
|
||||
When I create an inventory item "Pepper" with unit "kg" quantity 15 and minimum 2
|
||||
Then the response status should be 200
|
||||
And I store the response field "itemId" as "itemId"
|
||||
Given a user "member@test.org" exists with roles "community_member"
|
||||
And I login as "member@test.org"
|
||||
When I request inventory for item with quantity 2 unit "kg" and purpose "Seasoning"
|
||||
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 review the inventory request with status "approved"
|
||||
Then the response status should be 200
|
||||
When I fulfill the inventory request
|
||||
Then the response status should be 200
|
||||
And the response body field "status" should be "fulfilled"
|
||||
|
||||
Scenario: Unpermissioned user cannot create inventory items
|
||||
Given a user "guest@test.org" exists with roles "guest"
|
||||
And I login as "guest@test.org"
|
||||
When I create an inventory item "Forbidden Item" with unit "kg" quantity 10 and minimum 1
|
||||
Then the response status should be 403
|
||||
29
e2e/tests/features/kitchen.feature
Normal file
29
e2e/tests/features/kitchen.feature
Normal file
@@ -0,0 +1,29 @@
|
||||
Feature: Kitchen Management
|
||||
|
||||
Scenario: Create meal service as admin
|
||||
Given I login as "admin@perauset.org"
|
||||
When I create a meal service of type "lunch" on "2026-07-01" with headcount 20
|
||||
Then the response status should be 200
|
||||
And the response body field "status" should be "planned"
|
||||
And I store the response field "serviceId" as "serviceId"
|
||||
|
||||
Scenario: List meal services
|
||||
Given I login as "admin@perauset.org"
|
||||
When I create a meal service of type "breakfast" on "2026-07-02" with headcount 15
|
||||
Then the response status should be 200
|
||||
When I list meal services
|
||||
Then the response status should be 200
|
||||
And the response body field "items" should be truthy
|
||||
|
||||
Scenario: Upsert dietary profile
|
||||
Given a user "member@test.org" exists with roles "community_member"
|
||||
And I login as "member@test.org"
|
||||
When I upsert my dietary profile as vegan with nut allergy
|
||||
Then the response status should be 200
|
||||
And the response body field "profileId" should be truthy
|
||||
|
||||
Scenario: Unpermissioned user cannot create meal services
|
||||
Given a user "guest@test.org" exists with roles "guest"
|
||||
And I login as "guest@test.org"
|
||||
When I create a meal service of type "dinner" on "2026-07-03" with headcount 10
|
||||
Then the response status should be 403
|
||||
14
e2e/tests/features/notifications.feature
Normal file
14
e2e/tests/features/notifications.feature
Normal file
@@ -0,0 +1,14 @@
|
||||
Feature: Notification Management
|
||||
|
||||
Scenario: List notifications
|
||||
Given I login as "admin@perauset.org"
|
||||
When I send a GET request to "/notifications"
|
||||
Then the response status should be 200
|
||||
And the response body should be a list with field "items"
|
||||
|
||||
Scenario: Mark notification as read
|
||||
Given I login as "admin@perauset.org"
|
||||
And a test notification exists for the current user
|
||||
When I mark the notification as read
|
||||
Then the response status should be 200
|
||||
And the response body field "success" should be truthy
|
||||
68
e2e/tests/features/retreats.feature
Normal file
68
e2e/tests/features/retreats.feature
Normal file
@@ -0,0 +1,68 @@
|
||||
Feature: Retreat Management
|
||||
|
||||
Scenario: Create retreat as admin
|
||||
Given I login as "admin@perauset.org"
|
||||
When I create a retreat "Summer Solstice" with slug "summer-solstice-2026" from "2026-06-20" to "2026-06-22"
|
||||
Then the response status should be 200
|
||||
And the response body field "status" should be "draft"
|
||||
And I store the response field "retreatId" as "retreatId"
|
||||
|
||||
Scenario: List retreats
|
||||
Given I login as "admin@perauset.org"
|
||||
When I create a retreat "Autumn Equinox" with slug "autumn-equinox-2026" from "2026-09-22" to "2026-09-24"
|
||||
Then the response status should be 200
|
||||
When I list retreats
|
||||
Then the response status should be 200
|
||||
And the response body field "items" should be truthy
|
||||
|
||||
Scenario: Update retreat
|
||||
Given I login as "admin@perauset.org"
|
||||
When I create a retreat "Spring Retreat" with slug "spring-retreat-2026" from "2026-03-20" to "2026-03-22"
|
||||
Then the response status should be 200
|
||||
And I store the response field "retreatId" as "retreatId"
|
||||
When I update the retreat with name "Spring Renewal Retreat" and capacity 30
|
||||
Then the response status should be 200
|
||||
And the response body field "success" should be truthy
|
||||
|
||||
Scenario: Publish retreat
|
||||
Given I login as "admin@perauset.org"
|
||||
When I create a retreat "Winter Solstice" with slug "winter-solstice-2026" from "2026-12-20" to "2026-12-22"
|
||||
Then the response status should be 200
|
||||
And I store the response field "retreatId" as "retreatId"
|
||||
When I publish the retreat
|
||||
Then the response status should be 200
|
||||
And the response body field "status" should be "published"
|
||||
|
||||
Scenario: Add person to retreat
|
||||
Given I login as "admin@perauset.org"
|
||||
When I create a retreat "Meditation Retreat" with slug "meditation-2026" from "2026-08-01" to "2026-08-03"
|
||||
Then the response status should be 200
|
||||
And I store the response field "retreatId" as "retreatId"
|
||||
When I add a person "Jane Doe" with role "participant" to the retreat
|
||||
Then the response status should be 200
|
||||
And the response body field "attendanceStatus" should be "registered"
|
||||
And I store the response field "retreatPersonId" as "retreatPersonId"
|
||||
|
||||
Scenario: Add schedule item to retreat
|
||||
Given I login as "admin@perauset.org"
|
||||
When I create a retreat "Yoga Retreat" with slug "yoga-retreat-2026" from "2026-10-01" to "2026-10-03"
|
||||
Then the response status should be 200
|
||||
And I store the response field "retreatId" as "retreatId"
|
||||
When I add a schedule item "Morning Yoga" from "2026-10-01T07:00:00Z" to "2026-10-01T08:30:00Z" at "Main Hall"
|
||||
Then the response status should be 200
|
||||
And the response body field "itemId" should be truthy
|
||||
|
||||
Scenario: Cancel retreat
|
||||
Given I login as "admin@perauset.org"
|
||||
When I create a retreat "Cancelled Event" with slug "cancelled-event-2026" from "2026-11-01" to "2026-11-03"
|
||||
Then the response status should be 200
|
||||
And I store the response field "retreatId" as "retreatId"
|
||||
When I cancel the retreat
|
||||
Then the response status should be 200
|
||||
And the response body field "status" should be "cancelled"
|
||||
|
||||
Scenario: Unpermissioned user cannot create retreats
|
||||
Given a user "guest@test.org" exists with roles "guest"
|
||||
And I login as "guest@test.org"
|
||||
When I create a retreat "Forbidden Retreat" with slug "forbidden-2026" from "2026-07-01" to "2026-07-03"
|
||||
Then the response status should be 403
|
||||
20
e2e/tests/features/roles.feature
Normal file
20
e2e/tests/features/roles.feature
Normal file
@@ -0,0 +1,20 @@
|
||||
Feature: Role Management
|
||||
|
||||
Scenario: List all roles
|
||||
Given I login as "admin@perauset.org"
|
||||
When I send a GET request to "/roles"
|
||||
Then the response status should be 200
|
||||
And the response body should be a list with field "roles"
|
||||
|
||||
Scenario: Set user roles
|
||||
Given I login as "admin@perauset.org"
|
||||
And a user "vol@test.org" exists
|
||||
When I set roles "volunteer" for user "vol@test.org"
|
||||
Then the response status should be 200
|
||||
And the response body field "memberRoles" should contain "volunteer"
|
||||
|
||||
Scenario: Unpermissioned user cannot set roles
|
||||
Given a user "norole@test.org" exists with roles "guest"
|
||||
And I login as "norole@test.org"
|
||||
When I set roles "admin" for user "norole@test.org"
|
||||
Then the response status should be 403
|
||||
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
|
||||
102
e2e/tests/features/stays.feature
Normal file
102
e2e/tests/features/stays.feature
Normal file
@@ -0,0 +1,102 @@
|
||||
Feature: Stay Management
|
||||
|
||||
Scenario: Submit a stay request as community member
|
||||
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 "volunteer" from "2026-06-01" to "2026-06-15"
|
||||
Then the response status should be 200
|
||||
And the response body field "status" should be "submitted"
|
||||
And I store the response field "requestId" as "requestId"
|
||||
|
||||
Scenario: Approve a stay request as coordinator
|
||||
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 "volunteer" from "2026-07-01" 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
|
||||
And the response body field "status" should be "approved"
|
||||
|
||||
Scenario: Create stay from approved request
|
||||
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 the response body field "status" should be "pending"
|
||||
And I store the response field "stayId" as "stayId"
|
||||
|
||||
Scenario: Check in and check out 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 "volunteer" 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"
|
||||
Given the stay is confirmed in the database
|
||||
When I check in the stay
|
||||
Then the response status should be 200
|
||||
And the response body field "status" should be "checked_in"
|
||||
When I check out the stay
|
||||
Then the response status should be 200
|
||||
And the response body field "status" should be "checked_out"
|
||||
|
||||
Scenario: Reject a stay request
|
||||
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 "day_visit" from "2026-10-01" to "2026-10-01"
|
||||
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 reject the stay request with reason "Not available"
|
||||
Then the response status should be 200
|
||||
And the response body field "status" should be "rejected"
|
||||
|
||||
Scenario: Invalid transition - reject an already approved request
|
||||
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 "volunteer" from "2026-11-01" to "2026-11-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 reject the stay request with reason "Changed mind"
|
||||
Then the response status should be 409
|
||||
|
||||
Scenario: Unpermissioned user cannot approve requests
|
||||
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 "volunteer" from "2026-12-01" to "2026-12-10"
|
||||
Then the response status should be 200
|
||||
And I store the response field "requestId" as "requestId"
|
||||
Given a user "guest@test.org" exists with roles "guest"
|
||||
And I login as "guest@test.org"
|
||||
When I approve the stay request
|
||||
Then the response status should be 403
|
||||
|
||||
Scenario: Unpermissioned user cannot create stays
|
||||
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 "volunteer" from "2027-01-01" to "2027-01-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
|
||||
Given a user "guest@test.org" exists with roles "guest"
|
||||
And I login as "guest@test.org"
|
||||
When I create a stay from the approved request
|
||||
Then the response status should be 403
|
||||
87
e2e/tests/features/tasks.feature
Normal file
87
e2e/tests/features/tasks.feature
Normal file
@@ -0,0 +1,87 @@
|
||||
Feature: Task Management
|
||||
|
||||
Scenario: Create task template as coordinator
|
||||
Given I login as "admin@perauset.org"
|
||||
When I create a task template with title "Kitchen Cleanup" category "kitchen"
|
||||
Then the response status should be 200
|
||||
And I store the response field "templateId" as "templateId"
|
||||
|
||||
Scenario: Create task instance
|
||||
Given I login as "admin@perauset.org"
|
||||
When I create a task instance with title "Morning Dishes" category "kitchen"
|
||||
Then the response status should be 200
|
||||
And the response body field "status" should be "open"
|
||||
And I store the response field "taskId" as "taskId"
|
||||
|
||||
Scenario: Assign task to a user
|
||||
Given a user "volunteer@test.org" exists with roles "community_member"
|
||||
And I login as "admin@perauset.org"
|
||||
When I create a task instance with title "Fix Faucet" category "maintenance"
|
||||
Then the response status should be 200
|
||||
And I store the response field "taskId" as "taskId"
|
||||
When I assign the task to user "volunteer@test.org"
|
||||
Then the response status should be 200
|
||||
And the response body field "taskStatus" should be "assigned"
|
||||
|
||||
Scenario: Start a task
|
||||
Given I login as "admin@perauset.org"
|
||||
When I create a task instance with title "Mow Lawn" category "maintenance"
|
||||
Then the response status should be 200
|
||||
And I store the response field "taskId" as "taskId"
|
||||
Given a user "volunteer@test.org" exists with roles "community_member"
|
||||
When I assign the task to user "volunteer@test.org"
|
||||
Then the response status should be 200
|
||||
When I start the task
|
||||
Then the response status should be 200
|
||||
And the response body field "status" should be "in_progress"
|
||||
|
||||
Scenario: Complete a task
|
||||
Given I login as "admin@perauset.org"
|
||||
When I create a task instance with title "Paint Fence" category "maintenance"
|
||||
Then the response status should be 200
|
||||
And I store the response field "taskId" as "taskId"
|
||||
Given a user "volunteer@test.org" exists with roles "community_member"
|
||||
When I assign the task to user "volunteer@test.org"
|
||||
Then the response status should be 200
|
||||
When I start the task
|
||||
Then the response status should be 200
|
||||
When I complete the task
|
||||
Then the response status should be 200
|
||||
And the response body field "status" should be "completed"
|
||||
|
||||
Scenario: Claim task as volunteer
|
||||
Given I login as "admin@perauset.org"
|
||||
When I create a task instance with title "Sweep Patio" category "housekeeping"
|
||||
Then the response status should be 200
|
||||
And I store the response field "taskId" as "taskId"
|
||||
Given a user "volunteer@test.org" exists with roles "community_member"
|
||||
And I login as "volunteer@test.org"
|
||||
When I claim the task
|
||||
Then the response status should be 200
|
||||
And the response body field "taskStatus" should be "assigned"
|
||||
|
||||
Scenario: Block a task
|
||||
Given I login as "admin@perauset.org"
|
||||
When I create a task instance with title "Repair Roof" category "maintenance"
|
||||
Then the response status should be 200
|
||||
And I store the response field "taskId" as "taskId"
|
||||
Given a user "volunteer@test.org" exists with roles "community_member"
|
||||
When I assign the task to user "volunteer@test.org"
|
||||
Then the response status should be 200
|
||||
When I mark the task as blocked with reason "Waiting for materials"
|
||||
Then the response status should be 200
|
||||
And the response body field "status" should be "blocked"
|
||||
|
||||
Scenario: Invalid transition - complete an open task
|
||||
Given I login as "admin@perauset.org"
|
||||
When I create a task instance with title "Invalid Task" category "operations"
|
||||
Then the response status should be 200
|
||||
And I store the response field "taskId" as "taskId"
|
||||
When I complete the task
|
||||
Then the response status should be 409
|
||||
|
||||
Scenario: Unpermissioned user cannot create templates
|
||||
Given a user "guest@test.org" exists with roles "guest"
|
||||
And I login as "guest@test.org"
|
||||
When I create a task template with title "Forbidden Template" category "kitchen"
|
||||
Then the response status should be 403
|
||||
24
e2e/tests/features/users.feature
Normal file
24
e2e/tests/features/users.feature
Normal file
@@ -0,0 +1,24 @@
|
||||
Feature: User Management
|
||||
|
||||
Scenario: List users as admin
|
||||
Given I login as "admin@perauset.org"
|
||||
When I send a GET request to "/users"
|
||||
Then the response status should be 200
|
||||
And the response body should be a list with field "items"
|
||||
|
||||
Scenario: Get own user profile
|
||||
Given I login as "admin@perauset.org"
|
||||
When I get my own user profile
|
||||
Then the response status should be 200
|
||||
And the response body field "email" should be "admin@perauset.org"
|
||||
|
||||
Scenario: Update own profile
|
||||
Given I login as "admin@perauset.org"
|
||||
When I update my profile with displayName "Island Admin"
|
||||
Then the response status should be 200
|
||||
|
||||
Scenario: Unpermissioned user cannot list users
|
||||
Given a user "guest@test.org" exists with roles "guest"
|
||||
And I login as "guest@test.org"
|
||||
When I send a GET request to "/users"
|
||||
Then the response status should be 403
|
||||
Reference in New Issue
Block a user