Skip to content

Commit b644712

Browse files
VinayakaMayuraKazuCocoa
authored andcommitted
Moving reset method from WebDriver to Applications (appium#399)
1 parent ec0d06e commit b644712

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

appium/webdriver/extensions/applications.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,12 @@ def app_strings(self, language=None, string_file=None):
183183
data['stringFile'] = string_file
184184
return self.execute(Command.GET_APP_STRINGS, data)['value']
185185

186+
def reset(self):
187+
"""Resets the current application on the device.
188+
"""
189+
self.execute(Command.RESET)
190+
return self
191+
186192
# pylint: disable=protected-access
187193

188194
def _addCommands(self):
@@ -202,3 +208,5 @@ def _addCommands(self):
202208
('POST', '/session/$sessionId/appium/device/app_state')
203209
self.command_executor._commands[Command.GET_APP_STRINGS] = \
204210
('POST', '/session/$sessionId/appium/app/strings')
211+
self.command_executor._commands[Command.RESET] = \
212+
('POST', '/session/$sessionId/appium/app/reset')

appium/webdriver/webdriver.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -555,12 +555,6 @@ def create_web_element(self, element_id):
555555
"""
556556
return MobileWebElement(self, element_id)
557557

558-
def reset(self):
559-
"""Resets the current application on the device.
560-
"""
561-
self.execute(Command.RESET)
562-
return self
563-
564558
def press_button(self, button_name):
565559
"""Sends a physical button name to the device to simulate the user pressing.
566560
@@ -678,8 +672,6 @@ def _addCommands(self):
678672
('POST', '/session/$sessionId/appium/app/close')
679673
self.command_executor._commands[Command.END_TEST_COVERAGE] = \
680674
('POST', '/session/$sessionId/appium/app/end_test_coverage')
681-
self.command_executor._commands[Command.RESET] = \
682-
('POST', '/session/$sessionId/appium/app/reset')
683675
self.command_executor._commands[Command.OPEN_NOTIFICATIONS] = \
684676
('POST', '/session/$sessionId/appium/device/open_notifications')
685677
self.command_executor._commands[Command.REPLACE_KEYS] = \

0 commit comments

Comments
 (0)