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
Deprecated.
since 8.3
|
static String |
CHROME_DRIVER_DEFAULT_PATH_LINUX
Deprecated.
since 8.3
|
static String |
CHROME_DRIVER_DEFAULT_PATH_MAC
Deprecated.
since 8.3
|
static String |
CHROME_DRIVER_DEFAULT_PATH_WINVISTA
Deprecated.
since 8.3
|
static String |
CHROME_DRIVER_DEFAULT_PATH_WINXP
Deprecated.
since 8.3
|
static String |
CHROME_DRIVER_WINDOWS_EXECUTABLE_NAME
Deprecated.
since 8.3
|
static org.openqa.selenium.remote.RemoteWebDriver |
driver |
static int |
IMPLICIT_WAIT_MILLISECONDS
Driver implicit wait in milliseconds.
|
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 ProxyManager |
proxyManager |
static String |
SYSPROP_CHROME_DRIVER_PATH
Deprecated.
since 8.3
|
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 |
---|---|
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)
Deprecated.
|
protected CollectionContentTabSubPage |
createCollection(DocumentBasePage currentPage,
String collectionsTitle,
String fileDescription)
Deprecated.
since 8.3: use
DocumentBasePage.createCollection(String, String) instead. |
protected DocumentBasePage |
createCollections(DocumentBasePage currentPage,
String collectionsTitle,
String fileDescription)
Deprecated.
since 8.3: use
DocumentBasePage.createCollections(String, String) instead. |
protected FileDocumentBasePage |
createFile(DocumentBasePage currentPage,
String fileTitle,
String fileDescription,
boolean uploadBlob,
String filePrefix,
String fileSuffix,
String fileContent)
Deprecated.
since 8.3: use
DocumentBasePage.createFile(String, String, boolean, String, String, String)
instead. |
protected NoteDocumentBasePage |
createNote(DocumentBasePage currentPage,
String noteTitle,
String noteDescription,
boolean defineNote,
String noteContent)
Deprecated.
since 8.3: use
DocumentBasePage.createNote(String, String, boolean, String) instead. |
protected DocumentBasePage |
createWorkspace(DocumentBasePage currentPage,
String workspaceTitle,
String workspaceDescription)
Deprecated.
since 8.3: use
DocumentBasePage.createWorkspace(String, String) instead. |
protected void |
deleteWorkspace(DocumentBasePage currentPage,
String workspaceTitle)
Deprecated.
since 8.3: use
DocumentBasePage.deleteWorkspace(String) instead. |
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) |
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 static void |
initRemoteFirefoxDriver() |
protected DocumentBasePage |
initRepository(DocumentBasePage currentPage)
Deprecated.
|
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.
|
void |
navToUrl(String urlString)
Navigate to a specified url
|
static void |
open(String url)
Opens given url adding hardcoded Seam conversation named "0NXMAIN".
|
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 POLLING_FREQUENCY_SECONDS
public static final int PAGE_LOAD_TIME_OUT_SECONDS
public static final int LOAD_TIMEOUT_SECONDS
public static final int IMPLICIT_WAIT_MILLISECONDS
public static final int LOAD_SHORT_TIMEOUT_SECONDS
public static final int AJAX_TIMEOUT_SECONDS
public static final int AJAX_SHORT_TIMEOUT_SECONDS
@Deprecated public static final String CHROME_DRIVER_DEFAULT_PATH_LINUX
ChromeDriverProvider
,
Constant Field Values@Deprecated public static final String CHROME_DRIVER_DEFAULT_PATH_MAC
ChromeDriverProvider
,
Constant Field Values@Deprecated public static final String CHROME_DRIVER_DEFAULT_PATH_WINVISTA
ChromeDriverProvider
@Deprecated public static final String CHROME_DRIVER_DEFAULT_PATH_WINXP
ChromeDriverProvider
@Deprecated public static final String CHROME_DRIVER_DEFAULT_EXECUTABLE_NAME
ChromeDriverProvider
,
Constant Field Values@Deprecated public static final String CHROME_DRIVER_WINDOWS_EXECUTABLE_NAME
ChromeDriverProvider
,
Constant Field Values@Deprecated public static final String SYSPROP_CHROME_DRIVER_PATH
ChromeDriverProvider
,
Constant Field Valuespublic static org.openqa.selenium.remote.RemoteWebDriver driver
protected static ProxyManager proxyManager
public org.junit.rules.MethodRule watchman
public AbstractTest()
public void runBeforeAfters()
public static void initDriver() throws Exception
Exception
protected static void initFirefoxDriver() throws Exception
Exception
protected static void initRemoteFirefoxDriver() throws Exception
Exception
protected static void initChromeDriver() throws Exception
Exception
public void checkJavascriptError()
public static void quitDriver()
public static void open(String url)
public static <T> T getWithoutErrorHandler(String url, Class<T> pageClassToProxy) throws IOException
IOException
public static org.openqa.selenium.WebDriver getPopup()
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 <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
- the usernamepassword
- the password@Deprecated protected DocumentBasePage initRepository(DocumentBasePage currentPage) throws Exception
currentPage
.currentPage
- the current pageException
- if initializing repository fails@Deprecated protected void cleanRepository(DocumentBasePage currentPage) throws Exception
currentPage
.currentPage
- the current pageException
- if cleaning repository fails@Deprecated protected DocumentBasePage createWorkspace(DocumentBasePage currentPage, String workspaceTitle, String workspaceDescription)
DocumentBasePage.createWorkspace(String, String)
instead.currentPage
.currentPage
- the current pageworkspaceTitle
- the workspace titleworkspaceDescription
- the workspace description@Deprecated protected void deleteWorkspace(DocumentBasePage currentPage, String workspaceTitle)
DocumentBasePage.deleteWorkspace(String)
instead.workspaceTitle
from the currentPage
.currentPage
- the current pageworkspaceTitle
- the workspace title@Deprecated protected FileDocumentBasePage createFile(DocumentBasePage currentPage, String fileTitle, String fileDescription, boolean uploadBlob, String filePrefix, String fileSuffix, String fileContent) throws IOException
DocumentBasePage.createFile(String, String, boolean, String, String, String)
instead.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 fails@Deprecated protected DocumentBasePage createCollections(DocumentBasePage currentPage, String collectionsTitle, String fileDescription)
DocumentBasePage.createCollections(String, String)
instead.currentPage
.currentPage
- the current pagecollectionsTitle
- the Collections container titlefileDescription
- the collections description@Deprecated protected CollectionContentTabSubPage createCollection(DocumentBasePage currentPage, String collectionsTitle, String fileDescription)
DocumentBasePage.createCollection(String, String)
instead.currentPage
.currentPage
- the current pagecollectionsTitle
- the Collections container titlefileDescription
- the collection descriptionpublic static String getTmpFileToUploadPath(String filePrefix, String fileSuffix, String fileContent) throws IOException
filePrefix
- the file prefixfileSuffix
- the file suffixfileContent
- the file contentIOException
- if temporary file creation failsprotected String getCurrentDocumentId()
@Deprecated protected NoteDocumentBasePage createNote(DocumentBasePage currentPage, String noteTitle, String noteDescription, boolean defineNote, String noteContent) throws IOException
DocumentBasePage.createNote(String, String, boolean, String)
instead.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 noteIOException
Copyright © 2016 Nuxeo SA. All rights reserved.