Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'services' argument in 'mobile: getConnectivity' command doesn't impact the output of services states #866

Closed
okaruk opened this issue Feb 24, 2025 · 2 comments · Fixed by appium/appium-android-driver#987

Comments

@okaruk
Copy link

okaruk commented Feb 24, 2025

According to statement the services argument should filter the output to only include a particular service connectivity status.

➜  ~ appium --version
2.15.0
➜  ~ appium driver list --installed
✔ Listing installed drivers
- [email protected] [installed (npm)]
➜  ~

Ruby cmd 1:
driver.execute_script("mobile: getConnectivity", services: "wifi")
Output:
{"wifi" => true, "data" => false, "airplaneMode" => false}

[4138dcd7][HTTP] --> POST /wd/hub/session/4138dcd7-70fc-46cb-a28f-f62fa22b1d7d/execute/sync {"script":"mobile: getConnectivity","args":[{"services":"wifi"}]}
[4138dcd7][AndroidUiautomator2Driver@5e45] Calling AppiumDriver.execute() with args: ["mobile: getConnectivity",[{"services":"wifi"}],"4138dcd7-70fc-46cb-a28f-f62fa22b1d7d"]
[4138dcd7][ADB] Running '/Users/okaruk/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell settings get global wifi_on'
[4138dcd7][AndroidUiautomator2Driver@5e45] Responding to client with driver.execute() result: {"wifi":true,"data":false,"airplaneMode":false}
[4138dcd7][HTTP] <-- POST /wd/hub/session/4138dcd7-70fc-46cb-a28f-f62fa22b1d7d/execute/sync 200 65 ms - 57

Ruby cmd 2:
driver.execute_script("mobile: getConnectivity", services: %w[wifi data])
Output:
{"wifi" => true, "data" => false, "airplaneMode" => false}

[4138dcd7][HTTP] --> POST /wd/hub/session/4138dcd7-70fc-46cb-a28f-f62fa22b1d7d/execute/sync {"script":"mobile: getConnectivity","args":[{"services":["wifi","data"]}]}
[4138dcd7][AndroidUiautomator2Driver@5e45] Calling AppiumDriver.execute() with args: ["mobile: getConnectivity",[{"services":["wifi","data"]}],"4138dcd7-70fc-46cb-a28f-f62fa22b1d7d"]
[4138dcd7][ADB] Running '/Users/okaruk/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell settings get global wifi_on'
[4138dcd7][ADB] Running '/Users/okaruk/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell settings get global mobile_data'
[4138dcd7][AndroidUiautomator2Driver@5e45] Responding to client with driver.execute() result: {"wifi":true,"data":true,"airplaneMode":false}
[4138dcd7][HTTP] <-- POST /wd/hub/session/4138dcd7-70fc-46cb-a28f-f62fa22b1d7d/execute/sync 200 78 ms - 56
@okaruk okaruk changed the title Seems like 'services' argument is ignored in mobile: getConnectivity command Seems like 'services' argument is ignored in 'mobile: getConnectivity' command Feb 24, 2025
@okaruk okaruk changed the title Seems like 'services' argument is ignored in 'mobile: getConnectivity' command 'services' argument in 'mobile: getConnectivity' command doesn't impact the output of services states Feb 24, 2025
@okaruk
Copy link
Author

okaruk commented Mar 13, 2025

@KazuCocoa @mykola-mokhnach, did you have a chance to take a look?

@KazuCocoa
Copy link
Member

Thank you -> appium/appium-android-driver#987

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 a pull request may close this issue.

2 participants