Sha256: 0065ebc3f6ec45bba5746797efa5c5e1f4a34db4b80d3835a5b7a0f275f97930

Contents?: true

Size: 1.06 KB

Versions: 6

Compression:

Stored size: 1.06 KB

Contents

Before do |scenario|
  # https://groups.google.com/forum/?fromgroups#!topic/calabash-ios/ICA4f24eSsY
  @scenario_is_outline = (scenario.class == Cucumber::Ast::OutlineTable::ExampleRow) 
  if @scenario_is_outline 
    scenario = scenario.scenario_outline 
  end 

  StepCounter.step_index = 0
  # https://github.com/calabash/calabash-android/issues/58#issuecomment-6745642
  if scenario.respond_to? :raw_steps
    StepCounter.step_line = scenario.raw_steps[StepCounter.step_index].line
  else
    StepCounter.step_line = 0
  end
end

AfterStep do |scenario|
  #Handle multiline steps
  StepCounter.step_index = StepCounter.step_index + 1
  # https://github.com/calabash/calabash-android/issues/58#issuecomment-6745642
  if scenario.respond_to? :raw_steps
    StepCounter.step_line = scenario.raw_steps[StepCounter.step_index].line unless scenario.raw_steps[StepCounter.step_index].nil?
  else
    StepCounter.step_line = StepCounter.step_line + 1
  end
end

StepCounter = Class.new
class << StepCounter
  @step_index = 0
  @step_line = 0
  attr_accessor :step_index, :step_line
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
calabash-android-0.2.17 features-skeleton/support/hooks.rb
calabash-android-0.2.16 features-skeleton/support/hooks.rb
calabash-android-0.2.15 features-skeleton/support/hooks.rb
calabash-android-0.2.14 features-skeleton/support/hooks.rb
calabash-android-0.2.13 features-skeleton/support/hooks.rb
calabash-android-0.2.12 features-skeleton/support/hooks.rb