Class BaseModelLinkField

java.lang.Object
com.onenetwork.platform.tools.test.ui.components.ext.base.BaseModelLinkField
Direct Known Subclasses:
ModelLinkFieldIE

public class BaseModelLinkField
extends java.lang.Object
Base class for ModelLinkField component APIs.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected UIContext context  
    protected org.openqa.selenium.WebDriver driver  
    protected org.openqa.selenium.WebElement element  
    protected org.openqa.selenium.WebElement inputEl  
    protected static PlatformLogger LOG  
  • Constructor Summary

    Constructors 
    Constructor Description
    BaseModelLinkField​(UIContext context, org.openqa.selenium.WebElement formItemEl, ModelLinkField field)  
  • Method Summary

    Modifier and Type Method Description
    void clearValue()
    Clears ModelLink value
    protected void clickInputEl()  
    java.util.List<org.openqa.selenium.WebElement> getAutoCompleteItems​(java.lang.String wildCardValue, boolean returnNullIfNoneFound)
    Enter the string value Returns the List of drop down auto complete Items list.
    java.util.List<org.openqa.selenium.WebElement> getListOfFilledValues()
    Returns the list of already filled display values.
    java.util.List<org.openqa.selenium.WebElement> getListOfFilledValues​(boolean waitIfNotPresent)  
    org.json.JSONArray getValue()
    Returns the value of the ModelLinkField as a JSONArray.
    void insertStringValue​(java.lang.String value)
    Insert the String value into the ModelLinkField and leaves auto complete list opened.
    boolean isRequired()  
    Window launchPicker()
    Launches (and returns) a picker dialog window by clicking on the picker icon.
    void select​(java.lang.String val)
    Clears the value of a ModelLinkField and then set it then selects the match in the dropdown auto complete list
    protected void selectComboListItem​(java.lang.String val)  
    protected void selectComboListItemInExact​(java.lang.String val)  
    void setMultipleValues​(java.lang.String... values)
    This method can be used to add multiple values through autocomplete.
    void setMultipleValuesInExact​(java.lang.String... values)
    This method can be used to add multiple values through autocomplete.
    void setValue​(java.lang.Long value, java.lang.String displayValue)
    Convenience function to setValue(JSONObject), which allows you to pass the two components of a ModelLinkField's value as different parameters.
    void setValue​(java.lang.String val, boolean select)
    Clears the value of a ModelLinkField and then sets it to a string.
    void setValue​(org.json.JSONArray val)
    Sets the value of a multiselect ModelLinkField to a JSONArray of JSONObjects, each with value and displayValue properties.
    void setValue​(org.json.JSONObject val)
    Sets the value of the ModelLinkField to a JSONObject with value and displayValue properties.
    protected void setValueAux​(java.lang.Object val)  
    void setValueInexact​(java.lang.String val)
    Clears the value of a ModelLinkField and then sets it to the first autocomplete entry which contains the given value.

    Methods inherited from class java.lang.Object

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

    • inputEl

      protected final org.openqa.selenium.WebElement inputEl
    • context

      protected UIContext context
    • driver

      protected org.openqa.selenium.WebDriver driver
    • element

      protected org.openqa.selenium.WebElement element
    • LOG

      protected static final PlatformLogger LOG
  • Constructor Details

  • Method Details

    • setValue

      public void setValue​(org.json.JSONObject val)
      Sets the value of the ModelLinkField to a JSONObject with value and displayValue properties.
      Parameters:
      val -
    • setValue

      public void setValue​(org.json.JSONArray val)
      Sets the value of a multiselect ModelLinkField to a JSONArray of JSONObjects, each with value and displayValue properties.
      Parameters:
      val -
    • setValue

      public void setValue​(java.lang.String val, boolean select)
      Clears the value of a ModelLinkField and then sets it to a string. If [select] is true, it selects the match in the dropdown autocompleted list; if it's false, it leaves the field with the wildcard string.
      Parameters:
      val -
      select -
    • select

      public void select​(java.lang.String val)
      Clears the value of a ModelLinkField and then set it then selects the match in the dropdown auto complete list
      Parameters:
      val -
    • setValueInexact

      public void setValueInexact​(java.lang.String val)
      Clears the value of a ModelLinkField and then sets it to the first autocomplete entry which contains the given value. For example, if you provide value "Sou", and the value "SouthRegion" is in the autocomplete, it will select that value.
      Parameters:
      val - first autocomplete value value matching this string will be selected
    • setValue

      public void setValue​(java.lang.Long value, java.lang.String displayValue)
      Convenience function to setValue(JSONObject), which allows you to pass the two components of a ModelLinkField's value as different parameters.
      Parameters:
      value -
      displayValue -
    • setValueAux

      protected void setValueAux​(java.lang.Object val)
    • setMultipleValues

      public void setMultipleValues​(java.lang.String... values)
      This method can be used to add multiple values through autocomplete.

      Note: this method can be used only if ModelLinkField is configured for multiple values. Otherwise you will get RuntimeException

      Parameters:
      values -
    • setMultipleValuesInExact

      public void setMultipleValuesInExact​(java.lang.String... values)
      This method can be used to add multiple values through autocomplete. If multiple options are displayed for a value then first displayed option will be used.

      Note: this method can be used only if ModelLinkField is configured for multiple values. Otherwise you will get RuntimeException

      Parameters:
      values -
    • selectComboListItem

      protected void selectComboListItem​(java.lang.String val)
    • selectComboListItemInExact

      protected void selectComboListItemInExact​(java.lang.String val)
    • getValue

      public org.json.JSONArray getValue()
      Returns the value of the ModelLinkField as a JSONArray. If it's a single-select modellink, it will only contain a single JSONObject.
      Returns:
    • clearValue

      public void clearValue()
      Clears ModelLink value
    • launchPicker

      public Window launchPicker()
      Launches (and returns) a picker dialog window by clicking on the picker icon.
    • getAutoCompleteItems

      public java.util.List<org.openqa.selenium.WebElement> getAutoCompleteItems​(java.lang.String wildCardValue, boolean returnNullIfNoneFound)
      Enter the string value Returns the List of drop down auto complete Items list.
      Parameters:
      wildCardValue -
      returnNullIfNoneFound -
      Returns:
    • insertStringValue

      public void insertStringValue​(java.lang.String value)
      Insert the String value into the ModelLinkField and leaves auto complete list opened.
      Parameters:
      value -
    • getListOfFilledValues

      public java.util.List<org.openqa.selenium.WebElement> getListOfFilledValues()
      Returns the list of already filled display values.
      Returns:
    • getListOfFilledValues

      public java.util.List<org.openqa.selenium.WebElement> getListOfFilledValues​(boolean waitIfNotPresent)
    • isRequired

      public boolean isRequired()
    • clickInputEl

      protected void clickInputEl()