Java 类org.openqa.selenium.browserlaunchers.Sleeper 实例源码

项目:easycukes    文件:Page.java   
/**
 * switch focus of WebDriver to the next found window handle (that's your
 * newly opened window)
 */
public void switchToNewWindow() {
    handledWindowList.add(driver.getWindowHandle());
    Sleeper.sleepTightInSeconds(3);
    for (final String winHandle : driver.getWindowHandles())
        if (!handledWindowList.contains(winHandle)) {
            driver.switchTo().window(winHandle);
            break;
        }
}
项目:easycukes    文件:Page.java   
/**
 * @return
 */
public void waitLoadingPage() {
    if (loadProgressBy != null)
        waitUntilElementIsHidden(loadProgressBy);
    if (waitNotificationToHide && notifyBy != null)
        waitUntilElementIsHidden(notifyBy);
    Sleeper.sleepTightInSeconds(1);
}
项目:selenium-java-tests    文件:UpdateStatusPanelImpl.java   
@Override
public UpdateStatusPanel updateStatus(String status) {
    Preconditions.checkNotNull(status, "Status parameter is null");
    updateStatusTextArea.clear();
    updateStatusTextArea.sendKeys(status);
    postButton.click();
    int wait = 0;
    while (wait++ <= WAIT_FOR_POST_UPDATE && postButton.isDisplayed()) {
        Sleeper.sleepTightInSeconds(5);
    }
    return this;
}
项目:easycukes    文件:Page.java   
/**
 * Allows TODO
 */
public void refresh() {
    driver.navigate().refresh();
    Sleeper.sleepTightInSeconds(2);
    waitLoadingPage();
}
项目:easycukes    文件:SeleniumCommonStepdefs.java   
/**
 * Waits for a certain time
 *
 * @param seconds amount of time to wait in seconds
 * @throws Throwable
 */
@When("^wait for (\\d+) seconds$")
public void waitForSomeSeconds(int seconds) throws Throwable {
    log.info("waiting " + seconds + " seconds");
    Sleeper.sleepTightInSeconds(seconds);
}
项目:easycukes    文件:SeleniumConfigurationStepdefs.java   
/**
 * Defines the sleeping time to apply for a scenario
 *
 * @param scenario
 */
@Before
public void before(Scenario scenario) {
    Sleeper.sleepTightInSeconds(1);
}