Skip to content

Commit

Permalink
Merge pull request robotframework#237 from myaskevich/master
Browse files Browse the repository at this point in the history
Fixed Mouse Up keyword attempting to click and hold one more time before release
  • Loading branch information
emanlove committed Oct 16, 2013
2 parents e2ecb31 + 67872d5 commit cf971d9
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/Selenium2Library/keywords/_element.py
Expand Up @@ -274,7 +274,7 @@ def click_element(self, locator):

def click_element_at_coordinates(self, locator, xoffset, yoffset):
"""Click element identified by `locator` at x/y coordinates of the element.
Cursor is moved and the center of the element and x/y coordinates are
Cursor is moved and the center of the element and x/y coordinates are
calculted from that point.
Key attributes for arbitrary elements are `id` and `name`. See
Expand Down Expand Up @@ -384,7 +384,7 @@ def mouse_up(self, locator):
element = self._element_find(locator, True, False)
if element is None:
raise AssertionError("ERROR: Element %s not found." % (locator))
ActionChains(self._current_browser()).click_and_hold(element).release(element).perform()
ActionChains(self._current_browser()).release(element).perform()

def open_context_menu(self, locator):
"""Opens context menu on element identified by `locator`."""
Expand Down
4 changes: 2 additions & 2 deletions test/acceptance/keywords/click_element_at_coordinates.txt
Expand Up @@ -7,8 +7,8 @@ Resource ../resource.txt
Click Element At Coordinates
[Documentation] LOG 2 Click clicking element 'Clickable' in coordinates '10', '20'.
Click Element At Coordinates Clickable ${10} ${20}
Element Text Should Be outputX 10
Element Text Should Be outputY 20
Element Text Should Be outputX 110
Element Text Should Be outputY 120

*** Keywords ***
Initialize page
Expand Down
4 changes: 3 additions & 1 deletion test/acceptance/keywords/javascript.txt
Expand Up @@ -29,9 +29,11 @@ Mouse Down On Link
[Setup] Go To Page "javascript/mouse_events.html"
Mouse Down On Image image_mousedown
Text Field Should Contain textfield onmousedown
Mouse Up image_mousedown
Input text textfield ${EMPTY}
Mouse Down On Link onmousedown
Mouse Down On Link link_mousedown
Text Field Should Contain textfield onmousedown
Mouse Up link_mousedown

Confirm Action
Click Button Change the title
Expand Down
2 changes: 1 addition & 1 deletion test/acceptance/keywords/lists.txt
Expand Up @@ -99,7 +99,7 @@ Select Non-Existing Item From Multi-Selection List
... Select From List possible_channels Tin Can Phone Email Smoke Signals

Unselect Non-Existing Item From List
[Documentation] LOG 5 Unselecting non-existing items will not throw an error.
[Documentation] LOG 3 Unselecting option(s) 'Tin Can Phone, Smoke Signals, Email' from list 'possible_channels'.
[Tags] OnlyThisOne
Unselect From List possible_channels Tin Can Phone Smoke Signals
Unselect From List possible_channels Tin Can Phone Smoke Signals Email
Expand Down
6 changes: 3 additions & 3 deletions test/resources/html/javascript/mouse_events.html
Expand Up @@ -16,12 +16,12 @@
<img src="foo.jpg" id="image_mousedown" />
</a>

<a href="javascript:void(0);"
<a id="link" href="javascript:void(0);"
onclick="document.forms[0].textfield.value='onclick';return false;"
onmousedown="document.forms[0].textfield.value='onmousedown';return false;">both</a>

<a href="javascript:void(0);"
<a id="link_mousedown" href="javascript:void(0);"
onmousedown="document.forms[0].textfield.value='onmousedown';return false;">onmousedown</a>

</body>
</html>
</html>

0 comments on commit cf971d9

Please sign in to comment.