-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[Core] Add name to embedding #1693
[Core] Add name to embedding #1693
Conversation
@@ -737,8 +753,13 @@ private void runFeaturesWithFormatter(URL outputDir) throws Throwable { | |||
stepsToLocation.put("first step", "path/step_definitions.java:3"); | |||
hooks.add(TestHelper.hookEntry("after", result("passed"))); | |||
hooks.add(TestHelper.hookEntry("after", result("passed"))); | |||
hookActions.add(createEmbedHookAction("fakedata".getBytes("US-ASCII"), "image/png")); | |||
hookActions.add(createEmbedHookAction("dodgy stack trace here".getBytes("US-ASCII"), "text/plain")); | |||
if (isNamedEmbedding) { |
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.
i think it would be better to remove isNamedEmbedding
flag
as we can have both embeddings with and without name in one report.
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.
I deleted this flag and updated existing tests, so they cover case with and without name.
if (event.name != null) { | ||
jsFunctionCall("embedding", mimeType, fileName, event.name); | ||
} else { | ||
jsFunctionCall("embedding", mimeType, fileName); |
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.
Would it be possible to fix jsFunctionCall
so this if statement isn't needed?
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.
Or I guess fix the embedding
function that jsFunctionCall
calls.
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.
I removed this 'if' statement.
@@ -93,4 +96,10 @@ public Throwable getError() { | |||
|
|||
return max(stepResults, Result.SEVERITY).getError(); | |||
} | |||
|
|||
private void busSend(EmbedEvent embedEvent) { | |||
if (bus != null) { |
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.
I couldn't find any calls into the Scenario
constructor where bus
would be null.
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.
I removed the check for null, also did it in write
method for consistency.
…TMLFormatter tests
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.
Looks good! For the v5 version please deprecate the Scenario.embed
method without the name parameter.
LGTM. Cheers. 😄 |
Same, looks good. Merged! Thanks. |
Hi @Dzieciak, Thanks for your making your first contribution to Cucumber, and welcome to the Cucumber committers team! You can now push directly to this repo and all other repos under the cucumber organization! 🍾 In return for this generous offer we hope you will:
On behalf of the Cucumber core team, |
@beardedqa thanks for merging! In the future could you please use the squash merge option and add a commit message of the form Finally also please update the change-log itself occasionally. |
@mpkorstanje Sure, thank you for pointing that. |
Summary
This is a pull request related to #1692.