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.
- appium/__init__.py +17 -0
- appium/common/__init__.py +17 -0
- appium/common/exceptions.py +26 -0
- appium/common/helper.py +42 -0
- appium/common/logger.py +28 -0
- appium/options/__init__.py +0 -0
- appium/options/android/__init__.py +2 -0
- appium/options/android/common/__init__.py +0 -0
- appium/options/android/common/adb/__init__.py +0 -0
- appium/options/android/common/adb/adb_exec_timeout_option.py +41 -0
- appium/options/android/common/adb/adb_port_option.py +38 -0
- appium/options/android/common/adb/allow_delay_adb_option.py +39 -0
- appium/options/android/common/adb/build_tools_version_option.py +42 -0
- appium/options/android/common/adb/clear_device_logs_on_start_option.py +40 -0
- appium/options/android/common/adb/ignore_hidden_api_policy_error_option.py +40 -0
- appium/options/android/common/adb/logcat_filter_specs_option.py +42 -0
- appium/options/android/common/adb/logcat_format_option.py +39 -0
- appium/options/android/common/adb/mock_location_app_option.py +42 -0
- appium/options/android/common/adb/remote_adb_host_option.py +39 -0
- appium/options/android/common/adb/skip_logcat_capture_option.py +40 -0
- appium/options/android/common/adb/suppress_kill_server_option.py +39 -0
- appium/options/android/common/app/__init__.py +0 -0
- appium/options/android/common/app/allow_test_packages_option.py +40 -0
- appium/options/android/common/app/android_install_timeout_option.py +43 -0
- appium/options/android/common/app/app_activity_option.py +39 -0
- appium/options/android/common/app/app_package_option.py +39 -0
- appium/options/android/common/app/app_wait_activity_option.py +40 -0
- appium/options/android/common/app/app_wait_duration_option.py +41 -0
- appium/options/android/common/app/app_wait_for_launch_option.py +41 -0
- appium/options/android/common/app/app_wait_package_option.py +40 -0
- appium/options/android/common/app/auto_grant_premissions_option.py +40 -0
- appium/options/android/common/app/enforce_app_install_option.py +40 -0
- appium/options/android/common/app/intent_action_option.py +40 -0
- appium/options/android/common/app/intent_category_option.py +40 -0
- appium/options/android/common/app/intent_flags_option.py +40 -0
- appium/options/android/common/app/optional_intent_arguments_option.py +40 -0
- appium/options/android/common/app/remote_apps_cache_limit_option.py +42 -0
- appium/options/android/common/app/uninstall_other_packages_option.py +39 -0
- appium/options/android/common/avd/__init__.py +0 -0
- appium/options/android/common/avd/avd_args_option.py +38 -0
- appium/options/android/common/avd/avd_env_option.py +38 -0
- appium/options/android/common/avd/avd_launch_timeout_option.py +41 -0
- appium/options/android/common/avd/avd_option.py +41 -0
- appium/options/android/common/avd/avd_ready_timeout_option.py +41 -0
- appium/options/android/common/avd/gps_enabled_option.py +39 -0
- appium/options/android/common/avd/network_speed_option.py +41 -0
- appium/options/android/common/context/__init__.py +0 -0
- appium/options/android/common/context/auto_webview_timeout_option.py +41 -0
- appium/options/android/common/context/chrome_logging_prefs_option.py +41 -0
- appium/options/android/common/context/chrome_options_option.py +40 -0
- appium/options/android/common/context/chromedriver_args_option.py +41 -0
- appium/options/android/common/context/chromedriver_chrome_mapping_file_option.py +43 -0
- appium/options/android/common/context/chromedriver_disable_build_check_option.py +41 -0
- appium/options/android/common/context/chromedriver_executable_dir_option.py +43 -0
- appium/options/android/common/context/chromedriver_executable_option.py +38 -0
- appium/options/android/common/context/chromedriver_port_option.py +39 -0
- appium/options/android/common/context/chromedriver_ports_option.py +39 -0
- appium/options/android/common/context/chromedriver_use_system_executable_option.py +40 -0
- appium/options/android/common/context/ensure_webviews_have_pages_option.py +40 -0
- appium/options/android/common/context/extract_chrome_android_package_from_context_name_option.py +40 -0
- appium/options/android/common/context/native_web_screenshot_option.py +40 -0
- appium/options/android/common/context/recreate_chrome_driver_sessions_option.py +41 -0
- appium/options/android/common/context/show_chromedriver_log_option.py +39 -0
- appium/options/android/common/context/webview_devtools_port_option.py +40 -0
- appium/options/android/common/localization/__init__.py +0 -0
- appium/options/android/common/localization/locale_script_option.py +40 -0
- appium/options/android/common/locking/__init__.py +0 -0
- appium/options/android/common/locking/skip_unlock_option.py +42 -0
- appium/options/android/common/locking/unlock_key_option.py +40 -0
- appium/options/android/common/locking/unlock_strategy_option.py +40 -0
- appium/options/android/common/locking/unlock_success_timeout_option.py +43 -0
- appium/options/android/common/locking/unlock_type_option.py +40 -0
- appium/options/android/common/mjpeg/__init__.py +0 -0
- appium/options/android/common/mjpeg/mjpeg_screenshot_url_option.py +40 -0
- appium/options/android/common/other/__init__.py +0 -0
- appium/options/android/common/other/disable_suppress_accessibility_service_option.py +40 -0
- appium/options/android/common/other/user_profile_option.py +42 -0
- appium/options/android/common/signing/__init__.py +0 -0
- appium/options/android/common/signing/key_alias_option.py +40 -0
- appium/options/android/common/signing/key_password_option.py +40 -0
- appium/options/android/common/signing/keystore_password_option.py +40 -0
- appium/options/android/common/signing/keystore_path_option.py +40 -0
- appium/options/android/common/signing/no_sign_option.py +42 -0
- appium/options/android/common/signing/use_keystore_option.py +42 -0
- appium/options/android/espresso/__init__.py +0 -0
- appium/options/android/espresso/activity_options_option.py +41 -0
- appium/options/android/espresso/app_locale_option.py +44 -0
- appium/options/android/espresso/base.py +221 -0
- appium/options/android/espresso/espresso_build_config_option.py +46 -0
- appium/options/android/espresso/espresso_server_launch_timeout_option.py +43 -0
- appium/options/android/espresso/force_espresso_rebuild_option.py +41 -0
- appium/options/android/espresso/intent_options_option.py +41 -0
- appium/options/android/espresso/show_gradle_log_option.py +39 -0
- appium/options/android/uiautomator2/__init__.py +0 -0
- appium/options/android/uiautomator2/base.py +221 -0
- appium/options/android/uiautomator2/disable_window_animation_option.py +40 -0
- appium/options/android/uiautomator2/mjpeg_server_port_option.py +41 -0
- appium/options/android/uiautomator2/skip_device_initialization_option.py +40 -0
- appium/options/android/uiautomator2/skip_server_installation_option.py +44 -0
- appium/options/android/uiautomator2/uiautomator2_server_install_timeout_option.py +44 -0
- appium/options/android/uiautomator2/uiautomator2_server_launch_timeout_option.py +44 -0
- appium/options/android/uiautomator2/uiautomator2_server_read_timeout_option.py +46 -0
- appium/options/common/__init__.py +1 -0
- appium/options/common/app_option.py +41 -0
- appium/options/common/auto_web_view_option.py +40 -0
- appium/options/common/automation_name_option.py +38 -0
- appium/options/common/base.py +125 -0
- appium/options/common/browser_name_option.py +38 -0
- appium/options/common/bundle_id_option.py +38 -0
- appium/options/common/clear_system_files_option.py +38 -0
- appium/options/common/device_name_option.py +38 -0
- appium/options/common/enable_performance_logging_option.py +38 -0
- appium/options/common/event_timings_option.py +40 -0
- appium/options/common/full_reset_option.py +38 -0
- appium/options/common/is_headless_option.py +39 -0
- appium/options/common/language_option.py +38 -0
- appium/options/common/locale_option.py +38 -0
- appium/options/common/new_command_timeout_option.py +41 -0
- appium/options/common/no_reset_option.py +38 -0
- appium/options/common/orientation_option.py +40 -0
- appium/options/common/other_apps_option.py +39 -0
- appium/options/common/platform_version_option.py +40 -0
- appium/options/common/postrun_option.py +39 -0
- appium/options/common/prerun_option.py +40 -0
- appium/options/common/print_page_source_on_find_failure_option.py +40 -0
- appium/options/common/skip_log_capture_option.py +38 -0
- appium/options/common/supports_capabilities.py +26 -0
- appium/options/common/system_host_option.py +38 -0
- appium/options/common/system_port_option.py +38 -0
- appium/options/common/udid_option.py +38 -0
- appium/options/flutter_integration/__init__.py +15 -0
- appium/options/flutter_integration/base.py +39 -0
- appium/options/flutter_integration/flutter_element_wait_timeout_option.py +50 -0
- appium/options/flutter_integration/flutter_enable_mock_camera_option.py +44 -0
- appium/options/flutter_integration/flutter_server_launch_timeout_option.py +51 -0
- appium/options/flutter_integration/flutter_system_port_option.py +45 -0
- appium/options/gecko/__init__.py +1 -0
- appium/options/gecko/android_storage_option.py +39 -0
- appium/options/gecko/base.py +51 -0
- appium/options/gecko/firefox_options_option.py +38 -0
- appium/options/gecko/marionette_port_option.py +43 -0
- appium/options/gecko/verbosity_option.py +40 -0
- appium/options/ios/__init__.py +2 -0
- appium/options/ios/safari/__init__.py +0 -0
- appium/options/ios/safari/automatic_inspection_option.py +41 -0
- appium/options/ios/safari/automatic_profiling_option.py +41 -0
- appium/options/ios/safari/base.py +51 -0
- appium/options/ios/safari/device_name_option.py +43 -0
- appium/options/ios/safari/device_type_option.py +41 -0
- appium/options/ios/safari/device_udid_option.py +43 -0
- appium/options/ios/safari/platform_build_version_option.py +41 -0
- appium/options/ios/safari/platform_version_option.py +41 -0
- appium/options/ios/safari/use_simulator_option.py +41 -0
- appium/options/ios/safari/webkit_webrtc_option.py +52 -0
- appium/options/ios/xcuitest/__init__.py +0 -0
- appium/options/ios/xcuitest/app/__init__.py +0 -0
- appium/options/ios/xcuitest/app/app_install_strategy_option.py +46 -0
- appium/options/ios/xcuitest/app/app_push_timeout_option.py +42 -0
- appium/options/ios/xcuitest/app/localizable_strings_dir_option.py +39 -0
- appium/options/ios/xcuitest/base.py +223 -0
- appium/options/ios/xcuitest/general/__init__.py +0 -0
- appium/options/ios/xcuitest/general/include_device_caps_to_session_info_option.py +41 -0
- appium/options/ios/xcuitest/general/reset_location_service_option.py +39 -0
- appium/options/ios/xcuitest/other/__init__.py +0 -0
- appium/options/ios/xcuitest/other/command_timeouts_option.py +57 -0
- appium/options/ios/xcuitest/other/launch_with_idb_option.py +42 -0
- appium/options/ios/xcuitest/other/show_ios_log_option.py +39 -0
- appium/options/ios/xcuitest/other/use_json_source_option.py +39 -0
- appium/options/ios/xcuitest/simulator/__init__.py +0 -0
- appium/options/ios/xcuitest/simulator/calendar_access_authorized_option.py +41 -0
- appium/options/ios/xcuitest/simulator/calendar_format_option.py +38 -0
- appium/options/ios/xcuitest/simulator/connect_hardware_keyboard_option.py +43 -0
- appium/options/ios/xcuitest/simulator/custom_ssl_cert_option.py +39 -0
- appium/options/ios/xcuitest/simulator/enforce_fresh_simulator_creation_option.py +39 -0
- appium/options/ios/xcuitest/simulator/force_simulator_software_keyboard_presence_option.py +45 -0
- appium/options/ios/xcuitest/simulator/ios_simulator_logs_predicate_option.py +38 -0
- appium/options/ios/xcuitest/simulator/keep_key_chains_option.py +39 -0
- appium/options/ios/xcuitest/simulator/keychains_exclude_patterns_option.py +44 -0
- appium/options/ios/xcuitest/simulator/permissions_option.py +50 -0
- appium/options/ios/xcuitest/simulator/reduce_motion_option.py +40 -0
- appium/options/ios/xcuitest/simulator/reset_on_session_start_only_option.py +41 -0
- appium/options/ios/xcuitest/simulator/scale_factor_option.py +44 -0
- appium/options/ios/xcuitest/simulator/shutdown_other_simulators_option.py +44 -0
- appium/options/ios/xcuitest/simulator/simulator_devices_set_path_option.py +41 -0
- appium/options/ios/xcuitest/simulator/simulator_pasteboard_automatic_sync_option.py +42 -0
- appium/options/ios/xcuitest/simulator/simulator_startup_timeout_option.py +46 -0
- appium/options/ios/xcuitest/simulator/simulator_trace_pointer_option.py +41 -0
- appium/options/ios/xcuitest/simulator/simulator_window_center_option.py +41 -0
- appium/options/ios/xcuitest/wda/__init__.py +0 -0
- appium/options/ios/xcuitest/wda/allow_provisioning_device_regitration_option.py +40 -0
- appium/options/ios/xcuitest/wda/auto_accept_alerts_option.py +39 -0
- appium/options/ios/xcuitest/wda/auto_disimiss_alerts_option.py +39 -0
- appium/options/ios/xcuitest/wda/derived_data_path_option.py +41 -0
- appium/options/ios/xcuitest/wda/disable_automatic_screenshots_option.py +40 -0
- appium/options/ios/xcuitest/wda/force_app_launch_option.py +42 -0
- appium/options/ios/xcuitest/wda/keychain_password_option.py +39 -0
- appium/options/ios/xcuitest/wda/keychain_path_option.py +39 -0
- appium/options/ios/xcuitest/wda/max_typing_frequency_option.py +40 -0
- appium/options/ios/xcuitest/wda/mjpeg_server_port_option.py +42 -0
- appium/options/ios/xcuitest/wda/process_arguments_option.py +42 -0
- appium/options/ios/xcuitest/wda/result_bundle_path_option.py +42 -0
- appium/options/ios/xcuitest/wda/screenshot_quality_option.py +42 -0
- appium/options/ios/xcuitest/wda/should_terminate_app_option.py +42 -0
- appium/options/ios/xcuitest/wda/should_use_singleton_test_manager_option.py +39 -0
- appium/options/ios/xcuitest/wda/show_xcode_log_option.py +40 -0
- appium/options/ios/xcuitest/wda/simple_is_visible_check_option.py +42 -0
- appium/options/ios/xcuitest/wda/updated_wda_bundle_id_option.py +39 -0
- appium/options/ios/xcuitest/wda/use_native_caching_strategy_option.py +41 -0
- appium/options/ios/xcuitest/wda/use_new_wda_option.py +51 -0
- appium/options/ios/xcuitest/wda/use_prebuilt_wda_option.py +39 -0
- appium/options/ios/xcuitest/wda/use_simple_build_test_option.py +40 -0
- appium/options/ios/xcuitest/wda/use_xctestrun_file_option.py +49 -0
- appium/options/ios/xcuitest/wda/wait_for_idle_timeout_option.py +45 -0
- appium/options/ios/xcuitest/wda/wait_for_quiescence_option.py +42 -0
- appium/options/ios/xcuitest/wda/wda_base_url_option.py +41 -0
- appium/options/ios/xcuitest/wda/wda_connection_timeout_option.py +43 -0
- appium/options/ios/xcuitest/wda/wda_eventloop_idle_delay_option.py +46 -0
- appium/options/ios/xcuitest/wda/wda_launch_timeout_option.py +41 -0
- appium/options/ios/xcuitest/wda/wda_local_port_option.py +41 -0
- appium/options/ios/xcuitest/wda/wda_startup_retries_option.py +39 -0
- appium/options/ios/xcuitest/wda/wda_startup_retry_interval_option.py +43 -0
- appium/options/ios/xcuitest/wda/web_driver_agent_url_option.py +39 -0
- appium/options/ios/xcuitest/wda/xcode_org_id_option.py +39 -0
- appium/options/ios/xcuitest/wda/xcode_signing_id_option.py +39 -0
- appium/options/ios/xcuitest/webview/__init__.py +0 -0
- appium/options/ios/xcuitest/webview/absolute_web_locations_option.py +42 -0
- appium/options/ios/xcuitest/webview/additional_webview_bundle_ids_option.py +40 -0
- appium/options/ios/xcuitest/webview/enable_async_execute_from_https_option.py +39 -0
- appium/options/ios/xcuitest/webview/full_context_list_option.py +42 -0
- appium/options/ios/xcuitest/webview/include_safari_in_webviews_option.py +41 -0
- appium/options/ios/xcuitest/webview/native_web_tap_option.py +40 -0
- appium/options/ios/xcuitest/webview/safari_garbage_collect_option.py +39 -0
- appium/options/ios/xcuitest/webview/safari_ignore_fraud_warning_option.py +39 -0
- appium/options/ios/xcuitest/webview/safari_ignore_web_hostnames_option.py +42 -0
- appium/options/ios/xcuitest/webview/safari_initial_url_option.py +38 -0
- appium/options/ios/xcuitest/webview/safari_log_all_communication_hex_dump_option.py +43 -0
- appium/options/ios/xcuitest/webview/safari_log_all_communication_option.py +40 -0
- appium/options/ios/xcuitest/webview/safari_open_links_in_background_option.py +39 -0
- appium/options/ios/xcuitest/webview/safari_socket_chunk_size_option.py +41 -0
- appium/options/ios/xcuitest/webview/safari_web_inspector_max_frame_length_option.py +41 -0
- appium/options/ios/xcuitest/webview/webkit_response_timeout_option.py +43 -0
- appium/options/ios/xcuitest/webview/webview_connect_retries_option.py +40 -0
- appium/options/ios/xcuitest/webview/webview_connect_timeout_option.py +43 -0
- appium/options/mac/__init__.py +1 -0
- appium/options/mac/mac2/__init__.py +0 -0
- appium/options/mac/mac2/app_path_option.py +39 -0
- appium/options/mac/mac2/arguments_option.py +39 -0
- appium/options/mac/mac2/base.py +113 -0
- appium/options/mac/mac2/bootstrap_root_option.py +41 -0
- appium/options/mac/mac2/environment_option.py +41 -0
- appium/options/mac/mac2/server_startup_timeout_option.py +44 -0
- appium/options/mac/mac2/show_server_logs_option.py +39 -0
- appium/options/mac/mac2/skip_app_kill_option.py +40 -0
- appium/options/mac/mac2/web_driver_agent_mac_url_option.py +39 -0
- appium/options/windows/__init__.py +1 -0
- appium/options/windows/windows/__init__.py +0 -0
- appium/options/windows/windows/app_arguments_option.py +40 -0
- appium/options/windows/windows/app_top_level_window_option.py +40 -0
- appium/options/windows/windows/app_working_dir_option.py +40 -0
- appium/options/windows/windows/base.py +97 -0
- appium/options/windows/windows/create_session_timeout_option.py +45 -0
- appium/options/windows/windows/expreimental_web_driver_option.py +39 -0
- appium/options/windows/windows/wait_for_app_launch_option.py +43 -0
- appium/protocols/__init__.py +13 -0
- appium/protocols/webdriver/__init__.py +13 -0
- appium/protocols/webdriver/can_execute_commands.py +23 -0
- appium/protocols/webdriver/can_execute_scripts.py +27 -0
- appium/protocols/webdriver/can_find_elements.py +32 -0
- appium/protocols/webdriver/can_remember_extension_presence.py +23 -0
- appium/py.typed +0 -0
- appium/version.py +22 -0
- appium/webdriver/__init__.py +20 -0
- appium/webdriver/appium_connection.py +65 -0
- appium/webdriver/appium_service.py +330 -0
- appium/webdriver/applicationstate.py +21 -0
- appium/webdriver/client_config.py +38 -0
- appium/webdriver/clipboard_content_type.py +19 -0
- appium/webdriver/command_method.py +27 -0
- appium/webdriver/common/__init__.py +17 -0
- appium/webdriver/common/appiumby.py +54 -0
- appium/webdriver/connectiontype.py +42 -0
- appium/webdriver/errorhandler.py +125 -0
- appium/webdriver/extensions/__init__.py +13 -0
- appium/webdriver/extensions/action_helpers.py +188 -0
- appium/webdriver/extensions/android/__init__.py +0 -0
- appium/webdriver/extensions/android/activities.py +65 -0
- appium/webdriver/extensions/android/common.py +59 -0
- appium/webdriver/extensions/android/display.py +48 -0
- appium/webdriver/extensions/android/gsm.py +147 -0
- appium/webdriver/extensions/android/nativekey.py +1119 -0
- appium/webdriver/extensions/android/network.py +175 -0
- appium/webdriver/extensions/android/performance.py +85 -0
- appium/webdriver/extensions/android/power.py +80 -0
- appium/webdriver/extensions/android/sms.py +50 -0
- appium/webdriver/extensions/android/system_bars.py +58 -0
- appium/webdriver/extensions/applications.py +274 -0
- appium/webdriver/extensions/clipboard.py +107 -0
- appium/webdriver/extensions/context.py +63 -0
- appium/webdriver/extensions/device_time.py +75 -0
- appium/webdriver/extensions/execute_driver.py +60 -0
- appium/webdriver/extensions/execute_mobile_command.py +62 -0
- appium/webdriver/extensions/flutter_integration/__init__.py +13 -0
- appium/webdriver/extensions/flutter_integration/flutter_commands.py +296 -0
- appium/webdriver/extensions/flutter_integration/flutter_finder.py +55 -0
- appium/webdriver/extensions/flutter_integration/scroll_directions.py +6 -0
- appium/webdriver/extensions/hw_actions.py +149 -0
- appium/webdriver/extensions/images_comparison.py +132 -0
- appium/webdriver/extensions/keyboard.py +168 -0
- appium/webdriver/extensions/location.py +98 -0
- appium/webdriver/extensions/log_event.py +68 -0
- appium/webdriver/extensions/logs.py +53 -0
- appium/webdriver/extensions/remote_fs.py +110 -0
- appium/webdriver/extensions/screen_record.py +207 -0
- appium/webdriver/extensions/session.py +41 -0
- appium/webdriver/extensions/settings.py +49 -0
- appium/webdriver/locator_converter.py +29 -0
- appium/webdriver/mobilecommand.py +104 -0
- appium/webdriver/switch_to.py +35 -0
- appium/webdriver/webdriver.py +495 -0
- appium/webdriver/webelement.py +130 -0
- appium_python_client-5.2.0.dist-info/METADATA +573 -0
- appium_python_client-5.2.0.dist-info/RECORD +324 -0
- appium_python_client-5.2.0.dist-info/WHEEL +4 -0
- appium_python_client-5.2.0.dist-info/licenses/LICENSE +201 -0
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
from typing import Any, Union
|
|
16
|
+
|
|
17
|
+
from appium.protocols.webdriver.can_execute_commands import CanExecuteCommands
|
|
18
|
+
|
|
19
|
+
from ..mobilecommand import MobileCommand as Command
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class ScreenRecord(CanExecuteCommands):
|
|
23
|
+
def start_recording_screen(self, **options: Any) -> Union[bytes, str]:
|
|
24
|
+
"""Start asynchronous screen recording process.
|
|
25
|
+
|
|
26
|
+
+--------------+-----+---------+-----+-------+
|
|
27
|
+
| Keyword Args | iOS | Android | Win | macOS |
|
|
28
|
+
+==============+=====+=========+=====+=======+
|
|
29
|
+
| remotePath | O | O | O | O |
|
|
30
|
+
+--------------+-----+---------+-----+-------+
|
|
31
|
+
| user | O | O | O | O |
|
|
32
|
+
+--------------+-----+---------+-----+-------+
|
|
33
|
+
| password | O | O | O | O |
|
|
34
|
+
+--------------+-----+---------+-----+-------+
|
|
35
|
+
| method | O | O | O | O |
|
|
36
|
+
+--------------+-----+---------+-----+-------+
|
|
37
|
+
| timeLimit | O | O | O | O |
|
|
38
|
+
+--------------+-----+---------+-----+-------+
|
|
39
|
+
| forceRestart | O | O | O | O |
|
|
40
|
+
+--------------+-----+---------+-----+-------+
|
|
41
|
+
| fileFieldName| O | O | O | O |
|
|
42
|
+
+--------------+-----+---------+-----+-------+
|
|
43
|
+
| formFields | O | O | O | O |
|
|
44
|
+
+--------------+-----+---------+-----+-------+
|
|
45
|
+
| headers | O | O | O | O |
|
|
46
|
+
+--------------+-----+---------+-----+-------+
|
|
47
|
+
| videoQuality | O | | | |
|
|
48
|
+
+--------------+-----+---------+-----+-------+
|
|
49
|
+
| videoType | O | | | |
|
|
50
|
+
+--------------+-----+---------+-----+-------+
|
|
51
|
+
| videoFps | O | | | |
|
|
52
|
+
+--------------+-----+---------+-----+-------+
|
|
53
|
+
| videoFilter | O | | O | O |
|
|
54
|
+
+--------------+-----+---------+-----+-------+
|
|
55
|
+
| videoScale | O | | | |
|
|
56
|
+
+--------------+-----+---------+-----+-------+
|
|
57
|
+
| pixelFormat | O | | | |
|
|
58
|
+
+--------------+-----+---------+-----+-------+
|
|
59
|
+
| videoSize | | O | | |
|
|
60
|
+
+--------------+-----+---------+-----+-------+
|
|
61
|
+
| bitRate | | O | | |
|
|
62
|
+
+--------------+-----+---------+-----+-------+
|
|
63
|
+
| bugReport | | O | | |
|
|
64
|
+
+--------------+-----+---------+-----+-------+
|
|
65
|
+
| fps | | | O | O |
|
|
66
|
+
+--------------+-----+---------+-----+-------+
|
|
67
|
+
| captureCursor| | | O | O |
|
|
68
|
+
+--------------+-----+---------+-----+-------+
|
|
69
|
+
| captureClicks| | | O | O |
|
|
70
|
+
+--------------+-----+---------+-----+-------+
|
|
71
|
+
| deviceId | | | | O |
|
|
72
|
+
+--------------+-----+---------+-----+-------+
|
|
73
|
+
| preset | | | O | O |
|
|
74
|
+
+--------------+-----+---------+-----+-------+
|
|
75
|
+
| audioInput | | | O | |
|
|
76
|
+
+--------------+-----+---------+-----+-------+
|
|
77
|
+
|
|
78
|
+
Keyword Args:
|
|
79
|
+
remotePath (str): The remotePath upload option is the path to the remote location,
|
|
80
|
+
where the resulting video from the previous screen recording should be uploaded.
|
|
81
|
+
The following protocols are supported: http/https (multipart), ftp.
|
|
82
|
+
Missing value (the default setting) means the content of the resulting
|
|
83
|
+
file should be encoded as Base64 and passed as the endpoint response value, but
|
|
84
|
+
an exception will be thrown if the generated media file is too big to
|
|
85
|
+
fit into the available process memory.
|
|
86
|
+
This option only has an effect if there is/was an active screen recording session
|
|
87
|
+
and forced restart is not enabled (the default setting).
|
|
88
|
+
user (str): The name of the user for the remote authentication.
|
|
89
|
+
Only has an effect if both `remotePath` and `password` are set.
|
|
90
|
+
password (str): The password for the remote authentication.
|
|
91
|
+
Only has an effect if both `remotePath` and `user` are set.
|
|
92
|
+
method (str): The HTTP method name ('PUT'/'POST'). PUT method is used by default.
|
|
93
|
+
Only has an effect if `remotePath` is set.
|
|
94
|
+
timeLimit (int): The actual time limit of the recorded video in seconds.
|
|
95
|
+
The default value for both iOS and Android is 180 seconds (3 minutes).
|
|
96
|
+
The default value for macOS is 600 seconds (10 minutes).
|
|
97
|
+
The maximum value for Android is 3 minutes.
|
|
98
|
+
The maximum value for iOS is 10 minutes.
|
|
99
|
+
The maximum value for macOS is 10000 seconds (166 minutes).
|
|
100
|
+
forcedRestart (bool): Whether to ignore the result of previous capture and start a new recording
|
|
101
|
+
immediately (`True` value). By default (`False`) the endpoint will try to catch and
|
|
102
|
+
return the result of the previous capture if it's still available.
|
|
103
|
+
fileFieldName (str): [multipart/form-data requests] The name of the form field
|
|
104
|
+
containing the binary payload. "file" by default. (Since Appium 1.18.0)
|
|
105
|
+
formFields (dict): [multipart/form-data requests] Additional form fields mapping. If any entry has
|
|
106
|
+
the same key as `fileFieldName` then it is going to be ignored. (Since Appium 1.18.0)
|
|
107
|
+
headers (dict): [multipart/form-data requests] Headers mapping (Since Appium 1.18.0)
|
|
108
|
+
|
|
109
|
+
videoQuality (str): [iOS] The video encoding quality: 'low', 'medium', 'high', 'photo'. Defaults
|
|
110
|
+
to 'medium'.
|
|
111
|
+
videoType (str): [iOS] The format of the screen capture to be recorded.
|
|
112
|
+
Available formats: Execute `ffmpeg -codecs` in the terminal to see the list of supported video codecs.
|
|
113
|
+
'mjpeg' by default. (Since Appium 1.10.0)
|
|
114
|
+
videoFps (int): [iOS] The Frames Per Second rate of the recorded video. Change this value if the
|
|
115
|
+
resulting video is too slow or too fast. Defaults to 10. This can decrease the resulting file size.
|
|
116
|
+
videoFilters (str): [iOS, Win, macOS] The FFMPEG video filters to apply. These filters allow to scale,
|
|
117
|
+
flip, rotate and do many other useful transformations on the source video stream. The format of the
|
|
118
|
+
property must comply with https://ffmpeg.org/ffmpeg-filters.html. (Since Appium 1.15)
|
|
119
|
+
videoScale (str): [iOS] The scaling value to apply. Read https://trac.ffmpeg.org/wiki/Scaling for
|
|
120
|
+
possible values. No scale is applied by default. If videoFilters are set then the scale setting is
|
|
121
|
+
effectively ignored. (Since Appium 1.10.0)
|
|
122
|
+
pixelFormat (str): [iOS] Output pixel format. Run `ffmpeg -pix_fmts` to list possible values.
|
|
123
|
+
For Quicktime compatibility, set to "yuv420p" along with videoType: "libx264". (Since Appium 1.12.0)
|
|
124
|
+
|
|
125
|
+
videoSize (str): [Android] The video size of the generated media file. The format is WIDTHxHEIGHT.
|
|
126
|
+
The default value is the device's native display resolution (if supported),
|
|
127
|
+
1280x720 if not. For best results, use a size supported by your device's
|
|
128
|
+
Advanced Video Coding (AVC) encoder.
|
|
129
|
+
bitRate (int): [Android] The video bit rate for the video, in megabits per second.
|
|
130
|
+
The default value is 4. You can increase the bit rate to improve video quality,
|
|
131
|
+
but doing so results in larger movie files.
|
|
132
|
+
bugReport (str): [Android] Makes the recorder to display an additional information on the video overlay,
|
|
133
|
+
such as a timestamp, that is helpful in videos captured to illustrate bugs.
|
|
134
|
+
This option is only supported since API level 27 (Android P).
|
|
135
|
+
|
|
136
|
+
fps (int): [Win, macOS] The count of frames per second in the resulting video.
|
|
137
|
+
Increasing fps value also increases the size of the resulting video file and the CPU usage.
|
|
138
|
+
captureCursor (bool): [Win, macOS] Whether to capture the mouse cursor while recording the screen.
|
|
139
|
+
Disabled by default.
|
|
140
|
+
captureClick (bool): [Win, macOS] Whether to capture the click gestures while recording the screen.
|
|
141
|
+
Disabled by default.
|
|
142
|
+
deviceId (int): [macOS] Screen device index to use for the recording.
|
|
143
|
+
The list of available devices could be retrieved using
|
|
144
|
+
`ffmpeg -f avfoundation -list_devices true -i` command.
|
|
145
|
+
This option is mandatory and must be always provided.
|
|
146
|
+
preset (str): [Win, macOS] A preset is a collection of options that will provide a certain encoding
|
|
147
|
+
speed to compression ratio. A slower preset will provide better compression
|
|
148
|
+
(compression is quality per filesize). This means that, for example, if you target a certain file size
|
|
149
|
+
or constant bit rate, you will achieve better quality with a slower preset.
|
|
150
|
+
Read https://trac.ffmpeg.org/wiki/Encode/H.264 for more details.
|
|
151
|
+
Possible values are 'ultrafast', 'superfast', 'veryfast'(default), 'faster', 'fast', 'medium', 'slow',
|
|
152
|
+
'slower', 'veryslow'
|
|
153
|
+
|
|
154
|
+
Returns:
|
|
155
|
+
bytes: Base-64 encoded content of the recorded media
|
|
156
|
+
if `stop_recording_screen` isn't called after previous `start_recording_screen`.
|
|
157
|
+
Otherwise returns an empty string.
|
|
158
|
+
"""
|
|
159
|
+
if 'password' in options:
|
|
160
|
+
options['pass'] = options['password']
|
|
161
|
+
del options['password']
|
|
162
|
+
return self.execute(Command.START_RECORDING_SCREEN, {'options': options})['value']
|
|
163
|
+
|
|
164
|
+
def stop_recording_screen(self, **options: Any) -> bytes:
|
|
165
|
+
"""Gather the output from the previously started screen recording to a media file.
|
|
166
|
+
|
|
167
|
+
Keyword Args:
|
|
168
|
+
remotePath (str): The remotePath upload option is the path to the remote location,
|
|
169
|
+
where the resulting video should be uploaded.
|
|
170
|
+
The following protocols are supported: http/https (multipart), ftp.
|
|
171
|
+
Missing value (the default setting) means the content of the resulting
|
|
172
|
+
file should be encoded as Base64 and passed as the endpoint response value, but
|
|
173
|
+
an exception will be thrown if the generated media file is too big to
|
|
174
|
+
fit into the available process memory.
|
|
175
|
+
user (str): The name of the user for the remote authentication.
|
|
176
|
+
Only has an effect if both `remotePath` and `password` are set.
|
|
177
|
+
password (str): The password for the remote authentication.
|
|
178
|
+
Only has an effect if both `remotePath` and `user` are set.
|
|
179
|
+
method (str): The HTTP method name ('PUT'/'POST'). PUT method is used by default.
|
|
180
|
+
Only has an effect if `remotePath` is set.
|
|
181
|
+
fileFieldName (str): [multipart/form-data requests] The name of the form field
|
|
182
|
+
containing the binary payload. "file" by default. (Since Appium 1.18.0)
|
|
183
|
+
formFields (dict): [multipart/form-data requests] Additional form fields mapping. If any entry has
|
|
184
|
+
the same key as `fileFieldName` then it is going to be ignored. (Since Appium 1.18.0)
|
|
185
|
+
headers (dict): [multipart/form-data requests] Headers mapping (Since Appium 1.18.0)
|
|
186
|
+
|
|
187
|
+
Returns:
|
|
188
|
+
bytes: Base-64 encoded content of the recorded media file or an empty string
|
|
189
|
+
if the file has been successfully uploaded to a remote location
|
|
190
|
+
(depends on the actual `remotePath` value).
|
|
191
|
+
"""
|
|
192
|
+
if 'password' in options:
|
|
193
|
+
options['pass'] = options['password']
|
|
194
|
+
del options['password']
|
|
195
|
+
return self.execute(Command.STOP_RECORDING_SCREEN, {'options': options})['value']
|
|
196
|
+
|
|
197
|
+
def _add_commands(self) -> None:
|
|
198
|
+
self.command_executor.add_command(
|
|
199
|
+
Command.START_RECORDING_SCREEN,
|
|
200
|
+
'POST',
|
|
201
|
+
'/session/$sessionId/appium/start_recording_screen',
|
|
202
|
+
)
|
|
203
|
+
self.command_executor.add_command(
|
|
204
|
+
Command.STOP_RECORDING_SCREEN,
|
|
205
|
+
'POST',
|
|
206
|
+
'/session/$sessionId/appium/stop_recording_screen',
|
|
207
|
+
)
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
from typing import Dict
|
|
16
|
+
|
|
17
|
+
from appium.common.logger import logger
|
|
18
|
+
from appium.protocols.webdriver.can_execute_commands import CanExecuteCommands
|
|
19
|
+
|
|
20
|
+
from ..mobilecommand import MobileCommand as Command
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class Session(CanExecuteCommands):
|
|
24
|
+
@property
|
|
25
|
+
def events(self) -> Dict:
|
|
26
|
+
"""Retrieves events information from the current session
|
|
27
|
+
|
|
28
|
+
Usage:
|
|
29
|
+
events = driver.events
|
|
30
|
+
|
|
31
|
+
Returns:
|
|
32
|
+
`dict`: containing events timing information from the current session
|
|
33
|
+
"""
|
|
34
|
+
try:
|
|
35
|
+
return self.execute(Command.GET_SESSION)['value']['events']
|
|
36
|
+
except Exception as e:
|
|
37
|
+
logger.warning('Could not find events information in the session. Error: %s', e)
|
|
38
|
+
return {}
|
|
39
|
+
|
|
40
|
+
def _add_commands(self) -> None:
|
|
41
|
+
self.command_executor.add_command(Command.GET_SESSION, 'GET', '/session/$sessionId')
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
from typing import Any, Dict
|
|
16
|
+
|
|
17
|
+
from typing_extensions import Self
|
|
18
|
+
|
|
19
|
+
from appium.protocols.webdriver.can_execute_commands import CanExecuteCommands
|
|
20
|
+
|
|
21
|
+
from ..mobilecommand import MobileCommand as Command
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class Settings(CanExecuteCommands):
|
|
25
|
+
def get_settings(self) -> Dict[str, Any]:
|
|
26
|
+
"""Returns the appium server Settings for the current session.
|
|
27
|
+
|
|
28
|
+
Do not get Settings confused with Desired Capabilities, they are
|
|
29
|
+
separate concepts. See https://github.com/appium/appium/blob/master/docs/en/advanced-concepts/settings.md
|
|
30
|
+
|
|
31
|
+
Returns:
|
|
32
|
+
Current settings
|
|
33
|
+
"""
|
|
34
|
+
return self.execute(Command.GET_SETTINGS, {})['value']
|
|
35
|
+
|
|
36
|
+
def update_settings(self, settings: Dict[str, Any]) -> Self:
|
|
37
|
+
"""Set settings for the current session.
|
|
38
|
+
|
|
39
|
+
For more on settings, see: https://github.com/appium/appium/blob/master/docs/en/advanced-concepts/settings.md
|
|
40
|
+
|
|
41
|
+
Args:
|
|
42
|
+
settings: dictionary of settings to apply to the current test session
|
|
43
|
+
"""
|
|
44
|
+
self.execute(Command.UPDATE_SETTINGS, {'settings': settings})
|
|
45
|
+
return self
|
|
46
|
+
|
|
47
|
+
def _add_commands(self) -> None:
|
|
48
|
+
self.command_executor.add_command(Command.GET_SETTINGS, 'GET', '/session/$sessionId/appium/settings')
|
|
49
|
+
self.command_executor.add_command(Command.UPDATE_SETTINGS, 'POST', '/session/$sessionId/appium/settings')
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
from typing import Tuple
|
|
16
|
+
|
|
17
|
+
from selenium.webdriver.remote.locator_converter import LocatorConverter
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class AppiumLocatorConverter(LocatorConverter):
|
|
21
|
+
"""A custom locator converter in Appium.
|
|
22
|
+
|
|
23
|
+
Appium supports locators which are not defined in W3C WebDriver,
|
|
24
|
+
so Appium Python client wants to keep the given locators
|
|
25
|
+
to the Appium server as-is.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
def convert(self, by: str, value: str) -> Tuple[str, str]:
|
|
29
|
+
return (by, value)
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class MobileCommand:
|
|
17
|
+
# Common
|
|
18
|
+
GET_SESSION = 'getSession'
|
|
19
|
+
|
|
20
|
+
GET_STATUS = 'getStatus'
|
|
21
|
+
|
|
22
|
+
## MJSONWP for Selenium v4
|
|
23
|
+
GET_LOCATION = 'getLocation'
|
|
24
|
+
SET_LOCATION = 'setLocation'
|
|
25
|
+
|
|
26
|
+
CLEAR = 'clear'
|
|
27
|
+
LOCATION_IN_VIEW = 'locationInView'
|
|
28
|
+
|
|
29
|
+
CONTEXTS = 'getContexts'
|
|
30
|
+
GET_CURRENT_CONTEXT = 'getCurrentContext'
|
|
31
|
+
SWITCH_TO_CONTEXT = 'switchToContext'
|
|
32
|
+
|
|
33
|
+
BACKGROUND = 'background'
|
|
34
|
+
GET_APP_STRINGS = 'getAppStrings'
|
|
35
|
+
|
|
36
|
+
IS_LOCKED = 'isLocked'
|
|
37
|
+
LOCK = 'lock'
|
|
38
|
+
UNLOCK = 'unlock'
|
|
39
|
+
GET_DEVICE_TIME_GET = 'getDeviceTimeGet'
|
|
40
|
+
GET_DEVICE_TIME_POST = 'getDeviceTimePost'
|
|
41
|
+
INSTALL_APP = 'installApp'
|
|
42
|
+
REMOVE_APP = 'removeApp'
|
|
43
|
+
IS_APP_INSTALLED = 'isAppInstalled'
|
|
44
|
+
TERMINATE_APP = 'terminateApp'
|
|
45
|
+
ACTIVATE_APP = 'activateApp'
|
|
46
|
+
QUERY_APP_STATE = 'queryAppState'
|
|
47
|
+
SHAKE = 'shake'
|
|
48
|
+
HIDE_KEYBOARD = 'hideKeyboard'
|
|
49
|
+
PRESS_KEYCODE = 'pressKeyCode'
|
|
50
|
+
LONG_PRESS_KEYCODE = 'longPressKeyCode'
|
|
51
|
+
KEY_EVENT = 'keyEvent' # Needed for Selendroid
|
|
52
|
+
PUSH_FILE = 'pushFile'
|
|
53
|
+
PULL_FILE = 'pullFile'
|
|
54
|
+
PULL_FOLDER = 'pullFolder'
|
|
55
|
+
GET_CLIPBOARD = 'getClipboard'
|
|
56
|
+
SET_CLIPBOARD = 'setClipboard'
|
|
57
|
+
FINGER_PRINT = 'fingerPrint'
|
|
58
|
+
GET_SETTINGS = 'getSettings'
|
|
59
|
+
UPDATE_SETTINGS = 'updateSettings'
|
|
60
|
+
START_RECORDING_SCREEN = 'startRecordingScreen'
|
|
61
|
+
STOP_RECORDING_SCREEN = 'stopRecordingScreen'
|
|
62
|
+
COMPARE_IMAGES = 'compareImages'
|
|
63
|
+
IS_KEYBOARD_SHOWN = 'isKeyboardShown'
|
|
64
|
+
|
|
65
|
+
EXECUTE_DRIVER = 'executeDriver'
|
|
66
|
+
|
|
67
|
+
GET_EVENTS = 'getLogEvents'
|
|
68
|
+
LOG_EVENT = 'logCustomEvent'
|
|
69
|
+
|
|
70
|
+
## MJSONWP for Selenium v4
|
|
71
|
+
IS_ELEMENT_DISPLAYED = 'isElementDisplayed'
|
|
72
|
+
GET_CAPABILITIES = 'getCapabilities'
|
|
73
|
+
GET_SCREEN_ORIENTATION = 'getScreenOrientation'
|
|
74
|
+
SET_SCREEN_ORIENTATION = 'setScreenOrientation'
|
|
75
|
+
|
|
76
|
+
# To override selenium commands
|
|
77
|
+
GET_LOG = 'getLog'
|
|
78
|
+
GET_AVAILABLE_LOG_TYPES = 'getAvailableLogTypes'
|
|
79
|
+
|
|
80
|
+
# Android
|
|
81
|
+
OPEN_NOTIFICATIONS = 'openNotifications'
|
|
82
|
+
GET_CURRENT_ACTIVITY = 'getCurrentActivity'
|
|
83
|
+
GET_CURRENT_PACKAGE = 'getCurrentPackage'
|
|
84
|
+
GET_SYSTEM_BARS = 'getSystemBars'
|
|
85
|
+
GET_DISPLAY_DENSITY = 'getDisplayDensity'
|
|
86
|
+
TOGGLE_WIFI = 'toggleWiFi'
|
|
87
|
+
TOGGLE_LOCATION_SERVICES = 'toggleLocationServices'
|
|
88
|
+
GET_PERFORMANCE_DATA_TYPES = 'getPerformanceDataTypes'
|
|
89
|
+
GET_PERFORMANCE_DATA = 'getPerformanceData'
|
|
90
|
+
GET_NETWORK_CONNECTION = 'getNetworkConnection'
|
|
91
|
+
SET_NETWORK_CONNECTION = 'setNetworkConnection'
|
|
92
|
+
|
|
93
|
+
# Android Emulator
|
|
94
|
+
SEND_SMS = 'sendSms'
|
|
95
|
+
MAKE_GSM_CALL = 'makeGsmCall'
|
|
96
|
+
SET_GSM_SIGNAL = 'setGsmSignal'
|
|
97
|
+
SET_GSM_VOICE = 'setGsmVoice'
|
|
98
|
+
SET_NETWORK_SPEED = 'setNetworkSpeed'
|
|
99
|
+
SET_POWER_CAPACITY = 'setPowerCapacity'
|
|
100
|
+
SET_POWER_AC = 'setPowerAc'
|
|
101
|
+
|
|
102
|
+
# iOS
|
|
103
|
+
TOUCH_ID = 'touchId'
|
|
104
|
+
TOGGLE_TOUCH_ID_ENROLLMENT = 'toggleTouchIdEnrollment'
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
from typing import Optional
|
|
16
|
+
|
|
17
|
+
from selenium.webdriver.remote.switch_to import SwitchTo
|
|
18
|
+
from typing_extensions import Self
|
|
19
|
+
|
|
20
|
+
from .mobilecommand import MobileCommand
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class MobileSwitchTo(SwitchTo):
|
|
24
|
+
def context(self, context_name: Optional[str]) -> Self:
|
|
25
|
+
"""Sets the context for the current session.
|
|
26
|
+
Passing `None` is equal to switching to native context.
|
|
27
|
+
|
|
28
|
+
Args:
|
|
29
|
+
context_name: The name of the context to switch to.
|
|
30
|
+
|
|
31
|
+
Usage:
|
|
32
|
+
driver.switch_to.context('WEBVIEW_1')
|
|
33
|
+
"""
|
|
34
|
+
self._driver.execute(MobileCommand.SWITCH_TO_CONTEXT, {'name': context_name})
|
|
35
|
+
return self
|