Appium-Python-Client 5.2.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.
Files changed (324) hide show
  1. appium/__init__.py +17 -0
  2. appium/common/__init__.py +17 -0
  3. appium/common/exceptions.py +26 -0
  4. appium/common/helper.py +42 -0
  5. appium/common/logger.py +28 -0
  6. appium/options/__init__.py +0 -0
  7. appium/options/android/__init__.py +2 -0
  8. appium/options/android/common/__init__.py +0 -0
  9. appium/options/android/common/adb/__init__.py +0 -0
  10. appium/options/android/common/adb/adb_exec_timeout_option.py +41 -0
  11. appium/options/android/common/adb/adb_port_option.py +38 -0
  12. appium/options/android/common/adb/allow_delay_adb_option.py +39 -0
  13. appium/options/android/common/adb/build_tools_version_option.py +42 -0
  14. appium/options/android/common/adb/clear_device_logs_on_start_option.py +40 -0
  15. appium/options/android/common/adb/ignore_hidden_api_policy_error_option.py +40 -0
  16. appium/options/android/common/adb/logcat_filter_specs_option.py +42 -0
  17. appium/options/android/common/adb/logcat_format_option.py +39 -0
  18. appium/options/android/common/adb/mock_location_app_option.py +42 -0
  19. appium/options/android/common/adb/remote_adb_host_option.py +39 -0
  20. appium/options/android/common/adb/skip_logcat_capture_option.py +40 -0
  21. appium/options/android/common/adb/suppress_kill_server_option.py +39 -0
  22. appium/options/android/common/app/__init__.py +0 -0
  23. appium/options/android/common/app/allow_test_packages_option.py +40 -0
  24. appium/options/android/common/app/android_install_timeout_option.py +43 -0
  25. appium/options/android/common/app/app_activity_option.py +39 -0
  26. appium/options/android/common/app/app_package_option.py +39 -0
  27. appium/options/android/common/app/app_wait_activity_option.py +40 -0
  28. appium/options/android/common/app/app_wait_duration_option.py +41 -0
  29. appium/options/android/common/app/app_wait_for_launch_option.py +41 -0
  30. appium/options/android/common/app/app_wait_package_option.py +40 -0
  31. appium/options/android/common/app/auto_grant_premissions_option.py +40 -0
  32. appium/options/android/common/app/enforce_app_install_option.py +40 -0
  33. appium/options/android/common/app/intent_action_option.py +40 -0
  34. appium/options/android/common/app/intent_category_option.py +40 -0
  35. appium/options/android/common/app/intent_flags_option.py +40 -0
  36. appium/options/android/common/app/optional_intent_arguments_option.py +40 -0
  37. appium/options/android/common/app/remote_apps_cache_limit_option.py +42 -0
  38. appium/options/android/common/app/uninstall_other_packages_option.py +39 -0
  39. appium/options/android/common/avd/__init__.py +0 -0
  40. appium/options/android/common/avd/avd_args_option.py +38 -0
  41. appium/options/android/common/avd/avd_env_option.py +38 -0
  42. appium/options/android/common/avd/avd_launch_timeout_option.py +41 -0
  43. appium/options/android/common/avd/avd_option.py +41 -0
  44. appium/options/android/common/avd/avd_ready_timeout_option.py +41 -0
  45. appium/options/android/common/avd/gps_enabled_option.py +39 -0
  46. appium/options/android/common/avd/network_speed_option.py +41 -0
  47. appium/options/android/common/context/__init__.py +0 -0
  48. appium/options/android/common/context/auto_webview_timeout_option.py +41 -0
  49. appium/options/android/common/context/chrome_logging_prefs_option.py +41 -0
  50. appium/options/android/common/context/chrome_options_option.py +40 -0
  51. appium/options/android/common/context/chromedriver_args_option.py +41 -0
  52. appium/options/android/common/context/chromedriver_chrome_mapping_file_option.py +43 -0
  53. appium/options/android/common/context/chromedriver_disable_build_check_option.py +41 -0
  54. appium/options/android/common/context/chromedriver_executable_dir_option.py +43 -0
  55. appium/options/android/common/context/chromedriver_executable_option.py +38 -0
  56. appium/options/android/common/context/chromedriver_port_option.py +39 -0
  57. appium/options/android/common/context/chromedriver_ports_option.py +39 -0
  58. appium/options/android/common/context/chromedriver_use_system_executable_option.py +40 -0
  59. appium/options/android/common/context/ensure_webviews_have_pages_option.py +40 -0
  60. appium/options/android/common/context/extract_chrome_android_package_from_context_name_option.py +40 -0
  61. appium/options/android/common/context/native_web_screenshot_option.py +40 -0
  62. appium/options/android/common/context/recreate_chrome_driver_sessions_option.py +41 -0
  63. appium/options/android/common/context/show_chromedriver_log_option.py +39 -0
  64. appium/options/android/common/context/webview_devtools_port_option.py +40 -0
  65. appium/options/android/common/localization/__init__.py +0 -0
  66. appium/options/android/common/localization/locale_script_option.py +40 -0
  67. appium/options/android/common/locking/__init__.py +0 -0
  68. appium/options/android/common/locking/skip_unlock_option.py +42 -0
  69. appium/options/android/common/locking/unlock_key_option.py +40 -0
  70. appium/options/android/common/locking/unlock_strategy_option.py +40 -0
  71. appium/options/android/common/locking/unlock_success_timeout_option.py +43 -0
  72. appium/options/android/common/locking/unlock_type_option.py +40 -0
  73. appium/options/android/common/mjpeg/__init__.py +0 -0
  74. appium/options/android/common/mjpeg/mjpeg_screenshot_url_option.py +40 -0
  75. appium/options/android/common/other/__init__.py +0 -0
  76. appium/options/android/common/other/disable_suppress_accessibility_service_option.py +40 -0
  77. appium/options/android/common/other/user_profile_option.py +42 -0
  78. appium/options/android/common/signing/__init__.py +0 -0
  79. appium/options/android/common/signing/key_alias_option.py +40 -0
  80. appium/options/android/common/signing/key_password_option.py +40 -0
  81. appium/options/android/common/signing/keystore_password_option.py +40 -0
  82. appium/options/android/common/signing/keystore_path_option.py +40 -0
  83. appium/options/android/common/signing/no_sign_option.py +42 -0
  84. appium/options/android/common/signing/use_keystore_option.py +42 -0
  85. appium/options/android/espresso/__init__.py +0 -0
  86. appium/options/android/espresso/activity_options_option.py +41 -0
  87. appium/options/android/espresso/app_locale_option.py +44 -0
  88. appium/options/android/espresso/base.py +221 -0
  89. appium/options/android/espresso/espresso_build_config_option.py +46 -0
  90. appium/options/android/espresso/espresso_server_launch_timeout_option.py +43 -0
  91. appium/options/android/espresso/force_espresso_rebuild_option.py +41 -0
  92. appium/options/android/espresso/intent_options_option.py +41 -0
  93. appium/options/android/espresso/show_gradle_log_option.py +39 -0
  94. appium/options/android/uiautomator2/__init__.py +0 -0
  95. appium/options/android/uiautomator2/base.py +221 -0
  96. appium/options/android/uiautomator2/disable_window_animation_option.py +40 -0
  97. appium/options/android/uiautomator2/mjpeg_server_port_option.py +41 -0
  98. appium/options/android/uiautomator2/skip_device_initialization_option.py +40 -0
  99. appium/options/android/uiautomator2/skip_server_installation_option.py +44 -0
  100. appium/options/android/uiautomator2/uiautomator2_server_install_timeout_option.py +44 -0
  101. appium/options/android/uiautomator2/uiautomator2_server_launch_timeout_option.py +44 -0
  102. appium/options/android/uiautomator2/uiautomator2_server_read_timeout_option.py +46 -0
  103. appium/options/common/__init__.py +1 -0
  104. appium/options/common/app_option.py +41 -0
  105. appium/options/common/auto_web_view_option.py +40 -0
  106. appium/options/common/automation_name_option.py +38 -0
  107. appium/options/common/base.py +125 -0
  108. appium/options/common/browser_name_option.py +38 -0
  109. appium/options/common/bundle_id_option.py +38 -0
  110. appium/options/common/clear_system_files_option.py +38 -0
  111. appium/options/common/device_name_option.py +38 -0
  112. appium/options/common/enable_performance_logging_option.py +38 -0
  113. appium/options/common/event_timings_option.py +40 -0
  114. appium/options/common/full_reset_option.py +38 -0
  115. appium/options/common/is_headless_option.py +39 -0
  116. appium/options/common/language_option.py +38 -0
  117. appium/options/common/locale_option.py +38 -0
  118. appium/options/common/new_command_timeout_option.py +41 -0
  119. appium/options/common/no_reset_option.py +38 -0
  120. appium/options/common/orientation_option.py +40 -0
  121. appium/options/common/other_apps_option.py +39 -0
  122. appium/options/common/platform_version_option.py +40 -0
  123. appium/options/common/postrun_option.py +39 -0
  124. appium/options/common/prerun_option.py +40 -0
  125. appium/options/common/print_page_source_on_find_failure_option.py +40 -0
  126. appium/options/common/skip_log_capture_option.py +38 -0
  127. appium/options/common/supports_capabilities.py +26 -0
  128. appium/options/common/system_host_option.py +38 -0
  129. appium/options/common/system_port_option.py +38 -0
  130. appium/options/common/udid_option.py +38 -0
  131. appium/options/flutter_integration/__init__.py +15 -0
  132. appium/options/flutter_integration/base.py +39 -0
  133. appium/options/flutter_integration/flutter_element_wait_timeout_option.py +50 -0
  134. appium/options/flutter_integration/flutter_enable_mock_camera_option.py +44 -0
  135. appium/options/flutter_integration/flutter_server_launch_timeout_option.py +51 -0
  136. appium/options/flutter_integration/flutter_system_port_option.py +45 -0
  137. appium/options/gecko/__init__.py +1 -0
  138. appium/options/gecko/android_storage_option.py +39 -0
  139. appium/options/gecko/base.py +51 -0
  140. appium/options/gecko/firefox_options_option.py +38 -0
  141. appium/options/gecko/marionette_port_option.py +43 -0
  142. appium/options/gecko/verbosity_option.py +40 -0
  143. appium/options/ios/__init__.py +2 -0
  144. appium/options/ios/safari/__init__.py +0 -0
  145. appium/options/ios/safari/automatic_inspection_option.py +41 -0
  146. appium/options/ios/safari/automatic_profiling_option.py +41 -0
  147. appium/options/ios/safari/base.py +51 -0
  148. appium/options/ios/safari/device_name_option.py +43 -0
  149. appium/options/ios/safari/device_type_option.py +41 -0
  150. appium/options/ios/safari/device_udid_option.py +43 -0
  151. appium/options/ios/safari/platform_build_version_option.py +41 -0
  152. appium/options/ios/safari/platform_version_option.py +41 -0
  153. appium/options/ios/safari/use_simulator_option.py +41 -0
  154. appium/options/ios/safari/webkit_webrtc_option.py +52 -0
  155. appium/options/ios/xcuitest/__init__.py +0 -0
  156. appium/options/ios/xcuitest/app/__init__.py +0 -0
  157. appium/options/ios/xcuitest/app/app_install_strategy_option.py +46 -0
  158. appium/options/ios/xcuitest/app/app_push_timeout_option.py +42 -0
  159. appium/options/ios/xcuitest/app/localizable_strings_dir_option.py +39 -0
  160. appium/options/ios/xcuitest/base.py +223 -0
  161. appium/options/ios/xcuitest/general/__init__.py +0 -0
  162. appium/options/ios/xcuitest/general/include_device_caps_to_session_info_option.py +41 -0
  163. appium/options/ios/xcuitest/general/reset_location_service_option.py +39 -0
  164. appium/options/ios/xcuitest/other/__init__.py +0 -0
  165. appium/options/ios/xcuitest/other/command_timeouts_option.py +57 -0
  166. appium/options/ios/xcuitest/other/launch_with_idb_option.py +42 -0
  167. appium/options/ios/xcuitest/other/show_ios_log_option.py +39 -0
  168. appium/options/ios/xcuitest/other/use_json_source_option.py +39 -0
  169. appium/options/ios/xcuitest/simulator/__init__.py +0 -0
  170. appium/options/ios/xcuitest/simulator/calendar_access_authorized_option.py +41 -0
  171. appium/options/ios/xcuitest/simulator/calendar_format_option.py +38 -0
  172. appium/options/ios/xcuitest/simulator/connect_hardware_keyboard_option.py +43 -0
  173. appium/options/ios/xcuitest/simulator/custom_ssl_cert_option.py +39 -0
  174. appium/options/ios/xcuitest/simulator/enforce_fresh_simulator_creation_option.py +39 -0
  175. appium/options/ios/xcuitest/simulator/force_simulator_software_keyboard_presence_option.py +45 -0
  176. appium/options/ios/xcuitest/simulator/ios_simulator_logs_predicate_option.py +38 -0
  177. appium/options/ios/xcuitest/simulator/keep_key_chains_option.py +39 -0
  178. appium/options/ios/xcuitest/simulator/keychains_exclude_patterns_option.py +44 -0
  179. appium/options/ios/xcuitest/simulator/permissions_option.py +50 -0
  180. appium/options/ios/xcuitest/simulator/reduce_motion_option.py +40 -0
  181. appium/options/ios/xcuitest/simulator/reset_on_session_start_only_option.py +41 -0
  182. appium/options/ios/xcuitest/simulator/scale_factor_option.py +44 -0
  183. appium/options/ios/xcuitest/simulator/shutdown_other_simulators_option.py +44 -0
  184. appium/options/ios/xcuitest/simulator/simulator_devices_set_path_option.py +41 -0
  185. appium/options/ios/xcuitest/simulator/simulator_pasteboard_automatic_sync_option.py +42 -0
  186. appium/options/ios/xcuitest/simulator/simulator_startup_timeout_option.py +46 -0
  187. appium/options/ios/xcuitest/simulator/simulator_trace_pointer_option.py +41 -0
  188. appium/options/ios/xcuitest/simulator/simulator_window_center_option.py +41 -0
  189. appium/options/ios/xcuitest/wda/__init__.py +0 -0
  190. appium/options/ios/xcuitest/wda/allow_provisioning_device_regitration_option.py +40 -0
  191. appium/options/ios/xcuitest/wda/auto_accept_alerts_option.py +39 -0
  192. appium/options/ios/xcuitest/wda/auto_disimiss_alerts_option.py +39 -0
  193. appium/options/ios/xcuitest/wda/derived_data_path_option.py +41 -0
  194. appium/options/ios/xcuitest/wda/disable_automatic_screenshots_option.py +40 -0
  195. appium/options/ios/xcuitest/wda/force_app_launch_option.py +42 -0
  196. appium/options/ios/xcuitest/wda/keychain_password_option.py +39 -0
  197. appium/options/ios/xcuitest/wda/keychain_path_option.py +39 -0
  198. appium/options/ios/xcuitest/wda/max_typing_frequency_option.py +40 -0
  199. appium/options/ios/xcuitest/wda/mjpeg_server_port_option.py +42 -0
  200. appium/options/ios/xcuitest/wda/process_arguments_option.py +42 -0
  201. appium/options/ios/xcuitest/wda/result_bundle_path_option.py +42 -0
  202. appium/options/ios/xcuitest/wda/screenshot_quality_option.py +42 -0
  203. appium/options/ios/xcuitest/wda/should_terminate_app_option.py +42 -0
  204. appium/options/ios/xcuitest/wda/should_use_singleton_test_manager_option.py +39 -0
  205. appium/options/ios/xcuitest/wda/show_xcode_log_option.py +40 -0
  206. appium/options/ios/xcuitest/wda/simple_is_visible_check_option.py +42 -0
  207. appium/options/ios/xcuitest/wda/updated_wda_bundle_id_option.py +39 -0
  208. appium/options/ios/xcuitest/wda/use_native_caching_strategy_option.py +41 -0
  209. appium/options/ios/xcuitest/wda/use_new_wda_option.py +51 -0
  210. appium/options/ios/xcuitest/wda/use_prebuilt_wda_option.py +39 -0
  211. appium/options/ios/xcuitest/wda/use_simple_build_test_option.py +40 -0
  212. appium/options/ios/xcuitest/wda/use_xctestrun_file_option.py +49 -0
  213. appium/options/ios/xcuitest/wda/wait_for_idle_timeout_option.py +45 -0
  214. appium/options/ios/xcuitest/wda/wait_for_quiescence_option.py +42 -0
  215. appium/options/ios/xcuitest/wda/wda_base_url_option.py +41 -0
  216. appium/options/ios/xcuitest/wda/wda_connection_timeout_option.py +43 -0
  217. appium/options/ios/xcuitest/wda/wda_eventloop_idle_delay_option.py +46 -0
  218. appium/options/ios/xcuitest/wda/wda_launch_timeout_option.py +41 -0
  219. appium/options/ios/xcuitest/wda/wda_local_port_option.py +41 -0
  220. appium/options/ios/xcuitest/wda/wda_startup_retries_option.py +39 -0
  221. appium/options/ios/xcuitest/wda/wda_startup_retry_interval_option.py +43 -0
  222. appium/options/ios/xcuitest/wda/web_driver_agent_url_option.py +39 -0
  223. appium/options/ios/xcuitest/wda/xcode_org_id_option.py +39 -0
  224. appium/options/ios/xcuitest/wda/xcode_signing_id_option.py +39 -0
  225. appium/options/ios/xcuitest/webview/__init__.py +0 -0
  226. appium/options/ios/xcuitest/webview/absolute_web_locations_option.py +42 -0
  227. appium/options/ios/xcuitest/webview/additional_webview_bundle_ids_option.py +40 -0
  228. appium/options/ios/xcuitest/webview/enable_async_execute_from_https_option.py +39 -0
  229. appium/options/ios/xcuitest/webview/full_context_list_option.py +42 -0
  230. appium/options/ios/xcuitest/webview/include_safari_in_webviews_option.py +41 -0
  231. appium/options/ios/xcuitest/webview/native_web_tap_option.py +40 -0
  232. appium/options/ios/xcuitest/webview/safari_garbage_collect_option.py +39 -0
  233. appium/options/ios/xcuitest/webview/safari_ignore_fraud_warning_option.py +39 -0
  234. appium/options/ios/xcuitest/webview/safari_ignore_web_hostnames_option.py +42 -0
  235. appium/options/ios/xcuitest/webview/safari_initial_url_option.py +38 -0
  236. appium/options/ios/xcuitest/webview/safari_log_all_communication_hex_dump_option.py +43 -0
  237. appium/options/ios/xcuitest/webview/safari_log_all_communication_option.py +40 -0
  238. appium/options/ios/xcuitest/webview/safari_open_links_in_background_option.py +39 -0
  239. appium/options/ios/xcuitest/webview/safari_socket_chunk_size_option.py +41 -0
  240. appium/options/ios/xcuitest/webview/safari_web_inspector_max_frame_length_option.py +41 -0
  241. appium/options/ios/xcuitest/webview/webkit_response_timeout_option.py +43 -0
  242. appium/options/ios/xcuitest/webview/webview_connect_retries_option.py +40 -0
  243. appium/options/ios/xcuitest/webview/webview_connect_timeout_option.py +43 -0
  244. appium/options/mac/__init__.py +1 -0
  245. appium/options/mac/mac2/__init__.py +0 -0
  246. appium/options/mac/mac2/app_path_option.py +39 -0
  247. appium/options/mac/mac2/arguments_option.py +39 -0
  248. appium/options/mac/mac2/base.py +113 -0
  249. appium/options/mac/mac2/bootstrap_root_option.py +41 -0
  250. appium/options/mac/mac2/environment_option.py +41 -0
  251. appium/options/mac/mac2/server_startup_timeout_option.py +44 -0
  252. appium/options/mac/mac2/show_server_logs_option.py +39 -0
  253. appium/options/mac/mac2/skip_app_kill_option.py +40 -0
  254. appium/options/mac/mac2/web_driver_agent_mac_url_option.py +39 -0
  255. appium/options/windows/__init__.py +1 -0
  256. appium/options/windows/windows/__init__.py +0 -0
  257. appium/options/windows/windows/app_arguments_option.py +40 -0
  258. appium/options/windows/windows/app_top_level_window_option.py +40 -0
  259. appium/options/windows/windows/app_working_dir_option.py +40 -0
  260. appium/options/windows/windows/base.py +97 -0
  261. appium/options/windows/windows/create_session_timeout_option.py +45 -0
  262. appium/options/windows/windows/expreimental_web_driver_option.py +39 -0
  263. appium/options/windows/windows/wait_for_app_launch_option.py +43 -0
  264. appium/protocols/__init__.py +13 -0
  265. appium/protocols/webdriver/__init__.py +13 -0
  266. appium/protocols/webdriver/can_execute_commands.py +23 -0
  267. appium/protocols/webdriver/can_execute_scripts.py +27 -0
  268. appium/protocols/webdriver/can_find_elements.py +32 -0
  269. appium/protocols/webdriver/can_remember_extension_presence.py +23 -0
  270. appium/py.typed +0 -0
  271. appium/version.py +22 -0
  272. appium/webdriver/__init__.py +20 -0
  273. appium/webdriver/appium_connection.py +65 -0
  274. appium/webdriver/appium_service.py +330 -0
  275. appium/webdriver/applicationstate.py +21 -0
  276. appium/webdriver/client_config.py +38 -0
  277. appium/webdriver/clipboard_content_type.py +19 -0
  278. appium/webdriver/command_method.py +27 -0
  279. appium/webdriver/common/__init__.py +17 -0
  280. appium/webdriver/common/appiumby.py +54 -0
  281. appium/webdriver/connectiontype.py +42 -0
  282. appium/webdriver/errorhandler.py +125 -0
  283. appium/webdriver/extensions/__init__.py +13 -0
  284. appium/webdriver/extensions/action_helpers.py +188 -0
  285. appium/webdriver/extensions/android/__init__.py +0 -0
  286. appium/webdriver/extensions/android/activities.py +65 -0
  287. appium/webdriver/extensions/android/common.py +59 -0
  288. appium/webdriver/extensions/android/display.py +48 -0
  289. appium/webdriver/extensions/android/gsm.py +147 -0
  290. appium/webdriver/extensions/android/nativekey.py +1119 -0
  291. appium/webdriver/extensions/android/network.py +175 -0
  292. appium/webdriver/extensions/android/performance.py +85 -0
  293. appium/webdriver/extensions/android/power.py +80 -0
  294. appium/webdriver/extensions/android/sms.py +50 -0
  295. appium/webdriver/extensions/android/system_bars.py +58 -0
  296. appium/webdriver/extensions/applications.py +274 -0
  297. appium/webdriver/extensions/clipboard.py +107 -0
  298. appium/webdriver/extensions/context.py +63 -0
  299. appium/webdriver/extensions/device_time.py +75 -0
  300. appium/webdriver/extensions/execute_driver.py +60 -0
  301. appium/webdriver/extensions/execute_mobile_command.py +62 -0
  302. appium/webdriver/extensions/flutter_integration/__init__.py +13 -0
  303. appium/webdriver/extensions/flutter_integration/flutter_commands.py +296 -0
  304. appium/webdriver/extensions/flutter_integration/flutter_finder.py +55 -0
  305. appium/webdriver/extensions/flutter_integration/scroll_directions.py +6 -0
  306. appium/webdriver/extensions/hw_actions.py +149 -0
  307. appium/webdriver/extensions/images_comparison.py +132 -0
  308. appium/webdriver/extensions/keyboard.py +168 -0
  309. appium/webdriver/extensions/location.py +98 -0
  310. appium/webdriver/extensions/log_event.py +68 -0
  311. appium/webdriver/extensions/logs.py +53 -0
  312. appium/webdriver/extensions/remote_fs.py +110 -0
  313. appium/webdriver/extensions/screen_record.py +207 -0
  314. appium/webdriver/extensions/session.py +41 -0
  315. appium/webdriver/extensions/settings.py +49 -0
  316. appium/webdriver/locator_converter.py +29 -0
  317. appium/webdriver/mobilecommand.py +104 -0
  318. appium/webdriver/switch_to.py +35 -0
  319. appium/webdriver/webdriver.py +495 -0
  320. appium/webdriver/webelement.py +130 -0
  321. appium_python_client-5.2.0.dist-info/METADATA +573 -0
  322. appium_python_client-5.2.0.dist-info/RECORD +324 -0
  323. appium_python_client-5.2.0.dist-info/WHEEL +4 -0
  324. appium_python_client-5.2.0.dist-info/licenses/LICENSE +201 -0
