Class: PrettyFace::Formatter::ReportScenario

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scenario) ⇒ ReportScenario

Returns a new instance of ReportScenario.



167
168
169
170
171
172
173
# File 'lib/pretty_face/formatter/report.rb', line 167

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

Instance Attribute Details

#durationObject

Returns the value of attribute duration.



165
166
167
# File 'lib/pretty_face/formatter/report.rb', line 165

def duration
  @duration
end

#file_colon_lineObject

Returns the value of attribute file_colon_line.



165
166
167
# File 'lib/pretty_face/formatter/report.rb', line 165

def file_colon_line
  @file_colon_line
end

#imageObject

Returns the value of attribute image.



165
166
167
# File 'lib/pretty_face/formatter/report.rb', line 165

def image
  @image
end

#image_idObject

Returns the value of attribute image_id.



165
166
167
# File 'lib/pretty_face/formatter/report.rb', line 165

def image_id
  @image_id
end

#image_labelObject

Returns the value of attribute image_label.



165
166
167
# File 'lib/pretty_face/formatter/report.rb', line 165

def image_label
  @image_label
end

#nameObject

Returns the value of attribute name.



165
166
167
# File 'lib/pretty_face/formatter/report.rb', line 165

def name
  @name
end

#statusObject

Returns the value of attribute status.



165
166
167
# File 'lib/pretty_face/formatter/report.rb', line 165

def status
  @status
end

#stepsObject

Returns the value of attribute steps.



165
166
167
# File 'lib/pretty_face/formatter/report.rb', line 165

def steps
  @steps
end

Instance Method Details

#has_image?Boolean

Returns:

  • (Boolean)


187
188
189
# File 'lib/pretty_face/formatter/report.rb', line 187

def has_image?
  not image.nil?
end

#populate(scenario) ⇒ Object



175
176
177
178
179
180
181
182
183
184
185
# File 'lib/pretty_face/formatter/report.rb', line 175

def populate(scenario)
  @duration = Time.now - @start
  if scenario.instance_of? Cucumber::Ast::Scenario
    @name = scenario.name
    @file_colon_line = scenario.file_colon_line
  elsif scenario.instance_of? Cucumber::Ast::OutlineTable::ExampleRow
    @name = scenario.scenario_outline.name
    @file_colon_line = scenario.backtrace_line
  end
  @status = scenario.status
end