Skip to content

Instantly share code, notes, and snippets.

@enajski
Last active December 13, 2015 16:58
Show Gist options
  • Save enajski/4943653 to your computer and use it in GitHub Desktop.
Save enajski/4943653 to your computer and use it in GitHub Desktop.
require 'pry'
require 'calabash-cucumber/launch/simulator_helper'
require 'sim_launcher'
After( '@developing' ) do |scenario|
binding.pry if scenario.failed?
end
After do |scenario|
if scenario.failed?
ENV['RESET_BETWEEN_SCENARIOS'] = "0"
sdk = ENV['SDK_VERSION'] || SimLauncher::SdkDetector.new().latest_sdk_version
path = Calabash::Cucumber::SimulatorHelper.app_bundle_or_raise(app_path)
Calabash::Cucumber::SimulatorHelper.relaunch(path,sdk,ENV['DEVICE'] || 'iphone')
ENV['RESET_BETWEEN_SCENARIOS'] = "1"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment