Skip to content

Commit

Permalink
Launch Application and Quit Application added
Browse files Browse the repository at this point in the history
  • Loading branch information
serhatbolsu committed Oct 29, 2017
1 parent d2fc3db commit 55118f6
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 4 deletions.
42 changes: 40 additions & 2 deletions AppiumLibrary/keywords/_applicationmanagement.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def __init__(self):
# Public, open and close

def close_application(self):
"""Closes the current application."""
"""Closes the current application and also close webdriver session."""
self._debug('Closing application with session id %s' % self._current_application().session_id)
self._cache.close()

Expand Down Expand Up @@ -81,8 +81,46 @@ def switch_application(self, index_or_alias):
self._cache.switch(index_or_alias)
return old_index

def launch_application(self):
""" Launch application. Application can be launched while Appium session running.
This keyword can be used to launch application during test case or between test cases.
This keyword works while `Open Application` has a test running. This is good practice to `Launch Application`
and `Quit Application` between test cases. As Suite Setup is `Open Application`, `Test Setup` can be used to `Launch Application`
Example (syntax is just a representation, refer to RF Guide for usage of Setup/Teardown):
| [Setup Suite] |
| | Open Application | http://localhost:4723/wd/hub | platformName=Android | deviceName=192.168.56.101:5555 | app=${CURDIR}/demoapp/OrangeDemoApp.apk |
| [Test Setup] |
| | Launch Application |
| | | <<<test execution>>> |
| | | <<<test execution>>> |
| [Test Teardown] |
| | Quit Application |
| [Suite Teardown] |
| | Close Application |
See `Quit Application` for quiting application but keeping Appium sesion running.
New in AppiumLibrary 1.4.6
"""
driver = self._current_application()
driver.launch_app()

def quit_application(self):
""" Quit application. Application can be quit while Appium session is kept alive.
This keyword can be used to close application during test case or between test cases.
See `Launch Application` for an explanation.
New in AppiumLibrary 1.4.6
"""
driver = self._current_application()
driver.close_app()

def reset_application(self):
""" Reset application """
""" Reset application. Open Application can be reset while Appium session is kept alive.
"""
driver = self._current_application()
driver.reset()

Expand Down
2 changes: 1 addition & 1 deletion AppiumLibrary/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# -*- coding: utf-8 -*-

VERSION = '1.4.5.6'
VERSION = '1.4.6'
2 changes: 1 addition & 1 deletion docs/AppiumLibrary.html

Large diffs are not rendered by default.

0 comments on commit 55118f6

Please sign in to comment.