Skip to content

Commit

Permalink
Adding a new test inspired by issue 5237
Browse files Browse the repository at this point in the history
  • Loading branch information
barancev committed Apr 22, 2013
1 parent 5a4b067 commit b99f8a7
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
9 changes: 9 additions & 0 deletions common/src/web/click_tests/issue5237.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>Sample page for issue 5237</title>
</head>
<body>
<iframe id="search" src="issue5237_frame.html"></iframe>
</body>
</html>
1 change: 1 addition & 0 deletions common/src/web/click_tests/issue5237_frame.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<a id="submit" href="#" onclick="window.top.location = 'http://www.google.com/'; return false;">Continue</a>
10 changes: 10 additions & 0 deletions common/src/web/click_tests/issue5237_target.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<title>Target page for issue 5237</title>
</head>
<body>
<h1>Test passed</h1>
</map>
</body>
</html>
13 changes: 13 additions & 0 deletions java/client/test/org/openqa/selenium/FrameSwitchingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import static org.openqa.selenium.WaitingConditions.pageTitleToBe;
import static org.openqa.selenium.testing.Ignore.Driver.ALL;
import static org.openqa.selenium.testing.Ignore.Driver.ANDROID;
import static org.openqa.selenium.testing.Ignore.Driver.FIREFOX;
import static org.openqa.selenium.testing.Ignore.Driver.OPERA;
import static org.openqa.selenium.testing.Ignore.Driver.OPERA_MOBILE;
import static org.openqa.selenium.testing.Ignore.Driver.PHANTOMJS;
Expand Down Expand Up @@ -323,6 +324,18 @@ public void testShouldBeAbleToClickInAFrame() {
assertThat(getTextOfGreetingElement(), equalTo("Success!"));
}

// See https://code.google.com/p/selenium/issues/detail?id=5237
@Ignore({FIREFOX, OPERA, ANDROID, OPERA_MOBILE})
@JavascriptEnabled
@Test
public void testShouldBeAbleToClickInAFrameThatRewritesTopWindowLocation() {
driver.get(appServer.whereIs("click_tests/issue5237.html"));
driver.switchTo().frame("search");
driver.findElement(By.id("submit")).click();
driver.switchTo().defaultContent();
waitFor(pageTitleToBe(driver, "Google"));
}

@Ignore({OPERA, ANDROID, OPERA_MOBILE})
@Test
public void testShouldBeAbleToClickInASubFrame() {
Expand Down

0 comments on commit b99f8a7

Please sign in to comment.