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



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

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

#border_classesObject



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

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

#failure?Boolean

Returns:

  • (Boolean)


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

def failure?
  false # TBD
end

#success?Boolean

class CucumberToHtml::Cell::Scenario < Element

Returns:

  • (Boolean)


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

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