Class: CucumberToHtml::Cell::Scenario

Inherits:
Element show all
Defined in:
app/concepts/cucumber_to_html/cell/scenario.rb

Instance Method Summary collapse

Methods inherited from Element

#keyword, #name, #step, #steps

Instance Method Details

#body_classesObject



23
24
25
26
27
28
29
# File 'app/concepts/cucumber_to_html/cell/scenario.rb', line 23

def body_classes
  if success?
    'text-success'
  elsif failure?
    'text-danger'
  end
end

#border_classesObject



15
16
17
18
19
20
21
# File 'app/concepts/cucumber_to_html/cell/scenario.rb', line 15

def border_classes
  if success?
    'border-success'
  elsif failure?
    'border-danger'
  end
end

#failure?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'app/concepts/cucumber_to_html/cell/scenario.rb', line 11

def failure?
  false # TBD
end

#success?Boolean

Returns:

  • (Boolean)


5
6
7
8
9
# File 'app/concepts/cucumber_to_html/cell/scenario.rb', line 5

def success?
  model['steps'].all? do |step|
    step.dig('result', 'status') == 'passed'
  end
end