Skip to content

writing scenarios

Paulo Gomes da Cruz Junior edited this page Sep 11, 2026 · 2 revisions

title: "Writing Cypress Test Scenarios" type: guide domain: testing framework: cypress-cucumber tags: [cypress, gherkin, bdd, scenarios, feature-files] created: 2026-07-14

Writing Cypress Test Scenarios

Guide for writing Gherkin test scenarios. No coding experience required.

Cucumber and Gherkin

Cucumber executes test specifications written in Gherkin, a plain-text format that reads like a recipe. Each scenario lives in a .feature file. You describe what should happen; the development team wires up the how.

Free course: BDD Overview for Business Analysts and Product Owners.

Submitting a test via GitHub Issues

  1. Go to Issues and click New issue.
  2. Select User provided automated test-case.
  3. Fill out the form.

The issue converts to a .feature file automatically.

Gherkin is sensitive to spacing and casing. Use the exact keyword casing shown in examples.

Creating a Feature

Feature: User Registration
  As a new user I want to register on the website so that I can access exclusive content

The description sits one indent level below Feature.

Creating Scenarios

Steps use Given, When, Then, And, or But:

Scenario: Successful user registration
  Given I am on the registration page
  When I fill in the registration form with valid information
  And I click the "Register" button
  Then I should see a success message

Each step sits one indent level below Scenario. The Scenario itself sits one level below Feature.

Authentication annotations

Place the annotation directly above the Scenario keyword:

@loginAsBCeID
Scenario: Submit individuals
  When I click on the "Create client" button
  And I can read "Create client"
Annotation Description
@loginAsBCeID Log in as BCeID user
@loginAsIDIR Log in as IDIR user

Both hooks require credentials in environment variables (idir_username, idir_password, bceid_username, bceid_password).

Next steps

Waste Plus Wiki

Home

Architecture

Codes

Decisions

Knowledge Base

Development

Changes

Clone this wiki locally