Scenarios and Acceptance Tests Template

Template for documenting scenarios and acceptance tests in Gherkin format
Auteur
Affiliations

Université de Toulon

LIS UMR CNRS 7020

Date de publication

2026-10-03

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]

Full Template with Tags

@test-type @priority @scope
@implements-story:E01-F01-US01
@implements-fr:FR-103
@implements-nfr:NFR-201
Scenario: E01-F01-S01 - [Descriptive Title]
  Given [initial context]
    And [additional context]
  When [primary action]
    And [additional actions]
  Then [primary 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  |

Common Tags Reference

Test Type Tags

  • @smoke - Basic functionality verification
  • @regression - Regression test suite
  • @acceptance - User acceptance testing
  • @integration - Integration testing
  • @e2e - End-to-end testing

Execution Tags

  • @automated - Automated test
  • @manual - Manual test required
  • @visual - Visual verification needed

Priority Tags

  • @critical - Must pass for release
  • @high - Important test case
  • @medium - Standard priority
  • @low - Nice to have

Validation Checklist

Before finalizing scenarios and tests:

Réutilisation