eolo999
eolo999

Reputation: 893

How do I redirect cucumber failed scenarios to stderr?

Unluckily it seems that everything goes to stdout...

Upvotes: 1

Views: 632

Answers (1)

Jon M
Jon M

Reputation: 11705

The cucumber formatters take a single IO object, which will either be a file if you specify the --out option on the command line, or STDOUT if it is the last or only formatter specified.

Cucumber scenarios tend to fail partially, with the first few steps passing before a failure occurs, so you'd have to consider exactly what information you'd want to be written to STDOUT.

You could certainly create a custom cucumber formatter that wrote different bits of information to different IO streams, it's fairly easy to see how they work by looking at the built-in formatters. As Andrew Marshall pointed out in the comments though, it's not really the correct use of stderr.

Upvotes: 1

Related Questions