You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/cli.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@
3
3
Cucumber includes an executable file to run your scenarios. After installing the `@cucumber/cucumber` package, you can run it directly:
4
4
5
5
```shell
6
-
$ ./node_modules/.bin/cucumber-js
6
+
./node_modules/.bin/cucumber-js
7
7
```
8
8
9
9
Or via a [`package.json` script](https://docs.npmjs.com/cli/v8/using-npm/scripts):
@@ -19,7 +19,7 @@ Or via a [`package.json` script](https://docs.npmjs.com/cli/v8/using-npm/scripts
19
19
Or via [npx](https://docs.npmjs.com/cli/v8/commands/npx):
20
20
21
21
```shell
22
-
$ npx cucumber-js
22
+
npx cucumber-js
23
23
```
24
24
25
25
## Options
@@ -39,15 +39,15 @@ Additionally, there are a few options that are specific to the CLI:
39
39
To see the available options for your installed version, run:
40
40
41
41
```shell
42
-
$ cucumber-js --help
42
+
cucumber-js --help
43
43
```
44
44
45
45
## Exiting
46
46
47
47
By default, cucumber exits when the event loop drains. Use the `forceExit` configuration option in order to force shutdown of the event loop when the test run has finished:
48
48
49
49
- In a configuration file `{ forceExit: true }`
50
-
- On the CLI `$ cucumber-js --force-exit`
50
+
- On the CLI `cucumber-js --force-exit`
51
51
52
52
This is discouraged, as fixing the issues that causes the hang is a better long term solution. Some potential resources for that are:
53
53
*[Node.js guide to debugging](https://nodejs.org/en/docs/inspector/)
If your features are somewhere else, you can override this by proving your own [glob](https://github.com/isaacs/node-glob) or directory:
113
113
114
114
- In a configuration file `{ paths: ['somewhere-else/**/*.feature'] }`
115
-
- On the CLI `$ cucumber-js somewhere-else/**/*.feature`
115
+
- On the CLI `cucumber-js somewhere-else/**/*.feature`
116
116
117
117
This option is repeatable, so you can provide several values and they'll be combined.
118
118
@@ -130,7 +130,7 @@ By default, Cucumber finds support code files with this logic:
130
130
If your files are somewhere else, you can override this by proving your own [glob](https://github.com/isaacs/node-glob), directory or file path to the `import` configuration option:
131
131
132
132
- In a configuration file `{ import: ['somewhere-else/support/*.js'] }`
133
-
- On the CLI `$ cucumber-js --import somewhere-else/support/*.js`
133
+
- On the CLI `cucumber-js --import somewhere-else/support/*.js`
134
134
135
135
Once you specify any `import` options, the defaults described above are no longer applied. The option is repeatable, so you can provide several values and they'll be combined, meaning you can load files from multiple locations.
Copy file name to clipboardExpand all lines: docs/dry_run.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@
3
3
You can run cucumber-js in "Dry Run" mode:
4
4
5
5
- In a configuration file `{ dryRun: true }`
6
-
- On the CLI `$ cucumber-js --dry-run`
6
+
- On the CLI `cucumber-js --dry-run`
7
7
8
8
The effect is that Cucumber will still do all the aggregation work of looking at your feature files, loading your support code etc but without actually executing the tests. Specifically:
Copy file name to clipboardExpand all lines: docs/esm.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,5 +61,5 @@ export const ci = {
61
61
You can use [ESM loaders](https://nodejs.org/api/esm.html#loaders) to transpile your support code on the fly. The `requireModule` configuration option only works with CommonJS (i.e. `require` hooks) and is not applicable here. Cucumber doesn't have an equivalent option for ESM loaders because they currently can't be registered in-process, so you'll need to declare the loader externally, like this:
Copy file name to clipboardExpand all lines: docs/fail_fast.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
# Failing Fast
2
2
3
3
- In a configuration file `{ failFast: true }`
4
-
- On the CLI `$ cucumber-js --fail-fast`
4
+
- On the CLI `cucumber-js --fail-fast`
5
5
6
6
By default, Cucumber runs the entire suite and reports all the failures. `failFast` allows a developer workflow where you work on one failure at a time. Combining this feature with rerun files allows you to work through all failures in an efficient manner.
Copy file name to clipboardExpand all lines: docs/filtering.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,12 +7,12 @@ You can use a few different configurations to have Cucumber filter which scenari
7
7
You can specify an individual feature file to be run:
8
8
9
9
- In a configuration file `{ paths: ['features/my_feature.feature'] }`
10
-
- On the CLI `$ cucumber-js features/my_feature.feature`
10
+
- On the CLI `cucumber-js features/my_feature.feature`
11
11
12
12
You can also specify a line within a file to target an individual scenario:
13
13
14
14
- In a configuration file `{ paths: ['features/my_feature.feature:3'] }`
15
-
- On the CLI `$ cucumber-js features/my_feature.feature:3`
15
+
- On the CLI `cucumber-js features/my_feature.feature:3`
16
16
17
17
This option is repeatable, so you can provide several values and they'll be combined.
18
18
@@ -21,7 +21,7 @@ This option is repeatable, so you can provide several values and they'll be comb
21
21
You can specify a regular expression against which scenario names are tested to filter which should run:
22
22
23
23
- In a configuration file `{ name: ['^start.+end$'] }`
24
-
- On the CLI `$ cucumber-js --name "^start.+end$"`
24
+
- On the CLI `cucumber-js --name "^start.+end$"`
25
25
26
26
To escape special regex characters in scenario name, use backslashes e.g., `\(Scenario Name\)`
27
27
@@ -32,7 +32,7 @@ This option is repeatable, so you can provide several expressions and they'll al
32
32
You can specify a [Cucumber tag expression](https://docs.cucumber.io/cucumber/api/#tag-expressions) to only run scenarios that match it:
33
33
34
34
- In a configuration file `{ tags: '@foo or @bar' }`
35
-
- On the CLI `$ cucumber-js --tags "@foo or @bar"`
35
+
- On the CLI `cucumber-js --tags "@foo or @bar"`
36
36
37
37
This option is repeatable, so you can provide several expressions and they'll be combined with an `and` operator, meaning a scenario needs to match all of them.
38
38
@@ -41,7 +41,7 @@ This option is repeatable, so you can provide several expressions and they'll be
41
41
You can specify the order that scenarios should run in:
42
42
43
43
- In a configuration file `{ order: 'defined' }`
44
-
- On the CLI `$ cucumber-js --order defined`
44
+
- On the CLI `cucumber-js --order defined`
45
45
46
46
The default is `defined` where scenarios are run in the order they are discovered in. This roughly means alphabetical order of file path followed by sequential order within each file, although if you pass multiple globs/paths to the `paths` option this order will be honoured.
Copy file name to clipboardExpand all lines: docs/formatters.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ cucumber-js provides many built-in Formatters, plus building blocks with which y
7
7
You can specify one or more formats via the `format` configuration option:
8
8
9
9
- In a configuration file `{ format: ['progress-bar', ['html', 'cucumber-report.html']] }`
10
-
- On the CLI `$ cucumber-js --format progress-bar --format "html":"cucumber-report.html"`
10
+
- On the CLI `cucumber-js --format progress-bar --format "html":"cucumber-report.html"`
11
11
12
12
For each format you specify, you have to provide one or two values. The first (required) is to identify the formatter. It can take a few forms:
13
13
@@ -30,7 +30,7 @@ Some notes on specifying Formatters:
30
30
Many formatters, including the built-in ones, support some configuration via options. You can provide this data as an object literal via the `formatOptions` configuration option, like this:
31
31
32
32
- In a configuration file `{ formatOptions: { someOption: true } }`
33
-
- On the CLI `$ cucumber-js --format-options '{"someOption":true}'`
33
+
- On the CLI `cucumber-js --format-options '{"someOption":true}'`
34
34
35
35
This option is repeatable, so you can use it multiple times and the objects will be merged with the later ones taking precedence.
Copy file name to clipboardExpand all lines: docs/parallel.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@
3
3
Cucumber supports running scenarios in parallel. The main process becomes a "coordinator" and spins up several separate Node.js processes to be the "workers". You can enable this with the `parallel` configuration option:
4
4
5
5
- In a configuration file `{ parallel: 3 }`
6
-
- On the CLI `$ cucumber-js --parallel 3`
6
+
- On the CLI `cucumber-js --parallel 3`
7
7
8
8
The number you provide is the number of workers that will run scenarios in parallel.
0 commit comments