File without changes
@@ -0,0 +1,39 @@
1
+ # Licensed to the Software Freedom Conservancy (SFC) under one
2
+ # or more contributor license agreements. See the NOTICE file
3
+ # distributed with this work for additional information
4
+ # regarding copyright ownership. The SFC licenses this file
5
+ # to you under the Apache License, Version 2.0 (the
6
+ # "License"); you may not use this file except in compliance
7
+ # with the License. You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
18
+ from os import PathLike, fspath
19
+ from typing import Optional, Union
20
+
21
+ from appium.options.common.supports_capabilities import SupportsCapabilities
22
+
23
+ APP_PATH = 'appPath'
24
+
25
+
26
+ class AppPathOption(SupportsCapabilities):
27
+ @property
28
+ def app_path(self) -> Optional[str]:
29
+ """
30
+ The path of the application to automate.
31
+ """
32
+ return self.get_capability(APP_PATH)
33
+
34
+ @app_path.setter
35
+ def app_path(self, value: Union[str, PathLike]) -> None:
36
+ """
37
+ Set the path of the application to automate.
38
+ """
39
+ self.set_capability(APP_PATH, fspath(value))
@@ -0,0 +1,39 @@
1
+ # Licensed to the Software Freedom Conservancy (SFC) under one
2
+ # or more contributor license agreements. See the NOTICE file
3
+ # distributed with this work for additional information
4
+ # regarding copyright ownership. The SFC licenses this file
5
+ # to you under the Apache License, Version 2.0 (the
6
+ # "License"); you may not use this file except in compliance
7
+ # with the License. You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
18
+ from typing import List, Optional
19
+
20
+ from appium.options.common.supports_capabilities import SupportsCapabilities
21
+
22
+ ARGUMENTS = 'arguments'
23
+
24
+
25
+ class ArgumentsOption(SupportsCapabilities):
26
+ @property
27
+ def arguments(self) -> Optional[List[str]]:
28
+ """
29
+ Array of application command line arguments.
30
+ """
31
+ return self.get_capability(ARGUMENTS)
32
+
33
+ @arguments.setter
34
+ def arguments(self, value: List[str]) -> None:
35
+ """
36
+ Set the array of application command line arguments. This capability is
37
+ only going to be applied if the application is not running on session startup.
38
+ """
39
+ self.set_capability(ARGUMENTS, value)
@@ -0,0 +1,113 @@
1
+ # Licensed to the Software Freedom Conservancy (SFC) under one
2
+ # or more contributor license agreements. See the NOTICE file
3
+ # distributed with this work for additional information
4
+ # regarding copyright ownership. The SFC licenses this file
5
+ # to you under the Apache License, Version 2.0 (the
6
+ # "License"); you may not use this file except in compliance
7
+ # with the License. You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
18
+ from typing import Dict
19
+
20
+ from appium.options.common.automation_name_option import AUTOMATION_NAME
21
+ from appium.options.common.base import PLATFORM_NAME, AppiumOptions
22
+ from appium.options.common.bundle_id_option import BundleIdOption
23
+ from appium.options.common.postrun_option import PostrunOption
24
+ from appium.options.common.prerun_option import PrerunOption
25
+ from appium.options.common.system_host_option import SystemHostOption
26
+ from appium.options.common.system_port_option import SystemPortOption
27
+
28
+ from .app_path_option import AppPathOption
29
+ from .arguments_option import ArgumentsOption
30
+ from .bootstrap_root_option import BootstrapRootOption
31
+ from .environment_option import EnvironmentOption
32
+ from .server_startup_timeout_option import ServerStartupTimeoutOption
33
+ from .show_server_logs_option import ShowServerLogsOption
34
+ from .skip_app_kill_option import SkipAppKillOption
35
+ from .web_driver_agent_mac_url_option import WebDriverAgentMacUrlOption
36
+
37
+
38
+ class Mac2Options(
39
+ AppiumOptions,
40
+ AppPathOption,
41
+ PrerunOption,
42
+ PostrunOption,
43
+ ArgumentsOption,
44
+ BootstrapRootOption,
45
+ BundleIdOption,
46
+ EnvironmentOption,
47
+ ServerStartupTimeoutOption,
48
+ ShowServerLogsOption,
49
+ SkipAppKillOption,
50
+ SystemHostOption,
51
+ SystemPortOption,
52
+ WebDriverAgentMacUrlOption,
53
+ ):
54
+ @PrerunOption.prerun.setter # type: ignore
55
+ def prerun(self, value: Dict[str, str]) -> None:
56
+ """
57
+ A mapping containing either 'script' or 'command' key. The value of
58
+ each key must be a valid AppleScript script or command to be
59
+ executed after before Mac2Driver session is started. See
60
+ https://github.com/appium/appium-mac2-driver#applescript-commands-execution
61
+ for more details.
62
+ """
63
+ PrerunOption.prerun.fset(self, value) # type: ignore
64
+
65
+ @PostrunOption.postrun.setter # type: ignore
66
+ def postrun(self, value: Dict[str, str]) -> None:
67
+ """
68
+ A mapping containing either 'script' or 'command' key. The value of
69
+ each key must be a valid AppleScript script or command to be
70
+ executed after Mac2Driver session is stopped. See
71
+ https://github.com/appium/appium-mac2-driver#applescript-commands-execution
72
+ for more details.
73
+ """
74
+ PostrunOption.postrun.fset(self, value) # type: ignore
75
+
76
+ @SystemPortOption.system_port.setter # type: ignore
77
+ def system_port(self, value: int) -> None:
78
+ """
79
+ Set the number of the port for the internal server to listen on.
80
+ If not provided then Mac2Driver will use the default port 10100.
81
+ """
82
+ SystemPortOption.system_port.fset(self, value) # type: ignore
83
+
84
+ @SystemHostOption.system_host.setter # type: ignore
85
+ def system_host(self, value: str) -> None:
86
+ """
87
+ Set the number of the port for the internal server to listen on.
88
+ If not provided then Mac2Driver will use the default host
89
+ address 127.0.0.1. You could set it to 0.0.0.0 to make the
90
+ server listening on all available network interfaces.
91
+ It is also possible to set the particular interface name, for example en1.
92
+ """
93
+ SystemHostOption.system_host.fset(self, value) # type: ignore
94
+
95
+ @BundleIdOption.bundle_id.setter # type: ignore
96
+ def bundle_id(self, value: str) -> None:
97
+ """
98
+ Set the bundle identifier of the application to automate, for example
99
+ com.apple.TextEdit. This is an optional capability. If it is not provided
100
+ then the session will be started without an application under test
101
+ (actually, it will be Finder). If the application with the given
102
+ identifier is not installed then an error will be thrown on session
103
+ startup. If the application is already running then it will be moved to
104
+ the foreground.
105
+ """
106
+ BundleIdOption.bundle_id.fset(self, value) # type: ignore
107
+
108
+ @property
109
+ def default_capabilities(self) -> Dict:
110
+ return {
111
+ AUTOMATION_NAME: 'Mac2',
112
+ PLATFORM_NAME: 'Mac',
113
+ }
@@ -0,0 +1,41 @@
1
+ # Licensed to the Software Freedom Conservancy (SFC) under one
2
+ # or more contributor license agreements. See the NOTICE file
3
+ # distributed with this work for additional information
4
+ # regarding copyright ownership. The SFC licenses this file
5
+ # to you under the Apache License, Version 2.0 (the
6
+ # "License"); you may not use this file except in compliance
7
+ # with the License. You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
18
+ from typing import Optional
19
+
20
+ from appium.options.common.supports_capabilities import SupportsCapabilities
21
+
22
+ BOOTSTRAP_ROOT = 'bootstrapRoot'
23
+
24
+
25
+ class BootstrapRootOption(SupportsCapabilities):
26
+ @property
27
+ def bootstrap_root(self) -> Optional[str]:
28
+ """
29
+ The full path to WebDriverAgentMac root folder where Xcode project
30
+ of the server sources lives.
31
+ """
32
+ return self.get_capability(BOOTSTRAP_ROOT)
33
+
34
+ @bootstrap_root.setter
35
+ def bootstrap_root(self, value: str) -> None:
36
+ """
37
+ Set the full path to WebDriverAgentMac root folder where Xcode project
38
+ of the server sources lives. By default, this project is located in
39
+ the same folder where the corresponding driver Node.js module lives.
40
+ """
41
+ self.set_capability(BOOTSTRAP_ROOT, value)
@@ -0,0 +1,41 @@
1
+ # Licensed to the Software Freedom Conservancy (SFC) under one
2
+ # or more contributor license agreements. See the NOTICE file
3
+ # distributed with this work for additional information
4
+ # regarding copyright ownership. The SFC licenses this file
5
+ # to you under the Apache License, Version 2.0 (the
6
+ # "License"); you may not use this file except in compliance
7
+ # with the License. You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
18
+ from typing import Dict, Optional
19
+
20
+ from appium.options.common.supports_capabilities import SupportsCapabilities
21
+
22
+ ENVIRONMENT = 'environment'
23
+
24
+
25
+ class EnvironmentOption(SupportsCapabilities):
26
+ @property
27
+ def environment(self) -> Optional[Dict[str, str]]:
28
+ """
29
+ Application environment variables mapping.
30
+ """
31
+ return self.get_capability(ENVIRONMENT)
32
+
33
+ @environment.setter
34
+ def environment(self, value: Dict[str, str]) -> None:
35
+ """
36
+ Set the dictionary of environment variables (name->value) that are going to be passed
37
+ to the application under test on top of environment variables inherited from
38
+ the parent process. This option is only going to be applied if the application
39
+ is not running on session startup.
40
+ """
41
+ self.set_capability(ENVIRONMENT, value)
@@ -0,0 +1,44 @@
1
+ # Licensed to the Software Freedom Conservancy (SFC) under one
2
+ # or more contributor license agreements. See the NOTICE file
3
+ # distributed with this work for additional information
4
+ # regarding copyright ownership. The SFC licenses this file
5
+ # to you under the Apache License, Version 2.0 (the
6
+ # "License"); you may not use this file except in compliance
7
+ # with the License. You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
18
+ from datetime import timedelta
19
+ from typing import Optional, Union
20
+
21
+ from appium.options.common.supports_capabilities import SupportsCapabilities
22
+
23
+ SERVER_STARTUP_TIMEOUT = 'serverStartupTimeout'
24
+
25
+
26
+ class ServerStartupTimeoutOption(SupportsCapabilities):
27
+ @property
28
+ def server_startup_timeout(self) -> Optional[timedelta]:
29
+ """
30
+ Get the timeout to wait util the WebDriverAgentMac
31
+ project is built and started.
32
+ """
33
+ value_ms = self.get_capability(SERVER_STARTUP_TIMEOUT)
34
+ return None if value_ms is None else timedelta(milliseconds=value_ms)
35
+
36
+ @server_startup_timeout.setter
37
+ def server_startup_timeout(self, value: Union[int, timedelta]) -> None:
38
+ """
39
+ Set the timeout to wait util the WebDriverAgentMac
40
+ project is built and started.
41
+ """
42
+ self.set_capability(
43
+ SERVER_STARTUP_TIMEOUT, int(value.total_seconds() * 1000) if isinstance(value, timedelta) else value
44
+ )
@@ -0,0 +1,39 @@
1
+ # Licensed to the Software Freedom Conservancy (SFC) under one
2
+ # or more contributor license agreements. See the NOTICE file
3
+ # distributed with this work for additional information
4
+ # regarding copyright ownership. The SFC licenses this file
5
+ # to you under the Apache License, Version 2.0 (the
6
+ # "License"); you may not use this file except in compliance
7
+ # with the License. You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
18
+ from typing import Optional
19
+
20
+ from appium.options.common.supports_capabilities import SupportsCapabilities
21
+
22
+ SHOW_SERVER_LOGS = 'showServerLogs'
23
+
24
+
25
+ class ShowServerLogsOption(SupportsCapabilities):
26
+ @property
27
+ def show_server_logs(self) -> Optional[bool]:
28
+ """
29
+ Whether to show WDA server logs in the Appium log.
30
+ """
31
+ return self.get_capability(SHOW_SERVER_LOGS)
32
+
33
+ @show_server_logs.setter
34
+ def show_server_logs(self, value: bool) -> None:
35
+ """
36
+ Set it to true in order to include xcodebuild output to the Appium
37
+ server log. false by default.
38
+ """
39
+ self.set_capability(SHOW_SERVER_LOGS, value)
@@ -0,0 +1,40 @@
1
+ # Licensed to the Software Freedom Conservancy (SFC) under one
2
+ # or more contributor license agreements. See the NOTICE file
3
+ # distributed with this work for additional information
4
+ # regarding copyright ownership. The SFC licenses this file
5
+ # to you under the Apache License, Version 2.0 (the
6
+ # "License"); you may not use this file except in compliance
7
+ # with the License. You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
18
+ from typing import Optional
19
+
20
+ from appium.options.common.supports_capabilities import SupportsCapabilities
21
+
22
+ SKIP_APP_KILL = 'skipAppKill'
23
+
24
+
25
+ class SkipAppKillOption(SupportsCapabilities):
26
+ @property
27
+ def skip_app_kill(self) -> Optional[bool]:
28
+ """
29
+ Whether to skip the termination of the application under test.
30
+ """
31
+ return self.get_capability(SKIP_APP_KILL)
32
+
33
+ @skip_app_kill.setter
34
+ def skip_app_kill(self, value: bool) -> None:
35
+ """
36
+ Set whether to skip the termination of the application under test
37
+ when the testing session quits. false by default. This capability
38
+ is only going to be applied if bundleId is set.
39
+ """
40
+ self.set_capability(SKIP_APP_KILL, value)
@@ -0,0 +1,39 @@
1
+ # Licensed to the Software Freedom Conservancy (SFC) under one
2
+ # or more contributor license agreements. See the NOTICE file
3
+ # distributed with this work for additional information
4
+ # regarding copyright ownership. The SFC licenses this file
5
+ # to you under the Apache License, Version 2.0 (the
6
+ # "License"); you may not use this file except in compliance
7
+ # with the License. You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
18
+ from typing import Optional
19
+
20
+ from appium.options.common.supports_capabilities import SupportsCapabilities
21
+
22
+ WEB_DRIVER_ARGENT_MAC_URL = 'webDriverAgentMacUrl'
23
+
24
+
25
+ class WebDriverAgentMacUrlOption(SupportsCapabilities):
26
+ @property
27
+ def web_driver_agent_mac_url(self) -> Optional[str]:
28
+ """
29
+ The URL Appium will connect to an existing WebDriverAgentMac instance.
30
+ """
31
+ return self.get_capability(WEB_DRIVER_ARGENT_MAC_URL)
32
+
33
+ @web_driver_agent_mac_url.setter
34
+ def web_driver_agent_mac_url(self, value: str) -> None:
35
+ """
36
+ Set the URL Appium will connect to an existing WebDriverAgentMac
37
+ instance at this URL instead of starting a new one.
38
+ """
39
+ self.set_capability(WEB_DRIVER_ARGENT_MAC_URL, value)
@@ -0,0 +1 @@
1
+ from .windows.base import WindowsOptions
File without changes
@@ -0,0 +1,40 @@
1
+ # Licensed to the Software Freedom Conservancy (SFC) under one
2
+ # or more contributor license agreements. See the NOTICE file
3
+ # distributed with this work for additional information
4
+ # regarding copyright ownership. The SFC licenses this file
5
+ # to you under the Apache License, Version 2.0 (the
6
+ # "License"); you may not use this file except in compliance
7
+ # with the License. You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
18
+ from typing import Optional
19
+
20
+ from appium.options.common.supports_capabilities import SupportsCapabilities
21
+
22
+ APP_ARGUMENTS = 'appArguments'
23
+
24
+
25
+ class AppArgumentsOption(SupportsCapabilities):
26
+ @property
27
+ def app_arguments(self) -> Optional[str]:
28
+ """
29
+ Application arguments string, for example `/?`.
30
+ """
31
+ return self.get_capability(APP_ARGUMENTS)
32
+
33
+ @app_arguments.setter
34
+ def app_arguments(self, value: str) -> None:
35
+ """
36
+ Set application arguments string, for example `/argone "/arg two"`.
37
+ Make sure arguments are quoted/escaped properly if necessary:
38
+ https://ss64.com/nt/syntax-esc.html
39
+ """
40
+ self.set_capability(APP_ARGUMENTS, value)
@@ -0,0 +1,40 @@
1
+ # Licensed to the Software Freedom Conservancy (SFC) under one
2
+ # or more contributor license agreements. See the NOTICE file
3
+ # distributed with this work for additional information
4
+ # regarding copyright ownership. The SFC licenses this file
5
+ # to you under the Apache License, Version 2.0 (the
6
+ # "License"); you may not use this file except in compliance
7
+ # with the License. You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
18
+ from typing import Optional
19
+
20
+ from appium.options.common.supports_capabilities import SupportsCapabilities
21
+
22
+ APP_TOP_LEVEL_WINDOW = 'appTopLevelWindow'
23
+
24
+
25
+ class AppTopLevelWindowOption(SupportsCapabilities):
26
+ @property
27
+ def app_top_level_window(self) -> Optional[str]:
28
+ """
29
+ Hexadecimal handle of an existing application top level window to attach to.
30
+ """
31
+ return self.get_capability(APP_TOP_LEVEL_WINDOW)
32
+
33
+ @app_top_level_window.setter
34
+ def app_top_level_window(self, value: str) -> None:
35
+ """
36
+ Set the hexadecimal handle of an existing application top level
37
+ window to attach to, for example 0x12345 (should be of string type).
38
+ Either this capability or app one must be provided on session startup.
39
+ """
40
+ self.set_capability(APP_TOP_LEVEL_WINDOW, value)
@@ -0,0 +1,40 @@
1
+ # Licensed to the Software Freedom Conservancy (SFC) under one
2
+ # or more contributor license agreements. See the NOTICE file
3
+ # distributed with this work for additional information
4
+ # regarding copyright ownership. The SFC licenses this file
5
+ # to you under the Apache License, Version 2.0 (the
6
+ # "License"); you may not use this file except in compliance
7
+ # with the License. You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
18
+ from typing import Optional
19
+
20
+ from appium.options.common.supports_capabilities import SupportsCapabilities
21
+
22
+ APP_WORKING_DIR = 'appWorkingDir'
23
+
24
+
25
+ class AppWorkingDirOption(SupportsCapabilities):
26
+ @property
27
+ def app_working_dir(self) -> Optional[str]:
28
+ """
29
+ Full path to the folder, which is going to be set as the working
30
+ dir for the application under test.
31
+ """
32
+ return self.get_capability(APP_WORKING_DIR)
33
+
34
+ @app_working_dir.setter
35
+ def app_working_dir(self, value: str) -> None:
36
+ """
37
+ Set the full path to the folder, which is going to be set as the working
38
+ dir for the application under test. This is only applicable for classic apps.
39
+ """
40
+ self.set_capability(APP_WORKING_DIR, value)
@@ -0,0 +1,97 @@
1
+ # Licensed to the Software Freedom Conservancy (SFC) under one
2
+ # or more contributor license agreements. See the NOTICE file
3
+ # distributed with this work for additional information
4
+ # regarding copyright ownership. The SFC licenses this file
5
+ # to you under the Apache License, Version 2.0 (the
6
+ # "License"); you may not use this file except in compliance
7
+ # with the License. You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
18
+ from typing import Dict
19
+
20
+ from appium.options.common.app_option import AppOption
21
+ from appium.options.common.automation_name_option import AUTOMATION_NAME
22
+ from appium.options.common.base import PLATFORM_NAME, AppiumOptions
23
+ from appium.options.common.postrun_option import PostrunOption
24
+ from appium.options.common.prerun_option import PrerunOption
25
+ from appium.options.common.system_port_option import SystemPortOption
26
+
27
+ from .app_arguments_option import AppArgumentsOption
28
+ from .app_top_level_window_option import AppTopLevelWindowOption
29
+ from .app_working_dir_option import AppWorkingDirOption
30
+ from .create_session_timeout_option import CreateSessionTimeoutOption
31
+ from .expreimental_web_driver_option import ExperimentalWebDriverOption
32
+ from .wait_for_app_launch_option import WaitForAppLaunchOption
33
+
34
+
35
+ class WindowsOptions(
36
+ AppiumOptions,
37
+ PrerunOption,
38
+ PostrunOption,
39
+ AppOption,
40
+ AppTopLevelWindowOption,
41
+ AppWorkingDirOption,
42
+ CreateSessionTimeoutOption,
43
+ ExperimentalWebDriverOption,
44
+ SystemPortOption,
45
+ WaitForAppLaunchOption,
46
+ AppArgumentsOption,
47
+ ):
48
+ @AppOption.app.setter # type: ignore
49
+ def app(self, value: str) -> None:
50
+ """
51
+ The name of the UWP application to test or full path to a classic app,
52
+ for example Microsoft.WindowsCalculator_8wekyb3d8bbwe!App or
53
+ C:\\Windows\\System32\\notepad.exe. It is also possible to set app to Root.
54
+ In such case the session will be invoked without any explicit target application
55
+ (actually, it will be Explorer). Either this capability or appTopLevelWindow must
56
+ be provided on session startup.
57
+ """
58
+ AppOption.app.fset(self, value) # type: ignore
59
+
60
+ @PrerunOption.prerun.setter # type: ignore
61
+ def prerun(self, value: Dict[str, str]) -> None:
62
+ """
63
+ A mapping containing either 'script' or 'command' key. The value of
64
+ each key must be a valid PowerShell script or command to be
65
+ executed prior to the WinAppDriver session startup.
66
+ See https://github.com/appium/appium-windows-driver#power-shell-commands-execution
67
+ for more details.
68
+ """
69
+ PrerunOption.prerun.fset(self, value) # type: ignore
70
+
71
+ @PostrunOption.postrun.setter # type: ignore
72
+ def postrun(self, value: Dict[str, str]) -> None:
73
+ """
74
+ A mapping containing either 'script' or 'command' key. The value of
75
+ each key must be a valid PowerShell script or command to be
76
+ executed after a WinAppDriver session is finished.
77
+ See https://github.com/appium/appium-windows-driver#power-shell-commands-execution
78
+ for more details.
79
+ """
80
+ PostrunOption.postrun.fset(self, value) # type: ignore
81
+
82
+ @SystemPortOption.system_port.setter # type: ignore
83
+ def system_port(self, value: int) -> None:
84
+ """
85
+ The port number to execute Appium Windows Driver server listener on,
86
+ for example 5556. The port must not be occupied. The default starting port
87
+ number for a new Appium Windows Driver session is 4724. If this port is
88
+ already busy then the next free port will be automatically selected.
89
+ """
90
+ SystemPortOption.system_port.fset(self, value) # type: ignore
91
+
92
+ @property
93
+ def default_capabilities(self) -> Dict:
94
+ return {
95
+ AUTOMATION_NAME: 'Windows',
96
+ PLATFORM_NAME: 'Windows',
97
+ }