Skip to content

Commit

Permalink
Add possibility to opt-out from printing step attachments when scenar…
Browse files Browse the repository at this point in the history
…io 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 <marjutubli@gmail.com>
Co-authored-by: Matt Wynne <matt@cucumber.io>
Co-authored-by: Arti Mathanda <arti.mathanda@ably.com>
  • Loading branch information
4 people committed Feb 17, 2022
1 parent 5295a45 commit be75a6e
Show file tree
Hide file tree
Showing 13 changed files with 512 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ Please see [CONTRIBUTING.md](https://github.com/cucumber/cucumber/blob/master/CO
### Added
- Cucumber Expressions now support a wider array of parameter types (see [documentation](https://github.com/cucumber/cucumber-expressions#parameter-types))
- Improved styling and usability on report from `html` formatter
- Add a new option to `--format-options`: `printAttachments`.
See [./docs/cli.md#printing-attachments-details](https://github.com/cucumber/cucumber-js/blob/main/docs/cli.md#printing-attachments-details) for more info.
([#1136](https://github.com/cucumber/cucumber-js/issues/1136)
[#1721](https://github.com/cucumber/cucumber-js/pull/1721))

### Fixed
- Warn users who are on an unsupported node version ([#1922](https://github.com/cucumber/cucumber-js/pull/1922))
Expand Down
9 changes: 8 additions & 1 deletion docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ By default, cucumber works in _strict_ mode, meaning it will fail if there are p

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

## Printing Attachments Details

Printing attachments details can be disabled with
`--fomat-options '{"printAttachments": false}'`.

This option applies to the progress formatter and the summary formatter.

## Profiles

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

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

0 comments on commit be75a6e

Please sign in to comment.