Class Container
java.lang.Object
com.onenetwork.platform.tools.test.ui.components.Component
com.onenetwork.platform.tools.test.ui.components.Container
- Direct Known Subclasses:
Collaboration
,FilterOverlay
,FormPanel
,Frame
,GlobalSearchContainer
,Grid
,ProblemDetail
,ProblemList
,Report
,SearchPageContext
,TabPanel
,TreePanel
,UserDefinedBucketizationFilter
,Window
public class Container extends Component
This class represents an instance of Ext.Container.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description void
clickAction(java.lang.String actionName)
void
clickAction(java.util.List<org.openqa.selenium.WebElement> actions, java.lang.String actionName)
void
clickMenuItem(java.lang.String... path)
Clicks a menu item which is within some set of menus under a button.void
clickOneLogo()
Click on ONE Logo to open Home page.protected Component
createFieldFromLabel(java.lang.String fieldLabel, java.lang.String xpath)
Creates PLT selenium wrapper field from xpath for field labelprotected java.lang.String
findXTypeFromInput(org.openqa.selenium.WebElement fieldInputEl)
Finds the Ext.Component using Javascript and returns the values of its xtype property.java.util.List<org.openqa.selenium.WebElement>
getActions()
java.util.List<org.openqa.selenium.WebElement>
getActions(java.lang.String actionButtonName)
Gets all available actions under given action buttonButton
getButton(java.lang.String buttonText)
Returns the first visibleButton
in the Container with the provided [buttonText], or throws aNoSuchElementException
if none was found.Frame
getCC1InnerTab(java.lang.String tabName)
For legacy (Command Center 1) screens, fetches the Frame corresponding to an inner IFrame tab.Component
getComponent(java.lang.String xtype, org.openqa.selenium.By by)
Returns theComponent
given its [xtype] and the top-level element inside this Container that represents it.Dashboard
getDashboard()
Returns Dashboard component if tab contains dashboard otherwise throws NoSuchElementExceptionComponent
getFieldByLabel(java.lang.String fieldLabel)
Retrieves a field by its label within a form.Component
getFieldByLabelCC15(java.lang.String fieldLabel)
Retrieves a field by its label within a form on an old page.Component
getFieldByLabelFlux(java.lang.String fieldLabel)
Retrieves a field by its visible label within a form on an Flux page.protected Component
getFieldByLabelNew(java.lang.String fieldLabel)
Retrieves a field by its visible label within a form on an Ext page.Component
getFieldByMultiLineLabel(java.lang.String fieldLabel)
Retrieves a field by its multiple line label (label which contains
tags) within a form.Component
getFieldByName(java.lang.String name)
Retrieves a field within the Container by its name.java.lang.String
getFieldError(java.lang.String label)
FilterOverlay
getFilterOverlayPanel()
Component
getFormPanel()
Returns an instance of theComponent
that maps to the "form" xtype.Grid
getGrid()
Convenience method which returns the first visibleGrid
within the Container, or throws aNoSuchElementException
if none was found.Grid
getGridByClass(java.lang.String className)
Returns the first visibleGrid
within the Container with the provided class, or throws aNoSuchElementException
if none was found.java.util.List<Grid>
getGrids()
Returns a list of visibleGrid
s within the container.Hyperlink
getLink(java.lang.String linkText)
Returns the firstHyperlink
in the Container with the provided [linkText], or throws aNoSuchElementException
if none was found.Menu
getMenu()
MessagePanel
getMessagePanel()
Returns the first visibleMessagePanel
in the Container, or throws aNoSuchElementException
if none was found.MessagePanel
getMessagePanelFlux()
Returns the first visibleMessagePanel
in the Container of Flux UI, or throws aNoSuchElementException
if none was found.Collaboration
getNotificationCollaboration()
Fetches notification collaboration from tab.ProblemDetail
getProbelmDetail()
Returns ProbelmDetail component from current tabProblemList
getProblemList()
Returns ProbelmList component from current taborg.openqa.selenium.WebElement
getReadOnlyFieldByLabelCC15(java.lang.String fieldLabel)
Fetches a read-only CC 1.5 field value web element based on the field label.Report
getReport()
Returns the first visibleReport
in the Container, or throws aNoSuchElementException
if it wasn't found.java.util.List<Report>
getReports()
Returns a list of the visibleReport
s in the Container; the list will be empty if none were found.org.openqa.selenium.SearchContext
getSearchContext()
Returns theSearchContext
used for searching forComponent
s.SearchPageContext
getSearchPageContext()
Returns theSearchPageContext
in the Container, or throws aNoSuchElementException
if it wasn't found.TabPanel
getTabPanel()
Returns the firstTabPanel
found within the Container.TabPanel
getTabPanelByClass(java.lang.String className)
Returns the firstTabPanel
found within the Container which is of the given css class.TemplateDisplay
getTemplateDisplay()
TreePanel
getTreePanel()
Convenience method which returns the firstTreePanel
within the Container, or throws aNoSuchElementException
if none was found.Window
getWindow()
Returns the first visibleWindow
in the Container, or throws aNoSuchElementException
if none was found.java.util.List<Window>
getWindows(int noOfWindows)
Returns a list of visibleWindows
s within the container.protected java.lang.String
getXTypeFromFormItem(org.openqa.selenium.WebElement formItemEl)
protected java.lang.String
getXTypeFromId(java.lang.String id)
This method returns the xtype of a WebElement from its idprotected java.lang.String
getXTypeFromLabel(org.openqa.selenium.WebElement labelEl)
This method returns the xtype of a WebElement from the labelboolean
isRequired(java.lang.String fieldName)
Returns true:- if the field is required Returns false :- if the field is optionalvoid
switchDriver()
This is solely used to support its subclass,Frame
.void
waitForSuccessMessage()
Waits for a success message within the Container; if an error message is found instead, it throws a RuntimeException with the error message that would be displayed to the user.Methods inherited from class com.onenetwork.platform.tools.test.ui.components.Component
getEl, getId, isDisplayed, isRequired
-
Constructor Details
-
Method Details
-
getSearchContext
public org.openqa.selenium.SearchContext getSearchContext()Returns theSearchContext
used for searching forComponent
s. The default implementation returns the element passed into the constructor.- Returns:
-
switchDriver
public void switchDriver()This is solely used to support its subclass,Frame
. The default implementation does nothing. -
getComponent
Returns theComponent
given its [xtype] and the top-level element inside this Container that represents it.- Parameters:
xtype
-by
-- Returns:
-
getButton
Returns the first visibleButton
in the Container with the provided [buttonText], or throws aNoSuchElementException
if none was found.- Parameters:
buttonText
-- Returns:
-
getLink
Returns the firstHyperlink
in the Container with the provided [linkText], or throws aNoSuchElementException
if none was found.- Parameters:
buttonText
-- Returns:
-
getMessagePanel
Returns the first visibleMessagePanel
in the Container, or throws aNoSuchElementException
if none was found.- Returns:
-
getMessagePanelFlux
Returns the first visibleMessagePanel
in the Container of Flux UI, or throws aNoSuchElementException
if none was found.- Returns:
-
getTemplateDisplay
-
getReport
Returns the first visibleReport
in the Container, or throws aNoSuchElementException
if it wasn't found.- Returns:
-
getReports
Returns a list of the visibleReport
s in the Container; the list will be empty if none were found.- Returns:
- list of reports which were found in the Container
-
getWindow
Returns the first visibleWindow
in the Container, or throws aNoSuchElementException
if none was found. -
getWindows
Returns a list of visibleWindows
s within the container.- Parameters:
noOfWindows
- No of windows to wait- Returns:
-
getGrid
Convenience method which returns the first visibleGrid
within the Container, or throws aNoSuchElementException
if none was found.- Returns:
-
getGridByClass
Returns the first visibleGrid
within the Container with the provided class, or throws aNoSuchElementException
if none was found.- Parameters:
className
-- Returns:
-
getGrids
Returns a list of visibleGrid
s within the container.- Returns:
-
getTabPanel
Returns the firstTabPanel
found within the Container. -
getTabPanelByClass
Returns the firstTabPanel
found within the Container which is of the given css class. -
getProblemList
Returns ProbelmList component from current tab- Returns:
- ProbelmList
-
getProbelmDetail
Returns ProbelmDetail component from current tab- Returns:
- ProblemDetail
-
getNotificationCollaboration
Fetches notification collaboration from tab.- Returns:
- Collaboration component
-
waitForSuccessMessage
public void waitForSuccessMessage()Waits for a success message within the Container; if an error message is found instead, it throws a RuntimeException with the error message that would be displayed to the user. -
clickMenuItem
public void clickMenuItem(java.lang.String... path)Clicks a menu item which is within some set of menus under a button. The input to this method is at least 2 Strings, the first of which dictates the button text and the following dictate the text for each menu and submenu text (with the last String being the menu item to click).- Parameters:
driver
-path
-
-
getFieldByLabel
Retrieves a field by its label within a form. The label passed should not include the requiredness indicator or the trailing colon. For example, if the label next to a field is displayed as "* Required Field:", the string you would pass would be "Required Field".- Parameters:
fieldLabel
-- Returns:
-
getFieldByLabelNew
Retrieves a field by its visible label within a form on an Ext page. -
getFieldByLabelFlux
Retrieves a field by its visible label within a form on an Flux page. -
getFieldByMultiLineLabel
Retrieves a field by its multiple line label (label which contains
tags) within a form. The label passed should not include the
tags, requiredness indicator or the trailing colon. For example, if the label next to a field is displayed as "* Required
Field:", the string you would pass would be "Required Field".- Parameters:
fieldLabel
-- Returns:
- Component
-
createFieldFromLabel
Creates PLT selenium wrapper field from xpath for field label- Parameters:
fieldLabel
-xpath
-- Returns:
- Component
-
getReadOnlyFieldByLabelCC15
public org.openqa.selenium.WebElement getReadOnlyFieldByLabelCC15(java.lang.String fieldLabel)Fetches a read-only CC 1.5 field value web element based on the field label.- Parameters:
fieldLabel
- field label, not including colon
-
getFieldByLabelCC15
Retrieves a field by its label within a form on an old page. Use this directly (rather than callinggetFieldByLabel(String)
if you are working within an old (non-Ext) page. -
getFieldByName
Retrieves a field within the Container by its name. Note that the name passed must correspond to the element which has the Ext Component ID (this ID is always in the form of: "ext-comp-X", where X is some number). This element is usually the input tag within the field's markup, but it can vary between different fields; use the browser's developer tools to be sure.- Parameters:
name
-- Returns:
-
getXTypeFromLabel
protected java.lang.String getXTypeFromLabel(org.openqa.selenium.WebElement labelEl)This method returns the xtype of a WebElement from the label- Parameters:
labelEl
-- Returns:
- String
-
getXTypeFromId
protected java.lang.String getXTypeFromId(java.lang.String id)This method returns the xtype of a WebElement from its id- Parameters:
id
-- Returns:
- String
-
getXTypeFromFormItem
protected java.lang.String getXTypeFromFormItem(org.openqa.selenium.WebElement formItemEl) -
findXTypeFromInput
protected java.lang.String findXTypeFromInput(org.openqa.selenium.WebElement fieldInputEl)Finds the Ext.Component using Javascript and returns the values of its xtype property.- Parameters:
fieldInputEl
-- Returns:
-
getTreePanel
Convenience method which returns the firstTreePanel
within the Container, or throws aNoSuchElementException
if none was found. -
getCC1InnerTab
For legacy (Command Center 1) screens, fetches the Frame corresponding to an inner IFrame tab. Also, switches the Selenium driver to that Frame. -
getFormPanel
Returns an instance of theComponent
that maps to the "form" xtype. -
getSearchPageContext
Returns theSearchPageContext
in the Container, or throws aNoSuchElementException
if it wasn't found.- Returns:
-
getActions
public java.util.List<org.openqa.selenium.WebElement> getActions() -
getActions
public java.util.List<org.openqa.selenium.WebElement> getActions(java.lang.String actionButtonName)Gets all available actions under given action button- Parameters:
actionButtonName
-- Returns:
-
clickAction
public void clickAction(java.lang.String actionName) -
clickAction
public void clickAction(java.util.List<org.openqa.selenium.WebElement> actions, java.lang.String actionName) -
getMenu
-
isRequired
public boolean isRequired(java.lang.String fieldName)Returns true:- if the field is required Returns false :- if the field is optional- Parameters:
fieldName
-- Returns:
-
getFieldError
public java.lang.String getFieldError(java.lang.String label)- Parameters:
String
- label:- label of the filter- Returns:
- String :- Returns the error message or null associated with the label.
-
getDashboard
Returns Dashboard component if tab contains dashboard otherwise throws NoSuchElementException- Returns:
- Dashboard
-
getFilterOverlayPanel
-
clickOneLogo
public void clickOneLogo()Click on ONE Logo to open Home page.
-