8000 feat: Add xcuitest driver options by mykola-mokhnach · Pull Request #737 · appium/python-client · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ def bundle_id(self) -> Optional[str]:
@bundle_id.setter
def bundle_id(self, value: str) -> None:
"""
Set the bundle identifier of the application to automate, for example
com.apple.TextEdit. This is an optional capability. If it is not provided
then the session will be started without an application under test
(actually, it will be Finder). If the application with the given
identifier is not installed then an error will be thrown on session
startup. If the application is already running then it will be moved to
the foreground.
Set the bundle identifier of the application to automate.
"""
self.set_capability(BUNDLE_ID, value)
2 changes: 1 addition & 1 deletion appium/options/ios/safari/automatic_inspection_option.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class AutomaticInspectionOption(SupportsCapabilities):
@property
def automatic_inspection(self) -> Optional[bool]:
"""
:Returns: Whether to use automatic inspection.
Whether to use automatic inspection.
"""
return self.get_capability(AUTOMATIC_INSPECTION)

Expand Down
2 changes: 1 addition & 1 deletion appium/options/ios/safari/automatic_profiling_option.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class AutomaticProfilingOption(SupportsCapabilities):
@property
def automatic_profiling(self) -> Optional[bool]:
"""
:Returns: Whether to use automatic profiling.
Whether to use automatic profiling.
"""
return self.get_capability(AUTOMATIC_PROFILING)

Expand Down
2 changes: 1 addition & 1 deletion appium/options/ios/safari/device_name_option.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class DeviceNameOption(SupportsCapabilities):
@property
def device_name(self) -> Optional[str]:
"""
:Returns: String representing the name of the device.
String representing the name of the device.
"""
return self.get_capability(DEVICE_NAME)

Expand Down
2 changes: 1 addition & 1 deletion appium/options/ios/safari/device_type_option.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class DeviceTypeOption(SupportsCapabilities):
@property
def device_type(self) -> Optional[str]:
"""
:Returns: String representing the type of the device.
String representing the type of the device.
"""
return self.get_capability(DEVICE_TYPE)

Expand Down
2 changes: 1 addition & 1 deletion appium/options/ios/safari/device_udid_option.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class DeviceUdidOption(SupportsCapabilities):
@property
def device_udid(self) -> Optional[str]:
"""
:Returns: String representing the UDID of the device.
String representing the UDID of the device.
"""
return self.get_capability(DEVICE_UDID)

Expand Down
2 changes: 1 addition & 1 deletion appium/options/ios/safari/platform_build_version_option.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class PlatformBuildVersionOption(SupportsCapabilities):
@property
def platform_build_version(self) -> Optional[str]:
"""
:Returns: String representing the platform build version.
String representing the platform build version.
"""
return self.get_capability(PLATFORM_BUILD_VERSION)

Expand Down
2 changes: 1 addition & 1 deletion appium/options/ios/safari/platform_version_option.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class PlatformVersionOption(SupportsCapabilities):
@property
def platform_version(self) -> Optional[str]:
"""
:Returns: String representing the platform version.
String representing the platform version.
"""
return self.get_capability(PLATFORM_VERSION)

Expand Down
2 changes: 1 addition & 1 deletion appium/options/ios/safari/use_simulator_option.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class UseSimulatorOption(SupportsCapabilities):
@property
def use_simulator(self) -> Optional[bool]:
"""
:Returns: Whether to use iOS Simulator.
Whether to use iOS Simulator.
"""
return self.get_capability(USE_SIMULATOR)

Expand Down
2 changes: 1 addition & 1 deletion appium/options/ios/safari/webkit_webrtc_option.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class WebkitWebrtcOption(SupportsCapabilities):
@property
def webkit_webrtc(self) -> Optional[Dict[str, Any]]:
"""
:Returns: WebRTC policies.
WebRTC policies.
"""
return self.get_capability(WEBKIT_WEBRTC)

Expand Down
Empty file.
46 changes: 46 additions & 0 deletions appium/options/ios/xcuitest/app/app_install_strategy_option.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

from typing import Optional

from appium.options.common.supports_capabilities import SupportsCapabilities

APP_INSTALL_STRATEGY = 'appInstallStrategy'


class AppInstallStrategyOption(SupportsCapabilities):
@property
def app_install_strategy(self) -> Optional[str]:
"""
App install strategy.
"""
return self.get_capability(APP_INSTALL_STRATEGY)

@app_install_strategy.setter
def app_install_strategy(self, value: str) -> None:
"""
Select application installation strategy for real devices. The following
strategies are supported:
* serial (default) - pushes app files to the device in a sequential order;
this is the least performant strategy, although the most reliable;
* parallel - pushes app files simultaneously; this is usually the
most performant strategy, but sometimes could not be very stable;
* ios-deploy - tells the driver to use a third-party tool ios-deploy to
install the app; obviously the tool must be installed separately
first and must be present in PATH before it could be used.
"""
self.set_capability(APP_INSTALL_STRATEGY, value)
42 changes: 42 additions & 0 deletions appium/options/ios/xcuitest/app/app_push_timeout_option.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

from datetime import timedelta
from typing import Optional, Union

from appium.options.common.supports_capabilities import SupportsCapabilities

APP_PUSH_TIMEOUT = 'appPushTimeout'


class AppPushTimeoutOption(SupportsCapabilities):
@property
def app_push_timeout(self) -> Optional[timedelta]:
"""
Maximum timeout for application upload.
"""
value = self.get_capability(APP_PUSH_TIMEOUT)
return None if value is None else timedelta(milliseconds=value)

@app_push_timeout.setter
def app_push_timeout(self, value: Union[timedelta, int]) -> None:
"""
The timeout for application upload.
Works for real devices only.
The default value is 30000ms.
"""
self.set_capability(APP_PUSH_TIMEOUT, value.microseconds // 1000 if isinstance(value, timedelta) else value)
39 changes: 39 additions & 0 deletions appium/options/ios/xcuitest/app/localizable_strings_dir_option.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

from typing import Optional

from appium.options.common.supports_capabilities import SupportsCapabilities

LOCALIZABLE_STRINGS_DIR = 'localizableStringsDir'


class LocalizableStringsDirOption(SupportsCapabilities):
@property
def localizable_strings_dir(self) -> Optional[str]:
"""
Resource folder name where the main locale strings are stored.
"""
return self.get_capability(LOCALIZABLE_STRINGS_DIR)

@localizable_strings_dir.setter
def localizable_strings_dir(self, value: str) -> None:
"""
Where to look for localizable strings in the application bundle.
Defaults to en.lproj.
"""
self.set_capability(LOCALIZABLE_STRINGS_DIR, value)
Loading
0