LinuxCommandLibrary

cucumber

TLDR

Run all features

$ cucumber
copy
Run specific feature file
$ cucumber [features/login.feature]
copy
Run specific scenario by line
$ cucumber [features/login.feature]:[10]
copy
Run with specific tag
$ cucumber --tags @[smoke]
copy
Run excluding tag
$ cucumber --tags "not @[wip]"
copy
Generate HTML report
$ cucumber --format html --out [report.html]
copy
Dry run (check syntax only)
$ cucumber --dry-run
copy

SYNOPSIS

cucumber [options] [files|dirs]

DESCRIPTION

cucumber runs Behavior-Driven Development (BDD) tests written in Gherkin, a human-readable language for describing software behavior. It connects plain-language scenarios to executable step definitions.
Features describe behavior in Given/When/Then format that both developers and stakeholders can understand. Step definitions in Ruby (or other languages) implement the actual test logic.

PARAMETERS

-t, --tags expr

Run scenarios matching tag expression.
-f, --format type
Output format (pretty, progress, html, json).
-o, --out file
Write output to file.
-r, --require path
Require files before execution.
-d, --dry-run
Check syntax without running.
-s, --strict
Fail on undefined or pending steps.
--retry n
Retry failing scenarios n times.
-p, --profile name
Use named profile from cucumber.yml.
--order type
Run order (defined, random).

CAVEATS

Step definitions must match scenario steps exactly. Shared state between steps can cause flaky tests. Gherkin syntax errors stop execution. Slow for large test suites.

HISTORY

Cucumber was created by Aslak Hellesoy in 2008, inspired by RSpec and JBehave. It popularized BDD by enabling executable specifications in plain language. Originally Ruby-based, implementations now exist for Java, JavaScript, and many other languages.

SEE ALSO

rspec(1), behave(1), jest(1), pytest(1)

Copied to clipboard