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

net.thucydides.core.webdriver.PauseTestExecution Maven / Gradle / Ivy

There is a newer version: 4.2.8
Show newest version
package net.thucydides.core.webdriver;

import net.serenitybdd.model.exceptions.SerenityManagedException;

class PauseTestExecution {
    private final int delay;

    PauseTestExecution(int delay) {
        this.delay = delay;
    }

    static PauseTestExecution forADelayOf(int delay) {
        return new PauseTestExecution(delay);
    }

    void seconds() {
        delayFor(delay * 1000);
    }

    private void delayFor(int delayInMilliseconds) {
        try {
            Thread.sleep(delayInMilliseconds);
        } catch (InterruptedException e) {
            throw new SerenityManagedException(e);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy