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

    Fields inherited from class com.onenetwork.platform.tools.test.ui.components.Component

    context, driver, element
  • Constructor Summary

    Constructors 
    Constructor Description
    Container​(UIContext context, org.openqa.selenium.WebElement el)  
  • 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 label
    protected 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 button
    Button getButton​(java.lang.String buttonText)
    Returns the first visible Button in the Container with the provided [buttonText], or throws a NoSuchElementException 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 the Component 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 NoSuchElementException
    Component 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 the Component that maps to the "form" xtype.
    Grid getGrid()
    Convenience method which returns the first visible Grid within the Container, or throws a NoSuchElementException if none was found.
    Grid getGridByClass​(java.lang.String className)
    Returns the first visible Grid within the Container with the provided class, or throws a NoSuchElementException if none was found.
    java.util.List<Grid> getGrids()
    Returns a list of visible Grids within the container.
    Hyperlink getLink​(java.lang.String linkText)
    Returns the first Hyperlink in the Container with the provided [linkText], or throws a NoSuchElementException if none was found.
    Menu getMenu()  
    MessagePanel getMessagePanel()
    Returns the first visible MessagePanel in the Container, or throws a NoSuchElementException if none was found.
    MessagePanel getMessagePanelFlux()
    Returns the first visible MessagePanel in the Container of Flux UI, or throws a NoSuchElementException if none was found.
    Collaboration getNotificationCollaboration()
    Fetches notification collaboration from tab.
    ProblemDetail getProbelmDetail()
    Returns ProbelmDetail component from current tab
    ProblemList getProblemList()
    Returns ProbelmList component from current tab
    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.
    Report getReport()
    Returns the first visible Report in the Container, or throws a NoSuchElementException if it wasn't found.
    java.util.List<Report> getReports()
    Returns a list of the visible Reports in the Container; the list will be empty if none were found.
    org.openqa.selenium.SearchContext getSearchContext()
    Returns the SearchContext used for searching for Components.
    SearchPageContext getSearchPageContext()
    Returns the SearchPageContext in the Container, or throws a NoSuchElementException if it wasn't found.
    TabPanel getTabPanel()
    Returns the first TabPanel found within the Container.
    TabPanel getTabPanelByClass​(java.lang.String className)
    Returns the first TabPanel found within the Container which is of the given css class.
    TemplateDisplay getTemplateDisplay()  
    TreePanel getTreePanel()
    Convenience method which returns the first TreePanel within the Container, or throws a NoSuchElementException if none was found.
    Window getWindow()
    Returns the first visible Window in the Container, or throws a NoSuchElementException if none was found.
    java.util.List<Window> getWindows​(int noOfWindows)
    Returns a list of visible Windowss 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 id
    protected java.lang.String getXTypeFromLabel​(org.openqa.selenium.WebElement labelEl)
    This method returns the xtype of a WebElement from the label
    boolean isRequired​(java.lang.String fieldName)
    Returns true:- if the field is required Returns false :- if the field is optional
    void 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • getSearchContext

      public org.openqa.selenium.SearchContext getSearchContext()
      Returns the SearchContext used for searching for Components. 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

      public Component getComponent​(java.lang.String xtype, org.openqa.selenium.By by)
      Returns the Component given its [xtype] and the top-level element inside this Container that represents it.
      Parameters:
      xtype -
      by -
      Returns:
    • getButton

      public Button getButton​(java.lang.String buttonText)
      Returns the first visible Button in the Container with the provided [buttonText], or throws a NoSuchElementException if none was found.
      Parameters:
      buttonText -
      Returns:
    • getLink

      public Hyperlink getLink​(java.lang.String linkText)
      Returns the first Hyperlink in the Container with the provided [linkText], or throws a NoSuchElementException if none was found.
      Parameters:
      buttonText -
      Returns:
    • getMessagePanel

      public MessagePanel getMessagePanel()
      Returns the first visible MessagePanel in the Container, or throws a NoSuchElementException if none was found.
      Returns:
    • getMessagePanelFlux

      public MessagePanel getMessagePanelFlux()
      Returns the first visible MessagePanel in the Container of Flux UI, or throws a NoSuchElementException if none was found.
      Returns:
    • getTemplateDisplay

      public TemplateDisplay getTemplateDisplay()
    • getReport

      public Report getReport()
      Returns the first visible Report in the Container, or throws a NoSuchElementException if it wasn't found.
      Returns:
    • getReports

      public java.util.List<Report> getReports()
      Returns a list of the visible Reports in the Container; the list will be empty if none were found.
      Returns:
      list of reports which were found in the Container
    • getWindow

      public Window getWindow()
      Returns the first visible Window in the Container, or throws a NoSuchElementException if none was found.
    • getWindows

      public java.util.List<Window> getWindows​(int noOfWindows)
      Returns a list of visible Windowss within the container.
      Parameters:
      noOfWindows - No of windows to wait
      Returns:
    • getGrid

      public Grid getGrid()
      Convenience method which returns the first visible Grid within the Container, or throws a NoSuchElementException if none was found.
      Returns:
    • getGridByClass

      public Grid getGridByClass​(java.lang.String className)
      Returns the first visible Grid within the Container with the provided class, or throws a NoSuchElementException if none was found.
      Parameters:
      className -
      Returns:
    • getGrids

      public java.util.List<Grid> getGrids()
      Returns a list of visible Grids within the container.
      Returns:
    • getTabPanel

      public TabPanel getTabPanel()
      Returns the first TabPanel found within the Container.
    • getTabPanelByClass

      public TabPanel getTabPanelByClass​(java.lang.String className)
      Returns the first TabPanel found within the Container which is of the given css class.
    • getProblemList

      public ProblemList getProblemList()
      Returns ProbelmList component from current tab
      Returns:
      ProbelmList
    • getProbelmDetail

      public ProblemDetail getProbelmDetail()
      Returns ProbelmDetail component from current tab
      Returns:
      ProblemDetail
    • getNotificationCollaboration

      public Collaboration 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

      public Component getFieldByLabel​(java.lang.String fieldLabel)
      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

      protected Component getFieldByLabelNew​(java.lang.String fieldLabel)
      Retrieves a field by its visible label within a form on an Ext page.
    • getFieldByLabelFlux

      public Component getFieldByLabelFlux​(java.lang.String fieldLabel)
      Retrieves a field by its visible label within a form on an Flux page.
    • getFieldByMultiLineLabel

      public Component getFieldByMultiLineLabel​(java.lang.String fieldLabel)
      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

      protected Component createFieldFromLabel​(java.lang.String fieldLabel, java.lang.String xpath)
      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

      public Component getFieldByLabelCC15​(java.lang.String fieldLabel)
      Retrieves a field by its label within a form on an old page. Use this directly (rather than calling getFieldByLabel(String) if you are working within an old (non-Ext) page.
    • getFieldByName

      public Component getFieldByName​(java.lang.String name)
      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

      public TreePanel getTreePanel()
      Convenience method which returns the first TreePanel within the Container, or throws a NoSuchElementException if none was found.
    • getCC1InnerTab

      public Frame getCC1InnerTab​(java.lang.String tabName)
      For legacy (Command Center 1) screens, fetches the Frame corresponding to an inner IFrame tab. Also, switches the Selenium driver to that Frame.
    • getFormPanel

      public Component getFormPanel()
      Returns an instance of the Component that maps to the "form" xtype.
    • getSearchPageContext

      public SearchPageContext getSearchPageContext()
      Returns the SearchPageContext in the Container, or throws a NoSuchElementException 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

      public Menu 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

      public Dashboard getDashboard()
      Returns Dashboard component if tab contains dashboard otherwise throws NoSuchElementException
      Returns:
      Dashboard
    • getFilterOverlayPanel

      public FilterOverlay getFilterOverlayPanel()
    • clickOneLogo

      public void clickOneLogo()
      Click on ONE Logo to open Home page.