Skip to content

Instantly share code, notes, and snippets.

@bustardcelly
Created March 8, 2014 18:56
Show Gist options
  • Save bustardcelly/9437051 to your computer and use it in GitHub Desktop.
Save bustardcelly/9437051 to your computer and use it in GitHub Desktop.
Print iOS console error in After Scenario on failure using Cucumber + Calabash-ios
After do |scenario|
if(scenario.failed?)
$stdout.print "\n[Fail] #{scenario.exception.message}\n----------\n"
system("tail -r -100 \"#{ENV['HOME']}/Library/Logs/iOS Simulator/7.0.3/system.log\" | grep -A1000 Error -i -m1")
$stdout.print "----------\n"
end
unless @calabash_launcher.calabash_no_stop?
calabash_exit
if @calabash_launcher.active?
@calabash_launcher.stop
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment