Class WebPage
- java.lang.Object
-
- org.nuxeo.runtime.test.runner.web.WebPage
-
- Direct Known Subclasses:
DocumentPage,LoginPage,ModulePage,WebEngineHomePage
public abstract class WebPage extends Object
- Author:
- Bogdan Stefanescu
-
-
Field Summary
Fields Modifier and Type Field Description static intBIG_TIMEOUTprotected Configurationconfigstatic intDEFAULT_TIMEOUTCan be used by tests as default timeouts.protected org.openqa.selenium.WebDriverdriverprotected FeaturesRunnerrunner
-
Constructor Summary
Constructors Constructor Description WebPage()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description WebPageensureLoaded()Should be overridden by dynamic page (using ajax) to wait until the page is completely loaded By default nothing is done (page is assumed to be loaded)org.openqa.selenium.WebElementfindElement(org.openqa.selenium.By by)org.openqa.selenium.WebElementfindElement(org.openqa.selenium.By by, int timeOutInSeconds)List<org.openqa.selenium.WebElement>findElements(org.openqa.selenium.By by)static voidflushPageCache()AttachmentgetAttachment()Gives access to an attachment retrieved from this web page.ConfigurationgetConfiguration()org.openqa.selenium.WebDrivergetDriver()<T extends WebPage>
TgetPage(Class<T> type)static <T extends WebPage>
TgetPage(FeaturesRunner runner, Configuration config, Class<T> type)FeaturesRunnergetRunner()booleanhasElement(org.openqa.selenium.By by)booleanhasElement(org.openqa.selenium.By by, int timeoutInSeconds)voidhome()voidto(String path)org.openqa.selenium.WebElementwaitUntilElementFound(org.openqa.selenium.By by, int timeOutInSeconds)voidwaitUntilElementNotFound(org.openqa.selenium.By by, int timeOutInSeconds)
-
-
-
Field Detail
-
DEFAULT_TIMEOUT
public static final int DEFAULT_TIMEOUT
Can be used by tests as default timeouts. This way you can change these values to change all the timeout in the tests. DEFAULT_TIMEOUT is used for regular timeouts (loading an ajax page an ajax dialog etc.) while BIG_TIMEOUT should be used for pages that are slower (like the home of a GWT application)- See Also:
- Constant Field Values
-
BIG_TIMEOUT
public static final int BIG_TIMEOUT
- See Also:
- Constant Field Values
-
config
@Inject protected Configuration config
-
driver
@Inject protected org.openqa.selenium.WebDriver driver
-
runner
@Inject protected FeaturesRunner runner
-
-
Method Detail
-
ensureLoaded
public WebPage ensureLoaded()
Should be overridden by dynamic page (using ajax) to wait until the page is completely loaded By default nothing is done (page is assumed to be loaded)- Returns:
- the page itself
-
getConfiguration
public Configuration getConfiguration()
-
getDriver
public org.openqa.selenium.WebDriver getDriver()
-
getRunner
public FeaturesRunner getRunner()
-
home
public void home()
-
to
public void to(String path)
-
hasElement
public boolean hasElement(org.openqa.selenium.By by)
-
hasElement
public boolean hasElement(org.openqa.selenium.By by, int timeoutInSeconds)
-
findElement
public org.openqa.selenium.WebElement findElement(org.openqa.selenium.By by)
-
findElements
public List<org.openqa.selenium.WebElement> findElements(org.openqa.selenium.By by)
-
findElement
public org.openqa.selenium.WebElement findElement(org.openqa.selenium.By by, int timeOutInSeconds)
-
waitUntilElementFound
public org.openqa.selenium.WebElement waitUntilElementFound(org.openqa.selenium.By by, int timeOutInSeconds)
-
waitUntilElementNotFound
public void waitUntilElementNotFound(org.openqa.selenium.By by, int timeOutInSeconds)
-
getPage
public static <T extends WebPage> T getPage(FeaturesRunner runner, Configuration config, Class<T> type)
-
getAttachment
public Attachment getAttachment()
Gives access to an attachment retrieved from this web page.
-
flushPageCache
public static void flushPageCache()
-
-