Java 类org.openqa.selenium.support.ui.Duration 实例源码

项目:redsniff    文件:ExtraExpectedConditions.java   
public static ExpectedCondition<Boolean> done(final Activity activity){
    return new DelayingExpectedCondition<Boolean>() {
        @Override
        public Boolean apply(WebDriver driver) {

            return !activity.busyOn(driver);
        }

        @Override
        public String toString() {
            return activity.toString() + " to be done";
        }

           @Override
           public Duration initialDelay() {
               return activity.initialDelay();
           }

    };
}
项目:ScriptDriver    文件:RunTests.java   
private void sleepSeconds(long seconds) {
    try {
        Sleeper.SYSTEM_SLEEPER.sleep(new Duration(seconds, java.util.concurrent.TimeUnit.SECONDS));
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
}
项目:ScriptDriver    文件:RunTests.java   
private void sleep(long ms) {
    try {
        Sleeper.SYSTEM_SLEEPER.sleep(new Duration(ms, java.util.concurrent.TimeUnit.MILLISECONDS));
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
}
项目:redsniff    文件:Waiter.java   
public void sleep(Duration duration) {
    try {
        Sleeper.SYSTEM_SLEEPER.sleep(duration);
    } catch (InterruptedException e) {
        throw new RuntimeException(e);
    }
}
项目:redsniff    文件:WebDriverFactory.java   
public Duration getInitialAjaxDelayForDriver() {
    WebDriver webDriver = activeDriver();
    if (webDriver instanceof HtmlUnitDriver) {
        return null;
      //new Duration(0, MILLISECONDS);
    } else if (webDriver instanceof ChromeDriver) {
        return null;
    } else {
        return new Duration(1, SECONDS);
    }
}
项目:selenium-lxc    文件:SeleniumWait.java   
public SeleniumWait(WebDriver input) {
    super(input, new SystemClock(), new Sleeper() {
        @Override
        public void sleep(Duration duration) {
        }
    });

    ignoring(NoSuchElementException.class, StaleElementReferenceException.class);
    pollingEvery(100, TimeUnit.MILLISECONDS);
}
项目:gwt-d3    文件:DemoApplication.java   
private DemoApplication(final WebDriver driver) {
       super(driver);
    try {
        Sleeper.SYSTEM_SLEEPER.sleep(new Duration(5, TimeUnit.SECONDS));
    } catch (InterruptedException e) {
        throw new RuntimeException("cannot wait", e);
   }
}
项目:gwt-d3    文件:DemoApplication.java   
public DemoDragMultiple revealDemoDragMultiple() {
try {
    Sleeper.SYSTEM_SLEEPER.sleep(new Duration(5, TimeUnit.SECONDS));
      return new DemoDragMultiple(driver, this).reveal();
} catch (InterruptedException e) {
    throw new RuntimeException("do the thing ");
}
  }
项目:PrOfESSOS    文件:BrowserSimulator.java   
protected void waitMillis(long timeout) throws InterruptedException {
    Sleeper.SYSTEM_SLEEPER.sleep(new Duration(timeout, TimeUnit.MILLISECONDS));
}
项目:htmlelements    文件:RetryStatement.java   
public RetryStatement(Properties properties) {
    this.timeout = new Duration(Long.parseLong(properties.getProperty(TIMEOUT_KEY, "5")), TimeUnit.SECONDS);
    this.polling = new Duration(Long.parseLong(properties.getProperty(POLLING_KEY, "250")), TimeUnit.MILLISECONDS);
    this.ignoring = new ArrayList<>();
}
项目:htmlelements    文件:RetryStatement.java   
public RetryStatement withTimeout(long time, TimeUnit unit) {
    this.timeout = new Duration(time, unit);
    return this;
}
项目:htmlelements    文件:RetryStatement.java   
public RetryStatement pollingEvery(long time, TimeUnit unit) {
    this.polling = new Duration(time, unit);
    return this;
}
项目:redsniff    文件:Waiter.java   
private <V> void waitForInitialDelay(DelayingExpectedCondition<V> delayingExpectedCondition) {
    Duration initialDelay = delayingExpectedCondition.initialDelay();
    if (initialDelay != null) {
        sleep(initialDelay);
    }
}
项目:redsniff    文件:AjaxActivity.java   
@Override
public Duration initialDelay() {
    return WebDriverFactory.getInstance().getInitialAjaxDelayForDriver();
}
项目:cinnamon    文件:DefaultTimeout.java   
public DefaultTimeout() {
    this.duration = new Duration(DEFAULT_TIMEOUT_SECS, TimeUnit.SECONDS);
}
项目:cinnamon    文件:DefaultTimeout.java   
@Override
public Duration getDuration() {
    return duration;
}
项目:cinnamon    文件:Timeouts.java   
public static Timeout timeoutIn(final long time, final TimeUnit unit) {
    return () -> new Duration(time, unit);
}
项目:redsniff    文件:DelayingExpectedCondition.java   
public Duration initialDelay();
项目:redsniff    文件:Activity.java   
public Duration initialDelay();
项目:cinnamon    文件:Timeout.java   
Duration getDuration();