Files
perauset-e2e-mrfzot2p/e2e/tests/features/tasks.feature
2026-07-11 08:34:30 +02:00

88 lines
3.9 KiB
Gherkin

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