File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ class MobileCommand(object):
2828 DEACTIVATE_IME_ENGINE = 'deactivateIMEEngine'
2929 GET_ACTIVE_IME_ENGINE = 'getActiveEngine'
3030 TOGGLE_LOCATION_SERVICES = 'toggleLocationServices'
31+ TOGGLE_WIFI = 'toggleWiFi'
3132 LOCATION_IN_VIEW = 'locationInView'
3233
3334 # Appium Commands
Original file line number Diff line number Diff line change @@ -1116,6 +1116,12 @@ def update_settings(self, settings):
11161116 self .execute (Command .UPDATE_SETTINGS , data )
11171117 return self
11181118
1119+ def toggle_wifi (self ):
1120+ """Toggle the wifi on the device, Android only.
1121+ """
1122+ self .execute (Command .TOGGLE_WIFI , {})
1123+ return self
1124+
11191125 def toggle_location_services (self ):
11201126 """Toggle the location services on the device. Android only.
11211127 """
@@ -1500,6 +1506,8 @@ def _addCommands(self):
15001506 ('POST' , '/session/$sessionId/appium/settings' )
15011507 self .command_executor ._commands [Command .TOGGLE_LOCATION_SERVICES ] = \
15021508 ('POST' , '/session/$sessionId/appium/device/toggle_location_services' )
1509+ self .command_executor ._commands [Command .TOGGLE_WIFI ] = \
1510+ ('POST' , '/session/$sessionId/appium/device/toggle_wifi' )
15031511 self .command_executor ._commands [Command .SET_LOCATION ] = \
15041512 ('POST' , '/session/$sessionId/location' )
15051513 self .command_executor ._commands [Command .LOCATION_IN_VIEW ] = \
You can’t perform that action at this time.
0 commit comments