Skip to content
cccskills
FreePublished on GitHub

cucumber-bdd

Cucumber BDD integration for AID methodology. Gherkin-first acceptance criteria with executable specifications. Use for writing feature files, step definitions, and running acceptance tests.

The English summary is being prepared. Showing the original description.

See how to install

Files included (7)

  • SKILL.md6.6 KB
  • references/cucumber-go-guide.md9.5 KB
  • references/cucumber-java-guide.md7.2 KB
  • references/cucumber-js-guide.md10.0 KB
  • references/cucumber-python-guide.md7.5 KB
  • references/cucumber-ruby-guide.md5.6 KB
  • SKILL.extended.md8.8 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Cucumber BDD Skill

Turn acceptance criteria into executable tests: .feature files (Gherkin) → step definitions → HTML report.

Phase Integration

PhaseCucumber ActivityDeliverable
1 PRDWrite acceptance criteria as .feature filesfeatures/*.feature
2 Tech SpecDefine step definition architectureStep definition plan
3 Impl PlanPlan step implementation tasksTask breakdown
4 DevelopmentImplement step definitions (TDD)features/step-definitions/*.ts
5 QA & ShipExecute scenarios, verify all passreports/cucumber-report.html

Quick Start

# Phase 1: write feature file, e.g. features/auth/login.feature
# Phase 4: see undefined steps, then implement features/step-definitions/auth.steps.ts
npm run cucumber:dry
# Phase 5: execute and generate report
npm run test:bdd

Gherkin Keywords

KeywordPurposeExample
FeatureDescribes the feature being testedFeature: User Authentication
ScenarioA single test caseScenario: Successful login
GivenPrecondition/contextGiven I am on the login page
WhenAction being testedWhen I enter valid credentials
ThenExpected outcomeThen I should see the dashboard
And / ButAdditional stepsAnd I should see a welcome message
BackgroundShared preconditionsRuns before each scenario
Scenario OutlineParameterized scenariosWith Examples table

Feature File Template

Emit traceability comments, tags, a WHY/BUSINESS VALUE docstring, the As a/I want/So that role block, Background, then scenarios.

# Research: PROJECT-A-INT-001, PROJECT-A-JTBD-002
# PRD: US-001 User Login
@auth @critical
Feature: User Authentication
  """
  WHY: Users need secure access to personal data
  BUSINESS VALUE: Reduces support tickets by 40%
  """

  As a registered user
  I want to log in with my credentials
  So that I can access my personalized dashboard

  Background:
    Given the authentication service is running
    And I am on the login page

  @smoke @happy-path
  Scenario: Successful login with valid credentials
    Given I have a registered account with email "user@example.com"
    When I enter email "user@example.com"
    And I enter password "SecurePass123!"
    And I click the login button
    Then I should be redirected to the dashboard
    And I should see "Welcome back, User"

  @error-handling
  Scenario: Failed login shows helpful error message
    When I enter email "unknown@example.com"
    And I enter password "wrongpassword"
    And I click the login button
    Then I should see error message "Invalid email or password"
    And I should remain on the login page
    And the password field should be cleared

  @security
  Scenario Outline: Account lockout after failed attempts
    Given I have a registered account with email "<email>"
    When I enter incorrect password <attempts> times
    Then my account should be <status>
    And I should see "<message>"

    Examples:
      | email              | attempts | status  | message                           |
      | user@example.com   | 3        | active  | 2 attempts remaining              |
      | user@example.com   | 5        | locked  | Account locked. Reset password.   |

Step Definition Patterns

Given sets up preconditions (test data factories, navigation), When performs actions, Then asserts outcomes. Use {string} parameters instead of hardcoding values.

// features/step-definitions/auth.steps.ts
import { Given, When, Then } from '@cucumber/cucumber';
import { expect } from 'expect';

Given('I am on the login page', async function() {
  await this.page.goto('/login');
});

Given('I have a registered account with email {string}', async function(email: string) {
  this.testUser = await createTestUser({ email });
});

When('I enter email {string}', async function(email: string) {
  await this.page.fill('#email', email);
});

When('I click the login button', async function() {
  await this.page.click('#login-button');
  await this.page.waitForNavigation();
});

Then('I should be redirected to the dashboard', async function() {
  expect(this.page.url()).toContain('/dashboard');
});

Then('I should see error message {string}', async function(message: string) {
  const error = await this.page.textContent('.error-message');
  expect(error).toBe(message);
});

Share state across steps via a custom World class (page, testUser, response) in features/support/world.ts — see references/cucumber-js-guide.md for the CustomWorld implementation and hooks.

Tag Standards

TagWhen to UseCI Behavior
@criticalMust pass for releaseBlocks deployment
@smokeQuick sanity checksRuns on every PR
@regressionFull test suiteRuns nightly
@wipWork in progressExcluded from CI
@skipTemporarily disabledExcluded (document reason!)
@manualCannot be automatedExcluded
@securitySecurity-related testsRuns on security review
@performancePerformance testsRuns on performance review
@flakyKnown flaky testsRetried automatically

Tag Filtering

npx cucumber-js --tags "@critical"
npm run test:smoke
npx cucumber-js --tags "not @wip and not @manual"
npx cucumber-js --tags "@critical and @security"
npx cucumber-js --tags "@smoke or @critical"

Commands

CommandPurpose
npm run cucumberRun all features with default profile
npm run cucumber:dryValidate syntax without executing
npm run test:bddRun and generate HTML report
npm run test:smokeRun @smoke scenarios only
npm run test:criticalRun @critical scenarios only

Related Skills

  • aid-prd - PRD writing (where Gherkin acceptance criteria are created)
  • test-driven - TDD methodology (Cucumber at the top of test pyramid)
  • aid-qa-ship - QA verification (running Cucumber scenarios before release)

Resources

  • Cucumber.js Documentation
  • Gherkin Reference
  • Language setup guides: references/cucumber-js-guide.md, references/cucumber-python-guide.md, references/cucumber-java-guide.md, references/cucumber-go-guide.md, references/cucumber-ruby-guide.md

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

AID Phase 4 - Development phase. Use for implementing features, TDD practices, code reviews, transitioning from planning to QA.

The English summary is being prepared. Showing the original description.

ilandahan/AID10Updated Sep 23, 2026

AID Phase 0 - Research & discovery. Use for validating problem spaces, identifying stakeholders, defining success metrics, deciding whether to proceed.

The English summary is being prepared. Showing the original description.

ilandahan/AID10Updated Sep 23, 2026

AID Phase 3 - Implementation Planning with consolidation-first approach. Resolves contradictions between PRD and Tech Spec, creates consolidated master document, then breaks down into actionable tasks and populates Jira. Includes sprint planning and risk assessment.

The English summary is being prepared. Showing the original description.

ilandahan/AID10Updated Sep 23, 2026

AID Phase 1 - PRD creation. Use for user stories, acceptance criteria, scoping features, transitioning from discovery to tech spec.

The English summary is being prepared. Showing the original description.

ilandahan/AID10Updated Sep 23, 2026

AID Phase 5 - QA and Release. Use for validating implementations, acceptance tests, preparing releases, deployment, operational readiness.

The English summary is being prepared. Showing the original description.

ilandahan/AID10Updated Sep 23, 2026

AID Phase 2 - Technical Specification. Use for system architecture, API contracts, data models, security architecture, transitioning from PRD to implementation.

The English summary is being prepared. Showing the original description.

ilandahan/AID10Updated Sep 23, 2026

See all skills by ilandahan

Report a problem with this skill