1

I am using calabash-ios to run my tests and after every scenario the simulator will close and then restart to perform the next scenario. I am looking to keep the simulator open but reopen the application (so go back to menu and then reopen ?)

So far I can keep the application open but not reset the application to its original settings so to speak

Before do |scenario|
  if defined?(MY_LAUNCHER)
    @calabash_launcher = MY_LAUNCHER
  else
    MY_LAUNCHER = Calabash::Cucumber::Launcher.new
    @calabash_launcher = MY_LAUNCHER
  end
end

After do |scenario|
  unless @calabash_launcher.calabash_no_stop?
    calabash_exit
      if @calabash_launcher.active?
       @calabash_launcher.stop
      end
  end
end

at_exit do
  if MY_LAUNCHER.simulator_target?
    MY_LAUNCHER.simulator_launcher.stop
  end
end

I have read that you can use a backdoor which Calls a method on the app's AppDelegate object, but as only just getting started this is an alien concept.

How can I achieve this?

halfer
  • 19,824
  • 17
  • 99
  • 186
Richlewis
  • 15,070
  • 37
  • 122
  • 283

1 Answers1

0

We've had several different methods of doing this over the past few months. The most stable by far was using a backdoor and invoking it in the after hook.

You can read about backdoors here, they are not too difficult: https://developer.xamarin.com/guides/testcloud/calabash/working-with/backdoors/

goughy000
  • 668
  • 4
  • 13