Akceptační kritéria (Gherkin)¶
Formát stories.feature¶
# stories.feature - Akceptační kritéria pro QA agenta
Feature: Servisní zásah - základní operace
As a Dispečer
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 "Petr Technik" with role "Technician"
@critical @smoke
Scenario: Vytvoření nového servisního zásahu
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 "Nefunguje konvektomat - neohřívá"
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: Přidělení technika dispečerem
Given there exists a ServiceRequest "SRV-2025-0001" with status "New"
When I open ServiceRequest "SRV-2025-0001"
And I select "Petr Technik" in field "assignedUser"
And I click "Save"
Then the "status" field should be "Assigned"
And a notification should be sent to "Petr Technik"
@validation
Scenario: Validace povinných polí
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: Automatická notifikace pro kritický zásah
When I create ServiceRequest with:
| field | value |
| account | Dakota Restaurant |
| priority | Critical |
| description | Výpadek chlazení - akutní|
Then a notification should be sent to role "Dispatcher"
And a Task should be created with:
| field | value |
| name | Přidělit technika: SRV-2025-XXXX |
| priority | Urgent |
@edge-case
Scenario: Změna stavu na Completed bez přiřazeného technika
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 "Nelze dokončit zásah bez přiřazeného technika"
And the status should remain "New"
Tagy pro kategorizaci¶
| Tag | Význam |
|---|---|
@critical |
Kritický test - musí projít pro release |
@smoke |
Smoke test - základní funkčnost |
@regression |
Regresní test |
@workflow |
Test workflow/automatizace |
@validation |
Test validačních pravidel |
@edge-case |
Hraniční případ |
@integration |
Integrační test |
@wip |
Work in progress - přeskočit |
Best Practices¶
DO (Správně)¶
# ✅ Jasný, měřitelný requirement
### Requirement: Maximální doba načítání seznamu
Systém MUSÍ zobrazit seznam skladových karet do 2 sekund
pro až 10 000 položek.
#### Scenario: Performance test
- **GIVEN** databáze obsahuje 10 000 skladových karet
- **WHEN** uživatel otevře seznam karet
- **THEN** seznam se zobrazí do 2 sekund
DON'T (Špatně)¶
# ❌ Vágní, neměřitelný requirement
### Requirement: Rychlé načítání
Systém by měl rychle načítat data.
# ❌ Chybí scenario
### Requirement: Export do PDF
Systém MUSÍ umožnit export do PDF.
Checklist před commitem¶
- [ ] Všechny requirements mají SHALL/MUST
- [ ] Všechny requirements mají alespoň 1 scenario
- [ ] Scenarios používají GIVEN/WHEN/THEN formát
- [ ] Tagy jsou správně přiřazeny
- [ ] Edge cases jsou pokryty
➡️ Pokračujte na Validace a životní cyklus.