Bug 4339: Fixed deprecations

This commit is contained in:
Steffen Schaefer committed 2018-04-24 08:48:15 +02:00
1 parent f67ea36896
commit b0d790e335
2 files changed
+6 -6

No files matched your search

@@ -1,8 +1,8 @@
package com.sap.sailing.selenium.core;
import java.lang.reflect.Field;
import java.time.Duration;
import java.util.List;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.NoSuchElementException;
@@ -66,8 +66,8 @@ public class SeleniumElementLocator implements ElementLocator {
this.context = context;
this.wait = new FluentWait<>(this.context);
this.wait.withTimeout(timeOutSeconds, TimeUnit.SECONDS);
this.wait.pollingEvery(intervalMillis, TimeUnit.MILLISECONDS);
this.wait.withTimeout(Duration.ofSeconds(timeOutSeconds));
this.wait.pollingEvery(Duration.ofMillis(intervalMillis));
this.wait.ignoring(NoSuchElementException.class);
Annotations annotations = new Annotations(field);
@@ -1,11 +1,11 @@
package com.sap.sailing.selenium.pages;
import java.text.MessageFormat;
import java.time.Duration;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.function.BooleanSupplier;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -179,8 +179,8 @@ public class PageObject {
public static <T> FluentWait<T> createFluentWait(T input, int timeout, int polling,
Collection<Class<? extends Throwable>> exceptions) {
FluentWait<T> wait = new FluentWait<>(input);
wait.withTimeout(timeout, TimeUnit.SECONDS);
wait.pollingEvery(polling, TimeUnit.SECONDS);
wait.withTimeout(Duration.ofSeconds(timeout));
wait.pollingEvery(Duration.ofSeconds(polling));
wait.ignoreAll(exceptions);
return wait;