-
-
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
Changes from 1 commit
c84a105
edf6c30
aa59054
47184c7
6ef7f02
725a78d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,10 @@ | |
|
||
import static io.appium.java_client.android.AndroidMobileCommandHelper.endTestCoverageCommand; | ||
import static io.appium.java_client.android.AndroidMobileCommandHelper.openNotificationsCommand; | ||
import static io.appium.java_client.android.AndroidMobileCommandHelper.toggleAirplaneCommand; | ||
import static io.appium.java_client.android.AndroidMobileCommandHelper.toggleDataCommand; | ||
import static io.appium.java_client.android.AndroidMobileCommandHelper.toggleLocationServicesCommand; | ||
import static io.appium.java_client.android.AndroidMobileCommandHelper.toggleWifiCommand; | ||
|
||
import io.appium.java_client.AppiumDriver; | ||
import io.appium.java_client.CommandExecutionHelper; | ||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. This might be useful to have these methods in the separate There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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 commentThe 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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more.
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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't the server thrown exception in this case ? |
||
CommandExecutionHelper.execute(this, toggleDataCommand()); | ||
} | ||
} |
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