-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix html reporter with more than one embedded screenshot #1216
Fix html reporter with more than one embedded screenshot #1216
Conversation
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.
Good catch!
Looks like failed scenarios are not related to my changes. Anyway, I performed |
@olleolleolle thanks! |
spec/cucumber/formatter/html_spec.rb
Outdated
@@ -33,7 +33,7 @@ module Formatter | |||
describe 'when writing the report to a file' do | |||
before(:each) do | |||
allow(@out).to receive(:respond_to?).with(:path).and_return(true) | |||
expect(@out).to receive(:path).and_return('out/file.html') | |||
expect(@out).to receive(:path).at_most(:twice).and_return('out/file.html') |
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'd be more comfortable if you set the limit within the scope of where it will be encountered, rather than setting it at a level that potentially affects every test. In other words, set it to 1 in
describe 'with a step that embeds a snapshot' do
# stuff
end
and set it to 2 in
describe 'with more than one step that embeds snapshot' do
#stuff
end
Everything else looks fine.
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.
Updated. I had to move calling :run_defined_feature
method into a nested describe sections because :path
should be stubbed before using :run_defined_feature
.
There was typo in #next_id: @indices used incorrect key for incrementing screenshot number (:type as a symbol instead of type as a variable)
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.
Lgtm!
@nonkor Thanks for sticking with it! |
Hi @nonkor, 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, |
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. |
Summary
There was typo in
#next_id
method:@indices
used incorrect key for incrementing screenshot number (:type as a symbol instead of type as a variable). It was lead to confusion when every screenshot in reporter pointed to the same image id.How Has This Been Tested?
formatter/html_spec.rb
has been extended to cover a case with more than one screenshot in html-report.Screenshots (if appropriate):
Types of changes
Checklist: