-
-
Notifications
You must be signed in to change notification settings - Fork 6
Support configurable NamingStrategy.Strategy
and NamingStrategy.FeatureName
in MessagesToJunitXmlWriter
#105
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
base: main
Are you sure you want to change the base?
Conversation
NamingStrategy.Strategy
and NamingStrategy.FeatureName
NamingStrategy.Strategy
and NamingStrategy.FeatureName
NamingStrategy.Strategy
and NamingStrategy.FeatureName
in MessagesToJunitXmlWriter
Also relates to #74. |
@vitalets Thank you for including that! I have added a JS solution, I hope you don't mind, as you were planning to work on a PR. Happy to get feedback. |
Sure, thank you! I didn't get time for it( |
java/src/main/java/io/cucumber/junitxmlformatter/MessagesToJunitXmlWriter.java
Outdated
Show resolved
Hide resolved
return NamingStrategy.strategy(strategy).featureName(featureName).exampleName(exampleName).build(); | ||
} | ||
|
||
private MessagesToJunitXmlWriter(NamingStrategy namingStrategy, OutputStream out) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vitalets The alternative would be to make this method public. This way the JS and Java solutions would be similar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That allows the whole naming strategy to be provided. Which isn't great if the test suite and test class names can't also be set because otherwise the FeatureName#EXCLUDE
should always be used to avoid duplicate names feature names.
Also solved with the builder pattern.
} | ||
|
||
export function makeReport(query: Query): ReportSuite { | ||
export function makeReport(query: Query, customNamingStrategy: NamingStrategy = NAMING_STRATEGY): ReportSuite { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't compile.
- Makes the whole naming strategy configurable - Make suite name configurable - Make test class name configurable
Pushed a few changes.
@grappler would you like to finish the Javascript implementation? Javascript can use default values so the builder can be omitted, but adding the |
🤔 What's changed?
Two new methods to be able to change the naming strategy and feature name. Moved the default values to the first method.
⚡️ What's your motivation?
To be able to set the naming strategy for the XML report.
cucumber/cucumber-jvm#3087
🏷️ What kind of change is this?
♻️ Anything particular you want feedback on?
📋 Checklist:
This text was originally generated from a template, then edited by hand. You can modify the template here.