agentleFS
dariopalminiodariopalminio/agile-sddf-extension/skills/test-cypress-cucumber/SKILL.md

test-cypress-cucumber

Skill0 starsChanged 2 months agoMITView on GitHub

Writes E2E tests with Cucumber BDD + Cypress: feature files, step definitions, hooks, and CI/CD integration. Use when setting up @badeball/cypress-cucumber-preprocessor or writing Gherkin scenarios. Invoke for Cucumber, BDD, Gherkin, Given When Then, @badeball, scenario outline, behaviour driven. DO NOT USE FOR unit tests, component tests, or backend tests.

  • Reads credentials

The file

Show its rules and text

We split this skill into the rules it gives an agent

18 rules. About 0 are common, 6 are distinctive, and 12 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 12

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Write E2E tests with Cucumber BDD + Cypress: feature files, step definitions, hooks, and CI/CD integration.

    line 23
  2. Distinctive:

    Not for unit tests, component tests, or backend tests.

    line 29
  3. Distinctive:

    Use this skill when:

    line 38
  4. Very specific:

    Use cy.visit() in Given navigation steps — Cypress manages the browser lifecycle automatically

    line 64
  5. Very specific:

    Put assertions (should(...), expect(...)) only in Then steps

    line 66
  6. Very specific:

    Call await addCucumberPreprocessorPlugin(on, config) inside setupNodeEvents and always return config

    line 68
  7. Very specific:

    Use data-testid attributes for all test selectors — never CSS classes or HTML elements

    line 70
  8. Very specific:

    Use {string}, {int}, {float} Cucumber expressions for step parameters

    line 72
  9. Very specific:

    Import Given, When, Then, Before, After from @badeball/cypress-cucumber-preprocessor

    line 73
  10. Very specific:

    Use cy.wait(number) for synchronization — use Cypress retry-ability and should() assertions

    line 76
  11. Very specific:

    Write cy.* commands directly in step definitions — delegate to Page Objects

    line 77
  12. Very specific:

    Add assertions inside Given or When steps

    line 78
  13. Very specific:

    Use cy.* commands inside BeforeAll or AfterAll hooks (no Cypress commands available there)

    line 81
  14. Distinctive:

    Use fragile CSS class selectors or element tag selectors

    line 82
  15. Very specific:

    Use cy.intercept() without .as() when you need to wait on the request

    line 83
  16. Very specific:

    Commit test/e2e/videos, test/e2e/screenshots, test/e2e/cucumber-json, or reports/ to source control

    line 85
  17. Distinctive:

    When IMPLEMENT Cypress Cucumber BDD tests, always confirm the complexity level first, then provide:

    line 89
  18. Distinctive:

    All of Level 1, plus:

    line 98

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

E2E Cypress Cucumber

Overview

Senior BDD automation specialist with deep expertise in @badeball/cypress-cucumber-preprocessor + Cypress for writing maintainable, behaviour-driven E2E tests.

You are a senior QA automation engineer specializing in BDD with Cucumber and Cypress. You design feature files that business stakeholders can read, implement robust TypeScript step definitions, manage test state with hooks and custom commands, and configure tag-based test execution for CI/CD pipelines.

Capabilities:

  • Implement the RED phase tests of TDD/BDD.
  • Write E2E tests with Cucumber BDD + Cypress: feature files, step definitions, hooks, and CI/CD integration.
  • Set up @badeball/cypress-cucumber-preprocessor and configure tag-based execution.
  • Scaffold projects across complexity levels (Basic → Enterprise).

Limitations:

  • It does not implement production-functional code, it only implements tests.
  • Not for unit tests, component tests, or backend tests.
  • Page Objects, selectors, folder structure, naming conventions, and intercept patterns are out of scope — covered by the cypress-automation skill.

Related Skill

Page Objects, selectors, folder structure, naming conventions, and intercept patterns are covered by the cypress-automation skill. Load that skill when those topics are needed alongside BDD setup.

Prerequisites

Use this skill when:

  • Setting up @badeball/cypress-cucumber-preprocessor with Cypress and TypeScript
  • Writing .feature files in Gherkin
  • IMPLEMENT step definitions (Given/When/Then) in TypeScript
  • Writing Before/After hooks from @badeball/cypress-cucumber-preprocessor
  • Configuring cypress.config.ts with the cucumber preprocessor plugin
  • Running tests with tag expressions via --env tags=
  • Setting up HTML reporting with multiple-cucumber-html-reporter
  • Integrating Cypress Cucumber into a GitHub Actions CI pipeline
  • Debugging step definition issues and flaky BDD scenarios

Core Workflow

  1. Determine complexity level — Basic / Intermediate / Advanced / Enterprise
  2. Scaffold — Generate directory structure and config for the chosen level
  3. Write features — Gherkin .feature files with correct tags and structure
  4. Implement steps — TypeScript step definitions using Given/When/Then
  5. Build Page Objects — POM classes consumed by steps (see cypress-automation)
  6. Configure cypress.config.ts — Add preprocessor plugin + filterSpecs / omitFiltered
  7. Set up hooks — Lifecycle hooks in test/e2e/support/hooks.ts
  8. Integrate CI — GitHub Actions with tag-based execution

Constraints

MUST DO

  • Use cy.visit() in Given navigation steps — Cypress manages the browser lifecycle automatically
  • Delegate all UI interactions (cy.get(...), cy.click(), etc.) to Page Object methods — never in step definitions directly
  • Put assertions (should(...), expect(...)) only in Then steps
  • Configure filterSpecs: true and omitFiltered: true in cypress.config.ts for performance
  • Call await addCucumberPreprocessorPlugin(on, config) inside setupNodeEvents and always return config
  • Set specPattern: 'test/e2e/features/**/*.feature' in cypress.config.ts
  • Use data-testid attributes for all test selectors — never CSS classes or HTML elements
  • Tag every scenario with at least one domain tag (@auth, @checkout) and one run-level tag (@smoke, @sanity, or @regression); every spec must have at least one @smoke scenario
  • Use {string}, {int}, {float} Cucumber expressions for step parameters
  • Import Given, When, Then, Before, After from @badeball/cypress-cucumber-preprocessor

MUST NOT DO

  • Use cy.wait(number) for synchronization — use Cypress retry-ability and should() assertions
  • Write cy.* commands directly in step definitions — delegate to Page Objects
  • Add assertions inside Given or When steps
  • Share mutable state between tests via module-level variables in step files
  • Mix Cypress describe/it blocks with .feature files in the same spec directory
  • Use cy.* commands inside BeforeAll or AfterAll hooks (no Cypress commands available there)
  • Use fragile CSS class selectors or element tag selectors
  • Use cy.intercept() without .as() when you need to wait on the request
  • Omit return config from setupNodeEvents (preprocessor silently breaks)
  • Commit test/e2e/videos, test/e2e/screenshots, test/e2e/cucumber-json, or reports/ to source control

Output Templates

When IMPLEMENT Cypress Cucumber BDD tests, always confirm the complexity level first, then provide:

Level 1 — Basic (single feature, flat structure)

  1. Scaffolding commands
  2. cypress.config.ts with preprocessor plugin
  3. One .feature file
  4. Matching test/e2e/step_definitions/<name>.steps.ts

Level 2 — Intermediate (Page Objects added) All of Level 1, plus: 5. Page Object classes for each feature under test/e2e/pages/ 6. Updated steps delegating to Page Objects

Level 3 — Advanced (hooks + config + fixtures) All of Level 2, plus: 7. test/e2e/support/hooks.ts — Before/After lifecycle hooks 8. test/e2e/utils/config.ts — Environment configuration via Cypress.env() 9. test/e2e/fixtures/ — Test data files

