Appium-Python-Client 6.0.10__py3-none-any.whl → 6.0.12__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.
@@ -31,7 +31,8 @@ class FlutterElementWaitTimeOutOption(SupportsCapabilities):
31
31
  Returns:
32
32
  Optional[timedelta]: The timeout value as a `timedelta` object if set, or `None` if the timeout is not defined.
33
33
  """
34
- return self.get_capability(FLUTTER_ELEMENT_WAIT_TIMEOUT)
34
+ value = self.get_capability(FLUTTER_ELEMENT_WAIT_TIMEOUT)
35
+ return None if value is None else timedelta(milliseconds=value)
35
36
 
36
37
  @flutter_element_wait_timeout.setter
37
38
  def flutter_element_wait_timeout(self, value: timedelta | int) -> None:
@@ -32,7 +32,8 @@ class FlutterServerLaunchTimeOutOption(SupportsCapabilities):
32
32
  Optional[timedelta]: The timeout value as a `timedelta` object if set, or `None` if the timeout is not defined.
33
33
 
34
34
  """
35
- return self.get_capability(FLUTTER_SERVER_LAUNCH_TIMEOUT)
35
+ value = self.get_capability(FLUTTER_SERVER_LAUNCH_TIMEOUT)
36
+ return None if value is None else timedelta(milliseconds=value)
36
37
 
37
38
  @flutter_server_launch_timeout.setter
38
39
  def flutter_server_launch_timeout(self, value: timedelta | int) -> None:
@@ -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}
@@ -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.10
3
+ Version: 6.0.12
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
@@ -132,9 +132,9 @@ appium/options/common/system_port_option.py,sha256=hUiFktmdtFxRpToGGEOkah3XVlNE_
132
132
  appium/options/common/udid_option.py,sha256=Xz0cH4ilprI3YOuzxBiabJBZGHVkW2vCIpeRfb7ggsQ,1254
133
133
  appium/options/flutter_integration/__init__.py,sha256=eqWlzN3nUXDUVEplsdG2HtNTyv8kmmRniqcUkGkYxbc,631
134
134
  appium/options/flutter_integration/base.py,sha256=KkP23ROyLjUwjA05m9ppZVgjOGKMJ0U4N1sUoyskqOI,1677
135
- appium/options/flutter_integration/flutter_element_wait_timeout_option.py,sha256=QEYeEMoCw_d2fPZiE1u4lCxGmhc_6gBUEt2BkDO9DSc,2061
135
+ appium/options/flutter_integration/flutter_element_wait_timeout_option.py,sha256=ru0TXubYFeO-9AVts-DqlMBRrVBSYDCfE1VcLJwBS8s,2134
136
136
  appium/options/flutter_integration/flutter_enable_mock_camera_option.py,sha256=UhHPj9W-bgh4JpNtknf2_R-2ZHIfR2CNPfgqWnkCGQU,1757
137
- appium/options/flutter_integration/flutter_server_launch_timeout_option.py,sha256=qCRooCzjzIcV_G5s1TN2CAGOoshFMurt3xWMYGKRCUE,2084
137
+ appium/options/flutter_integration/flutter_server_launch_timeout_option.py,sha256=tIGjsOB5ocw0UV9sxtH6XLWseHzE0Pt_azbVBle8dqQ,2157
138
138
  appium/options/flutter_integration/flutter_system_port_option.py,sha256=km-2pBeiGm8pe5GoAUE1oddh2gXrom_cTGmUcvPJ6Bg,1623
139
139
  appium/options/gecko/__init__.py,sha256=ZAfwH3xL8QAI1iWWBvtStDGW07xa4Ems0dlvyYngrYc,59
140
140
  appium/options/gecko/android_storage_option.py,sha256=OZqwQwyYovV83Bd6wFWvOPGI-yxQ49L-35a19vCHTWw,1427
@@ -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
@@ -292,7 +292,7 @@ appium/webdriver/extensions/applications.py,sha256=KnRD9-JilgYtBuy8dik2iGI5GeS2R
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.10.dist-info/METADATA,sha256=DyIvFybuG5i_Ta8IvuQwr9Ayam55U59eehJzVABi4kI,21274
323
- appium_python_client-6.0.10.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
324
- appium_python_client-6.0.10.dist-info/licenses/LICENSE,sha256=QxeKfXNmPWCfFyrXiwdVzMFPFMK0nlBrKhYLUoIcqhk,11384
325
- appium_python_client-6.0.10.dist-info/RECORD,,
322
+ appium_python_client-6.0.12.dist-info/METADATA,sha256=4-B6Vfcd_WKqdqJytd1zySO73Oukatozsdyd3dPEKww,21274
323
+ appium_python_client-6.0.12.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
324
+ appium_python_client-6.0.12.dist-info/licenses/LICENSE,sha256=QxeKfXNmPWCfFyrXiwdVzMFPFMK0nlBrKhYLUoIcqhk,11384
325
+ appium_python_client-6.0.12.dist-info/RECORD,,