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

Cucumber 2 - Formatter API #312

Closed
stengvac opened this Issue Dec 4, 2017 · 2 comments

Comments

Projects
None yet
3 participants
@stengvac

stengvac commented Dec 4, 2017

Summary

Lang: Java
Cucumber: 2.1.0

Hello I am writing my own formatter for Cucumber 2.1.0 and I would like to ask if there is possibilily to provide more data and tools for creation of custom formatters. In Cucumber version 1.2.5 was present Reporter and Formatter interfaces, which provided nearly all information. But some of them were not present like fields from @CucumberOptions - dryRun, strict, features, glue, tags.

Why do i need my own formatter? I am sending colleted data after each tested feature to REST API + we are collecting other data like used environment, execution datetime.. .

Current behavior

Event driven Formatter in Cucumber 2.1.0 provide only portion of data and rest of them is accessed via package protected class cucumber.runtime.formatter.TestSourcesModel in Cucumber formatters.

Expected Behavior

Formatter API will provide more data or some utility class could be present.
Data from CucumberOptions should be accessible.

Thx for help/answers
V

@mpkorstanje

This comment has been minimized.

Contributor

mpkorstanje commented Dec 4, 2017

The contents of TestSourcesModel is entirely derived from the TestSourceReadEvent. So in the short term I would recommend copying the TestSourcesModel.

Why it is not part of the current API at this moment:

@brasmusson in cucumber/cucumber-jvm#1253
Things that are exported as part of the API are in Martin Fowler's terms "Published Interfaces". One of Martin Fowler's guidelines for Published Interfaces is "Publish as little as you can as late as you can". "As late as you can" so that you have had the time to refine the interface to be published. TestSourcesModel is far from being as refined to be part of a "Published Interface". Secondly as mentioned in previous comment, the proper place for a support library for lookup of Gherkin AST data, is most likely a sub-repo of https://github.com/cucumber/cucumber so it can be used by all Cucumber implementations and not only Cucumber-JVM (maybe rather the event-protocol sub-repo rather than the gherkin sub-repo).

Hammering out something to do these linenumber to ast-node lookups would be a good start.

@aslakhellesoy

This comment has been minimized.

Contributor

aslakhellesoy commented Dec 19, 2017

This issue was moved to cucumber/cucumber-jvm#1304

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment