robotframework-appiumwindows 0.1.4__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
 
@@ -164,7 +163,7 @@ class _WindowsKeywords(KeywordGroup):
164
163
 
165
164
  self._apply_modifier_keys(click_params, kwargs.get("modifierKeys"))
166
165
 
167
- def _action():
166
+ def func():
168
167
  elements = self._element_find(locator, False, False)
169
168
  if not elements:
170
169
  raise Exception(f"Element not found: {locator}")
@@ -185,7 +184,14 @@ class _WindowsKeywords(KeywordGroup):
185
184
  driver.execute_script("windows: click", click_params)
186
185
  time.sleep(0.5)
187
186
 
188
- 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
+ )
189
195
 
190
196
  def _appium_hover_api(self, start_locator, end_locator, timeout, **kwargs):
191
197
  """
@@ -201,13 +207,15 @@ class _WindowsKeywords(KeywordGroup):
201
207
 
202
208
  self._apply_modifier_keys(hover_params, kwargs.get("modifierKeys"))
203
209
 
204
- def _action():
210
+ def func():
205
211
  if start_locator:
206
212
  start_element = self._element_find(start_locator, True, False)
207
213
  if start_element:
208
214
  hover_params["startElementId"] = start_element.id
209
215
  hover_params.pop("startX", None)
210
216
  hover_params.pop("startY", None)
217
+ else:
218
+ raise Exception(f"Start element not found: {start_locator}")
211
219
 
212
220
  if end_locator:
213
221
  end_element = self._element_find(end_locator, True, False)
@@ -215,11 +223,20 @@ class _WindowsKeywords(KeywordGroup):
215
223
  hover_params["endElementId"] = end_element.id
216
224
  hover_params.pop("endX", None)
217
225
  hover_params.pop("endY", None)
226
+ else:
227
+ raise Exception(f"End element not found: {end_locator}")
218
228
 
219
229
  self._current_application().execute_script("windows: hover", hover_params)
220
230
  time.sleep(0.5)
221
231
 
222
- 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
+ )
223
240
 
224
241
  def _appium_drag_and_drop_api(self, start_locator, end_locator, timeout, **kwargs):
225
242
  """
@@ -236,7 +253,7 @@ class _WindowsKeywords(KeywordGroup):
236
253
 
237
254
  self._apply_modifier_keys(drag_params, kwargs.get("modifierKeys"))
238
255
 
239
- def _action():
256
+ def func():
240
257
  if start_locator:
241
258
  start_element = self._element_find(start_locator, True, False)
242
259
  if start_element:
@@ -254,7 +271,14 @@ class _WindowsKeywords(KeywordGroup):
254
271
  self._current_application().execute_script("windows: clickAndDrag", drag_params)
255
272
  time.sleep(0.5)
256
273
 
257
- 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
+ )
258
282
 
259
283
  def _appium_keys_api(self, text, **kwargs):
260
284
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: robotframework-appiumwindows
3
- Version: 0.1.4
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=wxlZhU5xJm_Y0j8Rv0qYVP_UnHpcLetPZSeK_f74ZZA,11788
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.4.dist-info/licenses/LICENSE,sha256=0usw_6IO4DLz-QIR_RLmRq9n4JX_Yns3Ew6dO-2FQmc,1070
20
- robotframework_appiumwindows-0.1.4.dist-info/METADATA,sha256=KhKi9I648go1eRtQc-PBgAihtNCOHScpV7vwwrK-Y8U,10256
21
- robotframework_appiumwindows-0.1.4.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
22
- robotframework_appiumwindows-0.1.4.dist-info/top_level.txt,sha256=2o2iQDagXnzsewODgcttx95vTzvaYaZB7q6KJB8sf-I,14
23
- robotframework_appiumwindows-0.1.4.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,,