All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.magentys.cinnamon.webdriver.Timeouts Maven / Gradle / Ivy

There is a newer version: 0.2.0
Show newest version
package io.magentys.cinnamon.webdriver;

import org.openqa.selenium.support.ui.Duration;

import java.util.concurrent.TimeUnit;

public final class Timeouts {

    // Suppresses default constructor, ensuring non-instantiability.
    private Timeouts() {}

    public static OffsetsTimeout defaultTimeout() {
        return new DefaultTimeout();
    }

    public static Timeout timeoutInSeconds(final long time) {
        return timeoutIn(time, TimeUnit.SECONDS);
    }

    public static Timeout timeoutInMillis(final long time) {
        return timeoutIn(time, TimeUnit.MILLISECONDS);
    }

    public static Timeout timeoutIn(final long time, final TimeUnit unit) {
        return () -> new Duration(time, unit);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy