Closed rockwig closed 4 years ago
I have been using background steps in my feature files all over and not facing this issue.. can you provide more details, like json or something..
This is the error that I am seeing:
/Users/ryanockwig/.rvm/gems/ruby-2.4.0@pipeline/gems/report_builder-1.8/lib/report_builder/builder.rb:193:in
block (2 levels) in get_features': undefined method +' for nil:NilClass (NoMethodError) from /Users/ryanockwig/.rvm/gems/ruby-2.4.0@pipeline/gems/report_builder-1.8/lib/report_builder/builder.rb:192:in
each'
from /Users/ryanockwig/.rvm/gems/ruby-2.4.0@pipeline/gems/report_builder-1.8/lib/report_builder/builder.rb:192:in group_by' from /Users/ryanockwig/.rvm/gems/ruby-2.4.0@pipeline/gems/report_builder-1.8/lib/report_builder/builder.rb:192:in
block in get_features'
from /Users/ryanockwig/.rvm/gems/ruby-2.4.0@pipeline/gems/report_builder-1.8/lib/report_builder/builder.rb:127:in each' from /Users/ryanockwig/.rvm/gems/ruby-2.4.0@pipeline/gems/report_builder-1.8/lib/report_builder/builder.rb:127:in
get_features'
from /Users/ryanockwig/.rvm/gems/ruby-2.4.0@pipeline/gems/report_builder-1.8/lib/report_builder/builder.rb:82:in get_groups' from /Users/ryanockwig/.rvm/gems/ruby-2.4.0@pipeline/gems/report_builder-1.8/lib/report_builder/builder.rb:22:in
build_report'
from /Users/ryanockwig/.rvm/gems/ruby-2.4.0@pipeline/gems/report_builder-1.8/lib/report_builder.rb:76:in build_report'
And it's happening because the in the json, the scenario that is being read in has no id
, Here's the JSON for that Scenario:
{"keyword"=>"Background", "name"=>"", "description"=>"", "line"=>5, "type"=>"background", "before"=>[{"match"=>{"location"=>"features/support/hooks.rb:7"}, "result"=>{"status"=>"passed", "duration"=>20361378536}, "status"=>"passed", "duration"=>20361378536}], "steps"=>[{"keyword"=>"And ", "name"=>"generic name blah", "line"=>6, "match"=>{"location"=>"features/step_definitions/api_steps.rb:188"}, "result"=>{"status"=>"passed", "duration"=>1422027623}, "status"=>"passed", "duration"=>1422027623}, {"keyword"=>"And ", "name"=>"some other generic text", "line"=>7, "match"=>{"location"=>"features/step_definitions/api_steps.rb:132"}, "result"=>{"status"=>"passed", "duration"=>614483123}, "status"=>"passed", "duration"=>614483123}, {"keyword"=>"And ", "name"=>"last piece of generic text", "line"=>8, "match"=>{"location"=>"features/step_definitions/api_steps.rb:193"}, "result"=>{"status"=>"passed", "duration"=>1793598939}, "status"=>"passed", "duration"=>1793598939}], "after"=>[], "status"=>"passed", "duration"=>24191488221}
I'm using Background steps with Scenario Outlines.
@rockwig Please provide you Feature File and Cucumber version.
cucumber (3.1.2) - And I'll try to create a basic feature file to reproduce the issue. As I try to get a feature file, this same JSON works with report_builder 1.6.
Having
background
steps before a Scenario causes the report not to build.