Appium-Python-Client 6.1.5__py3-none-any.whl → 6.1.6__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.
@@ -28,7 +28,7 @@ from selenium.webdriver.remote.remote_connection import RemoteConnection
28
28
  from selenium.webdriver.remote.webdriver import WebDriver as Remote
29
29
 
30
30
  from appium.common.logger import logger
31
- from appium.options.common.base import AppiumOptions
31
+ from appium.options.common.base import APPIUM_PREFIX, AppiumOptions
32
32
 
33
33
  from .appium_connection import AppiumConnection
34
34
  from .client_config import AppiumClientConfig
@@ -213,6 +213,14 @@ def _get_remote_connection_and_client_config(
213
213
  return (AppiumConnection(client_config=new_client_config), new_client_config)
214
214
 
215
215
 
216
+ def _get_direct_connect_value(caps: dict[str, Any], key: str) -> Any:
217
+ for candidate in (f'{APPIUM_PREFIX}{key}', key):
218
+ value = caps.get(candidate)
219
+ if value is not None and value != '':
220
+ return value
221
+ return None
222
+
223
+
216
224
  class WebDriver(
217
225
  Remote,
218
226
  ActionHelpers,
@@ -273,8 +281,9 @@ class WebDriver(
273
281
 
274
282
  self.error_handler = MobileErrorHandler()
275
283
 
276
- if client_config and client_config.direct_connection:
277
- self._update_command_executor(keep_alive=client_config.keep_alive)
284
+ effective_client_config = client_config or getattr(self.command_executor, 'client_config', None)
285
+ if isinstance(effective_client_config, AppiumClientConfig) and effective_client_config.direct_connection:
286
+ self._update_command_executor(keep_alive=effective_client_config.keep_alive)
278
287
 
279
288
  self._absent_extensions: set[str] = set()
280
289
 
@@ -316,15 +325,16 @@ class WebDriver(
316
325
  if not self.caps:
317
326
  raise ValueError('Driver capabilities must be defined')
318
327
  keys = (direct_protocol, direct_host, direct_port, direct_path)
319
- if not set(keys).issubset(self.caps):
320
- details = ' '.join(f"{key}: '{self.caps.get(key, '')}'" for key in keys)
328
+ values = {key: _get_direct_connect_value(self.caps, key) for key in keys}
329
+ if any(val is None for val in values.values()):
330
+ details = ' '.join(f"{key}: '{values[key] if values[key] is not None else ''}'" for key in keys)
321
331
  logger.debug(f'Direct connect capabilities from server were:\n{details} ')
322
332
  return
323
333
 
324
- protocol = self.caps[direct_protocol]
325
- hostname = self.caps[direct_host]
326
- port = self.caps[direct_port]
327
- path = self.caps[direct_path]
334
+ protocol = values[direct_protocol]
335
+ hostname = values[direct_host]
336
+ port = values[direct_port]
337
+ path = values[direct_path]
328
338
  executor = f'{protocol}://{hostname}:{port}{path}'
329
339
 
330
340
  logger.debug('Updated request endpoint to %s', executor)
@@ -338,7 +348,7 @@ class WebDriver(
338
348
  client_config.remote_server_addr = executor
339
349
  client_config.keep_alive = keep_alive
340
350
  if isinstance(self.command_executor, AppiumConnection):
341
- self.command_executor = AppiumConnection(client_config=client_config)
351
+ self.command_executor = type(self.command_executor)(client_config=client_config)
342
352
  else:
343
353
  self.command_executor = RemoteConnection(client_config=client_config)
344
354
  self._add_commands()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: Appium-Python-Client
3
- Version: 6.1.5
3
+ Version: 6.1.6
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
@@ -319,12 +319,12 @@ any | `appium.options.common.base.AppiumOptions`
319
319
 
320
320
  ## Direct Connect URLs
321
321
 
322
- If your Selenium/Appium server decorates the new session capabilities response with the following keys:
322
+ If your Selenium/Appium server decorates the new session capabilities response with the following keys (with or without the `appium:` prefix):
323
323
 
324
- - `directConnectProtocol`
325
- - `directConnectHost`
326
- - `directConnectPort`
327
- - `directConnectPath`
324
+ - `directConnectProtocol` (`appium:directConnectProtocol`)
325
+ - `directConnectHost` (`appium:directConnectHost`)
326
+ - `directConnectPort` (`appium:directConnectPort`)
327
+ - `directConnectPath` (`appium:directConnectPath`)
328
328
 
329
329
  Then python client will switch its endpoint to the one specified by the values of those keys.
330
330
 
@@ -282,7 +282,7 @@ appium/webdriver/errorhandler.py,sha256=_aT6Qo64ARGch7evG2Uku4-l8wkDaM1R2o06PWXx
282
282
  appium/webdriver/locator_converter.py,sha256=uUdJsX1o0E8x-StcJvO5gFFJbcRzhOmySfgPqJ0UaU4,999
283
283
  appium/webdriver/mobilecommand.py,sha256=B_okscraJMPrN4hSyetSNddkOZ0PyTzsQvBdYHHQqvM,3162
284
284
  appium/webdriver/switch_to.py,sha256=px12JwzTXngGWJiOfKXKaIc_QOoB1144Dv2U19jebSo,1386
285
- appium/webdriver/webdriver.py,sha256=nCvoilLFtAwa2fkd4lTSXF8iTSu-kyqvv0iVaimJ3dg,19391
285
+ appium/webdriver/webdriver.py,sha256=TOU7WYEyXSYJWwraIC4_L3-W79Paen9GGrWYYWtJrIA,19936
286
286
  appium/webdriver/webelement.py,sha256=P7ev_K9DwmMJ8oS6u4TpLi7R5xFcsSE8dmu2ICfrvJA,4472
287
287
  appium/webdriver/common/__init__.py,sha256=4MapoJ3p5LiP0AsHMgL2xoPTIFno4dcH1GSoxaZzv4w,623
288
288
  appium/webdriver/common/appiumby.py,sha256=cO3RpM41ht9kPzgLFvKwBLhVv832WjOsnuP0vEqvAeY,1896
@@ -319,7 +319,7 @@ appium/webdriver/extensions/flutter_integration/__init__.py,sha256=wSUl6yC2TJNla
319
319
  appium/webdriver/extensions/flutter_integration/flutter_commands.py,sha256=1bAczDwqr40Rrbln321cIVG83ghar7-27aerRAKbfMs,12306
320
320
  appium/webdriver/extensions/flutter_integration/flutter_finder.py,sha256=fq3ORd4-PGUurJn0xLUMfqg7P9sE-Syv353brgcyGfM,2039
321
321
  appium/webdriver/extensions/flutter_integration/scroll_directions.py,sha256=y1BCEbWHJ86ivj5quhln10uwV9fWsA6nsdQ18j1Ua3E,123
322
- appium_python_client-6.1.5.dist-info/METADATA,sha256=C_0pvNsjg5rDdkjsLqlKI2Wf9Q0M2tumihizQrADM-c,22042
323
- appium_python_client-6.1.5.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
324
- appium_python_client-6.1.5.dist-info/licenses/LICENSE,sha256=QxeKfXNmPWCfFyrXiwdVzMFPFMK0nlBrKhYLUoIcqhk,11384
325
- appium_python_client-6.1.5.dist-info/RECORD,,
322
+ appium_python_client-6.1.6.dist-info/METADATA,sha256=C3lWw-UC-gCA02DZjO60AgEb-4vyeQIuoU2DSDhT_rU,22201
323
+ appium_python_client-6.1.6.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
324
+ appium_python_client-6.1.6.dist-info/licenses/LICENSE,sha256=QxeKfXNmPWCfFyrXiwdVzMFPFMK0nlBrKhYLUoIcqhk,11384
325
+ appium_python_client-6.1.6.dist-info/RECORD,,