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

项目:htmlelements    文件:RetryStatement.java   
@Override
public Statement apply(Statement statement) throws Throwable {
    return () -> {
        Clock clock = new SystemClock();
        long end = clock.laterBy(timeout.in(TimeUnit.MILLISECONDS));
        Throwable lastException;
        do {
            try {
                return statement.evaluate();
            } catch (Throwable e) {
                lastException = e;
                if (ignoring.stream().anyMatch(clazz -> clazz.isInstance(e))) {
                    try {
                        Thread.sleep(polling.in(TimeUnit.MILLISECONDS));
                    } catch (InterruptedException i) {
                        break;
                    }
                } else {
                    Throwables.propagate(e);
                }
            }
        } while ((clock.isNowBefore(end)));
        throw lastException;
    };
}
项目:automationAbstractions    文件:CompletedToDosPage.java   
public CompletedToDosPage(WebDriver driver, TodoMVCSite site){
    super(new SystemClock(), 10);
    this.driver = driver;
    this.site = site;

    // delegate to the main page
    // normally we would do this for components, but since this is a
    // single page app, the 'pages' are somewhat artificial and this
    // avoids duplicated code
    page = new ApplicationPageStructuralSlowLoadable(driver, site);
}
项目:automationAbstractions    文件:AllToDosPage.java   
public AllToDosPage(WebDriver driver, TodoMVCSite site){
    super(new SystemClock(), 10);
    this.driver = driver;
    this.site = site;

    // delegate to the main page
    // normally we would do this for components, but since this is a
    // single page app, the 'pages' are somewhat artificial and this
    // avoids duplicated code
    page = new ApplicationPageStructuralSlowLoadable(driver, site);
}
项目:automationAbstractions    文件:ActiveToDosPage.java   
public ActiveToDosPage(WebDriver driver, TodoMVCSite site){
    super(new SystemClock(), 10);
    this.driver = driver;
    this.site = site;

    // delegate to the main page
    // normally we would do this for components, but since this is a
    // single page app, the 'pages' are somewhat artificial and this
    // avoids duplicated code
    page = new ApplicationPageStructuralSlowLoadable(driver, site);
}
项目:automationAbstractions    文件:CompletedToDosPageNoLoad.java   
public CompletedToDosPageNoLoad(WebDriver driver, TodoMVCSite site){
    super(new SystemClock(), 10);
    this.driver = driver;
    this.site = site;

    // delegate to the main page
    // normally we would do this for components, but since this is a
    // single page app, the 'pages' are somewhat artificial and this
    // avoids duplicated code
    page = new ApplicationPageStructuralSlowLoadable(driver, site);
}
项目:automationAbstractions    文件:ActiveToDosPageNoLoad.java   
public ActiveToDosPageNoLoad(WebDriver driver, TodoMVCSite site){
    super(new SystemClock(), 10);
    this.driver = driver;
    this.site = site;

    // delegate to the main page
    // normally we would do this for components, but since this is a
    // single page app, the 'pages' are somewhat artificial and this
    // avoids duplicated code
    page = new ApplicationPageStructuralSlowLoadable(driver, site);
}
项目:automationAbstractions    文件:AllToDosPageNoLoad.java   
public AllToDosPageNoLoad(WebDriver driver, TodoMVCSite site){
    super(new SystemClock(), 10);
    this.driver = driver;
    this.site = site;

    // delegate to the main page
    // normally we would do this for components, but since this is a
    // single page app, the 'pages' are somewhat artificial and this
    // avoids duplicated code
    page = new ApplicationPageStructuralSlowLoadable(driver, site);
}
项目:automationAbstractions    文件:ApplicationPageStructuralSlowLoadable.java   
public ApplicationPageStructuralSlowLoadable(WebDriver driver, TodoMVCSite todoMVCSite) {
    super(new SystemClock(), 10);

    this.driver = driver;
    this.todoMVCSite = todoMVCSite;
    wait = new WebDriverWait(driver,10);

    // move the mouse out of the way so it
    // doesn't interfere with the test
    try {
        new Robot().mouseMove(0,0);
    } catch (AWTException e) {
        e.printStackTrace();
    }
}
项目:brixen    文件:AbstractLoadable.java   
/**
 * Constructs an {@code AbstractLoadable} with the state specified by the {@code LoadableBean}.
 *
 * @param bean  the data transfer object for constructing this {@code AbstractLoadable}
 */
