Class AbstractOpenNMSSeleniumHelper


  • public abstract class AbstractOpenNMSSeleniumHelper
    extends Object
    • Field Detail

      • LOAD_TIMEOUT

        public static final long LOAD_TIMEOUT
      • REQ_TIMEOUT

        public static final long REQ_TIMEOUT
      • DOWNLOADS_FOLDER

        public static final File DOWNLOADS_FOLDER
      • wait

        public org.openqa.selenium.support.ui.WebDriverWait wait
      • requisitionWait

        public org.openqa.selenium.support.ui.WebDriverWait requisitionWait
      • m_watcher

        public org.junit.rules.TestWatcher m_watcher
    • Constructor Detail

      • AbstractOpenNMSSeleniumHelper

        public AbstractOpenNMSSeleniumHelper()
    • Method Detail

      • getDriver

        public abstract org.openqa.selenium.WebDriver getDriver()
      • getBaseUrlInternal

        public abstract String getBaseUrlInternal()
      • getBaseUrlExternal

        public abstract String getBaseUrlExternal()
      • setImplicitWait

        public org.openqa.selenium.WebDriver.Timeouts setImplicitWait()
      • setImplicitWait

        public org.openqa.selenium.WebDriver.Timeouts setImplicitWait​(long time,
                                                                      TimeUnit unit)
      • waitFor

        protected org.openqa.selenium.support.ui.WebDriverWait waitFor​(long seconds)
      • waitForClose

        protected void waitForClose​(org.openqa.selenium.By selector)
      • login

        public void login()
      • logout

        protected void logout()
      • pageContainsText

        protected org.openqa.selenium.support.ui.ExpectedCondition<Boolean> pageContainsText​(String text)
      • focusElement

        public void focusElement​(org.openqa.selenium.By by)
      • clearElement

        public void clearElement​(org.openqa.selenium.By by)
      • assertElementDoesNotExist

        public void assertElementDoesNotExist​(org.openqa.selenium.By by)
      • getElementImmediately

        public org.openqa.selenium.WebElement getElementImmediately​(org.openqa.selenium.By by)
      • getElementWithoutWaiting

        protected org.openqa.selenium.WebElement getElementWithoutWaiting​(org.openqa.selenium.By by)
      • assertElementDoesNotHaveText

        protected void assertElementDoesNotHaveText​(org.openqa.selenium.By by,
                                                    String text)
      • assertElementHasText

        protected void assertElementHasText​(org.openqa.selenium.By by,
                                            String text)
      • handleAlert

        protected String handleAlert()
      • handleAlert

        protected String handleAlert​(String expectedText)
      • setChecked

        protected void setChecked​(org.openqa.selenium.By by)
      • setUnchecked

        protected void setUnchecked​(org.openqa.selenium.By by)
      • clickMenuItem

        protected void clickMenuItem​(String menuItemText,
                                     String submenuItemText,
                                     String submenuItemHref)
      • clickMenuItem

        protected void clickMenuItem​(String menuItemText,
                                     String submenuItemText,
                                     String submenuItemHref,
                                     int timeout)
      • frontPage

        protected void frontPage()
      • adminPage

        public void adminPage()
      • nodePage

        protected void nodePage()
      • notificationsPage

        protected void notificationsPage()
      • outagePage

        protected void outagePage()
      • provisioningPage

        protected void provisioningPage()
      • reportsPage

        protected void reportsPage()
      • searchPage

        protected void searchPage()
      • supportPage

        protected void supportPage()
      • goBack

        protected void goBack()
      • clickElement

        public org.openqa.selenium.WebElement clickElement​(org.openqa.selenium.By by)
      • waitForElement

        public org.openqa.selenium.WebElement waitForElement​(org.openqa.selenium.By by)
      • waitForElement

        public org.openqa.selenium.WebElement waitForElement​(org.openqa.selenium.support.ui.WebDriverWait w,
                                                             org.openqa.selenium.By by)
      • enterAutocompleteText

        public void enterAutocompleteText​(org.openqa.selenium.By textInput,
                                          String text)
      • clickUntilVaadinPopupAppears

        public void clickUntilVaadinPopupAppears​(org.openqa.selenium.By by,
                                                 String title)
      • clickUntilVaadinPopupDisappears

        public void clickUntilVaadinPopupDisappears​(org.openqa.selenium.By by,
                                                    String title)
      • inVaadin

        protected boolean inVaadin()
      • selectVaadinFrame

        protected void selectVaadinFrame()
      • selectDefaultFrame

        protected void selectDefaultFrame()
      • getVaadinPopup

        public org.openqa.selenium.WebElement getVaadinPopup​(String title)
      • selectByVisibleText

        public void selectByVisibleText​(String id,
                                        String text)
      • getSelect

        public org.openqa.selenium.support.ui.Select getSelect​(String id)
        Vaadin usually wraps the select elements around a div element. This method considers this.
      • findElementById

        public org.openqa.selenium.WebElement findElementById​(String id)
      • findElementByLink

        public org.openqa.selenium.WebElement findElementByLink​(String link)
      • findElementByName

        public org.openqa.selenium.WebElement findElementByName​(String name)
      • findElementByCss

        public org.openqa.selenium.WebElement findElementByCss​(String css)
      • findElementByXpath

        public org.openqa.selenium.WebElement findElementByXpath​(String xpath)
      • enterText

        public 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...). We're doing this bizarre sequence of operations to try and work around them.
      • sleep

        protected void sleep​(int millis)
      • sleepQuietly

        public void sleepQuietly​(int millis)
      • waitForValue

        protected void waitForValue​(org.openqa.selenium.By selector,
                                    String expectedValue)
      • scrollToElement

        protected org.openqa.selenium.WebElement scrollToElement​(org.openqa.selenium.WebElement element)
        Deprecated.
        Use scrollToElement(By) instead.
      • scrollToElement

        protected static org.openqa.selenium.WebElement scrollToElement​(org.openqa.selenium.WebDriver driver,
                                                                        org.openqa.selenium.WebElement element)
        Deprecated.
        Use scrollToElement(By) instead.
      • scrollToElement

        protected org.openqa.selenium.WebElement scrollToElement​(org.openqa.selenium.By by)
      • scrollToElement

        protected org.openqa.selenium.WebElement scrollToElement​(org.openqa.selenium.By by,
                                                                 boolean waitForElement)
      • clickElementUntilElementDisappears

        public 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.
      • getBoundedRectangleOfElement

        protected static List<Integer> getBoundedRectangleOfElement​(org.openqa.selenium.WebDriver driver,
                                                                    org.openqa.selenium.WebElement we)
      • waitUntil

        public <T> T waitUntil​(Callable<T> callable)
      • waitUntil

        public <T> T waitUntil​(org.openqa.selenium.support.ui.WebDriverWait w,
                               Callable<T> callable)
      • waitUntil

        public <T> T waitUntil​(Long implicitWait,
                               org.openqa.selenium.support.ui.WebDriverWait w,
                               Callable<T> callable)
      • waitUntil

        public <T> T waitUntil​(org.openqa.selenium.support.ui.ExpectedCondition<T> condition)
      • waitUntil

        public <T> T waitUntil​(org.openqa.selenium.support.ui.WebDriverWait w,
                               org.openqa.selenium.support.ui.ExpectedCondition<T> condition)
      • waitUntil

        public <T> T waitUntil​(Long implicitWait,
                               org.openqa.selenium.support.ui.WebDriverWait w,
                               org.openqa.selenium.support.ui.ExpectedCondition<T> condition)
      • getNodesInDatabase

        public long getNodesInDatabase​(String foreignSource)
      • requisitionExists

        public boolean requisitionExists​(String foreignSource)
      • deleteExistingRequisition

        public void deleteExistingRequisition​(String foreignSource)
      • getForeignSourceElement

        @Deprecated
        protected org.openqa.selenium.WebElement getForeignSourceElement​(String requisitionName)
        Deprecated.
      • createTestRequisition

        protected void createTestRequisition()
      • createRequisition

        protected void createRequisition​(String foreignSource)
      • createRequisition

        protected void createRequisition​(String foreignSource,
                                         String xml,
                                         int expectedNodes)
      • deleteTestRequisition

        protected void deleteTestRequisition()
                                      throws Exception
        Throws:
        Exception
      • createTestForeignSource

        protected void createTestForeignSource​(String xml)
      • createForeignSource

        protected void createForeignSource​(String foreignSource,
                                           String xml)
      • deleteTestForeignSource

        protected void deleteTestForeignSource()
      • deleteExistingForeignSource

        protected void deleteExistingForeignSource​(String foreignSource)
      • getNodesInRequisition

        protected long getNodesInRequisition​(String foreignSource)
      • getNodesInRequisition

        @Deprecated
        protected long getNodesInRequisition​(org.openqa.selenium.WebElement element)
        Deprecated.
      • getNodesInDatabase

        @Deprecated
        protected long getNodesInDatabase​(org.openqa.selenium.WebElement element)
        Deprecated.
      • buildUrlInternal

        protected String buildUrlInternal​(String urlFragment)
      • buildUrlExternal

        protected String buildUrlExternal​(String urlFragment)
      • getDownloadsFolder

        public File getDownloadsFolder()
      • cleanDownloadsFolder

        public void cleanDownloadsFolder()
        Delete all files in the downloads directory.