Method: Cucumber::Formatter::Json::Builder#scenario

Defined in:
lib/cucumber/formatter/json.rb

#scenario(scenario_source, test_case) ⇒ Object

[View source] [View on GitHub]

274
275
276
277
278
279
280
281
282
283
284
285
286
# File 'lib/cucumber/formatter/json.rb', line 274

def scenario(scenario_source, test_case)
  scenario = scenario_source.type == :Scenario ? scenario_source.scenario : scenario_source.scenario_outline
  @test_case_hash = {
    id: "#{@feature_hash[:id]};#{create_id_from_scenario_source(scenario_source)}",
    keyword: scenario.keyword,
    name: test_case.name,
    description: value_or_empty_string(scenario.description),
    line: test_case.location.lines.max,
    type: 'scenario',
    steps: []
  }
  @test_case_hash[:tags] = create_tags_array_from_tags_array(test_case.tags) unless test_case.tags.empty?
end