public abstract class AbstractOpenNMSSeleniumHelper extends Object
Modifier and Type | Class and Description |
---|---|
protected class |
AbstractOpenNMSSeleniumHelper.WaitForNodesInDatabase |
protected class |
AbstractOpenNMSSeleniumHelper.WaitForNodesInRequisition |
Modifier and Type | Field and Description |
---|---|
static String |
BASIC_AUTH_PASSWORD |
static String |
BASIC_AUTH_USERNAME |
static File |
DOWNLOADS_FOLDER |
static String |
GROUP_NAME |
static long |
LOAD_TIMEOUT |
org.junit.rules.TestWatcher |
m_watcher |
static long |
REQ_TIMEOUT |
static String |
REQUISITION_NAME |
org.openqa.selenium.support.ui.WebDriverWait |
requisitionWait |
static String |
USER_NAME |
org.openqa.selenium.support.ui.WebDriverWait |
wait |
Constructor and Description |
---|
AbstractOpenNMSSeleniumHelper() |
Modifier and Type | Method and Description |
---|---|
void |
adminPage() |
void |
assertElementDoesNotExist(org.openqa.selenium.By by) |
protected void |
assertElementDoesNotHaveText(org.openqa.selenium.By by,
String text) |
protected void |
assertElementHasText(org.openqa.selenium.By by,
String text) |
protected String |
buildUrlExternal(String urlFragment) |
protected String |
buildUrlInternal(String urlFragment) |
void |
cleanDownloadsFolder()
Delete all files in the downloads directory.
|
void |
clearElement(org.openqa.selenium.By by) |
org.openqa.selenium.WebElement |
clickElement(org.openqa.selenium.By by) |
void |
clickElementUntilElementDisappears(org.openqa.selenium.By click,
org.openqa.selenium.By disappears)
In some cases, Vaadin doesn't register our clicks,
so this method keeps click until the given element
is no longer found.
|
protected void |
clickId(String id) |
protected void |
clickId(String id,
boolean refresh) |
protected void |
clickMenuItem(String menuItemText,
String submenuItemText,
String submenuItemHref) |
protected void |
clickMenuItem(String menuItemText,
String submenuItemText,
String submenuItemHref,
int timeout) |
void |
clickUntilVaadinPopupAppears(org.openqa.selenium.By by,
String title) |
void |
clickUntilVaadinPopupDisappears(org.openqa.selenium.By by,
String title) |
int |
countElementsMatchingCss(String css) |
protected void |
createForeignSource(String foreignSource,
String xml) |
protected void |
createRequisition(String foreignSource) |
protected void |
createRequisition(String foreignSource,
String xml,
int expectedNodes) |
protected void |
createTestForeignSource(String xml) |
protected void |
createTestRequisition() |
protected void |
deleteExistingForeignSource(String foreignSource) |
void |
deleteExistingRequisition(String foreignSource) |
protected void |
deleteTestForeignSource() |
protected void |
deleteTestGroup() |
protected void |
deleteTestRequisition() |
protected void |
deleteTestUser() |
protected Integer |
doRequest(org.apache.http.client.methods.HttpRequestBase request) |
void |
enterAutocompleteText(org.openqa.selenium.By textInput,
String text) |
org.openqa.selenium.WebElement |
enterText(org.openqa.selenium.By selector,
CharSequence... text)
CAUTION: There are a variety of Firefox-specific bugs related to using
WebElement.sendKeys(CharSequence...) . |
org.openqa.selenium.WebElement |
findElementByCss(String css) |
org.openqa.selenium.WebElement |
findElementById(String id) |
org.openqa.selenium.WebElement |
findElementByLink(String link) |
org.openqa.selenium.WebElement |
findElementByName(String name) |
org.openqa.selenium.WebElement |
findElementByXpath(String xpath) |
void |
focusElement(org.openqa.selenium.By by) |
protected void |
frontPage() |
abstract String |
getBaseUrlExternal() |
abstract String |
getBaseUrlInternal() |
protected static List<Integer> |
getBoundedRectangleOfElement(org.openqa.selenium.WebDriver driver,
org.openqa.selenium.WebElement we) |
File |
getDownloadsFolder() |
abstract org.openqa.selenium.WebDriver |
getDriver() |
org.openqa.selenium.WebElement |
getElementImmediately(org.openqa.selenium.By by) |
protected org.openqa.selenium.WebElement |
getElementWithoutWaiting(org.openqa.selenium.By by) |
protected org.openqa.selenium.WebElement |
getForeignSourceElement(String requisitionName)
Deprecated.
|
long |
getNodesInDatabase(String foreignSource) |
protected long |
getNodesInDatabase(org.openqa.selenium.WebElement element)
Deprecated.
|
protected long |
getNodesInRequisition(String foreignSource) |
protected long |
getNodesInRequisition(org.openqa.selenium.WebElement element)
Deprecated.
|
protected ResponseData |
getRequest(org.apache.http.client.methods.HttpRequestBase request) |
org.openqa.selenium.support.ui.Select |
getSelect(String id)
Vaadin usually wraps the select elements around a div element.
|
org.openqa.selenium.WebElement |
getVaadinPopup(String title) |
protected void |
goBack() |
protected String |
handleAlert() |
protected String |
handleAlert(String expectedText) |
protected boolean |
inVaadin() |
void |
login() |
protected void |
logout() |
protected void |
nodePage() |
protected void |
notificationsPage() |
protected void |
outagePage() |
protected org.openqa.selenium.support.ui.ExpectedCondition<Boolean> |
pageContainsText(String text) |
protected void |
provisioningPage() |
protected void |
remotingPage() |
protected void |
reportsPage() |
boolean |
requisitionExists(String foreignSource) |
protected org.openqa.selenium.WebElement |
scrollToElement(org.openqa.selenium.By by) |
protected org.openqa.selenium.WebElement |
scrollToElement(org.openqa.selenium.By by,
boolean waitForElement) |
protected static org.openqa.selenium.WebElement |
scrollToElement(org.openqa.selenium.WebDriver driver,
org.openqa.selenium.WebElement element)
Deprecated.
Use
scrollToElement(By) instead. |
protected org.openqa.selenium.WebElement |
scrollToElement(org.openqa.selenium.WebElement element)
Deprecated.
Use
scrollToElement(By) instead. |
protected void |
searchPage() |
void |
selectByVisibleText(String id,
String text) |
protected void |
selectDefaultFrame() |
protected void |
selectVaadinFrame() |
protected void |
sendDelete(String urlFragment) |
protected void |
sendDelete(String urlFragment,
Integer expectedResponse) |
protected void |
sendPost(String urlFragment,
String body) |
void |
sendPost(String urlFragment,
String body,
Integer expectedResponse) |
protected void |
sendPut(String urlFragment,
String body) |
protected void |
sendPut(String urlFragment,
String body,
Integer expectedResponse) |
protected void |
setChecked(org.openqa.selenium.By by) |
org.openqa.selenium.WebDriver.Timeouts |
setImplicitWait() |
org.openqa.selenium.WebDriver.Timeouts |
setImplicitWait(long time,
TimeUnit unit) |
protected void |
setUnchecked(org.openqa.selenium.By by) |
protected void |
sleep(int millis) |
void |
sleepQuietly(int millis) |
protected void |
supportPage() |
protected org.openqa.selenium.support.ui.WebDriverWait |
waitFor(long seconds) |
protected void |
waitForClose(org.openqa.selenium.By selector) |
org.openqa.selenium.WebElement |
waitForElement(org.openqa.selenium.By by) |
org.openqa.selenium.WebElement |
waitForElement(org.openqa.selenium.support.ui.WebDriverWait w,
org.openqa.selenium.By by) |
protected void |
waitForValue(org.openqa.selenium.By selector,
String expectedValue) |
<T> T |
waitUntil(Callable<T> callable) |
<T> T |
waitUntil(org.openqa.selenium.support.ui.ExpectedCondition<T> condition) |
<T> T |
waitUntil(Long implicitWait,
org.openqa.selenium.support.ui.WebDriverWait w,
Callable<T> callable) |
<T> T |
waitUntil(Long implicitWait,
org.openqa.selenium.support.ui.WebDriverWait w,
org.openqa.selenium.support.ui.ExpectedCondition<T> condition) |
<T> T |
waitUntil(org.openqa.selenium.support.ui.WebDriverWait w,
Callable<T> callable) |
<T> T |
waitUntil(org.openqa.selenium.support.ui.WebDriverWait w,
org.openqa.selenium.support.ui.ExpectedCondition<T> condition) |
public static final long LOAD_TIMEOUT
public static final long REQ_TIMEOUT
public static final String BASIC_AUTH_USERNAME
public static final String BASIC_AUTH_PASSWORD
public static final String REQUISITION_NAME
public static final String USER_NAME
public static final String GROUP_NAME
public static final File DOWNLOADS_FOLDER
public org.openqa.selenium.support.ui.WebDriverWait wait
public org.openqa.selenium.support.ui.WebDriverWait requisitionWait
public org.junit.rules.TestWatcher m_watcher
public abstract org.openqa.selenium.WebDriver getDriver()
public abstract String getBaseUrlInternal()
public abstract String getBaseUrlExternal()
public org.openqa.selenium.WebDriver.Timeouts setImplicitWait()
public org.openqa.selenium.WebDriver.Timeouts setImplicitWait(long time, TimeUnit unit)
protected org.openqa.selenium.support.ui.WebDriverWait waitFor(long seconds)
protected void waitForClose(org.openqa.selenium.By selector)
public void login()
protected void logout()
protected org.openqa.selenium.support.ui.ExpectedCondition<Boolean> pageContainsText(String text)
public void focusElement(org.openqa.selenium.By by)
public void clearElement(org.openqa.selenium.By by)
public void assertElementDoesNotExist(org.openqa.selenium.By by)
public org.openqa.selenium.WebElement getElementImmediately(org.openqa.selenium.By by)
protected org.openqa.selenium.WebElement getElementWithoutWaiting(org.openqa.selenium.By by)
protected void assertElementDoesNotHaveText(org.openqa.selenium.By by, String text)
protected void assertElementHasText(org.openqa.selenium.By by, String text)
protected String handleAlert()
protected void setChecked(org.openqa.selenium.By by)
protected void setUnchecked(org.openqa.selenium.By by)
protected void clickMenuItem(String menuItemText, String submenuItemText, String submenuItemHref)
protected void clickMenuItem(String menuItemText, String submenuItemText, String submenuItemHref, int timeout)
protected void frontPage()
public void adminPage()
protected void nodePage()
protected void notificationsPage()
protected void outagePage()
protected void provisioningPage()
protected void remotingPage()
protected void reportsPage()
protected void searchPage()
protected void supportPage()
protected void goBack()
public org.openqa.selenium.WebElement clickElement(org.openqa.selenium.By by)
public org.openqa.selenium.WebElement waitForElement(org.openqa.selenium.By by)
public org.openqa.selenium.WebElement waitForElement(org.openqa.selenium.support.ui.WebDriverWait w, org.openqa.selenium.By by)
public void enterAutocompleteText(org.openqa.selenium.By textInput, String text)
public void clickUntilVaadinPopupAppears(org.openqa.selenium.By by, String title)
public void clickUntilVaadinPopupDisappears(org.openqa.selenium.By by, String title)
protected boolean inVaadin()
protected void selectVaadinFrame()
protected void selectDefaultFrame()
public org.openqa.selenium.WebElement getVaadinPopup(String title)
public org.openqa.selenium.support.ui.Select getSelect(String id)
public org.openqa.selenium.WebElement findElementById(String id)
public org.openqa.selenium.WebElement findElementByLink(String link)
public org.openqa.selenium.WebElement findElementByName(String name)
public org.openqa.selenium.WebElement findElementByCss(String css)
public org.openqa.selenium.WebElement findElementByXpath(String xpath)
public int countElementsMatchingCss(String css) throws InstantiationException, IllegalAccessException, ClassNotFoundException
public org.openqa.selenium.WebElement enterText(org.openqa.selenium.By selector, CharSequence... text)
WebElement.sendKeys(CharSequence...)
. We're doing this bizarre
sequence of operations to try and work around them.protected void sleep(int millis)
public void sleepQuietly(int millis)
protected void waitForValue(org.openqa.selenium.By selector, String expectedValue)
protected org.openqa.selenium.WebElement scrollToElement(org.openqa.selenium.WebElement element)
scrollToElement(By)
instead.protected static org.openqa.selenium.WebElement scrollToElement(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement element)
scrollToElement(By)
instead.protected org.openqa.selenium.WebElement scrollToElement(org.openqa.selenium.By by)
protected org.openqa.selenium.WebElement scrollToElement(org.openqa.selenium.By by, boolean waitForElement)
public void clickElementUntilElementDisappears(org.openqa.selenium.By click, org.openqa.selenium.By disappears)
protected static List<Integer> getBoundedRectangleOfElement(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement we)
protected void clickId(String id) throws InterruptedException
InterruptedException
protected void clickId(String id, boolean refresh) throws InterruptedException
InterruptedException
public <T> T waitUntil(Callable<T> callable)
public <T> T waitUntil(org.openqa.selenium.support.ui.WebDriverWait w, Callable<T> callable)
public <T> T waitUntil(Long implicitWait, org.openqa.selenium.support.ui.WebDriverWait w, Callable<T> callable)
public <T> T waitUntil(org.openqa.selenium.support.ui.ExpectedCondition<T> condition)
public <T> T waitUntil(org.openqa.selenium.support.ui.WebDriverWait w, org.openqa.selenium.support.ui.ExpectedCondition<T> condition)
public <T> T waitUntil(Long implicitWait, org.openqa.selenium.support.ui.WebDriverWait w, org.openqa.selenium.support.ui.ExpectedCondition<T> condition)
protected Integer doRequest(org.apache.http.client.methods.HttpRequestBase request) throws org.apache.http.client.ClientProtocolException, IOException, InterruptedException
org.apache.http.client.ClientProtocolException
IOException
InterruptedException
protected ResponseData getRequest(org.apache.http.client.methods.HttpRequestBase request) throws org.apache.http.client.ClientProtocolException, IOException, InterruptedException
org.apache.http.client.ClientProtocolException
IOException
InterruptedException
public long getNodesInDatabase(String foreignSource)
public boolean requisitionExists(String foreignSource)
public void deleteExistingRequisition(String foreignSource)
@Deprecated protected org.openqa.selenium.WebElement getForeignSourceElement(String requisitionName)
protected void createTestRequisition()
protected void createRequisition(String foreignSource)
protected void createRequisition(String foreignSource, String xml, int expectedNodes)
protected void createTestForeignSource(String xml)
protected void deleteTestForeignSource()
protected void deleteExistingForeignSource(String foreignSource)
protected long getNodesInRequisition(String foreignSource)
@Deprecated protected long getNodesInRequisition(org.openqa.selenium.WebElement element)
@Deprecated protected long getNodesInDatabase(org.openqa.selenium.WebElement element)
protected void sendPost(String urlFragment, String body) throws org.apache.http.client.ClientProtocolException, IOException, InterruptedException
org.apache.http.client.ClientProtocolException
IOException
InterruptedException
public void sendPost(String urlFragment, String body, Integer expectedResponse) throws org.apache.http.client.ClientProtocolException, IOException, InterruptedException
org.apache.http.client.ClientProtocolException
IOException
InterruptedException
protected void sendPut(String urlFragment, String body) throws org.apache.http.client.ClientProtocolException, IOException, InterruptedException
org.apache.http.client.ClientProtocolException
IOException
InterruptedException
protected void sendPut(String urlFragment, String body, Integer expectedResponse) throws org.apache.http.client.ClientProtocolException, IOException, InterruptedException
org.apache.http.client.ClientProtocolException
IOException
InterruptedException
protected void sendDelete(String urlFragment) throws org.apache.http.client.ClientProtocolException, IOException, InterruptedException
org.apache.http.client.ClientProtocolException
IOException
InterruptedException
protected void sendDelete(String urlFragment, Integer expectedResponse) throws org.apache.http.client.ClientProtocolException, IOException, InterruptedException
org.apache.http.client.ClientProtocolException
IOException
InterruptedException
public File getDownloadsFolder()
public void cleanDownloadsFolder()
Copyright © 2022. All rights reserved.