Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion .github/workflows/functional-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ jobs:
name: func_test_android6
- target: test/functional/android/applications_tests.py
name: func_test_android7
- target: test/functional/android/network_connection_tests.py test/functional/android/log_event_tests.py test/functional/android/activities_tests.py test/functional/android/hw_actions_tests.py
- target: test/functional/android/network_connection_tests.py test/functional/android/log_event_tests.py test/functional/android/hw_actions_tests.py
name: func_test_android8

runs-on: ubuntu-latest
Expand Down
6 changes: 4 additions & 2 deletions appium/options/common/supports_capabilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@


class SupportsCapabilities(Protocol):
def set_capability(self: T, name: str, value: Any) -> T: ...
def set_capability(self: T, name: str, value: Any) -> T:
...
Copy link
Member Author

@KazuCocoa KazuCocoa Sep 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


def get_capability(self: T, name: str) -> Any: ...
def get_capability(self: T, name: str) -> Any:
...
3 changes: 2 additions & 1 deletion appium/protocols/webdriver/can_execute_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@
class CanExecuteCommands(Protocol):
command_executor: RemoteConnection

def execute(self, driver_command: str, params: Union[Dict, None] = None) -> Dict: ...
def execute(self, driver_command: str, params: Union[Dict, None] = None) -> Dict:
...
15 changes: 10 additions & 5 deletions appium/protocols/webdriver/can_execute_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,17 @@


class CanExecuteScripts(Protocol):
def pin_script(self, script: str, script_key: Optional[Any] = None) -> Any: ...
def pin_script(self, script: str, script_key: Optional[Any] = None) -> Any:
...

def unpin(self, script_key: Any) -> None: ...
def unpin(self, script_key: Any) -> None:
...

def get_pinned_scripts(self) -> List[str]: ...
def get_pinned_scripts(self) -> List[str]:
...

def execute_script(self, script: str, *args: Any) -> Any: ...
def execute_script(self, script: str, *args: Any) -> Any:
...

def execute_async_script(self, script: str, *args: Any) -> Any: ...
def execute_async_script(self, script: str, *args: Any) -> Any:
...
6 changes: 4 additions & 2 deletions appium/protocols/webdriver/can_find_elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@


class CanFindElements(Protocol):
def find_element(self, by: str, value: Union[str, Dict, None] = None) -> 'WebElement': ...
def find_element(self, by: str, value: Union[str, Dict, None] = None) -> 'WebElement':
...

def find_elements(self, by: str, value: Union[str, Dict, None] = None) -> List['WebElement']: ...
def find_elements(self, by: str, value: Union[str, Dict, None] = None) -> List['WebElement']:
...
6 changes: 4 additions & 2 deletions appium/protocols/webdriver/can_remember_extension_presence.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@


class CanRememberExtensionPresence(Protocol):
def assert_extension_exists(self: T, ext_name: str) -> T: ...
def assert_extension_exists(self: T, ext_name: str) -> T:
...

def mark_extension_absence(self: T, ext_name: str) -> T: ...
def mark_extension_absence(self: T, ext_name: str) -> T:
...
60 changes: 0 additions & 60 deletions test/functional/android/activities_tests.py

This file was deleted.

18 changes: 18 additions & 0 deletions test/unit/webdriver/webdriver_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,24 @@ class CustomAppiumConnection(AppiumConnection):

assert isinstance(driver.command_executor, CustomAppiumConnection)

@httpretty.activate
def test_extention_command_check(self):
driver = android_w3c_driver()
httpretty.register_uri(
httpretty.POST, appium_command('/session/1234567890/execute/sync'), body='{"value": true}'
)
assert (
driver.execute_script(
'mobile: startActivity',
{'component': 'io.appium.android.apis/.accessibility.AccessibilityNodeProviderActivity'},
)
is True
)
assert {
'args': [{'component': 'io.appium.android.apis/.accessibility.AccessibilityNodeProviderActivity'}],
'script': 'mobile: startActivity',
}, get_httpretty_request_body(httpretty.last_request())


class SubWebDriver(WebDriver):
def __init__(self, command_executor, direct_connection=False, options=None):
Expand Down
Loading