Appium-Python-Client 6.0.11__py3-none-any.whl → 6.1.0__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.
@@ -56,10 +56,13 @@ class AppiumConnection(RemoteConnection):
56
56
  This method will be used in sending a request method in this class.
57
57
  """
58
58
 
59
+ extra_headers = cls.extra_headers.copy()
59
60
  if parsed_url.path.endswith('/session'):
60
61
  # https://github.com/appium/appium-base-driver/pull/400
61
- cls.extra_headers[HEADER_IDEMOTENCY_KEY] = str(uuid.uuid4())
62
+ # Keep the per-request idempotency key local: sessions may be created concurrently.
63
+ extra_headers[HEADER_IDEMOTENCY_KEY] = str(uuid.uuid4())
62
64
  else:
63
- cls.extra_headers = _get_new_headers(HEADER_IDEMOTENCY_KEY, cls.extra_headers)
65
+ extra_headers = _get_new_headers(HEADER_IDEMOTENCY_KEY, extra_headers)
66
+ cls.extra_headers = extra_headers
64
67
 
65
- return {**super().get_remote_connection_headers(parsed_url, keep_alive=keep_alive), **cls.extra_headers}
68
+ return {**super().get_remote_connection_headers(parsed_url, keep_alive=keep_alive), **extra_headers}
@@ -19,7 +19,7 @@ from selenium.webdriver.common.actions import interaction
19
19
  from selenium.webdriver.common.actions.action_builder import ActionBuilder
20
20
  from selenium.webdriver.common.actions.mouse_button import MouseButton
21
21
  from selenium.webdriver.common.actions.pointer_input import PointerInput
22
- from typing_extensions import Self
22
+ from typing_extensions import Self, deprecated
23
23
 
24
24
  from appium.webdriver.webelement import WebElement
25
25
 
@@ -29,9 +29,14 @@ if TYPE_CHECKING:
29
29
 
30
30
 
31
31
  class ActionHelpers:
32
+ @deprecated('Please use W3C actions (ActionChains/ActionBuilder) or mobile: gesture extensions instead.')
32
33
  def scroll(self, origin_el: WebElement, destination_el: WebElement, duration: int | None = None) -> Self:
33
34
  """Scrolls from one element to another
34
35
 
36
+ .. deprecated::
37
+ Please use W3C actions (`ActionChains` / `ActionBuilder`) or driver-specific
38
+ `mobile:` gesture extensions instead.
39
+
35
40
  Args:
36
41
  origin_el: the element from which to begin scrolling (center of element)
37
42
  destination_el: the element to scroll to (center of element)
@@ -63,9 +68,14 @@ class ActionHelpers:
63
68
  actions.perform()
64
69
  return self
65
70
 
71
+ @deprecated('Please use W3C actions (ActionChains/ActionBuilder) or mobile: gesture extensions instead.')
66
72
  def drag_and_drop(self, origin_el: WebElement, destination_el: WebElement, pause: float | None = None) -> Self:
67
73
  """Drag the origin element to the destination element
68
74
 
75
+ .. deprecated::
76
+ Please use W3C actions (`ActionChains` / `ActionBuilder`) or driver-specific
77
+ `mobile:` gesture extensions instead.
78
+
69
79
  Args:
70
80
  origin_el: the element to drag
71
81
  destination_el: the element to drag to
@@ -84,10 +94,15 @@ class ActionHelpers:
84
94
  actions.perform()
85
95
  return self
86
96
 
97
+ @deprecated('Please use W3C actions (ActionChains/ActionBuilder) or mobile: gesture extensions instead.')
87
98
  def tap(self, positions: list[tuple[int, int]], duration: int | None = None) -> Self:
88
99
  """Taps on an particular place with up to five fingers, holding for a
89
100
  certain time
90
101
 
102
+ .. deprecated::
103
+ Please use W3C actions (`ActionChains` / `ActionBuilder`) or driver-specific
104
+ `mobile:` gesture extensions instead.
105
+
91
106
  Args:
92
107
  positions: an array of tuples representing the x/y coordinates of
93
108
  the fingers to tap. Length can be up to five.
@@ -132,9 +147,14 @@ class ActionHelpers:
132
147
  actions.perform()
133
148
  return self
134
149
 
150
+ @deprecated('Please use W3C actions (ActionChains/ActionBuilder) or mobile: gesture extensions instead.')
135
151
  def swipe(self, start_x: int, start_y: int, end_x: int, end_y: int, duration: int = 0) -> Self:
