Class: Cucumber::Runtime

Inherits:
Object
  • Object
show all
Defined in:
lib/cucumber_characteristics/cucumber_1x_step_patch.rb

Instance Method Summary collapse

Instance Method Details

#scenario_profilesObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/cucumber_characteristics/cucumber_1x_step_patch.rb', line 3

def scenario_profiles
  return @scenario_profiles if @scenario_profiles
  feature_profiles = {}
  scenarios.each do |f|
    if f.is_a?(Cucumber::Ast::OutlineTable::ExampleRow)
      feature_id = f.scenario_outline.file_colon_line
      feature_profiles[feature_id] ||= { name: f.scenario_outline.name, total_duration: 0, step_count: 0, example_count: 0, examples: {} }
      example_id = f.name
      feature_profiles[feature_id][:examples][example_id] = scenario_outline_example_profile(f)
    else
      feature_id = f.file_colon_line
      feature_profiles[feature_id] = scenario_profile(f)
    end
  end
  @scenario_profiles = feature_profiles
end