Skip to content

Commit 55118f6

Browse files
committed
Launch Application and Quit Application added
1 parent d2fc3db commit 55118f6

File tree

3 files changed

+42
-4
lines changed

3 files changed

+42
-4
lines changed

AppiumLibrary/keywords/_applicationmanagement.py

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def __init__(self):
1818
# Public, open and close
1919

2020
def close_application(self):
21-
"""Closes the current application."""
21+
"""Closes the current application and also close webdriver session."""
2222
self._debug('Closing application with session id %s' % self._current_application().session_id)
2323
self._cache.close()
2424

@@ -81,8 +81,46 @@ def switch_application(self, index_or_alias):
8181
self._cache.switch(index_or_alias)
8282
return old_index
8383

84+
def launch_application(self):
85+
""" Launch application. Application can be launched while Appium session running.
86+
This keyword can be used to launch application during test case or between test cases.
87+
88+
This keyword works while `Open Application` has a test running. This is good practice to `Launch Application`
89+
and `Quit Application` between test cases. As Suite Setup is `Open Application`, `Test Setup` can be used to `Launch Application`
90+
91+
Example (syntax is just a representation, refer to RF Guide for usage of Setup/Teardown):
92+
| [Setup Suite] |
93+
| | Open Application | http://localhost:4723/wd/hub | platformName=Android | deviceName=192.168.56.101:5555 | app=${CURDIR}/demoapp/OrangeDemoApp.apk |
94+
| [Test Setup] |
95+
| | Launch Application |
96+
| | | <<<test execution>>> |
97+
| | | <<<test execution>>> |
98+
| [Test Teardown] |
99+
| | Quit Application |
100+
| [Suite Teardown] |
101+
| | Close Application |
102+
103+
See `Quit Application` for quiting application but keeping Appium sesion running.
104+
105+
New in AppiumLibrary 1.4.6
106+
"""
107+
driver = self._current_application()
108+
driver.launch_app()
109+
110+
def quit_application(self):
111+
""" Quit application. Application can be quit while Appium session is kept alive.
112+
This keyword can be used to close application during test case or between test cases.
113+
114+
See `Launch Application` for an explanation.
115+
116+
New in AppiumLibrary 1.4.6
117+
"""
118+
driver = self._current_application()
119+
driver.close_app()
120+
84121
def reset_application(self):
85-
""" Reset application """
122+
""" Reset application. Open Application can be reset while Appium session is kept alive.
123+
"""
86124
driver = self._current_application()
87125
driver.reset()
88126

AppiumLibrary/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# -*- coding: utf-8 -*-
22

3-
VERSION = '1.4.5.6'
3+
VERSION = '1.4.6'

docs/AppiumLibrary.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)