Skip to content

Commit be75a6e

Browse files
aurelien-reeves16sheepmattwynneArti Mathanda
authored
Add possibility to opt-out from printing step attachments when scenario is not successful (#1721)
* Add a scenario with new format option printStepAttachments * Rename the parameter to printAttachments * Start a draft for a tutorial * Complete the tutorial * Add failing unit test for not printing attachments * Add a flag for specifying whether to print attachments * Adds printAttachments flag to step formatting functions. * Actually use printAttachments flag * Finish implementing the printAttachments option * Fix typos * Use 'boolean' rather than 'Boolean' for consistency * Add some doc in 'formatters.md' Co-authored-by: marjuhirsh <[email protected]> Co-authored-by: Matt Wynne <[email protected]> Co-authored-by: Arti Mathanda <[email protected]>
1 parent 5295a45 commit be75a6e

13 files changed

+512
-10
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ Please see [CONTRIBUTING.md](https://github.com/cucumber/cucumber/blob/master/CO
1111
### Added
1212
- Cucumber Expressions now support a wider array of parameter types (see [documentation](https://github.com/cucumber/cucumber-expressions#parameter-types))
1313
- Improved styling and usability on report from `html` formatter
14+
- Add a new option to `--format-options`: `printAttachments`.
15+
See [./docs/cli.md#printing-attachments-details](https://github.com/cucumber/cucumber-js/blob/main/docs/cli.md#printing-attachments-details) for more info.
16+
([#1136](https://github.com/cucumber/cucumber-js/issues/1136)
17+
[#1721](https://github.com/cucumber/cucumber-js/pull/1721))
1418

1519
### Fixed
1620
- Warn users who are on an unsupported node version ([#1922](https://github.com/cucumber/cucumber-js/pull/1922))

docs/cli.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@ By default, cucumber works in _strict_ mode, meaning it will fail if there are p
7474

7575
See [Parallel](./parallel.md).
7676

77+
## Printing Attachments Details
78+
79+
Printing attachments details can be disabled with
80+
`--fomat-options '{"printAttachments": false}'`.
81+
82+
This option applies to the progress formatter and the summary formatter.
83+
7784
## Profiles
7885

7986
See [Profiles](./profiles.md).
@@ -127,7 +134,7 @@ If you are using [ts-node](https://github.com/TypeStrong/ts-node):
127134
--require-module ts-node/register --require 'step-definitions/**/*.ts'
128135
```
129136

130-
> ⚠️ Some TypeScript setups use `esnext` modules by default,
137+
> ⚠️ Some TypeScript setups use `esnext` modules by default,
131138
> which doesn't marry well with Node. You may consider using commonjs instead.
132139
> See how to add [extra configuration](#extra-configuration) below.
133140

0 commit comments

Comments
 (0)