Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions appium/webdriver/mobilecommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class MobileCommand(object):
DEACTIVATE_IME_ENGINE = 'deactivateIMEEngine'
GET_ACTIVE_IME_ENGINE = 'getActiveEngine'
TOGGLE_LOCATION_SERVICES = 'toggleLocationServices'
TOGGLE_WIFI = 'toggleWiFi'
LOCATION_IN_VIEW = 'locationInView'

# Appium Commands
Expand Down
8 changes: 8 additions & 0 deletions appium/webdriver/webdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -1116,6 +1116,12 @@ def update_settings(self, settings):
self.execute(Command.UPDATE_SETTINGS, data)
return self

def toggle_wifi(self):
"""Toggle the wifi on the device, Android only.
"""
self.execute(Command.TOGGLE_WIFI, {})
return self

def toggle_location_services(self):
"""Toggle the location services on the device. Android only.
"""
Expand Down Expand Up @@ -1500,6 +1506,8 @@ def _addCommands(self):
('POST', '/session/$sessionId/appium/settings')
self.command_executor._commands[Command.TOGGLE_LOCATION_SERVICES] = \
('POST', '/session/$sessionId/appium/device/toggle_location_services')
self.command_executor._commands[Command.TOGGLE_WIFI] = \
('POST', '/session/$sessionId/appium/device/toggle_wifi')
self.command_executor._commands[Command.SET_LOCATION] = \
('POST', '/session/$sessionId/location')
self.command_executor._commands[Command.LOCATION_IN_VIEW] = \
Expand Down