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 int
BIG_TIMEOUT
protected Configuration
config
static int
DEFAULT_TIMEOUT
Can be used by tests as default timeouts.protected org.openqa.selenium.WebDriver
driver
protected FeaturesRunner
runner
-
Constructor Summary
Constructors Constructor Description WebPage()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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)org.openqa.selenium.WebElement
findElement(org.openqa.selenium.By by)
org.openqa.selenium.WebElement
findElement(org.openqa.selenium.By by, int timeOutInSeconds)
List<org.openqa.selenium.WebElement>
findElements(org.openqa.selenium.By by)
static void
flushPageCache()
Attachment
getAttachment()
Gives access to an attachment retrieved from this web page.Configuration
getConfiguration()
org.openqa.selenium.WebDriver
getDriver()
<T extends WebPage>
TgetPage(Class<T> type)
static <T extends WebPage>
TgetPage(FeaturesRunner runner, Configuration config, Class<T> type)
FeaturesRunner
getRunner()
boolean
hasElement(org.openqa.selenium.By by)
boolean
hasElement(org.openqa.selenium.By by, int timeoutInSeconds)
void
home()
void
to(String path)
org.openqa.selenium.WebElement
waitUntilElementFound(org.openqa.selenium.By by, int timeOutInSeconds)
void
waitUntilElementNotFound(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
-
-
Constructor Detail
-
WebPage
public WebPage()
-
-
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()
-
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()
-
-