/qa-bdd:cucumber-testingfrom qa-bdd
Answers questions about Cucumber and Gherkin in Java, Kotlin, JavaScript, and Ruby. Covers setup, .feature files, step definitions, expression mismatches, tags, and JUnit XML reports.
Ships in qa-bdd. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Per cucumber-install:
"Cucumber is available for most mainstream programming languages."
Cucumber implementations split into tiers (cucumber-install):
- Official: Hosted under the main Cucumber organization (JavaScript, Java, Ruby, Android, Kotlin, Scala, C++)
- Semi-official: Developed elsewhere but use Cucumber components (PHP's Behat, Python's Behave, .NET's Reqnroll)
This skill covers the three most-used official implementations:
Cucumber-JVM (Java + Kotlin), Cucumber-JS (Node), and
Cucumber-Ruby. For Python, see
behave-testing. For .NET, see
reqnroll-testing.
gherkin-from-stories.If only engineers will read the tests, BDD's collaboration value is wasted - plain xUnit-style tests are simpler. Not sure which runner fits the repo, or whether BDD is worth adopting at all? See references/runner-selection.md - the runner decision table, per-runner first-run commands, the SpecFlow end-of-life note, and the "when BDD is not worth it" test.
Maven:
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>7.20.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit-platform-engine</artifactId>
<version>7.20.0</version>
<scope>test</scope>
</dependency>
For Kotlin: replace cucumber-java with cucumber-kotlin.
npm install --save-dev @cucumber/cucumber
gem install cucumber
# Or in Gemfile:
group :test do
gem 'cucumber-ruby'
end
# features/cart.feature
Feature: Apply promo code at checkout
Background:
Given a logged-in user with email confirmed
And the cart contains 1 of "BOOK-001" at $24.99
Scenario: Apply valid promo
When I enter "WELCOME10" in the promo input
And I click "Apply"
Then the subtotal updates to $22.49
And a confirmation toast appears
Scenario Outline: Promo validation rejects bad codes
When I enter "<code>" in the promo input
And I click "Apply"
Then an error appears: "<error>"
Examples:
| code | error |
| EXPIRED50 | This code has expired |
| NOTREAL | Code not found |
| "" (empty) | Please enter a code |
Bind each Gherkin line to a method with a {cucumber-expression} capture.
Minimal JS example:
const { Given, When, Then } = require('@cucumber/cucumber');
Given('a logged-in user with email confirmed', function() {
this.page = new CheckoutPage(createLoggedInUser());
});
When('I enter {string} in the promo input', function(code) {
this.page.enterPromo(code);
});
Then('the subtotal updates to ${float}', function(expected) {
assert.equal(this.page.getSubtotal(), expected);
});
Full Java (Cucumber-JVM) and JS step definitions, plus the JUnit XML reporting config, are in references/step-definitions-and-reporting.md.
JVM (via Maven):
mvn test
# Or specific feature:
mvn test -Dcucumber.features=features/cart.feature
JS:
npx cucumber-js features/
Ruby:
cucumber features/
Cucumber outputs multiple formats; JUnit XML is the CI-canonical one and feeds
junit-xml-analysis (in the qa-test-reporting plugin). The JVM
(cucumber.properties) and JS (CLI) reporting config is in
references/step-definitions-and-reporting.md.
@regression @critical
Scenario: Apply valid promo
...
# Run only critical tests
npx cucumber-js features/ --tags '@critical'
# Skip @wip
npx cucumber-js features/ --tags 'not @wip'
| Anti-pattern | Why it fails | Fix |
|---|---|---|
| Imperative steps ("I click button id=#submit") | Couples to implementation; scenarios become fragile. | Declarative steps ("I submit the form"). |
| 100 unique step definitions | Drift; inconsistency. | Step library curation (see bdd-step-library-curator). |
| BDD without business stakeholder involvement | Defeats the point; expensive xUnit tests. | If non-engineers don't read the features, switch to plain unit tests. |
| Mixing Cucumber + plain JUnit assertions | Two test runners; double maintenance. | Cucumber's runner only; plain JUnit for non-BDD tests in separate suite. |
Skipping Background for shared setup | Repeated Given lines clutter scenarios. | Background block (Step 4 example). |
behave-testing - Python sibling.reqnroll-testing - .NET sibling.bdd-step-library-curator - addresses step proliferation.gherkin-from-stories - upstream skill that generates Gherkin from stories, AC lists, manual steps, and raw specs.evals/billing-change-broke-checkout-scenarios/criteria.json (opens in a new tab)evals/billing-change-broke-checkout-scenarios/task.md (opens in a new tab)evals/bulk-price-import-has-no-coverage/criteria.json (opens in a new tab)evals/bulk-price-import-has-no-coverage/task.md (opens in a new tab)evals/cart-state-leaks-between-scenarios/criteria.json (opens in a new tab)evals/cart-state-leaks-between-scenarios/task.md (opens in a new tab)evals/every-pull-request-runs-the-whole-suite/criteria.json (opens in a new tab)evals/every-pull-request-runs-the-whole-suite/task.md (opens in a new tab)evals/gherkin-everything-mandate/criteria.json (opens in a new tab)evals/gherkin-everything-mandate/task.md (opens in a new tab)evals/green-pipeline-hid-unwired-steps/criteria.json (opens in a new tab)evals/green-pipeline-hid-unwired-steps/task.md (opens in a new tab)evals/maven-build-never-runs-the-feature/criteria.json (opens in a new tab)evals/maven-build-never-runs-the-feature/task.md (opens in a new tab)evals/money-parsing-repeated-in-every-step/criteria.json (opens in a new tab)evals/money-parsing-repeated-in-every-step/task.md (opens in a new tab)evals/orders-feature-repeats-its-setup/criteria.json (opens in a new tab)evals/orders-feature-repeats-its-setup/task.md (opens in a new tab)evals/promo-rejection-cases-copy-pasted/criteria.json (opens in a new tab)evals/promo-rejection-cases-copy-pasted/task.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Java, Kotlin, JavaScript, Ruby
cucumber, gherkin, bdd, cucumber-jvm, cucumber-js, cucumber-ruby
6 skills in this plugin
/bdd-step-library-curatorUse when a Cucumber, Behave or Reqnroll project has grown past ~50 step definitions, before writing a step that may already exist, or when new .feature files need a duplicate check. Inventories steps, merges duplicates, publishes a step-library README and a scenario coverage map./behave-testingUse for any question or task about BDD in Python, including quick how-to questions: Behave .feature files, step implementations in features/steps, environment.py hooks (sharing a browser or database between scenarios), tags, reports and CI runs, plus the pytest-bdd alternative. Has Behave layout, hook and anti-pattern notes./gherkin-from-storiesUse whenever user stories, acceptance criteria, manual test steps or a spec need to become Gherkin, or when asked how to write good acceptance scenarios: maps each criterion to scenarios, finds Scenario Outlines and Background, reuses existing steps and flags hidden preconditions. Writes .feature files only, not step code./living-documentation-publisherUse when BDD scenarios pass in CI and stakeholders need an always-current, readable report of which acceptance criteria pass. Turns Cucumber JSON into HTML living documentation (multiple-cucumber-html-reporter or Serenity BDD) and publishes it to GitHub or GitLab Pages./reqnroll-testingUse for any question or task about BDD in .NET or C#: starting with Gherkin feature files, moving off SpecFlow (end-of-life 2024-12-31), or writing [Given/When/Then] C# step bindings. Configures Reqnroll with hooks, async steps, tags and dotnet test runs, and has a SpecFlow migration path.npx claudepluginhub testland/qa --plugin qa-bddOther plugins' skills for the same job