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

net.serenitybdd.core.pages.WidgetObjectImpl Maven / Gradle / Ivy

There is a newer version: 4.2.8
Show newest version
package net.serenitybdd.core.pages;

import net.thucydides.core.webdriver.DefaultWidgetObjectInitialiser;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.pagefactory.ElementLocator;

/**
 * Base implementation for {@link WidgetObject}.
 * 
 * @author Joe Nasca
 */
public class WidgetObjectImpl extends WebElementFacadeImpl implements WidgetObject {

	private final PageObject page;

	public WidgetObjectImpl(PageObject page, ElementLocator locator, WebElement webElement, long timeoutInMilliseconds) {
		super(page.getDriver(), locator, webElement, timeoutInMilliseconds);
		this.page = page;
		new DefaultWidgetObjectInitialiser(page.getDriver(), (int) timeoutInMilliseconds).apply(this);
	}

	public WidgetObjectImpl(PageObject page, ElementLocator locator, long timeoutInMilliseconds) {
		this(page, locator, null, timeoutInMilliseconds);
	}

	public PageObject getPage() {
		return page;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy