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

io.github.kgress.scaffold.WebElementWait Maven / Gradle / Ivy

There is a newer version: 3.5.0
Show newest version
package io.github.kgress.scaffold;

import lombok.Getter;
import org.openqa.selenium.WebElement;

public class WebElementWait {

    @Getter
    private final BaseWebElement element;

    @Getter
    private final WebDriverWrapper webDriverWrapper;

    WebElementWait(WebDriverWrapper webDriverWrapper, BaseWebElement element) {
        this.webDriverWrapper = webDriverWrapper;
        this.element = element;
    }

    /**
     * Waits for an element to be displayed using {@link AutomationWait#waitUntilDisplayed(BaseWebElement, Long)}
     * @return as {@link WebElement}
     */
    public WebElement waitUntilDisplayed() {
        return getWebDriverWrapper().getAutomationWait().waitUntilDisplayed(getElement());
    }

    /**
     * Waits for the page to return to a loaded state.
     * @return as {@link Boolean}
     */
    public Boolean waitUntilPageIsLoaded() {
        return getWebDriverWrapper().getAutomationWait().waitUntilPageIsLoaded();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy