本文整理汇总了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;
};
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例14: QueNessSlowLoadingExamplePage
import org.openqa.selenium.support.ui.SystemClock; //导入依赖的package包/类
public QueNessSlowLoadingExamplePage(WebDriver driver) {
super(new SystemClock(), 10);
this.driver = driver;
}
示例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);
}