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-1.2.4-x86-mingw32 setup_samples/sample_android/features/support/app_installation_hooks.rb
awetestlib-0.1.30 setup_samples/sample_android/features/support/app_installation_hooks.rb
awetestlib-0.1.30-x86-mingw32 setup_samples/sample_android/features/support/app_installation_hooks.rb
awetestlib-0.1.30pre3 setup_samples/sample_android/features/support/app_installation_hooks.rb
awetestlib-0.1.30pre3-x86-mingw32 setup_samples/sample_android/features/support/app_installation_hooks.rb
awetestlib-0.1.30pre2 setup_samples/sample_android/features/support/app_installation_hooks.rb
awetestlib-0.1.30pre2-x86-mingw32 setup_samples/sample_android/features/support/app_installation_hooks.rb
awetestlib-0.1.30pre1-x86-mingw32 setup_samples/sample_android/features/support/app_installation_hooks.rb
awetestlib-0.1.30pre1 setup_samples/sample_android/features/support/app_installation_hooks.rb
awetestlib-0.1.29 setup_samples/sample_android/features/support/app_installation_hooks.rb
awetestlib-0.1.29-x86-mingw32 setup_samples/sample_android/features/support/app_installation_hooks.rb
awetestlib-0.1.29pre4 setup_samples/sample_android/features/support/app_installation_hooks.rb
awetestlib-0.1.29pre4-x86-mingw32 setup_samples/sample_android/features/support/app_installation_hooks.rb
awetestlib-0.1.29pre3-x86-mingw32 setup_samples/sample_android/features/support/app_installation_hooks.rb
awetestlib-0.1.29pre3 setup_samples/sample_android/features/support/app_installation_hooks.rb
awetestlib-0.1.29pre1 setup_samples/sample_android/features/support/app_installation_hooks.rb
awetestlib-0.1.28-x86-mingw32 setup_samples/sample_android/features/support/app_installation_hooks.rb
awetestlib-0.1.27-x86-mingw32 setup_samples/sample_android/features/support/app_installation_hooks.rb
awetestlib-0.1.26-x86-mingw32 setup_samples/sample_android/features/support/app_installation_hooks.rb
awetestlib-0.1.25-x86-mingw32 setup_samples/sample_android/features/support/app_installation_hooks.rb