Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for custom formatters #516

Closed
charlierudolph opened this issue Feb 19, 2016 · 17 comments
Closed

Add support for custom formatters #516

charlierudolph opened this issue Feb 19, 2016 · 17 comments

Comments

@charlierudolph
Copy link
Member

Previous PRs
#215
#257
#309

Currently blocked on some work in progress that will change the formatters to look like the following

// suite - an event emitter
// log - function to call with output
// options - formatter options coming from cucumber
//   snippetGenerator - function to call to generate snippet for an undefined step
//   useColors - boolean of whether or not to use colors
function MyFormatter(suite, log, options) {
  suite.on('beforeFeatures', function () {});
  suite.on('beforeFeature', function (feature) {});
  suite.on('beforeScenario', function (scenario) {});
  suite.on('beforeStep', function (step) {});
  suite.on('stepResult', function (stepResult) {});
  suite.on('afterStep', function (step) {});
  suite.on('scenarioResult', function (scenarioResult) {});
  suite.on('afterScenario', function (scenario) {});
  suite.on('afterFeature', function (feature) {});
  suite.on('featuresResult', function (featuresResult) {});
  suite.on('afterFeatures', function () {});
}
@benhoIIand
Copy link

Just been reading through the previous PRs and this feels like the more ideal solution - let me know if there's anything I can do to assist in getting this pushed out 👍

@apbarrero
Copy link

Also looking forward for this. Let me know If I can help 👍

@vjuras
Copy link

vjuras commented Apr 1, 2016

do we have ETA of this feature?

@brettneese
Copy link

brettneese commented May 3, 2016

Any update on this? It seems as if this has been in the works for years....

Let us know if there's anything we can do to help.

@floribon
Copy link
Contributor

floribon commented May 3, 2016

+1, waiting for so long is painful

@kchokhawala
Copy link

+1

@kchokhawala
Copy link

@charlierudolph : I need this and I am also looking to pick up a open source project and contribute. I can work with @apbarrero or anyone else on this particular issue so we can get this out of door asap. I Also, I would love to be continuously contributing member. So, please guide me to become a contributing member. Thanks

@brettneese
Copy link

Also willing to contribute.

@charlierudolph
Copy link
Member Author

Thank you guys very much for the offer to contribute! Just to give you some background on the work in progress. So one big thing for changing the formatters to this syntax is a complete rework of how cucumber hooks in the formatters. That resulted in the need to remove registerHandler, something that I believe is largely used for beforeAll / afterAll hooks but with an inconsistent interface. I have a branch that removes registerHandler. That however is dependent on updating to using gherkin4 which is waiting on a new release of gherkin in order to properly support the browser version.

I think I'll just manually fix the bug with gherkin for browser support so we can keep moving. Sorry this has taken so long. I really want to get all my existing work in which should help us get close to this.

For anyone willing to contribute, please either pick up an issue or ping me on gitter with something you would like to work on. I'd ask that you create your first PR from a fork. Once I've worked with you to get one of your PRs in, I'm happy to give you commit access to the repo.

@JimLynchCodes
Copy link

+1

1 similar comment
@kerbyfc
Copy link

kerbyfc commented Jul 4, 2016

+1

@charlierudolph charlierudolph added this to the 2.0 release milestone Aug 29, 2016
@charlierudolph
Copy link
Member Author

Update: I am no longer planning on removing registerHandler. With version 1.1.0, I am happy enough with how registerHandler / formatters currently work. Adding support for this as part of 2.0 which I am working on now and is a rewrite of the codebase in ES6.

@charlierudolph
Copy link
Member Author

Added in 2.0.0-rc.1

@batje
Copy link

batje commented Apr 26, 2017

I am using rc9 and the formatter folder does not contain a junit or tap formatter. nor does the --format option support them. Did I miss anything?

@charlierudolph
Copy link
Member Author

charlierudolph commented Apr 26, 2017

There is now support for custom formatters (see link on the readme) so for junit / tap formatters, those can be implemented as their own modules. I don't believe any are at the moment

@batje
Copy link

batje commented Apr 26, 2017

For now, I am using https://github.com/stjohnjohnson/cucumber-junit which is not as nice as a native formatter, but works.

@lock
Copy link

lock bot commented Oct 25, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants