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

Scenario outlines make the JSON formatter fail (an exception is raised) #707

Merged
merged 2 commits into from
Jul 25, 2014

Conversation

brasmusson
Copy link
Contributor

The scenario added in this PR with the @wip-new-core tag, does pass in v1.3.x (but it is not included in the json_formatter.feature until #700).

The problem is that in gherkin_formatter_adapter the code relies on using the gherkin_statement method on the AST classes. This does not work on the AST classes Core::Ast::ScenarioOutline nor Core::Ast::ExamplesTable.

Requires cucumber/cucumber-ruby-core#59

@brasmusson
Copy link
Contributor Author

With cucumber/cucumber-ruby-core#59 and the fix in normalise_output.rb, the remaining JSON diff is:

      -        "match"=>{"location"=>"features/step_definitions/steps.rb:1"}}],
      +        "match"=>{"location"=>"features/outline.feature:4"}}],

That is in v1.3.x the match of the step in the scenario outline refers to a step definition, whereas it in v2.0 refers to the step location itself.

The step definition referred to in v1.3.x is actually not all that accurate, only when <status> has the value pass, steps.rb:1 will be executed, when <status> has the value fail, it is actually steps.rb:5 that is executed.

@mattwynne
Copy link
Member

I don't think a match is even relevant in the data at that point - it might match many different step definitions through the examples, depending on what gets substituted.

@mattwynne
Copy link
Member

I think the data model is broken here. It would be better, IMO, to have completely separate data about results from test-cases that uses the id of the scenario / example row to match it back to the gherkin.

But that's a different problem. I'm going to change the feature so this passes.

@mattwynne mattwynne merged commit 30d6294 into cucumber:master Jul 25, 2014
mattwynne added a commit that referenced this pull request Jul 25, 2014
@brasmusson brasmusson deleted the json-formatter-outline branch July 25, 2014 21:12
@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

Successfully merging this pull request may close these issues.

2 participants