Skip to content

Instantly share code, notes, and snippets.

@enajski

enajski/hooks.rb

Last active Dec 13, 2015
Embed
What would you like to do?
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
You can’t perform that action at this time.