Skip to content
This repository was archived by the owner on Nov 23, 2023. It is now read-only.

Commit 3a5b5ab

Browse files
committed
fix: merge conflicts
2 parents cb25911 + 0a85d74 commit 3a5b5ab

File tree

8 files changed

+72
-5
lines changed

8 files changed

+72
-5
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ nosetests.xml
3030
# Translations
3131
*.mo
3232

33-
# PyCharm
33+
# IDE
3434
.idea
35+
.vscode
3536

3637
# Mr Developer
3738
.mr.developer.cfg

AppiumFlutterLibrary/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@
88
class AppiumFlutterLibrary(
99
_ApplicationManagementKeyWords,
1010
_ElementKeywords,
11+
_KeyeventsKeywords,
1112
_LoggingKeywords,
1213
_ScreenKeywords,
1314
_RunOnFailureKeyWords,
15+
_TouchKeywords,
1416
_WaintingKeywords,
1517
):
1618
""" AppiumFlutterLibrary is a flutter testing library for Robot Framework
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
from ._applicationmanagement import _ApplicationManagementKeyWords
22
from ._element import _ElementKeywords
3+
from ._keyevents import _KeyeventsKeywords
34
from ._logging import _LoggingKeywords
45
from ._runonfailure import _RunOnFailureKeyWords
56
from ._screen import _ScreenKeywords
7+
from ._touch import _TouchKeywords
68
from ._waiting import _WaintingKeywords
79

810
__all__ = [
911
"_ApplicationManagementKeyWords",
1012
"_ElementKeywords",
13+
"_KeyeventsKeywords",
1114
"_LoggingKeywords",
1215
"_RunOnFailureKeyWords",
1316
"_ScreenKeywords",
14-
"_WaintingKeywords"
17+
"_TouchKeywords",
18+
"_WaintingKeywords",
1519
]
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
from .keywordgroup import KeywordGroup
2+
3+
class _KeyeventsKeywords(KeywordGroup):
4+
def press_keycode(self, keycode, metastate=None):
5+
"""Sends a press of keycode to the device.
6+
Android only.
7+
Possible keycodes & meta states can be found in
8+
http://developer.android.com/reference/android/view/KeyEvent.html
9+
Meta state describe the pressed state of key modifiers such as
10+
Shift, Ctrl & Alt keys. The Meta State is an integer in which each
11+
bit set to 1 represents a pressed meta key.
12+
For example
13+
- META_SHIFT_ON = 1
14+
- META_ALT_ON = 2
15+
| metastate=1 --> Shift is pressed
16+
| metastate=2 --> Alt is pressed
17+
| metastate=3 --> Shift+Alt is pressed
18+
- _keycode- - the keycode to be sent to the device
19+
- _metastate- - status of the meta keys
20+
"""
21+
driver = self._current_application()
22+
driver.press_keycode(keycode, metastate)
23+
24+
def long_press_keycode(self, keycode, metastate=None):
25+
"""Sends a long press of keycode to the device.
26+
Android only.
27+
See `press keycode` for more details.
28+
"""
29+
driver = self._current_application()
30+
driver.long_press_keycode(int(keycode), metastate)
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
from .keywordgroup import KeywordGroup
2+
from AppiumFlutterLibrary.finder import ElementFinder
3+
4+
class _TouchKeywords(KeywordGroup):
5+
def init(self):
6+
self._element_finder = ElementFinder()
7+
8+
def scroll(self, start_locator, end_locator):
9+
"""
10+
Scrolls from one element to another
11+
Key attributes for arbitrary elements are `id` and `name`. See
12+
`introduction` for details about locating elements.
13+
"""
14+
el1 = self._find_element(self, start_locator)
15+
el2 = self._find_element(self, end_locator)
16+
driver = self._current_application()
17+
driver.scroll(el1, el2)
18+
19+
def scroll_down(self, locator):
20+
"""Scrolls down to element"""
21+
driver = self._current_application()
22+
element = self._find_element(self, locator)
23+
driver.execute_script("mobile: scroll", {"direction": 'down', 'elementid': element.id})
24+
25+
def scroll_up(self, locator):
26+
"""Scrolls up to element"""
27+
driver = self._current_application()
28+
element = self._element_find(locator, True, True)
29+
driver.execute_script("mobile: scroll", {"direction": 'up', 'elementid': element.id})

AppiumFlutterLibrary/version.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# -*- coding: utf-8 -*-
2-
VERSION = '1.0.0-beta2'
2+
3+
VERSION = '1.0.0-beta.2'

docs/AppiumFlutterLibrary.html

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

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
setup(name='robotframework-appiumflutterlibrary',
1212
version=VERSION,
1313
description='Robot Framework Mobile flutter app testing library for Appium Client Android & iOS & Web',
14-
long_description=open(join(ROOT, 'README.md')).read(),
14+
long_description=open(join(ROOT, 'README.rst')).read(),
1515
author='Igor Augusto',
1616
author_email='igortavtib@gmail.com',
1717
url='https://github.com/igortavtib/robotframework-appiumflutterlibrary',

0 commit comments

Comments
 (0)