Sha256: ab685237d15cc71b90aff57e244309ded175fd9872cf4a0234660dce4f761166

Contents?: true

Size: 1.22 KB

Versions: 27

Compression:

Stored size: 1.22 KB

Contents

require 'calabash-cucumber/launcher'

# You can find examples of more complicated launch hooks in these
# two repositories:
#
# https://github.com/calabash/ios-smoke-test-app/blob/master/CalSmokeApp/features/support/01_launch.rb
# https://github.com/calabash/ios-webview-test-app/blob/master/CalWebViewApp/features/support/01_launch.rb

module Calabash::Launcher
  @@launcher = nil

  def self.launcher
    @@launcher ||= Calabash::Cucumber::Launcher.new
  end

  def self.launcher=(launcher)
    @@launcher = launcher
  end
end

Before do |scenario|
  launcher = Calabash::Launcher.launcher
  options = {
    # Add launch options here.
  }

  launcher.relaunch(options)
end

After do |scenario|
  # Calabash can shutdown the app cleanly by calling the app life cycle methods
  # in the UIApplicationDelegate.  This is really nice for CI environments, but
  # not so good for local development.
  #
  # See the documentation for QUIT_APP_AFTER_SCENARIO for a nice debugging workflow
  #
  # http://calabashapi.xamarin.com/ios/file.ENVIRONMENT_VARIABLES.html#label-QUIT_APP_AFTER_SCENARIO
  # http://calabashapi.xamarin.com/ios/Calabash/Cucumber/Core.html#console_attach-instance_method
  if launcher.quit_app_after_scenario?
    calabash_exit
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
calabash-cucumber-0.23.7 features-skeleton/support/01_launch.rb
calabash-cucumber-0.23.6 features-skeleton/support/01_launch.rb
calabash-cucumber-0.23.5 features-skeleton/support/01_launch.rb
calabash-cucumber-0.23.4 features-skeleton/support/01_launch.rb
calabash-cucumber-0.23.3 features-skeleton/support/01_launch.rb
calabash-cucumber-0.23.2 features-skeleton/support/01_launch.rb
calabash-cucumber-0.23.1 features-skeleton/support/01_launch.rb
calabash-cucumber-0.23.0 features-skeleton/support/01_launch.rb
calabash-cucumber-0.22.2 features-skeleton/support/01_launch.rb
calabash-cucumber-0.21.10 features-skeleton/support/01_launch.rb
calabash-cucumber-0.21.8 features-skeleton/support/01_launch.rb
calabash-cucumber-0.21.7 features-skeleton/support/01_launch.rb
calabash-cucumber-0.21.6 features-skeleton/support/01_launch.rb
calabash-cucumber-0.21.5 features-skeleton/support/01_launch.rb
calabash-cucumber-0.21.4 features-skeleton/support/01_launch.rb
calabash-cucumber-0.21.2 features-skeleton/support/01_launch.rb
calabash-cucumber-0.21.1 features-skeleton/support/01_launch.rb
calabash-cucumber-0.20.5 features-skeleton/support/01_launch.rb
calabash-cucumber-0.20.4 features-skeleton/support/01_launch.rb
calabash-cucumber-0.20.3 features-skeleton/support/01_launch.rb