public abstract class AbstractTest extends Object
Modifier and Type | Field and Description |
---|---|
static int |
AJAX_SHORT_TIMEOUT_SECONDS |
static int |
AJAX_TIMEOUT_SECONDS |
static String |
CHROME_DRIVER_DEFAULT_EXECUTABLE_NAME |
static String |
CHROME_DRIVER_DEFAULT_PATH_LINUX |
static String |
CHROME_DRIVER_DEFAULT_PATH_MAC |
static String |
CHROME_DRIVER_DEFAULT_PATH_WINVISTA |
static String |
CHROME_DRIVER_DEFAULT_PATH_WINXP |
static String |
CHROME_DRIVER_WINDOWS_EXECUTABLE_NAME |
static org.openqa.selenium.remote.RemoteWebDriver |
driver |
static int |
LOAD_SHORT_TIMEOUT_SECONDS |
static int |
LOAD_TIMEOUT_SECONDS |
static String |
NUXEO_URL |
static int |
PAGE_LOAD_TIME_OUT_SECONDS
Page Load timeout in seconds.
|
static int |
POLLING_FREQUENCY_MILLISECONDS
Polling frequency in milliseconds.
|
static int |
POLLING_FREQUENCY_SECONDS |
static String |
SYSPROP_CHROME_DRIVER_PATH |
static String |
TEST_PASSWORD |
static String |
TEST_USERNAME |
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) |
void |
checkJavascriptError() |
static <T> T |
fillElement(Class<T> pageClassToProxy,
T page)
Fills an instantiated page/form/widget attributes
|
static <T> T |
get(String url,
Class<T> pageClassToProxy) |
LoginPage |
getLoginPage() |
static org.openqa.selenium.WebDriver |
getPopup() |
static String |
getTmpFileToUploadPath(String filePrefix,
String fileSuffix,
String fileContent)
Creates a temporary file and returns its absolute path.
|
static <T extends WebFragment> |
getWebFragment(org.openqa.selenium.By by,
Class<T> webFragmentClass) |
static <T extends WebFragment> |
getWebFragment(org.openqa.selenium.WebElement element,
Class<T> webFragmentClass) |
static <T> T |
getWithoutErrorHandler(String url,
Class<T> pageClassToProxy)
Do not wait for page load.
|
static void |
initDriver() |
DocumentBasePage |
login()
Login as Administrator
|
DocumentBasePage |
login(String username,
String password) |
DocumentBasePage |
loginAsTestUser()
Login as default test user.
|
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() |
void |
runBeforeAfters()
This method will be executed before any method registered with JUnit After annotation.
|
public static final String TEST_USERNAME
public static final String TEST_PASSWORD
public static final int POLLING_FREQUENCY_MILLISECONDS
public static final int PAGE_LOAD_TIME_OUT_SECONDS
public static final String CHROME_DRIVER_DEFAULT_PATH_LINUX
public static final String CHROME_DRIVER_DEFAULT_PATH_MAC
public static final String CHROME_DRIVER_DEFAULT_PATH_WINVISTA
public static final String CHROME_DRIVER_DEFAULT_PATH_WINXP
public static final String CHROME_DRIVER_DEFAULT_EXECUTABLE_NAME
public static final String CHROME_DRIVER_WINDOWS_EXECUTABLE_NAME
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 static final int POLLING_FREQUENCY_SECONDS
public static final String SYSPROP_CHROME_DRIVER_PATH
public static org.openqa.selenium.remote.RemoteWebDriver driver
public org.junit.rules.MethodRule watchman
public void runBeforeAfters()
public void checkJavascriptError()
public static void quitDriver()
public static <T> T getWithoutErrorHandler(String url, Class<T> pageClassToProxy) throws IOException
IOException
public static org.openqa.selenium.WebDriver getPopup()
public static <T> T asPage(Class<T> pageClassToProxy)
public static <T extends WebFragment> T getWebFragment(org.openqa.selenium.By by, Class<T> webFragmentClass)
public static <T extends WebFragment> T getWebFragment(org.openqa.selenium.WebElement element, Class<T> webFragmentClass)
public static <T> T fillElement(Class<T> pageClassToProxy, T page)
public LoginPage getLoginPage()
public LoginPage logout()
public <T extends AbstractPage> T nav(Class<T> pageClass, String linkText)
public void navToUrl(String urlString) throws MalformedURLException
urlString
- urlMalformedURLException
public DocumentBasePage login() throws DocumentBasePage.UserNotConnectedException
DocumentBasePage.UserNotConnectedException
public DocumentBasePage login(String username, String password) throws DocumentBasePage.UserNotConnectedException
public DocumentBasePage loginAsTestUser() throws DocumentBasePage.UserNotConnectedException
DocumentBasePage.UserNotConnectedException
public LoginPage loginInvalid(String username, String password)
username
- password
- public static String getTmpFileToUploadPath(String filePrefix, String fileSuffix, String fileContent) throws IOException
tmpFilePrefix
- the file prefixfileSuffix
- the file suffixfileContent
- the file contentIOException
- if temporary file creation failsCopyright © 2015 Nuxeo SA. All rights reserved.