Skip to content

Acceptance Criteria (Gherkin)

stories.feature format

# stories.feature - Acceptance criteria for QA agent

Feature: Service intervention - core operations
  As a Dispatcher
  I want to create and manage service requests
  So that I can coordinate technician work

  Background:
    Given I am logged in as "dispatcher"
    And there exists an Account "Dakota Restaurant"
    And there exists a User "Peter Technician" with role "Technician"

  @critical @smoke
  Scenario: Create a new service request
    When I navigate to "ServiceRequest/create"
    And I select "Dakota Restaurant" in field "account"
    And I select "High" in field "priority"
    And I fill "description" with "Combi oven not heating"
    And I click "Save"
    Then I should see success message "Service Request has been created"
    And the "number" field should match pattern "SRV-\d{4}-\d{4}"
    And the "status" field should be "New"

  @critical
  Scenario: Dispatcher assigns technician
    Given there exists a ServiceRequest "SRV-2025-0001" with status "New"
    When I open ServiceRequest "SRV-2025-0001"
    And I select "Peter Technician" in field "assignedUser"
    And I click "Save"
    Then the "status" field should be "Assigned"
    And a notification should be sent to "Peter Technician"

  @validation
  Scenario: Required field validation
    When I navigate to "ServiceRequest/create"
    And I click "Save"
    Then I should see validation error for "account"
    And I should see validation error for "description"
    And the record should not be saved

  @workflow
  Scenario: Automatic notification for critical request
    When I create ServiceRequest with:
      | field       | value                           |
      | account     | Dakota Restaurant               |
      | priority    | Critical                        |
      | description | Cooling outage - urgent         |
    Then a notification should be sent to role "Dispatcher"
    And a Task should be created with:
      | field    | value                              |
      | name     | Assign technician: SRV-2025-XXXX   |
      | priority | Urgent                             |

  @edge-case
  Scenario: Changing status to Completed without an assigned tech
    Given there exists a ServiceRequest "SRV-2025-0002" with status "New"
    And the ServiceRequest has no assigned user
    When I try to change status to "Completed"
    Then I should see error "Cannot complete without an assigned technician"
    And the status should remain "New"

Tags for categorization

Tag Meaning
@critical Critical test - must pass for release
@smoke Smoke test - basic functionality
@regression Regression test
@workflow Workflow/automation test
@validation Validation rules test
@edge-case Edge case
@integration Integration test
@wip Work in progress - skip

Best Practices

DO (Good)

# ✅ Clear, measurable requirement
### Requirement: Maximum list load time
The system MUST display the list of stock cards within 2 seconds
for up to 10,000 items.

#### Scenario: Performance test
- **GIVEN** the database contains 10,000 stock cards
- **WHEN** the user opens the card list
- **THEN** the list appears within 2 seconds

DON'T (Bad)

# ❌ Vague, not measurable requirement
### Requirement: Fast loading
The system should load data quickly.

# ❌ Missing scenario
### Requirement: PDF export
The system MUST allow exporting to PDF.

Pre-commit checklist

  • [ ] All requirements use SHALL/MUST
  • [ ] All requirements have at least 1 scenario
  • [ ] Scenarios use GIVEN/WHEN/THEN format
  • [ ] Tags are assigned correctly
  • [ ] Edge cases are covered

➡️ Continue to Validation and lifecycle.