public AbstractLoadable(final LoadableBean bean) {
    super(new SystemClock(), bean.getLoadTimeout());

    this.driver = bean.getDriver();
    this.loadTimeout = bean.getLoadTimeout();
}
项目: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);
}
项目:automationAbstractions    文件:PublicLoadableComponentWaiter.java   
public PublicLoadableComponentWaiter(LoadableComponent aComponent) {
    clock = new SystemClock();
    this.componentName =  aComponent.getClass().getCanonicalName();
    this.isLoadedPage = new PublicIsLoadableComponent(aComponent);
}
项目:easytest    文件:WebDriverWait2.java   
public WebDriverWait2(final WebDriver driver, final long timeOutInSeconds, final long sleepInMillis) {
    super(driver, new SystemClock(), Sleeper.SYSTEM_SLEEPER, timeOutInSeconds, sleepInMillis);
}
项目:AugmentedDriver    文件:WebElementWait.java   
public WebElementWait(SearchContext element, long timeoutInSeconds) {
    super(element, new SystemClock(), Sleeper.SYSTEM_SLEEPER);
    withTimeout(timeoutInSeconds, TimeUnit.SECONDS);
    pollingEvery(500, TimeUnit.MILLISECONDS);
    ignoring(WebDriverException.class);
}
项目:webDriverExperiments    文件:QueNessSlowLoadingExamplePage.java   
public QueNessSlowLoadingExamplePage(WebDriver driver) {
    super(new SystemClock(), 10);
    this.driver = driver;
}
项目:cinnamon    文件:SearchContextWait.java   
public SearchContextWait(final SearchContext input, final long timeoutMillis) {
    this(input, new SystemClock(), Sleeper.SYSTEM_SLEEPER, timeoutMillis, TimeUnit.MILLISECONDS, DEFAULT_SLEEP_TIMEOUT, TimeUnit.MILLISECONDS);
}
项目:cinnamon    文件:SearchContextWait.java   
public SearchContextWait(final SearchContext input, final long timeoutMillis, final long sleepMillis) {
    this(input, new SystemClock(), Sleeper.SYSTEM_SLEEPER, timeoutMillis, TimeUnit.MILLISECONDS, sleepMillis, TimeUnit.MILLISECONDS);
}
项目:webDriverExperiments    文件:QueNessSlowLoadingExamplePage.java   
public QueNessSlowLoadingExamplePage(WebDriver driver) {
    super(new SystemClock(), 10);
    this.driver = driver;
}
项目:Selenium-Foundation    文件:SearchContextWait.java   
/**
 * Wait will ignore instances of NotFoundException that are encountered
 * (thrown) by default in the 'until' condition, and immediately propagate
 * all others. You can add more to the ignore list by calling
 * ignoring(exceptions to add).
 *
 * @param context
 *            The SearchContext instance to pass to the expected conditions
 * @param timeOutInSeconds
 *            The timeout in seconds when an expectation is called
 * @see SearchContextWait#ignoring(java.lang.Class)
 */
public SearchContextWait(SearchContext context, long timeOutInSeconds) {
    this(context, new SystemClock(), Sleeper.SYSTEM_SLEEPER, timeOutInSeconds, DEFAULT_SLEEP_TIMEOUT);
}
项目:Selenium-Foundation    文件:SearchContextWait.java   
/**
 * Wait will ignore instances of NotFoundException that are encountered
 * (thrown) by default in the 'until' condition, and immediately propagate
 * all others. You can add more to the ignore list by calling
 * ignoring(exceptions to add).
 *
 * @param context
 *            The SearchContext instance to pass to the expected conditions
 * @param timeOutInSeconds
 *            The timeout in seconds when an expectation is called
 * @param sleepInMillis
 *            The duration in milliseconds to sleep between polls.
 * @see SearchContextWait#ignoring(java.lang.Class)
 */
