【发布时间】:2018-05-14 17:27:30
【问题描述】:
我正在使用 calabash-ios 运行我的测试,并且在每个场景之后模拟器将关闭然后重新启动以执行下一个场景。我希望保持模拟器打开但重新打开应用程序(所以返回菜单然后重新打开?)
到目前为止,我可以让应用程序保持打开状态,但不能将应用程序重置为其原始设置
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
我读到您可以使用 backdoor 来调用应用程序的 AppDelegate 对象上的方法,但只是刚刚开始,这是一个陌生的概念。
我怎样才能做到这一点?
【问题讨论】:
标签: ios calabash calabash-ios