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 |
protected static org.browsermob.proxy.ProxyServer |
proxyServer |
static String |
SYSPROP_CHROME_DRIVER_PATH |
static String |
TEST_PASSWORD |
static String |
TEST_USERNAME |
protected static File |
tmp_firebug_xpi |
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 |
|---|---|
protected static void |
addFireBug(org.openqa.selenium.firefox.FirefoxProfile profile) |
protected static String |
anyElementNotLoaded(List<org.openqa.selenium.internal.WrapsElement> proxies,
List<String> fieldNames) |
static <T> T |
asPage(Class<T> pageClassToProxy) |
void |
checkJavascriptError() |
protected void |
cleanRepository(DocumentBasePage currentPage)
Cleans the repository (delete the test Workspace) from the
currentPage. |
protected CollectionContentTabSubPage |
createCollection(DocumentBasePage currentPage,
String collectionsTitle,
String fileDescription)
Creates a Collection form the
currentPage. |
protected DocumentBasePage |
createCollections(DocumentBasePage currentPage,
String collectionsTitle,
String fileDescription)
Creates a Collections container form the
currentPage. |
protected FileDocumentBasePage |
createFile(DocumentBasePage currentPage,
String fileTitle,
String fileDescription,
boolean uploadBlob,
String filePrefix,
String fileSuffix,
String fileContent)
Creates a File form the
currentPage. |
protected NoteDocumentBasePage |
createNote(DocumentBasePage currentPage,
String noteTitle,
String noteDescription,
boolean defineNote,
String noteContent)
Creates a Note form the
currentPage. |
protected DocumentBasePage |
createWorkspace(DocumentBasePage currentPage,
String workspaceTitle,
String workspaceDescription)
Creates a Workspace form the
currentPage. |
protected void |
deleteWorkspace(DocumentBasePage currentPage,
String workspaceTitle)
Deletes the Workspace with title
workspaceTitle from the currentPage. |
static <T> T |
fillElement(Class<T> pageClassToProxy,
T page)
Fills an instantiated page/form/widget attributes
|
protected static File |
findExecutableOnPath(String executableName) |
static <T> T |
get(String url,
Class<T> pageClassToProxy) |
protected static List<String> |
getClassLoaderFiles()
Introspects the classpath and returns the list of files in it.
|
protected String |
getCurrentDocumentId()
Get the current document id stored in the javascript ctx.currentDocument variable of the current page.
|
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.
|
protected static void |
initChromeDriver() |
static void |
initDriver() |
protected static void |
initFirefoxDriver() |
protected DocumentBasePage |
initRepository(DocumentBasePage currentPage)
Init the repository with a test Workspace form the
currentPage. |
protected static <T> T |
instantiatePage(Class<T> pageClassToProxy) |
protected static <T extends WebFragment> |
instantiateWebFragment(org.openqa.selenium.WebElement element,
Class<T> webFragmentClass) |
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. wait until the link is available and click on it.
|
void |
navToUrl(String urlString)
Navigate to a specified url
|
static void |
quitDriver() |
protected static void |
removeFireBug() |
void |
runBeforeAfters()
This method will be executed before any method registered with JUnit After annotation.
|
protected static org.openqa.selenium.Proxy |
startProxy() |
protected static void |
stopProxy() |
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
protected static File tmp_firebug_xpi
protected static org.browsermob.proxy.ProxyServer proxyServer
public org.junit.rules.MethodRule watchman
public void runBeforeAfters()
public void checkJavascriptError()
public static void quitDriver()
protected static List<String> getClassLoaderFiles() throws Exception
Exceptionprotected static void addFireBug(org.openqa.selenium.firefox.FirefoxProfile profile)
throws Exception
Exceptionprotected static void removeFireBug()
protected static org.openqa.selenium.Proxy startProxy()
throws Exception
Exceptionpublic static <T> T getWithoutErrorHandler(String url, Class<T> pageClassToProxy) throws IOException
IOExceptionpublic 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)
protected static String anyElementNotLoaded(List<org.openqa.selenium.internal.WrapsElement> proxies, List<String> fieldNames)
protected static <T> T instantiatePage(Class<T> pageClassToProxy)
protected static <T extends WebFragment> T instantiateWebFragment(org.openqa.selenium.WebElement element, Class<T> webFragmentClass)
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 - urlMalformedURLExceptionpublic DocumentBasePage login() throws DocumentBasePage.UserNotConnectedException
DocumentBasePage.UserNotConnectedExceptionpublic DocumentBasePage login(String username, String password) throws DocumentBasePage.UserNotConnectedException
public DocumentBasePage loginAsTestUser() throws DocumentBasePage.UserNotConnectedException
DocumentBasePage.UserNotConnectedExceptionpublic LoginPage loginInvalid(String username, String password)
username - password - protected DocumentBasePage initRepository(DocumentBasePage currentPage) throws Exception
currentPage.currentPage - the current pageException - if initializing repository failsprotected void cleanRepository(DocumentBasePage currentPage) throws Exception
currentPage.currentPage - the current pageException - if cleaning repository failsprotected DocumentBasePage createWorkspace(DocumentBasePage currentPage, String workspaceTitle, String workspaceDescription)
currentPage.currentPage - the current pageworkspaceTitle - the workspace titleworkspaceDescription - the workspace descriptionprotected void deleteWorkspace(DocumentBasePage currentPage, String workspaceTitle)
workspaceTitle from the currentPage.currentPage - the current pageworkspaceTitle - the workspace titleprotected FileDocumentBasePage createFile(DocumentBasePage currentPage, String fileTitle, String fileDescription, boolean uploadBlob, String filePrefix, String fileSuffix, String fileContent) throws IOException
currentPage.currentPage - the current pagefileTitle - the file titlefileDescription - the file descriptionuploadBlob - true if a blob needs to be uploaded (temporary file created for this purpose)filePrefix - the file prefixfileSuffix - the file suffixfileContent - the file contentIOException - if temporary file creation failsprotected DocumentBasePage createCollections(DocumentBasePage currentPage, String collectionsTitle, String fileDescription)
currentPage.currentPage - the current pagecollectionsTitle - the Collections container titlecollectionsDescription - the collections descriptionIOException - if temporary file creation failsprotected CollectionContentTabSubPage createCollection(DocumentBasePage currentPage, String collectionsTitle, String fileDescription)
currentPage.currentPage - the current pagecollectionTitle - the Collections container titlecollectionDescription - the collection descriptionIOException - if temporary file creation failspublic 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 failsprotected String getCurrentDocumentId()
protected NoteDocumentBasePage createNote(DocumentBasePage currentPage, String noteTitle, String noteDescription, boolean defineNote, String noteContent) throws IOException
currentPage.currentPage - the current pagenoteTitle - the note titlenoteDescription - the note descriptiondefineNote - true if the content of the note needs to be definednoteContent - the content of the noteIOExceptionCopyright © 2019 Nuxeo SA. All rights reserved.