当前位置: 首页>>代码示例>>Java>>正文


Java SystemClock类代码示例

本文整理汇总了Java中org.openqa.selenium.support.ui.SystemClock的典型用法代码示例。如果您正苦于以下问题:Java SystemClock类的具体用法?Java SystemClock怎么用?Java SystemClock使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SystemClock类属于org.openqa.selenium.support.ui包,在下文中一共展示了SystemClock类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: apply

import org.openqa.selenium.support.ui.SystemClock; //导入依赖的package包/类
@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;
    };
}
 
开发者ID:eroshenkoam,项目名称:htmlelements,代码行数:26,代码来源:RetryStatement.java

示例2: CompletedToDosPage

import org.openqa.selenium.support.ui.SystemClock; //导入依赖的package包/类
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);
}
 
开发者ID:eviltester,项目名称:automationAbstractions,代码行数:12,代码来源:CompletedToDosPage.java

示例3: AllToDosPage

import org.openqa.selenium.support.ui.SystemClock; //导入依赖的package包/类
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);
}
 
开发者ID:eviltester,项目名称:automationAbstractions,代码行数:12,代码来源:AllToDosPage.java

示例4: ActiveToDosPage

import org.openqa.selenium.support.ui.SystemClock; //导入依赖的package包/类
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);
}
 
开发者ID:eviltester,项目名称:automationAbstractions,代码行数:12,代码来源:ActiveToDosPage.java

示例5: CompletedToDosPageNoLoad

import org.openqa.selenium.support.ui.SystemClock; //导入依赖的package包/类
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);
}
 
开发者ID:eviltester,项目名称:automationAbstractions,代码行数:12,代码来源:CompletedToDosPageNoLoad.java

示例6: ActiveToDosPageNoLoad

import org.openqa.selenium.support.ui.SystemClock; //导入依赖的package包/类
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);
}
 
开发者ID:eviltester,项目名称:automationAbstractions,代码行数:12,代码来源:ActiveToDosPageNoLoad.java

示例7: AllToDosPageNoLoad

import org.openqa.selenium.support.ui.SystemClock; //导入依赖的package包/类
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);
}
 
开发者ID:eviltester,项目名称:automationAbstractions,代码行数:12,代码来源:AllToDosPageNoLoad.java

示例8: ApplicationPageStructuralSlowLoadable

import org.openqa.selenium.support.ui.SystemClock; //导入依赖的package包/类
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();
    }
}
 
开发者ID:eviltester,项目名称:automationAbstractions,代码行数:16,代码来源:ApplicationPageStructuralSlowLoadable.java

示例9: AbstractLoadable

import org.openqa.selenium.support.ui.SystemClock; //导入依赖的package包/类
/**
 * 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();
}
 
开发者ID:selenareneephillips,项目名称:brixen,代码行数:12,代码来源:AbstractLoadable.java

示例10: SeleniumWait

import org.openqa.selenium.support.ui.SystemClock; //导入依赖的package包/类
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);
}
 
开发者ID:lesfurets,项目名称:selenium-lxc,代码行数:11,代码来源:SeleniumWait.java

示例11: PublicLoadableComponentWaiter

import org.openqa.selenium.support.ui.SystemClock; //导入依赖的package包/类
public PublicLoadableComponentWaiter(LoadableComponent aComponent) {
    clock = new SystemClock();
    this.componentName =  aComponent.getClass().getCanonicalName();
    this.isLoadedPage = new PublicIsLoadableComponent(aComponent);
}
 
开发者ID:eviltester,项目名称:automationAbstractions,代码行数:6,代码来源:PublicLoadableComponentWaiter.java

示例12: WebDriverWait2

import org.openqa.selenium.support.ui.SystemClock; //导入依赖的package包/类
public WebDriverWait2(final WebDriver driver, final long timeOutInSeconds, final long sleepInMillis) {
    super(driver, new SystemClock(), Sleeper.SYSTEM_SLEEPER, timeOutInSeconds, sleepInMillis);
}
 
开发者ID:codezombies,项目名称:easytest,代码行数:4,代码来源:WebDriverWait2.java

示例13: WebElementWait

import org.openqa.selenium.support.ui.SystemClock; //导入依赖的package包/类
public WebElementWait(SearchContext element, long timeoutInSeconds) {
    super(element, new SystemClock(), Sleeper.SYSTEM_SLEEPER);
    withTimeout(timeoutInSeconds, TimeUnit.SECONDS);
    pollingEvery(500, TimeUnit.MILLISECONDS);
    ignoring(WebDriverException.class);
}
 
开发者ID:relateiq,项目名称:AugmentedDriver,代码行数:7,代码来源:WebElementWait.java

示例14: QueNessSlowLoadingExamplePage

import org.openqa.selenium.support.ui.SystemClock; //导入依赖的package包/类
public QueNessSlowLoadingExamplePage(WebDriver driver) {
    super(new SystemClock(), 10);
    this.driver = driver;
}
 
开发者ID:eviltester,项目名称:webDriverExperiments,代码行数:5,代码来源:QueNessSlowLoadingExamplePage.java

示例15: SearchContextWait

import org.openqa.selenium.support.ui.SystemClock; //导入依赖的package包/类
public SearchContextWait(final SearchContext input, final long timeoutMillis) {
    this(input, new SystemClock(), Sleeper.SYSTEM_SLEEPER, timeoutMillis, TimeUnit.MILLISECONDS, DEFAULT_SLEEP_TIMEOUT, TimeUnit.MILLISECONDS);
}
 
开发者ID:MagenTys,项目名称:cinnamon,代码行数:4,代码来源:SearchContextWait.java


注:本文中的org.openqa.selenium.support.ui.SystemClock类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。