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

html formatter marks paints wrong scenario red, when failure occurs in background step #520

Closed
mlex opened this issue Aug 16, 2013 · 2 comments

Comments

@mlex
Copy link
Contributor

mlex commented Aug 16, 2013

When a background-step fails, the html-formatter incorrectly paints the scenario directly above the failing background red (and not the background). This is very misleading, because the red scenario doesn't even belong to the same feature like the failed background-step.

Consider a project with 2 features, each having a background and 2 scenarios:

* feature A
    - background
    - scenario 1
    - scenario 2
* feature B
    - background
    - scenario 1
    - scenario 2

If a step in feature-B-background fails, then feature-A-scenario-2 will be marked as a failure (red background). Instead the feature-B-background should have a red background.

The problem is, that in methods set_scenario_color_failed (resp. set_scenario_color_pending) in https://github.com/cucumber/cucumber/blob/master/lib/cucumber/formatter/html.rb#L422 the scenario_#number is painted red (resp. yellow). If the current step is a background step, the element 'background_#number' should be painted red (resp. yellow) instead.

I'm working on a test-case and bugfix.

mlex added a commit to mlex/cucumber that referenced this issue Aug 16, 2013
mlex added a commit to mlex/cucumber that referenced this issue Aug 16, 2013
…round step fails

When encountering a failure in a background step, the html formatter
incorrectly marked the previous scenario red. With this fix, the html
formatter now correctly marks the current background red and does not
touch the output of the previous scenario anymore.
mlex added a commit to mlex/cucumber that referenced this issue Aug 16, 2013
…round step fails

When encountering a failure in a background step, the html formatter
incorrectly marked the previous scenario red. With this fix, the html
formatter now correctly marks the current background red and does not
touch the output of the previous scenario anymore.
@os97673
Copy link
Member

os97673 commented Sep 6, 2013

closed by #521

@os97673 os97673 closed this as completed Sep 6, 2013
@lock
Copy link

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

No branches or pull requests

2 participants