robotframework-appiumwindows 0.1.3__py3-none-any.whl → 0.1.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,28 +14,27 @@ class _WindowsKeywords(KeywordGroup):
14
14
  super().__init__()
15
15
 
16
16
  # Public
17
- def appium_hover(self, locator, start_locator=None, timeout=20, **kwargs):
17
+ def appium_hover(self, locator, start_locator=None, timeout=None, **kwargs):
18
18
  self._info(f"Appium Hover '{locator}', timeout '{timeout}'")
19
19
  self._appium_hover_api(start_locator=start_locator, end_locator=locator, timeout=timeout, **kwargs)
20
20
 
21
- def appium_click_offset(self, locator, x_offset=0, y_offset=0, timeout=20, **kwargs):
22
- self._info(
23
- f"Appium Click Offset '{locator}', (x_offset,y_offset) '({x_offset},{y_offset})', timeout '{timeout}'")
21
+ def appium_click_offset(self, locator, x_offset=0, y_offset=0, timeout=None, **kwargs):
22
+ self._info(f"Appium Click Offset '{locator}', (x_offset,y_offset) '({x_offset},{y_offset})', timeout '{timeout}'")
24
23
  self._appium_click_api(locator=locator, timeout=timeout, x_offset=x_offset, y_offset=y_offset, **kwargs)
25
24
 
26
- def appium_right_click(self, locator, timeout=20, **kwargs):
25
+ def appium_right_click(self, locator, timeout=None, **kwargs):
27
26
  self._info(f"Appium Right Click '{locator}', timeout '{timeout}'")
28
27
  self._appium_click_api(locator=locator, timeout=timeout, button="right", **kwargs)
29
28
 
30
- def appium_left_click(self, locator, timeout=20, **kwargs):
29
+ def appium_left_click(self, locator, timeout=None, **kwargs):
31
30
  self._info(f"Appium Left Click '{locator}', timeout '{timeout}'")
32
31
  self._appium_click_api(locator=locator, timeout=timeout, button="left", **kwargs)
33
32
 
34
- def appium_double_click(self, locator, timeout=20, **kwargs):
33
+ def appium_double_click(self, locator, timeout=None, **kwargs):
35
34
  self._info(f"Appium Double Click '{locator}', timeout '{timeout}'")
36
35
  self._appium_click_api(locator=locator, timeout=timeout, times=2, **kwargs)
37
36
 
38
- def appium_drag_and_drop(self, start_locator=None, end_locator=None, timeout=20, **kwargs):
37
+ def appium_drag_and_drop(self, start_locator=None, end_locator=None, timeout=None, **kwargs):
39
38
  self._info(f"Appium Drag And Drop '{start_locator} -> {end_locator}', timeout '{timeout}'")
40
39
  self._appium_drag_and_drop_api(start_locator=start_locator, end_locator=end_locator, timeout=timeout, **kwargs)
41
40
 
@@ -49,6 +48,10 @@ class _WindowsKeywords(KeywordGroup):
49
48
  def appium_sendkeys(self, text=None, **kwargs):
50
49
  self._info(f"Appium Sendkeys '{text}'")
51
50
  self._appium_keys_api(text=text, **kwargs)
51
+
52
+ # TODO: temporary add, will be removed in the future
53
+ def normalize_windows_path(self, path, sep="\\", case_normalize=False, escape_backtick=True):
54
+ return self.appium_normalize_path(path=path, sep=sep, case_normalize=case_normalize, escape_backtick=escape_backtick)
52
55
 
53
56
  def appium_normalize_path(self, path, sep="\\", case_normalize=False, escape_backtick=True):
54
57
  """Normalizes the given path.
@@ -160,7 +163,7 @@ class _WindowsKeywords(KeywordGroup):
160
163
 
161
164
  self._apply_modifier_keys(click_params, kwargs.get("modifierKeys"))
162
165
 
163
- def _action():
166
+ def func():
164
167
  elements = self._element_find(locator, False, False)
165
168
  if not elements:
166
169
  raise Exception(f"Element not found: {locator}")
@@ -181,7 +184,14 @@ class _WindowsKeywords(KeywordGroup):
181
184
  driver.execute_script("windows: click", click_params)
182
185
  time.sleep(0.5)
183
186
 
184
- self._retry(_action, timeout, f"Failed to perform click action on '{locator}'")
187
+ self._retry(
188
+ timeout,
189
+ func,
190
+ action=f"Failed to perform click action on '{locator}'",
191
+ required=kwargs.pop("required", True),
192
+ return_value=kwargs.pop("return_value", True),
193
+ poll_interval=kwargs.pop("poll_interval", None)
194
+ )
185
195
 
186
196
  def _appium_hover_api(self, start_locator, end_locator, timeout, **kwargs):
187
197
  """
@@ -197,13 +207,15 @@ class _WindowsKeywords(KeywordGroup):
197
207
 
198
208
  self._apply_modifier_keys(hover_params, kwargs.get("modifierKeys"))
199
209
 
200
- def _action():
210
+ def func():
201
211
  if start_locator:
202
212
  start_element = self._element_find(start_locator, True, False)
203
213
  if start_element:
204
214
  hover_params["startElementId"] = start_element.id
205
215
  hover_params.pop("startX", None)
206
216
  hover_params.pop("startY", None)
217
+ else:
218
+ raise Exception(f"Start element not found: {start_locator}")
207
219
 
208
220
  if end_locator:
209
221
  end_element = self._element_find(end_locator, True, False)
@@ -211,11 +223,20 @@ class _WindowsKeywords(KeywordGroup):
211
223
  hover_params["endElementId"] = end_element.id
212
224
  hover_params.pop("endX", None)
213
225
  hover_params.pop("endY", None)
226
+ else:
227
+ raise Exception(f"End element not found: {end_locator}")
214
228
 
215
229
  self._current_application().execute_script("windows: hover", hover_params)
216
230
  time.sleep(0.5)
217
231
 
218
- self._retry(_action, timeout, "Failed to perform hover action")
232
+ self._retry(
233
+ timeout,
234
+ func,
235
+ action="Failed to perform hover action",
236
+ required=kwargs.pop("required", True),
237
+ return_value=kwargs.pop("return_value", True),
238
+ poll_interval=kwargs.pop("poll_interval", None)
239
+ )
219
240
 
220
241
  def _appium_drag_and_drop_api(self, start_locator, end_locator, timeout, **kwargs):
221
242
  """
@@ -232,7 +253,7 @@ class _WindowsKeywords(KeywordGroup):
232
253
 
233
254
  self._apply_modifier_keys(drag_params, kwargs.get("modifierKeys"))
234
255
 
235
- def _action():
256
+ def func():
236
257
  if start_locator:
237
258
  start_element = self._element_find(start_locator, True, False)
238
259
  if start_element:
@@ -250,7 +271,14 @@ class _WindowsKeywords(KeywordGroup):
250
271
  self._current_application().execute_script("windows: clickAndDrag", drag_params)
251
272
  time.sleep(0.5)
252
273
 
253
- self._retry(_action, timeout, "Failed to perform drag and drop action")
274
+ self._retry(
275
+ timeout,
276
+ func,
277
+ action="Failed to perform drag and drop action",
278
+ required=kwargs.pop("required", True),
279
+ return_value=kwargs.pop("return_value", True),
280
+ poll_interval=kwargs.pop("poll_interval", None)
281
+ )
254
282
 
255
283
  def _appium_keys_api(self, text, **kwargs):
256
284
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: robotframework-appiumwindows
3
- Version: 0.1.3
3
+ Version: 0.1.5
4
4
  Summary: Robot Framework AppiumLibrary extension for Windows desktop automation using NovaWindows2 Driver instead of WinAppDriver.
5
5
  Author-email: Huy Nguyen <nguyenvanhuy0612@gmail.com>
6
6
  License: MIT
@@ -10,14 +10,14 @@ AppiumLibrary/keywords/_runonfailure.py,sha256=dsy0qAyvoRFbnLy1lZgwadnFrKoFRh8hw
10
10
  AppiumLibrary/keywords/_screenrecord.py,sha256=ND1BQXt14uXbnknCNU2l4Wzna5abIUGU1l8FHM6dqZs,6789
11
11
  AppiumLibrary/keywords/_screenshot.py,sha256=K5JJciCLOYbuSGzY5OErxL1Kc9tJX16GhqztdAzw32o,3747
12
12
  AppiumLibrary/keywords/_waiting.py,sha256=GvX2Yn88zX_1rrl-MEADgx62wXUm08m8E04fcDlSLls,6265
13
- AppiumLibrary/keywords/_windows.py,sha256=LNp6W-SuRsHXD3EUOXuB3GOz2zsogu-grhsBFCtUi4U,11502
13
+ AppiumLibrary/keywords/_windows.py,sha256=jqOnRA3bcVdEBT3nxXK_V1ozzNxrwX-YJaahylXx3Mw,12643
14
14
  AppiumLibrary/keywords/keywordgroup.py,sha256=nd7zhoqodlG4E7-smySMGbK6e1cV9AjI0FAxr4YncMc,2467
15
15
  AppiumLibrary/locators/__init__.py,sha256=XtTYoS3PKdGSjZIR7fvaaK-ExaOh8ZWW2dddNBL419c,102
16
16
  AppiumLibrary/locators/elementfinder.py,sha256=acwAJ2OJsN59yJ5201UH5GdRgWJIzEj5Cc-xCgHTJW8,10977
17
17
  AppiumLibrary/utils/__init__.py,sha256=kFiEGeyc2IJVA1nUx2DezPkkO7HWTDnoL__gW4nRRlw,1572
18
18
  AppiumLibrary/utils/applicationcache.py,sha256=YrRQgz-4d77hToib4ApBjFT5VohO65DMNiNVUr_PI_0,1523
19
- robotframework_appiumwindows-0.1.3.dist-info/licenses/LICENSE,sha256=0usw_6IO4DLz-QIR_RLmRq9n4JX_Yns3Ew6dO-2FQmc,1070
20
- robotframework_appiumwindows-0.1.3.dist-info/METADATA,sha256=Rm5Syhj0T3VRu8ghOOrnNu8HRpambc-84XONN46OCcQ,10256
21
- robotframework_appiumwindows-0.1.3.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
22
- robotframework_appiumwindows-0.1.3.dist-info/top_level.txt,sha256=2o2iQDagXnzsewODgcttx95vTzvaYaZB7q6KJB8sf-I,14
23
- robotframework_appiumwindows-0.1.3.dist-info/RECORD,,
19
+ robotframework_appiumwindows-0.1.5.dist-info/licenses/LICENSE,sha256=0usw_6IO4DLz-QIR_RLmRq9n4JX_Yns3Ew6dO-2FQmc,1070
20
+ robotframework_appiumwindows-0.1.5.dist-info/METADATA,sha256=N4ZMjw44NMiOobLzcPBimjY-YO0R7ERbRR41MzOP-HM,10256
21
+ robotframework_appiumwindows-0.1.5.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
22
+ robotframework_appiumwindows-0.1.5.dist-info/top_level.txt,sha256=2o2iQDagXnzsewODgcttx95vTzvaYaZB7q6KJB8sf-I,14
23
+ robotframework_appiumwindows-0.1.5.dist-info/RECORD,,