com.tidal.wave.wait.ThreadSleep Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of wave Show documentation
Show all versions of wave Show documentation
Automation Code Repository
package com.tidal.wave.wait;
import org.openqa.selenium.WebDriverException;
import org.openqa.selenium.support.ui.Sleeper;
import java.time.Duration;
public class ThreadSleep {
private static final Sleeper sleeper = Sleeper.SYSTEM_SLEEPER;
private ThreadSleep() {
}
public static void forSeconds(double seconds) {
long millis = (long) seconds * 1000;
try {
sleeper.sleep(Duration.ofMillis(millis));
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new WebDriverException(e);
}
}
public static void forMilliS(long millis) {
try {
sleeper.sleep(Duration.ofMillis(millis));
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new WebDriverException(e);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy