public abstract class AbstractTest extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
AJAX_SHORT_TIMEOUT_SECONDS |
static int |
AJAX_TIMEOUT_SECONDS |
static int |
LOAD_SHORT_TIMEOUT_SECONDS |
static int |
LOAD_TIMEOUT_SECONDS |
static String |
NUXEO_URL |
org.junit.rules.MethodRule |
watchman
Logger method to follow what's being run on server logs and take a
screenshot of the last page in case of failure
|
| Constructor and Description |
|---|
AbstractTest() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
asPage(Class<T> pageClassToProxy) |
static org.openqa.selenium.WebElement |
findElementAndWaitUntilEnabled(org.openqa.selenium.By by)
Finds the first
WebElement using the given method, with the
default timeout. |
static org.openqa.selenium.WebElement |
findElementAndWaitUntilEnabled(org.openqa.selenium.By by,
int findElementTimeout,
int waitUntilEnabledTimeout)
Finds the first
WebElement using the given method, with a
findElementTimeout. |
static List<org.openqa.selenium.WebElement> |
findElementsWithTimeout(org.openqa.selenium.By by) |
static void |
findElementWaitUntilEnabledAndClick(org.openqa.selenium.By by)
Finds the first
WebElement using the given method, with the
default timeout. |
static void |
findElementWaitUntilEnabledAndClick(org.openqa.selenium.By by,
int findElementTimeout,
int waitUntilEnabledTimeout)
Finds the first
WebElement using the given method, with a
findElementTimeout. |
static org.openqa.selenium.WebElement |
findElementWithTimeout(org.openqa.selenium.By by)
Finds the first
WebElement using the given method, with a
timeout. |
static org.openqa.selenium.WebElement |
findElementWithTimeout(org.openqa.selenium.By by,
int timeout)
Finds the first
WebElement using the given method, with a
timeout. |
static org.openqa.selenium.WebElement |
findElementWithTimeout(org.openqa.selenium.By by,
int timeout,
org.openqa.selenium.WebElement parentElement)
Finds the first
WebElement using the given method, with a
timeout. |
static org.openqa.selenium.WebElement |
findElementWithTimeout(org.openqa.selenium.By by,
org.openqa.selenium.WebElement parentElement)
Finds the first
WebElement using the given method, with a
timeout. |
static <T> T |
get(String url,
Class<T> pageClassToProxy) |
LoginPage |
getLoginPage() |
static void |
initDriver() |
DocumentBasePage |
login()
Login as Administrator
|
DocumentBasePage |
login(String username,
String password) |
LoginPage |
loginInvalid(String username,
String password)
Login using an invalid credential.
|
LoginPage |
logout() |
<T extends AbstractPage> |
nav(Class<T> pageClass,
String linkText)
navigate to a link text.
|
void |
navToUrl(String urlString)
Navigate to a specified url
|
static void |
quitDriver() |
static void |
waitUntilEnabled(org.openqa.selenium.WebElement element)
Waits until an element is enabled, with a timeout.
|
static void |
waitUntilEnabled(org.openqa.selenium.WebElement element,
int timeout)
Waits until an element is enabled, with a timeout.
|
public static final String NUXEO_URL
public static final int LOAD_TIMEOUT_SECONDS
public static final int LOAD_SHORT_TIMEOUT_SECONDS
public static final int AJAX_TIMEOUT_SECONDS
public static final int AJAX_SHORT_TIMEOUT_SECONDS
public org.junit.rules.MethodRule watchman
public static void quitDriver()
throws InterruptedException
InterruptedExceptionpublic static <T> T asPage(Class<T> pageClassToProxy)
public static org.openqa.selenium.WebElement findElementWithTimeout(org.openqa.selenium.By by,
int timeout)
throws org.openqa.selenium.NoSuchElementException
WebElement using the given method, with a
timeout.by - the locating mechanismtimeout - the timeout in millisecondsorg.openqa.selenium.NoSuchElementException - when not foundpublic static org.openqa.selenium.WebElement findElementWithTimeout(org.openqa.selenium.By by,
int timeout,
org.openqa.selenium.WebElement parentElement)
throws org.openqa.selenium.NoSuchElementException
WebElement using the given method, with a
timeout.by - the locating mechanismtimeout - the timeout in millisecondsparentElement - find from the elementorg.openqa.selenium.NoSuchElementException - when not foundpublic static org.openqa.selenium.WebElement findElementWithTimeout(org.openqa.selenium.By by)
throws org.openqa.selenium.NoSuchElementException
WebElement using the given method, with a
timeout.by - the locating mechanismtimeout - the timeout in millisecondsorg.openqa.selenium.NoSuchElementException - when not foundpublic static List<org.openqa.selenium.WebElement> findElementsWithTimeout(org.openqa.selenium.By by) throws org.openqa.selenium.NoSuchElementException
org.openqa.selenium.NoSuchElementExceptionpublic static org.openqa.selenium.WebElement findElementWithTimeout(org.openqa.selenium.By by,
org.openqa.selenium.WebElement parentElement)
throws org.openqa.selenium.NoSuchElementException
WebElement using the given method, with a
timeout.by - the locating mechanismtimeout - the timeout in millisecondsparentElement - find from the elementorg.openqa.selenium.NoSuchElementException - when not foundpublic static void waitUntilEnabled(org.openqa.selenium.WebElement element,
int timeout)
throws org.openqa.selenium.NotFoundException
element - the elementtimeout - the timeout in millisecondsorg.openqa.selenium.NotFoundExceptionpublic static void waitUntilEnabled(org.openqa.selenium.WebElement element)
throws org.openqa.selenium.NotFoundException
element - the elementorg.openqa.selenium.NotFoundExceptionpublic static org.openqa.selenium.WebElement findElementAndWaitUntilEnabled(org.openqa.selenium.By by,
int findElementTimeout,
int waitUntilEnabledTimeout)
throws org.openqa.selenium.NotFoundException
WebElement using the given method, with a
findElementTimeout. Then waits until the element is enabled,
with a waitUntilEnabledTimeout.by - the locating mechanismfindElementTimeout - the find element timeout in millisecondswaitUntilEnabledTimeout - the wait until enabled timeout in
millisecondsorg.openqa.selenium.NotFoundException - if the element is not found or not enabledpublic static org.openqa.selenium.WebElement findElementAndWaitUntilEnabled(org.openqa.selenium.By by)
throws org.openqa.selenium.NotFoundException
WebElement using the given method, with the
default timeout. Then waits until the element is enabled, with the
default timeout.by - the locating mechanismorg.openqa.selenium.NotFoundException - if the element is not found or not enabledpublic static void findElementWaitUntilEnabledAndClick(org.openqa.selenium.By by,
int findElementTimeout,
int waitUntilEnabledTimeout)
throws org.openqa.selenium.NotFoundException
WebElement using the given method, with a
findElementTimeout. Then waits until the element is enabled,
with a waitUntilEnabledTimeout. Then clicks on the element.by - the locating mechanismfindElementTimeout - the find element timeout in millisecondswaitUntilEnabledTimeout - the wait until enabled timeout in
millisecondsorg.openqa.selenium.NotFoundException - if the element is not found or not enabledpublic static void findElementWaitUntilEnabledAndClick(org.openqa.selenium.By by)
throws org.openqa.selenium.NotFoundException
WebElement using the given method, with the
default timeout. Then waits until the element is enabled, with the
default timeout. Then clicks on the element.by - the locating mechanismorg.openqa.selenium.NotFoundException - if the element is not found or not enabledpublic LoginPage getLoginPage()
public LoginPage logout()
public <T extends AbstractPage> T nav(Class<T> pageClass, String linkText)
public void navToUrl(String urlString) throws MalformedURLException
urlString - urlMalformedURLExceptionpublic DocumentBasePage login() throws DocumentBasePage.UserNotConnectedException
DocumentBasePage.UserNotConnectedExceptionpublic DocumentBasePage login(String username, String password) throws DocumentBasePage.UserNotConnectedException
Copyright © 2012 Nuxeo SA. All Rights Reserved.