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
1 change: 0 additions & 1 deletion .github/issue_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,3 @@ If necessary, describe the problem you have been experiencing in more detail.
Create a [GIST](https://gist.github.com) which is a paste of your _full_ Appium logs, and link them here.

## Code To reproduce issue

4 changes: 2 additions & 2 deletions .ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ select = [
"I", # isort
"PERF", # perflint
"FURB", # Refurb
"SIM" # Simplify
"SIM", # Simplify
"UP", # Upgrade
]

[lint.per-file-ignores]
Expand All @@ -22,7 +23,6 @@ select = [
]

[lint.pylint]

max-args = 6

[format]
Expand Down
4 changes: 2 additions & 2 deletions appium/common/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
# limitations under the License.

import base64
from typing import Any, Dict
from typing import Any

from appium import version as appium_version


def extract_const_attributes(cls: type) -> Dict[str, Any]:
def extract_const_attributes(cls: type) -> dict[str, Any]:
"""Return dict with constants attributes and values in the class(e.g. {'VAL1': 1, 'VAL2': 2})

Args:
Expand Down
5 changes: 2 additions & 3 deletions appium/options/android/common/adb/adb_exec_timeout_option.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
# under the License.

from datetime import timedelta
from typing import Optional, Union

from appium.options.common.supports_capabilities import SupportsCapabilities

Expand All @@ -25,15 +24,15 @@

class AdbExecTimeoutOption(SupportsCapabilities):
@property
def adb_exec_timeout(self) -> Optional[timedelta]:
def adb_exec_timeout(self) -> timedelta | None:
"""
Maximum time to wait until single ADB command is executed.
"""
value = self.get_capability(ADB_EXEC_TIMEOUT)
return None if value is None else timedelta(milliseconds=value)

@adb_exec_timeout.setter
def adb_exec_timeout(self, value: Union[timedelta, int]) -> None:
def adb_exec_timeout(self, value: timedelta | int) -> None:
"""
Maximum time to wait until single ADB command is executed.
20000 ms by default.
Expand Down
3 changes: 1 addition & 2 deletions appium/options/android/common/adb/adb_port_option.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# specific language governing permissions and limitations
# under the License.

from typing import Optional

from appium.options.common.supports_capabilities import SupportsCapabilities

Expand All @@ -24,7 +23,7 @@

class AdbPortOption(SupportsCapabilities):
@property
def adb_port(self) -> Optional[int]:
def adb_port(self) -> int | None:
"""
Number of the port where ADB is running.
"""
Expand Down
3 changes: 1 addition & 2 deletions appium/options/android/common/adb/allow_delay_adb_option.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# specific language governing permissions and limitations
# under the License.

from typing import Optional

from appium.options.common.supports_capabilities import SupportsCapabilities

Expand All @@ -24,7 +23,7 @@

class AllowDelayAdbOption(SupportsCapabilities):
@property
def allow_delay_adb(self) -> Optional[bool]:
def allow_delay_adb(self) -> bool | None:
"""
Whether to prevent the emulator to use -delay-adb feature.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# specific language governing permissions and limitations
# under the License.

from typing import Optional

from appium.options.common.supports_capabilities import SupportsCapabilities

Expand All @@ -24,7 +23,7 @@

class BuildToolsVersionOption(SupportsCapabilities):
@property
def build_tools_version(self) -> Optional[str]:
def build_tools_version(self) -> str | None:
"""
Version of Android build tools to use.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# specific language governing permissions and limitations
# under the License.

from typing import Optional

from appium.options.common.supports_capabilities import SupportsCapabilities

Expand All @@ -24,7 +23,7 @@

class ClearDeviceLogsOnStartOption(SupportsCapabilities):
@property
def clear_device_logs_on_start(self) -> Optional[bool]:
def clear_device_logs_on_start(self) -> bool | None:
"""
Makes the driver to delete all the existing logs in the
device buffer before starting a new test.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# specific language governing permissions and limitations
# under the License.

from typing import Optional

from appium.options.common.supports_capabilities import SupportsCapabilities

Expand All @@ -24,7 +23,7 @@

class IgnoreHiddenApiPolicyErrorOption(SupportsCapabilities):
@property
def ignore_hidden_api_policy_error(self) -> Optional[bool]:
def ignore_hidden_api_policy_error(self) -> bool | None:
"""
Whether to ignore a failure while changing hidden API access policies.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# specific language governing permissions and limitations
# under the License.

from typing import Optional

from appium.options.common.supports_capabilities import SupportsCapabilities

Expand All @@ -24,7 +23,7 @@

class LogcatFilterSpecsOption(SupportsCapabilities):
@property
def logcat_filter_specs(self) -> Optional[str]:
def logcat_filter_specs(self) -> str | None:
"""
Logcat filter format.
"""
Expand Down
3 changes: 1 addition & 2 deletions appium/options/android/common/adb/logcat_format_option.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# specific language governing permissions and limitations
# under the License.

from typing import Optional

from appium.options.common.supports_capabilities import SupportsCapabilities

Expand All @@ -24,7 +23,7 @@

class LogcatFormatOption(SupportsCapabilities):
@property
def logcat_format(self) -> Optional[str]:
def logcat_format(self) -> str | None:
"""
Log print format.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# specific language governing permissions and limitations
# under the License.

from typing import Optional

from appium.options.common.supports_capabilities import SupportsCapabilities

Expand All @@ -24,7 +23,7 @@

class MockLocationAppOption(SupportsCapabilities):
@property
def mock_location_app(self) -> Optional[str]:
def mock_location_app(self) -> str | None:
"""
Identifier of the app, which is used as a system mock location provider.
"""
Expand Down
3 changes: 1 addition & 2 deletions appium/options/android/common/adb/remote_adb_host_option.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# specific language governing permissions and limitations
# under the License.

from typing import Optional

from appium.options.common.supports_capabilities import SupportsCapabilities

Expand All @@ -24,7 +23,7 @@

class RemoteAdbHostOption(SupportsCapabilities):
@property
def remote_adb_host(self) -> Optional[str]:
def remote_adb_host(self) -> str | None:
"""
Address of the host where ADB is running.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# specific language governing permissions and limitations
# under the License.

from typing import Optional

from appium.options.common.supports_capabilities import SupportsCapabilities

Expand All @@ -24,7 +23,7 @@

class SkipLogcatCaptureOption(SupportsCapabilities):
@property
def skip_logcat_capture(self) -> Optional[bool]:
def skip_logcat_capture(self) -> bool | None:
"""
Whether to delete all the existing logs in the
device buffer before starting a new test.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# specific language governing permissions and limitations
# under the License.

from typing import Optional

from appium.options.common.supports_capabilities import SupportsCapabilities

Expand All @@ -24,7 +23,7 @@

class SuppressKillServerOption(SupportsCapabilities):
@property
def suppress_kill_server(self) -> Optional[bool]:
def suppress_kill_server(self) -> bool | None:
"""
Prevents the driver from ever killing the ADB server explicitly.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# specific language governing permissions and limitations
# under the License.

from typing import Optional

from appium.options.common.supports_capabilities import SupportsCapabilities

Expand All @@ -24,7 +23,7 @@

class AllowTestPackagesOption(SupportsCapabilities):
@property
def allow_test_packages(self) -> Optional[bool]:
def allow_test_packages(self) -> bool | None:
"""
Whether it is possible to use packages built with the test flag for
the automated testing (literally adds -t flag to the adb install command).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
# under the License.

from datetime import timedelta
from typing import Optional, Union

from appium.options.common.supports_capabilities import SupportsCapabilities

Expand All @@ -25,15 +24,15 @@

class AndroidInstallTimeoutOption(SupportsCapabilities):
@property
def android_install_timeout(self) -> Optional[timedelta]:
def android_install_timeout(self) -> timedelta | None:
"""
Maximum amount of time to wait until the application under test is installed.
"""
value = self.get_capability(ANDROID_INSTALL_TIMEOUT)
return None if value is None else timedelta(milliseconds=value)

@android_install_timeout.setter
def android_install_timeout(self, value: Union[timedelta, int]) -> None:
def android_install_timeout(self, value: timedelta | int) -> None:
"""
Maximum amount of time to wait until the application under test is installed.
90000 ms by default
Expand Down
3 changes: 1 addition & 2 deletions appium/options/android/common/app/app_activity_option.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# specific language governing permissions and limitations
# under the License.

from typing import Optional

from appium.options.common.supports_capabilities import SupportsCapabilities

Expand All @@ -24,7 +23,7 @@

class AppActivityOption(SupportsCapabilities):
@property
def app_activity(self) -> Optional[str]:
def app_activity(self) -> str | None:
"""
Name of the main app activity.
"""
Expand Down
3 changes: 1 addition & 2 deletions appium/options/android/common/app/app_package_option.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# specific language governing permissions and limitations
# under the License.

from typing import Optional

from appium.options.common.supports_capabilities import SupportsCapabilities

Expand All @@ -24,7 +23,7 @@

class AppPackageOption(SupportsCapabilities):
@property
def app_package(self) -> Optional[str]:
def app_package(self) -> str | None:
"""
App package identifier.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# specific language governing permissions and limitations
# under the License.

from typing import Optional

from appium.options.common.supports_capabilities import SupportsCapabilities

Expand All @@ -24,7 +23,7 @@

class AppWaitActivityOption(SupportsCapabilities):
@property
def app_wait_activity(self) -> Optional[str]:
def app_wait_activity(self) -> str | None:
"""
Name of the app activity to wait for.
"""
Expand Down
5 changes: 2 additions & 3 deletions appium/options/android/common/app/app_wait_duration_option.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
# under the License.

from datetime import timedelta
from typing import Optional, Union

from appium.options.common.supports_capabilities import SupportsCapabilities

Expand All @@ -25,15 +24,15 @@

class AppWaitDurationOption(SupportsCapabilities):
@property
def app_wait_duration(self) -> Optional[timedelta]:
def app_wait_duration(self) -> timedelta | None:
"""
Identifier of the app package to wait for.
"""
value = self.get_capability(APP_WAIT_DURATION)
return None if value is None else timedelta(milliseconds=value)

@app_wait_duration.setter
def app_wait_duration(self, value: Union[timedelta, int]) -> None:
def app_wait_duration(self, value: timedelta | int) -> None:
"""
Maximum amount of time to wait until the application under test is started
(e.g. an activity returns the control to the caller). 20000 ms by default.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# specific language governing permissions and limitations
# under the License.

from typing import Optional

from appium.options.common.supports_capabilities import SupportsCapabilities

Expand All @@ -24,7 +23,7 @@

class AppWaitForLaunchOption(SupportsCapabilities):
@property
def app_wait_for_launch(self) -> Optional[bool]:
def app_wait_for_launch(self) -> bool | None:
"""
Whether to block until the app under test returns the control to the
caller after its activity has been started by Activity Manager.
Expand Down
Loading
Loading