Skip to content

Commit

Permalink
[py] clear local actions for w3c as well when resetting actions
Browse files Browse the repository at this point in the history
  • Loading branch information
lmtierney committed Aug 21, 2018
1 parent f55fd60 commit 913261c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 3 additions & 4 deletions py/selenium/webdriver/common/action_chains.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,11 @@ def perform(self):

def reset_actions(self):
"""
Clears actions that are already stored on the remote end.
Clears actions that are already stored locally and on the remote end
"""
if self._driver.w3c:
self._driver.execute(Command.W3C_CLEAR_ACTIONS)
else:
self._actions = []
self.w3c_actions.clear_actions()
self._actions = []

def click(self, on_element=None):
"""
Expand Down
3 changes: 3 additions & 0 deletions py/selenium/webdriver/common/actions/action_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ def perform(self):
self.driver.execute(Command.W3C_ACTIONS, enc)

def clear_actions(self):
"""
Clears actions that are already stored on the remote end
"""
self.driver.execute(Command.W3C_CLEAR_ACTIONS)

def _add_input(self, input):
Expand Down

0 comments on commit 913261c

Please sign in to comment.