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-11-19

À propos de ce support

Transparence IA : support rédigé avec l'assistance d'un modèle de langage, relu et validé par l'auteur.

  • Contenu ebpro/notebook-se-101 · engagement b482c83, état courant de ce dépôt

  • Configuration partagée _quarto-utils à l'engagement e628793

  • Licence CC BY-NC 4.0 · aucune version stable publiée à ce jour

  • Politique de production

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:

Politique de production

Cette page dit comment ce support est produit. Son existence dans la configuration partagée est la condition d’émission du cartouche « À propos de ce support », et son texte est publié en fin de chaque leçon.

Transparence

Le support est rédigé avec l’assistance d’un modèle de langage, relu et validé par l’auteur.

Traçabilité

Chaque leçon indique en fin de document le dépôt source, la branche ou la version qui a produit la page, le commit de la leçon et l’engagement (commit) de la configuration partagée _quarto-utils. Les références sont des liens cliquables ; une information inconnue au rendu est masquée, jamais inventée.

Dates et erreurs

Aucune date d’enseignement n’est publiée sans saisie de l’auteur. Une démonstration qui échoue se voit ; une démonstration impossible fait rougir la publication plutôt que de publier une page muette.

Auteur : Emmanuel Bruno — Université de Toulon. Licence : CC BY-NC 4.0.

Réutilisation