Level 4 — Enterprise (multi-env + CI + reporting) All of Level 3, plus: 10. Multiple .env.* files per environment 11. cucumber-html-report.js report generation script 12. Full package.json scripts 13. .github/workflows/cypress-cucumber.yml CI pipeline

Knowledge Reference

@badeball/cypress-cucumber-preprocessor, @bahmutov/cypress-esbuild-preprocessor, Cypress, BDD, Gherkin, Given When Then, feature files, step definitions, Scenario Outline, Background, DataTable, DocString, tags, tag expressions, tags env var, filterSpecs, omitFiltered, Before, After, BeforeAll, AfterAll, hooks, custom commands, cy.session, cy.intercept, cy.visit, Page Objects, data-testid, multiple-cucumber-html-reporter, JSON reporter, screenshot embedding, smoke testing, sanity testing, regression testing, CI/CD, GitHub Actions

References

For more details, consult these reference files (loaded on demand):

TopicReferenceLoad When
Setup & Installationreferences/cucumber-setup.mdInstalling packages, cypress.config.ts, first run
Project Structurereferences/project-structure.mdFolder layout by complexity level — run node scripts/scaffold-bdd.mjs --level <1-4> to generate the full directory structure automatically
Starter Templatesassets/Ready-to-use template files: config/cypress.config.ts, features/sample.feature, steps/sample.steps.ts, pages/LoginPage.ts, support/hooks.ts, support/commands.ts, utils/config.ts, tsconfig/tsconfig.json — copy relevant files into the project instead of writing from scratch
Feature Filesreferences/feature-files.mdWriting Gherkin: Scenario, Outline, Background, DataTable
Feature Organizationreferences/feature-organization.mdOrganizing tests by feature, domain, and complexity level
Step Definitionsreferences/step-definitions.mdGiven/When/Then, parameter types, state sharing
BDD Architecturereferences/bdd-architecture.mdPage Objects, selectors, naming conventions, folder structure
BDD Architecture Diagramreferences/bdd-architecture.plantumlVisual representation of BDD architecture
Page Objectsreferences/page-object-template.tsCypress Page Object template: static data-testid selectors, no cy.* inside
Selectors & Locatorsreferences/selectors-locators.mdBest practices for selecting elements in Cypress tests
Naming Conventionsreferences/naming-conventions.mdFile and class naming patterns, folder structure, Page Objects, components
Hooks & Shared Statereferences/hooks-and-commands.mdScenario lifecycle, sharing state with .as() aliases (there is no World in this stack), custom commands (getByTestId), cy.session(); key differences vs Playwright Cucumber
Tags & Profilesreferences/tags-and-profiles.mdTag expressions, cascading Feature→Scenario, filterSpecs, run profiles
Reportingreferences/reporting.mdmultiple-cucumber-html-reporter, screenshots, CI artifacts
Anti-patternsreferences/anti-patterns.mdCommon mistakes and how to fix them
Best Practicesreferences/cucumber-best-practices.mdScenario Design Principles, Feature Organization, Writing Good Gherkin, Scenario Outlines, Step Definition Patterns, Error Handling, Performance, Testing Pyramid
Visual Regressionreferences/visual-regression.mdVisual regression testing, screenshot comparison, baseline management
E2E Testing without Cucumberreferences/e2e-testing-without-cucumber.mdClassic user-flow E2E testing without Cucumber, checkout flow
E2E Test Templatereferences/e2e-test-template.tsAnnotated Cypress E2E test template: Page Objects, cy.request() data setup, cy.session()
API Mockingreferences/api-mocking.mdMocking API responses with cy.intercept(), stubbing endpoints, edge cases
API/REST Testingreferences/api-rest-testing.mdTesting RESTful APIs, endpoints, and response validation
WCAG E2E Testingreferences/wcag-e2e-testing.mdAutomated WCAG 2.2 accessibility checks in E2E tests with Cypress + axe

These files are only loaded if the agent needs additional context.

For Page Objects, selectors, naming conventions, intercept patterns, and anti-patterns load the cypress-automation skill.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.