Files
qa-test/features/crud.feature
2025-06-17 22:58:08 +08:00

46 lines
2.0 KiB
Gherkin

Feature: CRUD Operations on Records
Scenario Outline: Create a record with name "<name>", age <age>, and email "<email>"
Given the API is runing
When I create a record with name "<name>", age <age>, email "<email>"
Then the response status should be 201
And the response should contain an id
Examples:
| name | age | email |
| John Smith | 30 | john@example.com |
| Jane Doe | 25 | jane@example.com |
Scenario Outline: Get the record by ID after creation with name "<name>", age <age>, email "<email>"
Given the API is running
And I have a created record with name "<name>", age <age>, email "<email>"
When I get the record by ID
Then the response status should be 200
And the response should contain the correct data for name "<name>", age <age>, email "<email>"
Examples:
| name | age | email |
| Temp_Name | 25 | temp@example.com |
Scenario Outline: Update the record with name "<oldName>", age <oldAge>, email "<oldEmail>" to name "<newName>", age <newAge>, email "<newEmail>"
Given the API is running
And I have a created record with name "<oldName>", age <oldAge>, email "<oldEmail>"
When I update the record with name "<newName>", age <newAge>, email "<newEmail>"
Then the response status should be 200
And the response should contain updated true
Examples:
| oldName | oldAge | oldEmail | newName | newAge | newEmail |
| Temp_Name | 25 | temp@example.com | Jane Smith | 28 | jane@example.com |
Scenario Outline: Delete the record with name "<name>", age <age>, email "<email>"
Given the API is running
And I have a created record with name "<name>", age <age>, email "<email>"
When I delete the record by ID
Then the response status should be 200
And the response should contain deleted true
Examples:
| name | age | email |
| Temp_Name | 25 | temp@example.com |