-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
JSON formatter shows incorrect line number for steps in a Scenario Outline #128
Comments
I've already found the issue and created a fix locally. I'll commit a pull request shortly. |
This fix should also be committed to version 1.5.0
I don't think this issue belongs here, since the JSON formatter is implemented in the Cucumber-Ruby project and its spec is also there - therefore issues and discussions about its behaviour should be kept there. Some issues might be fixed by a change here, but issues here in Cucumber-Ruby-Core should use the concepts defined here, rather than for instance formatters of Cucumber-Ruby. Yes, the behaviour was changed in Cucmber-Ruby v2.0.0 (I do not know how conscious the change was), but both behaviours is equally right and equally wrong. The step executed is not the step of the scenario outline, but an instantiated/expanded step based on the step of the scenario outline - instantiated/expanded with the use of the data of the example row. The newer version of Gherkin get it really right by using multiple locations for compiled steps from scenario outlines (both the line of the scenario outline step and the example row are associated with the compiled step). Similarly in Cucumber-Ruvy >v2.0.0 both the scenario outline step and the instantiate/expanded step are included in error backtraces example:
As using one line is not really correct, regardless of which of the line of the scenario outline step or the |
Thanks for your input @brasmusson please feel free to move the ticket to Cucumber-ruby, I'm not familiar with your processes. I understand that this is a difficult matter as in the depth that the issue is in and how it could break existing cucumber projects, however, I do not feel it's equally wrong or right. From my point of view, the data that we're working with is a crude form of a database, and thus it should apply to the standards of a database. The most important rule in databases is that in every Row of data should have a unique ID. In our case, the Line number + File creates this uniqueness. With Steps not having a Line number, it isn't unique and so it can't be used as data. I understand if this change won't be added to Cucumber 2.x, but I hope you will consider implementing it in the upcoming Cucumber 3. |
Using |
I agree @brasmusson, if steps would get an But in the case of the Anyway, what do you ought the chance of this being implemented? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs. |
Haven't had time to look into the discussed solution. But it's still on the to-do list. Feel free to assign to me. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs. |
I close this because the Json Formatter is not part of the this project, so issues with the Json Formatter should not be raised here. Issues raised here should be formulated in concepts available in this project. This issue with the Json Formatter is tracked in cucumber/cucumber-ruby#1108. |
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. |
Copied issue from cucumber-ruby: cucumber/cucumber-ruby#1108
Configuration
Issue not present on Cucumber 1.3.20, that's why I assume it came with version 2.
Upon further inspection, it seems the introduction of Cucumber Core caused this issue
Summary
The line numbers given to a step in the json formatter is always the line number of the Example row. Because of this, it's not possible to distinguish the steps from each other, as the line number is their unique value.
Expected Behavior
In Cucumber 1.3.20 the correct JSON output is given, I've cut out the important pieces:
Note how the step line numbers are the same as the actual line number of the step.
Current Behavior
In cucumber 2.4.0 the following JSON output is given:
Context & Motivation
This issue has affected us at spriteCloud in the following way:
This is going fine with regular Scenario's, but when it is an Outline we're not able to link the screenshot to the step and thus we can't visualize the given error.
Your Environment
The text was updated successfully, but these errors were encountered: