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

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

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

import net.serenitybdd.core.di.SerenityInfrastructure;
import net.serenitybdd.core.pages.PageObject;
import org.openqa.selenium.SearchContext;
import org.openqa.selenium.WebDriver;

public class DefaultPageObjectInitialiser extends AbstractObjectInitialiser {

	private ElementProxyCreator elementProxyCreator;
	
    public DefaultPageObjectInitialiser(WebDriver driver, long ajaxTimeoutInMilliseconds) {
    	super(driver, ajaxTimeoutInMilliseconds);
    	this.elementProxyCreator = SerenityInfrastructure.getElementProxyCreator();
    }

    public boolean apply(PageObject page) {
        if (driver != null) {
            page.setWaitForElementTimeout(ajaxTimeout.toMillis());
            elementProxyCreator.proxyElements(page, driver, ajaxTimeoutInSecondsWithAtLeast1Second());
        }
        return true;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy