Let’s start by taking a look at the command-line options. Like most command-line tools, Cucumber provides a --help option. The following is a shortened version of what that would print:
| $ cucumber --help |
| |
| -r, --require LIBRARY|DIR Require files before executing the features. |
| --i18n LANG List keywords for in a particular language. |
| Run with "--i18n help" to see all languages. |
| -f, --format FORMAT How to format features (Default: pretty). |
| -o, --out [FILE|DIR] Write output to a file/directory instead of |
| STDOUT. |
| -t, --tags TAG_EXPRESSION Only execute the features or scenarios with |
| tags matching TAG_EXPRESSION. |
| -n, --name NAME Only execute the feature elements which match |
| part of the given name. |
| -e, --exclude PATTERN Don't run feature files or require ruby files |
| matching PATTERN |
| -p, --profile PROFILE Pull command line arguments from cucumber.yml. |
| -P, --no-profile Disables all profile loading to avoid using |
| the 'default' profile. |
| -c, --[no-]color Whether or not to use ANSI color in the output. |
| -d, --dry-run Invokes formatters without executing the steps. |
| -a, --autoformat DIR Reformats (pretty prints) feature files and |
| writes them to DIR. |
| -m, --no-multiline Don't print multiline strings and tables under |
| steps. |
| -s, --no-source Don't print the file and line of the step |
| definition with the steps. |
| -i, --no-snippets Don't print snippets for pending steps. |
| -q, --quiet Alias for --no-snippets --no-source. |
| -b, --backtrace Show full backtrace for all errors. |
| -S, --strict Fail if there are any undefined or pending steps. |
| -w, --wip Fail if there are any passing scenarios. |
| -v, --verbose Show the files and features loaded. |
| -g, --guess Guess best match for Ambiguous steps. |
| -l, --lines LINES Run given line numbers. Equivalent to FILE:LINE |
| syntax |
| -x, --expand Expand Scenario Outline Tables in output. |
| --version Show version. |
| -h, --help You're looking at it. |
That’s a lot of options, and it may not be obvious when each one of them is useful. Let’s look at some situations when you would use some of them.
52.15.129.90