58 lines
2.1 KiB
Gherkin
58 lines
2.1 KiB
Gherkin
@api @quests-api
|
|
Feature: Quests API
|
|
Validates CRUD operations and filtering on quests
|
|
|
|
Background:
|
|
Given the API is accessible
|
|
And I am authenticated as "frodo_baggins"
|
|
|
|
Scenario: Get all quests returns a list
|
|
When I GET "/api/quests/"
|
|
Then the response status should be 200
|
|
And the response body should be an array
|
|
|
|
Scenario: Create a new quest
|
|
When I create a quest with title "Test Quest" type "The Journey" status "Not Yet Begun"
|
|
Then the response status should be 201
|
|
And the response body should have property "id"
|
|
And the response body property "title" should equal "Test Quest"
|
|
|
|
Scenario: Get quest by ID
|
|
Given I have created a quest with title "Get Test Quest" type "The Battle"
|
|
When I GET the created quest
|
|
Then the response status should be 200
|
|
And the response body property "title" should equal "Get Test Quest"
|
|
|
|
Scenario: Update a quest
|
|
Given I have created a quest with title "Update Test Quest" type "The Fellowship"
|
|
When I update the created quest title to "Updated Title"
|
|
Then the response status should be 200
|
|
And the response body property "title" should equal "Updated Title"
|
|
|
|
Scenario: Delete a quest
|
|
Given I have created a quest with title "Delete Test Quest" type "The Ring"
|
|
When I delete the created quest
|
|
Then the response status should be 200
|
|
When I GET the created quest
|
|
Then the response status should be 404
|
|
|
|
Scenario: Filter quests by status
|
|
When I GET "/api/quests/?status=not_yet_begun"
|
|
Then the response status should be 200
|
|
And the response body should be an array
|
|
|
|
Scenario: Filter quests by type
|
|
When I GET "/api/quests/?type=The%20Journey"
|
|
Then the response status should be 200
|
|
And the response body should be an array
|
|
|
|
Scenario: Filter quests by location
|
|
When I GET "/api/quests/?location=Mordor"
|
|
Then the response status should be 200
|
|
And the response body should be an array
|
|
|
|
Scenario: Complete a quest
|
|
Given I have created a quest with title "Complete Test Quest" type "The Journey"
|
|
When I complete the created quest
|
|
Then the response status should be 200
|