-
-
Notifications
You must be signed in to change notification settings - Fork 764
#835 added handlers for toggle_wifi,data and airplane mode #837
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
#835 added handlers for toggle_wifi,data and airplane mode #837
Conversation
@@ -238,6 +244,9 @@ | |||
commandRepository.put(NETWORK_SPEED, postC("/session/:sessionId/appium/device/network_speed")); | |||
commandRepository.put(POWER_CAPACITY, postC("/session/:sessionId/appium/device/power_capacity")); | |||
commandRepository.put(POWER_AC_STATE, postC("/session/:sessionId/appium/device/power_ac")); | |||
commandRepository.put(TOGGLE_WIFI, postC("/session/:sessionId/appium/device/toggle_wifi")); | |||
commandRepository.put(TOGGLE_WIFI, postC("/session/:sessionId/appium/device/toggle_airplane_mode")); | |||
commandRepository.put(TOGGLE_WIFI, postC("/session/:sessionId/appium/device/toggle_data")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TOGGLE_AIRPLANE_MODE
@@ -176,4 +179,16 @@ public void openNotifications() { | |||
public void toggleLocationServices() { | |||
CommandExecutionHelper.execute(this, toggleLocationServicesCommand()); | |||
} | |||
|
|||
public void toggleWifi() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be useful to have these methods in the separate SupportsNetworkStateManagement
interface
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay i will do that :) cheers
CommandExecutionHelper.execute(this, toggleWifiCommand()); | ||
} | ||
|
||
public void toggleAirplaneMode() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docstrings are missing. BTW, this method works for Android only. Also, it foes not work since Android 7+
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In such case, what to do ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
apply the interface to Android driver only. Also, describe the limitations in the docstring
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we move it inside SupportsSpecialEmulatorCommands
not needed. As you said Appium will anyway throw an exception if the command didn't work. Although, it might be useful to describe what is supported in the docstring
CommandExecutionHelper.execute(this, toggleAirplaneCommand()); | ||
} | ||
|
||
public void toggleData() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This only works on Android. Also, the device should be rooted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the server thrown exception in this case ?
|
||
/** | ||
* Toggle Airplane mode and this works on OS 6.0 | ||
* and does not work on OS 7.0 and greater |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6.0 and lesser
Types of changes
What types of changes are you proposing/introducing to Java client?
Put an
x
in the boxes that apply