Class: UglyFace::Formatter::ReportScenario

Inherits:
Object
  • Object
show all
Defined in:
lib/ugly_face/formatter/report.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scenario) ⇒ ReportScenario

Returns a new instance of ReportScenario.



169
170
171
172
173
174
175
# File 'lib/ugly_face/formatter/report.rb', line 169

def initialize(scenario)
  @steps = []
  @image = []
  @image_label = []
  @image_id = []
  @start = Time.now
end

Instance Attribute Details

#durationObject

Returns the value of attribute duration.



167
168
169
# File 'lib/ugly_face/formatter/report.rb', line 167

def duration
  @duration
end

#file_colon_lineObject

Returns the value of attribute file_colon_line.



167
168
169
# File 'lib/ugly_face/formatter/report.rb', line 167

def file_colon_line
  @file_colon_line
end

#imageObject

Returns the value of attribute image.



167
168
169
# File 'lib/ugly_face/formatter/report.rb', line 167

def image
  @image
end

#image_idObject

Returns the value of attribute image_id.



167
168
169
# File 'lib/ugly_face/formatter/report.rb', line 167

def image_id
  @image_id
end

#image_labelObject

Returns the value of attribute image_label.



167
168
169
# File 'lib/ugly_face/formatter/report.rb', line 167

def image_label
  @image_label
end

#nameObject

Returns the value of attribute name.



167
168
169
# File 'lib/ugly_face/formatter/report.rb', line 167

def name
  @name
end

#statusObject

Returns the value of attribute status.



167
168
169
# File 'lib/ugly_face/formatter/report.rb', line 167

def status
  @status
end

#stepsObject

Returns the value of attribute steps.



167
168
169
# File 'lib/ugly_face/formatter/report.rb', line 167

def steps
  @steps
end

Instance Method Details

#has_image?Boolean

Returns:

  • (Boolean)


189
190
191
# File 'lib/ugly_face/formatter/report.rb', line 189

def has_image?
  not image.nil?
end

#populate(scenario) ⇒ Object



177
178
179
180
181
182
183
184
185
186
187
# File 'lib/ugly_face/formatter/report.rb', line 177

def populate(scenario)
  @duration = Time.now - @start
  @status = scenario.status
  if scenario.instance_of? Cucumber::Formatter::LegacyApi::Ast::Scenario
    @name = scenario.name
    @file_colon_line = scenario.line
  elsif scenario.instance_of? Cucumber::Formatter::LegacyApi::Ast::ExampleTableRow
    @name = scenario.name
    @file_colon_line = scenario.line
  end
end