lib/calabash/life_cycle.rb in calabash-2.0.0.pre2 vs lib/calabash/life_cycle.rb in calabash-2.0.0.pre3

- old
+ new

@@ -1,6 +1,14 @@ module Calabash + + # Methods for managing an app's life cycle. + # + # The life cycle of an app includes: + # * installing / uninstalling + # * stopping / starting + # * clearing the application data + # * sending the application to background and resuming it module LifeCycle # Start the given application (and its test-server) on the port of # {Calabash::Defaults#default_server Calabash.default_server}. # This method will **not** install the application specified. If no # application is given, it will start @@ -120,14 +128,23 @@ Device.default.clear_app_data(path_or_application) end # Sends the current app to the background and resumes it after - # `for_seconds`. This should not exceed 60 seconds for iOS. + # `for_seconds`. # - # On Android you can control the app lifecycle more granularly using + # On iOS, `for_seconds` must be between 1 and 60 seconds. + # + # On iOS the _current app_ is the app under test (your app). + # + # On Android you can control the app lifecycle more granularity using # {Calabash::Android::Interactions#go_home \#go_home} and # {Calabash::Android::LifeCycle#resume_app \#resume_app}. + # + # @param [Numeric] for_seconds How long to keep the app to the background. + # + # @raise [ArgumentError] On iOS, if number of seconds is less than 1 and + # more than 60 seconds. def send_current_app_to_background(for_seconds = 10) _send_current_app_to_background(for_seconds) true end