Scenarios and Acceptance Tests Template
Template for documenting scenarios and acceptance tests in Gherkin format
Scenario Structure
Basic Format
@tags
Scenario: E[XX]-F[XX]-S[XX] - [Descriptive Title]
Given [initial context/precondition]
When [action/event occurs]
Then [expected outcome]
And [additional outcomes]
Acceptance Test Structure
Basic Format
@acceptance @sprint-X
Scenario: E[XX]-F[XX]-TA[XX] - [Test Title]
Given [specific test context]
When [specific action under test]
Then [specific verification criteria]
Example Scenarios
Happy Path Scenario
@happy-path @smoke @automated
@implements-story:E01-F01-US01
Scenario: E01-F01-S01 - Successful User Registration
Given a new user on the registration page
When they complete the registration form with:
| Field | Value |
| Username | testuser |
| Email | test@example.com |
| Password | SecurePass123! |
And they submit the form
Then their account should be created
And they should receive a confirmation email
Edge Case Scenario
@edge-case @security @automated
@implements-nfr:NFR-202
Scenario: E01-F01-S02 - Registration with Existing Email
Given a new user on the registration page
And an existing account with email "test@example.com"
When they attempt to register with:
| Field | Value |
| Email | test@example.com |
Then registration should be prevented
And they should see the message "Email already registered"
Acceptance Test Examples
Functional Acceptance Test
@acceptance @functional @automated
@validates-fr:FR-103
Scenario: E01-F01-TA01 - Verify User Authentication Flow
Given a registered user with credentials:
| Username | Password |
| testuser | Test123! |
When they attempt to login
Then they should be authenticated
And redirected to their dashboard
And session token should be valid
Performance Acceptance Test
@acceptance @performance @automated
@validates-nfr:NFR-201
Scenario: E01-F01-TA02 - Verify Login Response Time
Given the system is under normal load
When 100 concurrent users attempt to login
Then all requests should complete within 2 seconds
And the system maintains normal responsiveness
And no errors are reported
Test Data Templates
Data Table Format
Scenario: Data-Driven Test
Given a test case with data:
| Input | Expected Output |
| Value 1 | Result 1 |
| Value 2 | Result 2 |
Scenario Outline Format
Scenario Outline: Multiple Test Cases
Given a user with <role>
When they access <feature>
Then they should see <result>
Examples:
| role | feature | result |
| admin | settings | full access |
| user | settings | limited view |
Traceability Links
Requirements Coverage
- Link to Functional Requirements:
@validates-fr:FR-XXX - Link to Non-Functional Requirements:
@validates-nfr:NFR-XXX - Link to User Stories:
@implements-story:EXX-FXX-USXX
Test Implementation
- Link to Test Code:
@test-impl:path/to/test/file - Link to Test Data:
@test-data:path/to/data/file
Validation Checklist
Before finalizing scenarios and tests: