← 返回命令列表

Linux command

cucumber 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Run all features

cucumber

Run specific feature file

cucumber [features/login.feature]

Run specific scenario by line

cucumber [features/login.feature]:[10]

Run with specific tag

cucumber --tags @[smoke]

Run excluding tag

cucumber --tags "not @[wip]"

Generate HTML report

cucumber --format html --out [report.html]

Dry run

cucumber --dry-run

说明

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.

参数

-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).

FAQ

What is the cucumber command used for?

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.

How do I run a basic cucumber example?

Run `cucumber` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -t, --tags _expr_ do in cucumber?

Run scenarios matching tag expression.