net.thucydides.core.webdriver.DefaultWidgetObjectInitialiser Maven / Gradle / Ivy
package net.thucydides.core.webdriver;
import net.serenitybdd.core.di.SerenityInfrastructure;
import net.serenitybdd.core.pages.WebElementFacade;
import net.serenitybdd.core.pages.WidgetObject;
import org.openqa.selenium.WebDriver;
/**
* Initializes the {@link WebElementFacade} members of a {@link WidgetObject}.
* @author Joe Nasca
*/
public class DefaultWidgetObjectInitialiser extends AbstractObjectInitialiser {
private final WidgetProxyCreator widgetProxyCreator;
public DefaultWidgetObjectInitialiser(WebDriver driver, int ajaxTimeoutInMilliseconds) {
super(driver, ajaxTimeoutInMilliseconds);
this.widgetProxyCreator = SerenityInfrastructure.getWidgetProxyCreator();
}
public boolean apply(WidgetObject widget) {
widgetProxyCreator.proxyElements(widget, driver, ajaxTimeoutInSecondsWithAtLeast1Second());
return true;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy