Appium-Python-Client 6.0.5__py3-none-any.whl → 6.0.7__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.
@@ -248,6 +248,12 @@ class WebDriver(
248
248
  options: AppiumOptions | list[AppiumOptions] | None = None,
249
249
  client_config: AppiumClientConfig | None = None,
250
250
  ):
251
+ if isinstance(options, list):
252
+ # Normalize before Selenium separates common and alternative capabilities.
253
+ options = [
254
+ AppiumOptions().load_capabilities(AppiumOptions.as_w3c(option.to_capabilities())['capabilities']['alwaysMatch'])
255
+ for option in options
256
+ ]
251
257
  command_executor, client_config = _get_remote_connection_and_client_config(
252
258
  command_executor=command_executor, client_config=client_config
253
259
  )
@@ -308,11 +314,10 @@ class WebDriver(
308
314
 
309
315
  if not self.caps:
310
316
  raise ValueError('Driver capabilities must be defined')
311
- if not {direct_protocol, direct_host, direct_port, direct_path}.issubset(set(self.caps)):
312
- message = 'Direct connect capabilities from server were:\n'
313
- for key in [direct_protocol, direct_host, direct_port, direct_path]:
314
- message += f"{key}: '{self.caps.get(key, '')}' "
315
- logger.debug(message)
317
+ keys = (direct_protocol, direct_host, direct_port, direct_path)
318
+ if not set(keys).issubset(self.caps):
319
+ details = ' '.join(f"{key}: '{self.caps.get(key, '')}'" for key in keys)
320
+ logger.debug(f'Direct connect capabilities from server were:\n{details} ')
316
321
  return
317
322
 
318
323
  protocol = self.caps[direct_protocol]
@@ -352,7 +357,17 @@ class WebDriver(
352
357
  if not isinstance(capabilities, (dict, AppiumOptions)):
353
358
  raise InvalidArgumentException('Capabilities must be a dictionary or AppiumOptions instance')
354
359
 
355
- w3c_caps = AppiumOptions.as_w3c(capabilities) if isinstance(capabilities, dict) else capabilities.to_w3c()
360
+ if isinstance(capabilities, AppiumOptions):
361
+ w3c_caps = capabilities.to_w3c()
362
+ elif (
363
+ set(capabilities) == {'capabilities'}
364
+ and isinstance(capabilities['capabilities'], dict)
365
+ and {'alwaysMatch', 'firstMatch'}.issubset(capabilities['capabilities'])
366
+ ):
367
+ # Selenium already creates the W3C envelope when given a list of options.
368
+ w3c_caps = copy.deepcopy(capabilities)
369
+ else:
370
+ w3c_caps = AppiumOptions.as_w3c(capabilities)
356
371
  response = self.execute(RemoteCommand.NEW_SESSION, w3c_caps)
357
372
  # https://w3c.github.io/webdriver/#new-session
358
373
  if not isinstance(response, dict):
@@ -443,7 +458,7 @@ class WebDriver(
443
458
  """
444
459
  allowed_values = ['LANDSCAPE', 'PORTRAIT']
445
460
  if value.upper() in allowed_values:
446
- self.execute(Command.SET_SCREEN_ORIENTATION, {'orientation': value})
461
+ self.execute(Command.SET_SCREEN_ORIENTATION, {'orientation': value.upper()})
447
462
  else:
448
463
  raise WebDriverException("You can only set the orientation to 'LANDSCAPE' and 'PORTRAIT'")
449
464
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: Appium-Python-Client
3
- Version: 6.0.5
3
+ Version: 6.0.7
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
@@ -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=kom9MHNOdZuEG0ALDuaw27NHvtsRDnl-sy_XNAd-Rl4,1174
285
- appium/webdriver/webdriver.py,sha256=RzBoHK5Yp0pPCYTmmY1HOfnTuhdWSubOI9fgWk_9680,18621
285
+ appium/webdriver/webdriver.py,sha256=hrtnGonxC9heAgd1Kf1B25IlFOW9N9gKcEC9VLX0rCs,19314
286
286
  appium/webdriver/webelement.py,sha256=U3B2clH3lXHN_cPahNEAIsIaFWJwvrizWYTpQjnSay4,4417
287
287
  appium/webdriver/common/__init__.py,sha256=4MapoJ3p5LiP0AsHMgL2xoPTIFno4dcH1GSoxaZzv4w,623
288
288
  appium/webdriver/common/appiumby.py,sha256=1sFzgJht8v9pO0fG-uK1jgbb8zMJwfBy3LJH15OPqq8,1785
@@ -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.5.dist-info/METADATA,sha256=xvkoIMy_LiReV0DXPw861IN5BbUcz2sSJeD9b940T5g,21194
323
- appium_python_client-6.0.5.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
324
- appium_python_client-6.0.5.dist-info/licenses/LICENSE,sha256=QxeKfXNmPWCfFyrXiwdVzMFPFMK0nlBrKhYLUoIcqhk,11384
325
- appium_python_client-6.0.5.dist-info/RECORD,,
322
+ appium_python_client-6.0.7.dist-info/METADATA,sha256=KjhRvFWdmfmYfic5_Tujn131PvmJ9Cg3gBVeuP4cSgA,21194
323
+ appium_python_client-6.0.7.dist-info/WHEEL,sha256=THafob7ofN-NsuMN7Mg4qZyHaQI7KkD-QlcQatYhXPo,87
324
+ appium_python_client-6.0.7.dist-info/licenses/LICENSE,sha256=QxeKfXNmPWCfFyrXiwdVzMFPFMK0nlBrKhYLUoIcqhk,11384
325
+ appium_python_client-6.0.7.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.32.0
2
+ Generator: hatchling 1.32.3
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any