Skip to content

Commit 6c467ea

Browse files
authored
Merge pull request #236 from serhatbolsu/feature/execute_script_version_prepare
Prepare for 1.5, visit CHANGES.rst for changes
2 parents 202cf85 + 2eb3eae commit 6c467ea

File tree

6 files changed

+56
-7
lines changed

6 files changed

+56
-7
lines changed

AppiumLibrary/keywords/_android_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ def set_location(self, latitude, longitude, altitude=10):
164164
- _longitude_
165165
- _altitude_ = 10 [optional]
166166
167-
Android only
167+
Android only.
168+
New in AppiumLibrary 1.5
168169
"""
169170
driver = self._current_application()
170171
driver.set_location(latitude,longitude,altitude)

AppiumLibrary/keywords/_applicationmanagement.py

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def close_all_applications(self):
3939
def open_application(self, remote_url, alias=None, **kwargs):
4040
"""Opens a new application to given Appium server.
4141
Capabilities of appium server, Android and iOS,
42-
Please check http://appium.io/slate/en/master/?python#appium-server-capabilities
42+
Please check https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/server-args.md
4343
| *Option* | *Man.* | *Description* |
4444
| remote_url | Yes | Appium server url |
4545
| alias | no | alias |
@@ -186,6 +186,34 @@ def log_source(self, loglevel='INFO'):
186186
else:
187187
return ''
188188

189+
def execute_script(self, script):
190+
"""
191+
Inject a snippet of JavaScript into the page for execution in the
192+
context of the currently selected frame (Web context only).
193+
194+
The executed script is assumed to be synchronous and the result
195+
of evaluating the script is returned to the client.
196+
197+
New in AppiumLibrary 1.5
198+
"""
199+
return self._current_application().execute_script(script)
200+
201+
def execute_async_script(self, script):
202+
"""
203+
Inject a snippet of Async-JavaScript into the page for execution in the
204+
context of the currently selected frame (Web context only).
205+
206+
The executed script is assumed to be asynchronous and must signal that is done by
207+
invoking the provided callback, which is always provided as the final argument to the
208+
function.
209+
210+
The value to this callback will be returned to the client.
211+
212+
213+
New in AppiumLibrary 1.5
214+
"""
215+
return self._current_application().execute_async_script(script)
216+
189217
def go_back(self):
190218
"""Goes one step backward in the browser history."""
191219
self._current_application().back()
@@ -208,12 +236,16 @@ def touch_id(self, match=True):
208236
Simulate Touch ID on iOS Simulator
209237
210238
`match` (boolean) whether the simulated fingerprint is valid (default true)
239+
240+
New in AppiumLibrary 1.5
211241
"""
212242
self._current_application().touch_id(match)
213243

214244
def toggle_touch_id_enrollment(self):
215245
"""
216246
Toggle Touch ID enrolled state on iOS Simulator
247+
248+
New in AppiumLibrary 1.5
217249
"""
218250
self._current_application().toggle_touch_id_enrollment()
219251

AppiumLibrary/keywords/_logging.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import os
44
from robot.libraries.BuiltIn import BuiltIn
5+
from robot.libraries.BuiltIn import RobotNotRunningError
56
from robot.api import logger
67
from .keywordgroup import KeywordGroup
78

@@ -13,7 +14,11 @@ class _LoggingKeywords(KeywordGroup):
1314

1415
@property
1516
def _log_level(self):
16-
return BuiltIn().get_variable_value("${APPIUM_LOG_LEVEL}", default='DEBUG')
17+
try:
18+
level = BuiltIn().get_variable_value("${APPIUM_LOG_LEVEL}", default='DEBUG')
19+
except RobotNotRunningError:
20+
level = 'DEBUG'
21+
return level
1722

1823
def _debug(self, message):
1924
if self._log_level in self.LOG_LEVEL_DEBUG:

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.6'
3+
VERSION = '1.5'

CHANGES.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
History
22
=======
3+
1.5
4+
----------------
5+
- iOS predicates selector - new locator strategy
6+
- Execute Sync/Async Script in Web context - new keyword added
7+
- Long press has time parameter now
8+
- Added log-level filter for reporting
9+
- Set Location Keyword - new keyword added
10+
- Appium-Python library min-version bump
11+
- Simulate Touch ID on iOS Simulator
12+
13+
314
1.4.5
415
----------------
516
- Swipe By Percent - new keyword added

docs/AppiumLibrary.html

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)