public abstract class AbstractPage extends Object
Modifier and Type | Field and Description |
---|---|
protected org.openqa.selenium.WebDriver |
driver |
org.openqa.selenium.WebElement |
userServicesForm |
Constructor and Description |
---|
AbstractPage(org.openqa.selenium.WebDriver driver) |
Modifier and Type | Method and Description |
---|---|
<T> T |
asPage(Class<T> pageClassToProxy) |
protected void |
clickOnTabIfNotSelected(String tabPanelId,
String tabElementId) |
protected void |
clickOnTabIfNotSelected(String tabPanelId,
org.openqa.selenium.WebElement tabElement) |
protected void |
clickOnTabIfNotSelected(String tabPanelId,
org.openqa.selenium.WebElement tabElement,
boolean useAjax) |
static void |
closeFancyBox()
Closes current fancy box.
|
static org.openqa.selenium.WebElement |
findElementAndWaitUntilEnabled(org.openqa.selenium.By by)
Finds the first
WebElement using the given method, with the default timeout. |
static org.openqa.selenium.WebElement |
findElementAndWaitUntilEnabled(org.openqa.selenium.By by,
int findElementTimeout,
int waitUntilEnabledTimeout)
Finds the first
WebElement using the given method, with a findElementTimeout . |
static List<org.openqa.selenium.WebElement> |
findElementsWithTimeout(org.openqa.selenium.By by)
Finds webelement list using the given method, with a timeout
|
static void |
findElementWaitUntilEnabledAndClick(org.openqa.selenium.By by)
Finds the first
WebElement using the given method, with the default timeout. |
static void |
findElementWaitUntilEnabledAndClick(org.openqa.selenium.By by,
int findElementTimeout,
int waitUntilEnabledTimeout)
Deprecated.
|
static void |
findElementWaitUntilEnabledAndClick(org.openqa.selenium.WebElement parentElement,
org.openqa.selenium.By by)
Finds the first
WebElement using the given method, with the default timeout, inside an optional
parentElement . |
static org.openqa.selenium.WebElement |
findElementWithTimeout(org.openqa.selenium.By by)
Finds the first
WebElement using the given method, with a timeout. |
org.openqa.selenium.WebElement |
findElementWithTimeout(org.openqa.selenium.By by,
int timeout)
Finds the first
WebElement using the given method, with a timeout. |
org.openqa.selenium.WebElement |
findElementWithTimeout(org.openqa.selenium.By by,
int timeout,
org.openqa.selenium.WebElement parentElement)
Finds the first
WebElement using the given method, with a timeout. |
static org.openqa.selenium.WebElement |
findElementWithTimeout(org.openqa.selenium.By by,
org.openqa.selenium.WebElement parentElement)
Finds the first
WebElement using the given method, with a timeout. |
<T> T |
get(String url,
Class<T> pageClassToProxy) |
String |
getErrorFeedbackMessage()
Returns the error feedback message.
|
static org.openqa.selenium.WebElement |
getFancyBoxContent()
Returns the fancy box content web element.
|
protected String |
getFeedbackMessage(String styleClass) |
HeaderLinksSubPage |
getHeaderLinks()
Gets the top bar navigation sub page.
|
String |
getInfoFeedbackMessage()
Returns the info feedback message.
|
<T extends WebFragment> |
getWebFragment(org.openqa.selenium.By by,
Class<T> webFragmentClass) |
<T extends WebFragment> |
getWebFragment(org.openqa.selenium.WebElement element,
Class<T> webFragmentClass) |
boolean |
hasElement(org.openqa.selenium.By by)
Returns true if corresponding element is found in the test page.
|
void |
selectItemInDropDownMenu(org.openqa.selenium.WebElement selector,
String optionLabel)
Selects item in drop down menu.
|
org.openqa.selenium.WebDriver |
switchToFrame(String id)
Switch to given frame id.
|
boolean |
useAjaxTabs()
Helper method to adapt tests behaviour when ajaxifying tabs.
|
static void |
waitForFancyBoxClosed()
Waits for the fancybox to be fully closed.
|
static void |
waitUntilEnabled(org.openqa.selenium.WebElement element)
Waits until an element is enabled, with a default timeout.
|
static void |
waitUntilEnabled(org.openqa.selenium.WebElement element,
int waitUntilEnabledTimeout)
Waits until an element is enabled, with a timeout.
|
static void |
waitUntilEnabledAndClick(org.openqa.selenium.WebElement element)
Waits until an element is enabled, with a default timeout.
|
static void |
waitUntilEnabledAndClick(org.openqa.selenium.WebElement element,
int waitUntilEnabledTimeout)
Waits until an element is enabled, with a timeout.
|
void |
waitUntilURLDifferentFrom(String url)
Waits until the URL is different from the one given in parameter, with a timeout.
|
public org.openqa.selenium.WebElement userServicesForm
protected org.openqa.selenium.WebDriver driver
public AbstractPage(org.openqa.selenium.WebDriver driver)
public boolean hasElement(org.openqa.selenium.By by)
public <T extends WebFragment> T getWebFragment(org.openqa.selenium.By by, Class<T> webFragmentClass)
public <T extends WebFragment> T getWebFragment(org.openqa.selenium.WebElement element, Class<T> webFragmentClass)
public String getErrorFeedbackMessage()
If there are more than one error message, always return the last one (not interested by 'Please correct errors' message).
public String getInfoFeedbackMessage()
If there are more than one info message, always return the last one.
protected String getFeedbackMessage(String styleClass)
public HeaderLinksSubPage getHeaderLinks()
public static org.openqa.selenium.WebElement getFancyBoxContent()
public static void closeFancyBox()
public static void waitForFancyBoxClosed()
public org.openqa.selenium.WebElement findElementWithTimeout(org.openqa.selenium.By by, int timeout) throws org.openqa.selenium.NoSuchElementException
WebElement
using the given method, with a timeout.by
- the locating mechanismtimeout
- the timeout in millisecondsorg.openqa.selenium.NoSuchElementException
- when not foundpublic org.openqa.selenium.WebElement findElementWithTimeout(org.openqa.selenium.By by, int timeout, org.openqa.selenium.WebElement parentElement) throws org.openqa.selenium.NoSuchElementException
WebElement
using the given method, with a timeout.by
- the locating mechanismtimeout
- the timeout in millisecondsparentElement
- find from the elementorg.openqa.selenium.NoSuchElementException
- when not foundpublic static org.openqa.selenium.WebElement findElementWithTimeout(org.openqa.selenium.By by) throws org.openqa.selenium.NoSuchElementException
WebElement
using the given method, with a timeout.by
- the locating mechanismorg.openqa.selenium.NoSuchElementException
- when not foundpublic static List<org.openqa.selenium.WebElement> findElementsWithTimeout(org.openqa.selenium.By by) throws org.openqa.selenium.NoSuchElementException
org.openqa.selenium.NoSuchElementException
public static org.openqa.selenium.WebElement findElementWithTimeout(org.openqa.selenium.By by, org.openqa.selenium.WebElement parentElement) throws org.openqa.selenium.NoSuchElementException
WebElement
using the given method, with a timeout.by
- the locating mechanismparentElement
- find from the elementorg.openqa.selenium.NoSuchElementException
- when not foundpublic static void waitUntilEnabled(org.openqa.selenium.WebElement element) throws org.openqa.selenium.NotFoundException
element
- the elementorg.openqa.selenium.NotFoundException
public static void waitUntilEnabled(org.openqa.selenium.WebElement element, int waitUntilEnabledTimeout) throws org.openqa.selenium.NotFoundException
element
- the elementwaitUntilEnabledTimeout
- the timeout in millisecondsorg.openqa.selenium.NotFoundException
public static void waitUntilEnabledAndClick(org.openqa.selenium.WebElement element) throws org.openqa.selenium.NotFoundException
element
- the elementorg.openqa.selenium.NotFoundException
public static void waitUntilEnabledAndClick(org.openqa.selenium.WebElement element, int waitUntilEnabledTimeout) throws org.openqa.selenium.NotFoundException
element
- the elementwaitUntilEnabledTimeout
- the timeout in millisecondsorg.openqa.selenium.NotFoundException
public static org.openqa.selenium.WebElement findElementAndWaitUntilEnabled(org.openqa.selenium.By by, int findElementTimeout, int waitUntilEnabledTimeout) throws org.openqa.selenium.NotFoundException
WebElement
using the given method, with a findElementTimeout
. Then waits until
the element is enabled, with a waitUntilEnabledTimeout
.by
- the locating mechanismfindElementTimeout
- the find element timeout in millisecondswaitUntilEnabledTimeout
- the wait until enabled timeout in millisecondsorg.openqa.selenium.NotFoundException
- if the element is not found or not enabledpublic static org.openqa.selenium.WebElement findElementAndWaitUntilEnabled(org.openqa.selenium.By by) throws org.openqa.selenium.NotFoundException
WebElement
using the given method, with the default timeout. Then waits until the element
is enabled, with the default timeout.by
- the locating mechanismorg.openqa.selenium.NotFoundException
- if the element is not found or not enabled@Deprecated public static void findElementWaitUntilEnabledAndClick(org.openqa.selenium.By by, int findElementTimeout, int waitUntilEnabledTimeout) throws org.openqa.selenium.NotFoundException
Locator.findElementWaitUntilEnabledAndClick(WebElement, By, int, int)
WebElement
using the given method, with a findElementTimeout
. Then waits until
the element is enabled, with a waitUntilEnabledTimeout
. Then clicks on the element.by
- the locating mechanismfindElementTimeout
- the find element timeout in millisecondswaitUntilEnabledTimeout
- the wait until enabled timeout in millisecondsorg.openqa.selenium.NotFoundException
- if the element is not found or not enabledpublic static void findElementWaitUntilEnabledAndClick(org.openqa.selenium.By by) throws org.openqa.selenium.NotFoundException
WebElement
using the given method, with the default timeout. Then waits until the element
is enabled, with the default timeout. Then clicks on the element.by
- the locating mechanismorg.openqa.selenium.NotFoundException
- if the element is not found or not enabledpublic static void findElementWaitUntilEnabledAndClick(org.openqa.selenium.WebElement parentElement, org.openqa.selenium.By by) throws org.openqa.selenium.NotFoundException
WebElement
using the given method, with the default timeout, inside an optional
parentElement
. Then waits until the element is enabled, with the default timeout. Then clicks on the
element.parentElement
- the parent element (can be null)by
- the locating mechanismorg.openqa.selenium.NotFoundException
- if the element is not found or not enabledpublic void waitUntilURLDifferentFrom(String url)
url
- the URL to compare topublic void selectItemInDropDownMenu(org.openqa.selenium.WebElement selector, String optionLabel)
public org.openqa.selenium.WebDriver switchToFrame(String id)
public boolean useAjaxTabs()
protected void clickOnTabIfNotSelected(String tabPanelId, org.openqa.selenium.WebElement tabElement)
protected void clickOnTabIfNotSelected(String tabPanelId, org.openqa.selenium.WebElement tabElement, boolean useAjax)
protected void clickOnTabIfNotSelected(String tabPanelId, String tabElementId)
Copyright © 2018 Nuxeo. All rights reserved.