Skip to content

Commit

Permalink
Fixing interactions API in Firefox to be able to move mouse to elemen…
Browse files Browse the repository at this point in the history
…ts in frames using native events. Fixes issue 7253
  • Loading branch information
barancev committed May 17, 2014
1 parent c1358e8 commit 6369b48
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
6 changes: 6 additions & 0 deletions common/src/web/click_tests/click_iframe.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<html>
<head>
<title>click iframe</title>
</head>
<body><a id="link" href="submitted_page.html" target="_top">Click me</a></body>
</html>
8 changes: 8 additions & 0 deletions common/src/web/click_tests/click_in_iframe.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<html>
<head>
<title>click in iframe</title>
</head>
<body>
<iframe id="ifr" src="click_iframe.html" style="margin: 200px; width: 100px; height: 50px;" />
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,24 @@ private void navigateToClicksPageAndClickLink() {
wait.until(titleIs("XHTML Test Page"));
}

@Ignore(value = {ANDROID, IPHONE, OPERA, PHANTOMJS, SAFARI}, reason = "Not tested")
@Test
public void canMoveMouseToAnElementInAnIframeAndClick() {
driver.get(appServer.whereIs("click_tests/click_in_iframe.html"));

wait.until(presenceOfElementLocated(By.id("ifr")));
driver.switchTo().frame("ifr");

WebElement link = driver.findElement(By.id("link"));

new Actions(driver)
.moveToElement(link)
.click()
.perform();

wait.until(titleIs("Submitted Successfully!"));
}

@Ignore({IPHONE})
@Test
public void testCanClickOnLinks() {
Expand Down
2 changes: 1 addition & 1 deletion javascript/firefox-driver/js/firefoxDriver.js
Original file line number Diff line number Diff line change
Expand Up @@ -1297,7 +1297,7 @@ FirefoxDriver.prototype.mouseClick = function(respond, parameters) {
}

var doc = respond.session.getDocument();
var elementForNode = getElementFromLocation(respond.session.getMousePosition(), doc);
var elementForNode = getElementFromLocation(respond.session.getMousePosition(), respond.session.getTopDocument());

var nativeMouse = Utils.getNativeMouse();
var node = Utils.getNodeForNativeEvents(elementForNode);
Expand Down

0 comments on commit 6369b48

Please sign in to comment.