public SearchContextWait(SearchContext context, long timeOutInSeconds, long sleepInMillis) {
    this(context, new SystemClock(), Sleeper.SYSTEM_SLEEPER, timeOutInSeconds, sleepInMillis);
}
项目:qaf    文件:QAFWebDriverWait.java   
/**
 * Wait will ignore instances of NotFoundException that are encountered
 * (thrown) by default in the 'until' condition, and immediately propagate
 * all others. You can add more to the ignore list by calling
 * ignoring(exceptions to add).
 * 
 * @param driver
 *            The WebDriver instance to pass to the expected conditions
 * @param timeOutInMiliSeconds
 *            The timeout in seconds when an expectation is called
 * @see QAFWebDriverWait#ignoring(Class[]) equals
 */
public QAFWebDriverWait(QAFExtendedWebDriver driver, long timeOutInMiliSeconds) {
    this(driver, new SystemClock(), Sleeper.SYSTEM_SLEEPER, timeOutInMiliSeconds,
            getDefaultInterval());
}
项目:qaf    文件:QAFWebDriverWait.java   
/**
 * Wait will ignore instances of NotFoundException that are encountered
 * (thrown) by default in the 'until' condition, and immediately propagate
 * all others. You can add more to the ignore list by calling
 * ignoring(exceptions to add).
 * 
 * @param driver
 *            The WebDriver instance to pass to the expected conditions
 * @param timeOutInMiliSeconds
 *            The timeout in seconds when an expectation is called
 * @param sleepInMillis
 *            The duration in milliseconds to sleep between polls.
 * @see QAFWebDriverWait#ignoring(Class[]) equals
 */
public QAFWebDriverWait(QAFExtendedWebDriver driver, long timeOutInMiliSeconds,
        long sleepInMillis) {
    this(driver, new SystemClock(), Sleeper.SYSTEM_SLEEPER, timeOutInMiliSeconds,
            sleepInMillis);
}
项目:qaf    文件:QAFWebElementWait.java   
/**
 * Wait will ignore instances of NotFoundException that are encountered
 * (thrown) by default in the 'until' condition, and immediately propagate
 * all others. You can add more to the ignore list by calling
 * ignoring(exceptions to add).
 * 
 * @param element
 *            The WebElement instance to pass to the expected conditions
 * @param timeOutInMiliSeconds
 *            The timeout in seconds when an expectation is called
 * @see QAFWebElementWait#ignoring(Class[]) equals
 */
public QAFWebElementWait(QAFExtendedWebElement element, long timeOutInMiliSeconds) {
    this(element, new SystemClock(), Sleeper.SYSTEM_SLEEPER, timeOutInMiliSeconds, getDefaultInterval());
}
项目:qaf    文件:QAFWebElementWait.java   
/**
 * Wait will ignore instances of NotFoundException that are encountered
 * (thrown) by default in the 'until' condition, and immediately propagate
 * all others. You can add more to the ignore list by calling
 * ignoring(exceptions to add).
 * 
 * @param element
 *            The WebElement instance to pass to the expected conditions
 * @param timeOutInMiliSeconds
 *            The timeout in seconds when an expectation is called
 * @param sleepInMillis
 *            The duration in milliseconds to sleep between polls.
 * @see QAFWebElementWait#ignoring(Class[]) equals
 */
public QAFWebElementWait(QAFExtendedWebElement element, long timeOutInMiliSeconds, long sleepInMillis) {
    this(element, new SystemClock(), Sleeper.SYSTEM_SLEEPER, timeOutInMiliSeconds, sleepInMillis);
}