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

Fix html reporter with more than one embedded screenshot #1216

Merged
merged 1 commit into from
Oct 20, 2017
Merged

Fix html reporter with more than one embedded screenshot #1216

merged 1 commit into from
Oct 20, 2017

Conversation

nonkor
Copy link
Contributor

@nonkor nonkor commented Oct 12, 2017

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

  • Refactor (code change that does not change external functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • I've added tests for my code.

Copy link
Contributor

@olleolleolle olleolleolle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@nonkor
Copy link
Contributor Author

nonkor commented Oct 13, 2017

Looks like failed scenarios are not related to my changes. Anyway, I performed bundle exec rake locally and it has been passed successfully.

@nonkor
Copy link
Contributor Author

nonkor commented Oct 13, 2017

@olleolleolle thanks!

@@ -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')
Copy link
Contributor

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.

Copy link
Contributor Author

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)
Copy link
Contributor

@olleolleolle olleolleolle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm!

@olleolleolle
Copy link
Contributor

@nonkor Thanks for sticking with it!

@enkessler enkessler merged commit 135408b into cucumber:master Oct 20, 2017
@aslakhellesoy
Copy link
Contributor

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:

  • ✅ Continue to use branches and pull requests. When someone on the core team approves a pull request (yours or someone else's), you're welcome to merge it yourself.
  • 💚 Commit to setting a good example by following and upholding our code of conduct in your interactions with other collaborators and users.
  • 💬 Join the community Slack channel to meet the rest of the team and make yourself at home.
  • ℹ️ Don't feel obliged to help, just do what you can if you have the time and the energy.
  • 🙋 Ask if you need anything. We're looking for feedback about how to make the project more welcoming, so please tell us!

On behalf of the Cucumber core team,
Aslak Hellesøy
Creator of Cucumber

@brasmusson brasmusson mentioned this pull request Nov 6, 2017
brasmusson added a commit that referenced this pull request Nov 11, 2017
@lock
Copy link

lock bot commented Oct 24, 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 24, 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

Successfully merging this pull request may close these issues.

4 participants