Skip to content

Commit bd7d47f

Browse files
gregorykleinerlukeis
authored andcommitted
Issue 509 - added unit test to show issue should be resolved and cannot be reproduced
Signed-off-by: Luke Inman-Semerau <[email protected]>
1 parent eccd99f commit bd7d47f

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,4 @@ Gemfile.lock
7272
.idea/sonarIssues.xml
7373
.idea/inspectionProfiles/profiles_settings.xml
7474
.idea/inspectionProfiles/Project_Default.xml
75+
.idea/misc.xml

java/client/test/org/openqa/selenium/ImplicitWaitTest.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
package org.openqa.selenium;
1919

20+
import static java.util.concurrent.TimeUnit.SECONDS;
2021
import static org.junit.Assert.assertFalse;
2122
import static org.junit.Assert.assertTrue;
2223
import static org.junit.Assert.fail;
@@ -154,4 +155,28 @@ public void testShouldImplicitlyWaitForAnElementToBeVisibleBeforeInteracting() {
154155
fail("Element should have been visible");
155156
}
156157
}
158+
159+
160+
@Test
161+
@JavascriptEnabled
162+
@Ignore({IE, PHANTOMJS, SAFARI, MARIONETTE})
163+
public void testShouldRetainImplicitlyWaitFromTheReturnedWebDriverOfFrameSwitchTo() {
164+
driver.manage().timeouts().implicitlyWait(1, SECONDS);
165+
driver.get(pages.xhtmlTestPage);
166+
driver.findElement(By.name("windowOne")).click();
167+
String handle = (String)driver.getWindowHandles().toArray()[1];
168+
169+
WebDriver newWindow = driver.switchTo().window(handle);
170+
171+
long start = System.currentTimeMillis();
172+
173+
newWindow.findElements(By.id("This crazy thing doesn't exist"));
174+
175+
long end = System.currentTimeMillis();
176+
177+
long time = end - start;
178+
179+
assertTrue(time >= 1000);
180+
181+
}
157182
}

0 commit comments

Comments
 (0)