Sha256: 286bd56959d2172a53f83ecbf7fe5dd0d27392ca6cac7a2615c360d3b31d8d5d

Contents?: true

Size: 1018 Bytes

Versions: 23

Compression:

Stored size: 1018 Bytes

Contents

require 'calabash-android/management/app_installation'

AfterConfiguration do |config|
  FeatureNameMemory.feature_name = nil
end

Before do |scenario|
  @scenario_is_outline = (scenario.class == Cucumber::Ast::OutlineTable::ExampleRow)
  if @scenario_is_outline 
    scenario = scenario.scenario_outline 
  end 

  feature_name = scenario.feature.title
  if FeatureNameMemory.feature_name != feature_name \
      or ENV["RESET_BETWEEN_SCENARIOS"] == "1"
    if ENV["RESET_BETWEEN_SCENARIOS"] == "1"
      log "New scenario - reinstalling apps"
    else
      log "First scenario in feature - reinstalling apps"
    end
    
    uninstall_apps
    install_app(ENV["TEST_APP_PATH"])
    install_app(ENV["APP_PATH"])
    FeatureNameMemory.feature_name = feature_name
  FeatureNameMemory.invocation = 1
  else
    FeatureNameMemory.invocation += 1
  end
end

FeatureNameMemory = Class.new
class << FeatureNameMemory
  @feature_name = nil
  attr_accessor :feature_name, :invocation
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
awetestlib-0.1.24-x86-mingw32 setup_samples/sample_android/features/support/app_installation_hooks.rb
awetestlib-0.1.23-x86-mingw32 setup_samples/sample_android/features/support/app_installation_hooks.rb
awetestlib-0.1.22-x86-mingw32 setup_samples/sample_android/features/support/app_installation_hooks.rb