Skip to content
This repository has been archived by the owner on May 22, 2018. It is now read-only.

Commit

Permalink
fixing test, finding another edge case where we need to check -1 from…
Browse files Browse the repository at this point in the history
… the right and bottom of the element's rect
  • Loading branch information
lukeis committed Feb 4, 2016
1 parent 84aaf1d commit 903c2b9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,12 @@ public void testClickOverlappingElements() {
try {
driver.findElement(By.id("under")).click();
} catch (WebDriverException expected) {
return;
if (expected.getMessage().contains("Other element would receive the click")) {
return;
}
expected.printStackTrace();
}
fail("Should throw");
fail("Should have thrown Exception with 'Other element would receive the click' in the message");
}

@JavascriptEnabled
Expand Down
6 changes: 3 additions & 3 deletions javascript/firefox-driver/js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -749,9 +749,9 @@ Utils.getClickablePoint = function(element) {
var offsets = [
{ x: Math.floor(r.width / 2), y: Math.floor(r.height / 2) },
{ x: 0, y: 0 },
{ x: r.width, y: 0 },
{ x: 0, y: r.height },
{ x: r.width, y: r.height}
{ x: r.width - 1, y: 0 },
{ x: 0, y: r.height - 1 },
{ x: r.width - 1, y: r.height - 1}
]

return goog.array.find(offsets, function(offset){
Expand Down

0 comments on commit 903c2b9

Please sign in to comment.