refactor: Network extension to remove legacy command fallbacks#1258
Open
Dor-bl wants to merge 3 commits into
Open
refactor: Network extension to remove legacy command fallbacks#1258Dor-bl wants to merge 3 commits into
Dor-bl wants to merge 3 commits into
Conversation
Remove `try/except UnknownMethodException` fallback logic from `network_connection`, `set_network_connection`, `toggle_wifi`, and `set_network_speed` methods in the `Network` extension, relying solely on their corresponding `mobile:` scripts. Also removes the inheritance from `CanRememberExtensionPresence`, unneeded imports, and clears `_add_commands` as these endpoints are now completely deprecated. Updates unit tests to remove mocks for legacy endpoints.
Remove `try/except UnknownMethodException` fallback logic from `network_connection`, `set_network_connection`, `toggle_wifi`, and `set_network_speed` methods in the `Network` extension, relying solely on their corresponding `mobile:` scripts. Also removes the inheritance from `CanRememberExtensionPresence`, unneeded imports, and clears `_add_commands` as these endpoints are now completely deprecated. Updates unit tests to remove mocks for legacy endpoints. Fixed ruff format issue.
execute_script's raw result doesn't match the method's documented int return type; return self.network_connection after setting instead.
|
KazuCocoa
approved these changes
Jul 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request refactors the Android network extension in the Appium Python client to remove legacy MJSONWP (Mobile JSON Wire Protocol) code paths and dependencies, standardizing all network-related commands to use W3C WebDriver extension scripts. The code is simplified by removing fallback logic, unused imports, and direct command registrations. Corresponding unit tests are updated to reflect these changes.
Refactoring to W3C-only network commands:
Networkclass; now only W3C extension scripts are used for network operations such as getting/setting network connection, toggling WiFi, and setting network speed (appium/webdriver/extensions/android/network.py). [1] [2] [3] [4] [5] [6]Code cleanup:
CanRememberExtensionPresencemixin from theNetworkclass, as well as command registration for legacy endpoints (appium/webdriver/extensions/android/network.py). [1] [2] [3]Unit test updates:
test/unit/webdriver/network_test.py). [1] [2] [3]