refactor: remove legacy fallback for network commands#5
Conversation
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
Pull request overview
This PR refactors the Android Network WebDriver extension to exclusively use modern mobile: execute-script endpoints, removing legacy W3C/command fallbacks and updating unit tests accordingly.
Changes:
- Removed legacy command fallbacks (
/network_connection,/appium/device/*) from the Android network extension. - Simplified
Networkextension methods to callexecute_script('mobile: ...')directly. - Updated unit tests to stop registering the legacy fallback endpoints and validate only the
execute/syncpath.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
appium/webdriver/extensions/android/network.py |
Drops legacy command fallback logic and relies solely on mobile: scripts for connectivity/speed operations. |
test/unit/webdriver/network_test.py |
Removes HTTP stubs for legacy endpoints, keeping only execute/sync stubs for mobile: scripts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
5c804d4 to
05c70d2
Compare
Refactored the
Networkextension for Android to strictly use modernmobile:scripts, removing old W3C command fallbacks.PR created automatically by Jules for task 7102057085996419728 started by @Dor-bl