136
152
  """Swipe from one point to another point, for an optional duration.
137
153
 
154
+ .. deprecated::
155
+ Please use W3C actions (`ActionChains` / `ActionBuilder`) or driver-specific
156
+ `mobile:` gesture extensions instead.
157
+
138
158
  Args:
139
159
  start_x: x-coordinate at which to start
140
160
  start_y: y-coordinate at which to start
@@ -161,9 +181,14 @@ class ActionHelpers:
161
181
  actions.perform()
162
182
  return self
163
183
 
184
+ @deprecated('Please use W3C actions (ActionChains/ActionBuilder) or mobile: gesture extensions instead.')
164
185
  def flick(self, start_x: int, start_y: int, end_x: int, end_y: int) -> Self:
165
186
  """Flick from one point to another point.
166
187
 
188
+ .. deprecated::
189
+ Please use W3C actions (`ActionChains` / `ActionBuilder`) or driver-specific
190
+ `mobile:` gesture extensions instead.
191
+
167
192
  Args:
168
193
  start_x: x-coordinate at which to start
169
194
  start_y: y-coordinate at which to start
@@ -20,8 +20,19 @@ from ..mobilecommand import MobileCommand as Command
20
20
 
21
21
 
22
22
  class ExecuteDriver(CanExecuteCommands):
23
- # TODO Inner class case
24
- def execute_driver(self, script: str, script_type: str = 'webdriverio', timeout_ms: int | None = None) -> Any:
23
+ class Result:
24
+ """The result of ``execute_driver``, containing ``result`` and ``logs``."""
25
+
26
+ result: Any
27
+ logs: dict[str, list[Any]]
28
+
29
+ def __init__(self, res: dict[str, Any]) -> None:
30
+ self.result = res['result']
31
+ self.logs = res['logs']
32
+
33
+ def execute_driver(
34
+ self, script: str, script_type: str = 'webdriverio', timeout_ms: int | None = None
35
+ ) -> 'ExecuteDriver.Result':
25
36
  """Run a set of script against the current session, allowing execution of many commands in one Appium request.
26
37
  Please read http://appium.io/docs/en/commands/session/execute-driver for more details about the acceptable
27
38
  scripts and the output format.
@@ -43,18 +54,12 @@ class ExecuteDriver(CanExecuteCommands):
43
54
  Raises:
44
55
  WebDriverException: If something error happens in the script. The message has the original error message.
45
56
  """
46
-
47
- class Result:
48
- def __init__(self, res: dict):
49
- self.result = res['result']
50
- self.logs = res['logs']
51
-
52
57
  option: dict[str, str | int] = {'script': script, 'type': script_type}
53
58
  if timeout_ms is not None:
54
59
  option['timeout'] = timeout_ms
55
60
 
56
61
  response = self.execute(Command.EXECUTE_DRIVER, option)['value']
57
- return Result(response)
62
+ return ExecuteDriver.Result(response)
58
63
 
59
64
  def _add_commands(self) -> None:
60
65
  self.command_executor.add_command(Command.EXECUTE_DRIVER, 'POST', '/session/$sessionId/appium/execute_driver')
@@ -188,10 +188,12 @@ class ScreenRecord(CanExecuteCommands):
188
188
  headers (dict): [multipart/form-data requests] Headers mapping (Since Appium 1.18.0)
189
189
 
190
190
  Usage:
191
- payload = driver.stop_recording_screen()
192
- with open('media.mp4', "wb") as fd:
193
- import base64
194
- fd.write(base64.b64decode(payload))
191
+ .. code-block:: python
192
+
193
+ payload = driver.stop_recording_screen()
194
+ with open('media.mp4', "wb") as fd:
195
+ import base64
196
+ fd.write(base64.b64decode(payload))
195
197
 
196
198
  Returns:
197
199
  bytes: Base-64 encoded content of the recorded media file or an empty string
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: Appium-Python-Client
3
- Version: 6.0.11
3
+ Version: 6.1.0
4
4
  Summary: Python client for Appium
5
5
  Project-URL: Homepage, https://appium.io/
6
6
  Project-URL: Repository, https://github.com/appium/python-client
@@ -152,10 +152,12 @@ For example, some changes in the Selenium binding could break the Appium client.
152
152
  - `MultiAction` and `TouchAction` are deprecated. Please use W3C WebDriver actions or `mobile:` extensions
153
153
  - `launch_app`, `close_app`, and `reset` are deprecated. Please read [issues#15807](https://github.com/appium/appium/issues/15807) for more details
154
154
 
155
- #### MultiAction/TouchAction to W3C actions
155
+ #### MultiAction/TouchAction and ActionHelpers Shortcuts to W3C Actions
156
+
157
+ The interaction shortcut methods on `ActionHelpers` (`scroll`, `drag_and_drop`, `tap`, `swipe`, and `flick`) are deprecated because gesture behavior varies across drivers and pointer types (for example, Android UiAutomator2 handles `POINTER_TOUCH` and `POINTER_MOUSE` inputs differently in the underlying UIAutomator framework). Build W3C WebDriver actions directly with `ActionChains` / `ActionBuilder` instead.
156
158
 
157
159
  Some elements can be handled with `touch` pointer action instead of the default `mouse` pointer action in the Selenium Python client.
158
- For example, the below action builder is to replace the default one with the `touch` pointer action.
160
+ For example, the below action builder is to replace the default one with the `touch` pointer action:
159
161
 
160
162
  ```python
161
163
  from selenium.webdriver import ActionChains
@@ -164,7 +166,7 @@ from selenium.webdriver.common.actions.action_builder import ActionBuilder
164
166
  from selenium.webdriver.common.actions.pointer_input import PointerInput
165
167
 
166
168
  actions = ActionChains(driver)
167
- # override as 'touch' pointer action
169
+ # override as 'touch' pointer action (or use interaction.POINTER_MOUSE for mouse input)
168
170
  actions.w3c_actions = ActionBuilder(driver, mouse=PointerInput(interaction.POINTER_TOUCH, 'touch'))
169
171
  actions.w3c_actions.pointer_action.move_to_location(start_x, start_y)
170
172
  actions.w3c_actions.pointer_action.pointer_down()
@@ -271,7 +271,7 @@ appium/protocols/webdriver/can_execute_commands.py,sha256=l6Wq-yL-hzCek9djetnrfp
271
271
  appium/protocols/webdriver/can_execute_scripts.py,sha256=dMRDjreiyV3IJp7-NRUx1TjouOu34mLUa9N6qZPq3b0,962
272
272
  appium/protocols/webdriver/can_find_elements.py,sha256=glM-Qpe-_KyLhZmojl6aa82B3xhEzRpJPyVQHhtOP8Q,1492
273
273
  appium/webdriver/__init__.py,sha256=oT-lIYWpqD562rbXy36HlS03pKfW48BIxqZsqt1XEm0,730
274
- appium/webdriver/appium_connection.py,sha256=S-CodDwQWjT-lNwyHSsGtdb4GFHxTM9BXGoOyWdMI94,2405
274
+ appium/webdriver/appium_connection.py,sha256=qh6LowDI9_6gwPxy50LGD96YTqKwa0ODGM1RUGOSpks,2580
275
275
  appium/webdriver/appium_service.py,sha256=lMfbkiHQIccpqy0_kG7qtO1BbTljIJq8aYTcOQ0ErPY,12172
276
276
  appium/webdriver/applicationstate.py,sha256=zUPaMt4o4mdAtWP6FapYLJju_tqO6FmMcYFpbFz83dM,735
277
277
  appium/webdriver/client_config.py,sha256=iuVcGsBF9eGNsF_gzs8b6vZWS0iI1u7actaBGBwNrqY,1631
@@ -287,12 +287,12 @@ appium/webdriver/webelement.py,sha256=ewBkxaZiJtmhRoKjQk317WjewansQ6tpm3JePSv1pQ
287
287
  appium/webdriver/common/__init__.py,sha256=4MapoJ3p5LiP0AsHMgL2xoPTIFno4dcH1GSoxaZzv4w,623
288
288
  appium/webdriver/common/appiumby.py,sha256=1sFzgJht8v9pO0fG-uK1jgbb8zMJwfBy3LJH15OPqq8,1785
289
289
  appium/webdriver/extensions/__init__.py,sha256=wSUl6yC2TJNla7xbHXkCfn9J1LpQs9UIx8oOs6V8kZA,567
290
- appium/webdriver/extensions/action_helpers.py,sha256=LPpEia81XoMMt6ENdP8hvY1WOoy7ST5tzN1NuzQQv-g,8006
290
+ appium/webdriver/extensions/action_helpers.py,sha256=yK_SDJCl-PeepC3C-zXJnfCLkcFwRz3NB_SH4JicFTw,9388
291
291
  appium/webdriver/extensions/applications.py,sha256=KnRD9-JilgYtBuy8dik2iGI5GeS2RPQws2BSdKL9HDo,6575
292
292
  appium/webdriver/extensions/clipboard.py,sha256=G0qvK5I5DP87IR8A5ICMC-_mtEPktSCOPKif-RZwX2M,3470
293
293
  appium/webdriver/extensions/context.py,sha256=Ldhyld4n_JRu9YhgnIOtF-qZQYsXlYrjdYHStcIV2jA,1994
294
294
  appium/webdriver/extensions/device_time.py,sha256=CRponsom_3wAEFuxVa6_zUa7BoFkmGCSIeWzCrPTV1g,2009
295
- appium/webdriver/extensions/execute_driver.py,sha256=vyd8TuLQ2FNKRuSkDnKdGAsjPL4iticaSVFCt3Qg-hI,2583
295
+ appium/webdriver/extensions/execute_driver.py,sha256=UDI3ppN3oEHWgKIRzEhnUMjcjiMo6xWZCaf4MeNPSZw,2744
296
296
  appium/webdriver/extensions/execute_mobile_command.py,sha256=a0zxwCTLnrP7ozitzFh0dvXBl2CX3PqLmXRXsLNuWY0,2358
297
297
  appium/webdriver/extensions/hw_actions.py,sha256=BCcYzbEW7PbEhf5IPD7Tvr-44sfHfElk_ffi4EhsYF0,4192
298
298
  appium/webdriver/extensions/images_comparison.py,sha256=cNdJHn2NFyp9dkFslNLrT4ZRkkKwpELtfrZ0QKXynlU,7674
@@ -301,7 +301,7 @@ appium/webdriver/extensions/location.py,sha256=id6qK3ufhrpsvcFPLNQU0Mx0yXl7Wvth3
301
301
  appium/webdriver/extensions/log_event.py,sha256=zF5XoNHSaqFjbGd1bw7gTm-bNOiafTYMgzDJMH2kDj4,2423
302
302
  appium/webdriver/extensions/logs.py,sha256=Wlc-aG3arxnVKvjsTAoxU_lHiiPeqe8rdJP3QUEt2mY,1828
303
303
  appium/webdriver/extensions/remote_fs.py,sha256=KVYzLpgx7ZIjhRnVmBRPxz4jgSgUqqGrhfx9XBaL31k,3402
304
- appium/webdriver/extensions/screen_record.py,sha256=ufNpyKJrtvgE9DEbNUMbAlaE9ejF0yECsTK3dw1Doqk,13245
304
+ appium/webdriver/extensions/screen_record.py,sha256=YfdlEtOC_FHtT1B0vXN-MpJQGm2xFvqNlxk2SzKi4HM,13297
305
305
  appium/webdriver/extensions/session.py,sha256=P3NSXeIgWHeKK9GDEzkGERIqnIseZDcWUTyAucRpqOg,1414
306
306
  appium/webdriver/extensions/settings.py,sha256=WaGFYJ91YK_t9cQJeotxHzp5yYQR7HKoC0DH5Z0VQVs,1921
307
307
  appium/webdriver/extensions/android/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -319,7 +319,7 @@ appium/webdriver/extensions/flutter_integration/__init__.py,sha256=wSUl6yC2TJNla
319
319
  appium/webdriver/extensions/flutter_integration/flutter_commands.py,sha256=FwNqIykRyMAU8-344GTlceBOxLbS-bA9bfGX4iJpHxw,11985
320
320
  appium/webdriver/extensions/flutter_integration/flutter_finder.py,sha256=HH9vGAouJuHzp29Jam_lQGrh67PDq6MxU5Ifewf7C5w,2164
321
321
  appium/webdriver/extensions/flutter_integration/scroll_directions.py,sha256=CkOv7k21SMe-h2-EYSZ6MBKBGTRC1csQ-tuowHgMn0E,85
322
- appium_python_client-6.0.11.dist-info/METADATA,sha256=iUBcndrEVFUXXuJo138Lg1E8RN4oxkKwcXHnkK3_Wn0,21274
323
- appium_python_client-6.0.11.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
324
- appium_python_client-6.0.11.dist-info/licenses/LICENSE,sha256=QxeKfXNmPWCfFyrXiwdVzMFPFMK0nlBrKhYLUoIcqhk,11384
325
- appium_python_client-6.0.11.dist-info/RECORD,,
322
+ appium_python_client-6.1.0.dist-info/METADATA,sha256=lnYvisOqH_pImigF_8hYtOb-kSMOLzqzSnpE2k7oLS4,21766
323
+ appium_python_client-6.1.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
324
+ appium_python_client-6.1.0.dist-info/licenses/LICENSE,sha256=QxeKfXNmPWCfFyrXiwdVzMFPFMK0nlBrKhYLUoIcqhk,11384
325
+ appium_python_client-6.1.0.dist-info/RECORD,,