Skip to content

refactor: remove legacy fallback for network commands#5

Open
Dor-bl wants to merge 3 commits into
masterfrom
refactor/remove-network-fallback-7102057085996419728
Open

refactor: remove legacy fallback for network commands#5
Dor-bl wants to merge 3 commits into
masterfrom
refactor/remove-network-fallback-7102057085996419728

Conversation

@Dor-bl

@Dor-bl Dor-bl commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Refactored the Network extension for Android to strictly use modern mobile: scripts, removing old W3C command fallbacks.


PR created automatically by Jules for task 7102057085996419728 started by @Dor-bl

@google-labs-jules

Copy link
Copy Markdown

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 Network extension methods to call execute_script('mobile: ...') directly.
  • Updated unit tests to stop registering the legacy fallback endpoints and validate only the execute/sync path.

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.

Comment thread appium/webdriver/extensions/android/network.py Outdated
Dor-bl and others added 3 commits July 20, 2026 21:04
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.
@Dor-bl
Dor-bl force-pushed the refactor/remove-network-fallback-7102057085996419728 branch from 5c804d4 to 05c70d2 Compare July 20, 2026 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants