Skip to content

Commit

Permalink
Issue 509 - added unit test to show issue should be resolved and cann…
Browse files Browse the repository at this point in the history
…ot be reproduced

Signed-off-by: Luke Inman-Semerau <luke.semerau@gmail.com>
  • Loading branch information
gregorykleiner authored and lukeis committed Sep 9, 2015
1 parent eccd99f commit bd7d47f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,4 @@ Gemfile.lock
.idea/sonarIssues.xml
.idea/inspectionProfiles/profiles_settings.xml
.idea/inspectionProfiles/Project_Default.xml
.idea/misc.xml
25 changes: 25 additions & 0 deletions java/client/test/org/openqa/selenium/ImplicitWaitTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package org.openqa.selenium;

import static java.util.concurrent.TimeUnit.SECONDS;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
Expand Down Expand Up @@ -154,4 +155,28 @@ public void testShouldImplicitlyWaitForAnElementToBeVisibleBeforeInteracting() {
fail("Element should have been visible");
}
}


@Test
@JavascriptEnabled
@Ignore({IE, PHANTOMJS, SAFARI, MARIONETTE})
public void testShouldRetainImplicitlyWaitFromTheReturnedWebDriverOfFrameSwitchTo() {
driver.manage().timeouts().implicitlyWait(1, SECONDS);
driver.get(pages.xhtmlTestPage);
driver.findElement(By.name("windowOne")).click();
String handle = (String)driver.getWindowHandles().toArray()[1];

WebDriver newWindow = driver.switchTo().window(handle);

long start = System.currentTimeMillis();

newWindow.findElements(By.id("This crazy thing doesn't exist"));

long end = System.currentTimeMillis();

long time = end - start;

assertTrue(time >= 1000);

}
}

0 comments on commit bd7d47f

Please sign in to comment.