Package com.znize.platform.test.api
Class HierarchySelect
- java.lang.Object
-
- com.znize.platform.test.api.HierarchySelect
-
public class HierarchySelect extends java.lang.ObjectHierarchySelect: hierarchical selects for a hierarchy property that has a number of child select properties.- Since:
- 5.17
-
-
Constructor Summary
Constructors Constructor Description HierarchySelect(EntityProperty hierarchyProperty)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetSelectedValue(boolean visibleText)Get the selected value of the hierarchy property, which is the selected value of the last select component.java.lang.StringgetSelectedValue(int selectIndex, boolean visibleText)Get the selected value for the select component at the index.booleanhasOption(int selectIndex, java.lang.String pattern, boolean exactMatch, boolean visibleText)Does the select component at the index have the option? Return false if the select component does not exist.voidselectOption(int selectIndex, java.lang.String pattern, boolean exactMatch, boolean visibleText)Select one option for the select component at the index.voidselectOptions(java.util.List<java.lang.String> patterns, boolean exactMatch, boolean visibleText)Select options for a list of select components.
-
-
-
Constructor Detail
-
HierarchySelect
public HierarchySelect(EntityProperty hierarchyProperty)
Constructor- Parameters:
hierarchyProperty- the associated hierarchy property
-
-
Method Detail
-
getSelectedValue
public java.lang.String getSelectedValue(boolean visibleText)
Get the selected value of the hierarchy property, which is the selected value of the last select component.- Parameters:
visibleText- whether to get visible text or invisible value- Returns:
- selected value or visible text. The value of an empty selection is its parent hierarchy value.
-
getSelectedValue
public java.lang.String getSelectedValue(int selectIndex, boolean visibleText)Get the selected value for the select component at the index.- Parameters:
selectIndex- zero-based select component indexvisibleText- whether to get visible text or invisible value- Returns:
- selected value or visible text. The value of an empty selection is its parent hierarchy value.
-
selectOptions
public void selectOptions(java.util.List<java.lang.String> patterns, boolean exactMatch, boolean visibleText)Select options for a list of select components.The list of patterns is to match options for the list of select components in the same order. e.g., 01,0102,010205 to select 010205.
- Parameters:
patterns- the list of patternsexactMatch- true for exact match, false if the selected value or visible text contains the patternvisibleText- whether the pattern matches option value or visible text- Throws:
java.lang.IllegalArgumentException- throw if there is no match
-
selectOption
public void selectOption(int selectIndex, java.lang.String pattern, boolean exactMatch, boolean visibleText)Select one option for the select component at the index.- Parameters:
selectIndex- zero-based select component indexpattern- the pattern to match optionsexactMatch- true for exact match, false if the selected value or visible text contains the patternvisibleText- whether the pattern matches option value or visible text- Throws:
java.lang.IllegalArgumentException- throw if there is no match
-
hasOption
public boolean hasOption(int selectIndex, java.lang.String pattern, boolean exactMatch, boolean visibleText)Does the select component at the index have the option? Return false if the select component does not exist.- Parameters:
selectIndex- zero-based select component indexpattern- option value or label patternexactMatch- true for exact match, false if partial match(option value or visible text contain the pattern)visibleText- whether the pattern matches option value or visible text- Returns:
- true if having the option, false otherwise
- Throws:
java.lang.IllegalArgumentException- if the select index is invalid
-
-