public class TextMatchingCriterion
extends java.lang.Object
matchIndexHierarchically()
return true, then it contains an array; otherwise it just contains a single int value.Modifier and Type | Field and Description |
---|---|
static int |
INDEX_TRY_ALL_MATCHED_ITEMS
'-1000', normally a matchIndex should be given to verify if a text is selected.
matchIndex allows to match item N in a list containing duplicate entries. when this value is provided as matchIndex, then verification will be ok if one of matched items is verified. |
static int |
INVALID_INDEX
'-1' an invalid index value.
|
Constructor and Description |
---|
TextMatchingCriterion(int expectedMatchedIndex) |
TextMatchingCriterion(java.lang.String text,
boolean partialMatch,
int expectedMatchedIndex)
constructor of TextMatchingCriterion.
|
TextMatchingCriterion(java.lang.String path,
boolean partialMatch,
int[] expectedMatchedIndices)
constructor of TextMatchingCriterion.
|
TextMatchingCriterion(java.lang.String path,
boolean partialMatch,
java.lang.String indexPathStr)
constructor of TextMatchingCriterion.
|
TextMatchingCriterion(java.lang.String path,
boolean partialMatch,
java.lang.String indexPathStr,
java.lang.String separator)
constructor of TextMatchingCriterion.
|
Modifier and Type | Method and Description |
---|---|
int |
getExpectedMatchedIndex()
return 0-based index
|
int[] |
getExpectedMatchedIndices()
return 0-based indices array
|
java.lang.String |
getSeparator() |
java.lang.String |
getText()
The text/path string to match
|
boolean |
isHierarchical()
Test if the criterion is hierarchical or not.
|
boolean |
isPartialMatch()
If the match of text is partial or full
|
boolean |
matchIndexHierarchically()
Test if the expected-index should be matched level by level.
Be careful, even if isHierarchical() is true, but this method may return false. |
boolean |
matchText(java.lang.String actualText)
Test if the actualText matches with the
getText() .Used for non-hierarchical structure, such as List, ComboBox etc. |
boolean |
matchText(java.lang.String actualText,
int level)
Test if the actualText matches with the value of array
pathArray at index.Used for hierarchical structure, such as Tree, Menu etc. |
void |
setExpectedMatchedIndex(int expectedMatchedIndex) |
protected void |
setText(java.lang.String text) |
java.lang.String |
toString() |
public static final int INVALID_INDEX
public static final int INDEX_TRY_ALL_MATCHED_ITEMS
#verifyItemSelection(String, boolean, int, boolean)
,
Constant Field Valuespublic TextMatchingCriterion(int expectedMatchedIndex)
public TextMatchingCriterion(java.lang.String text, boolean partialMatch, int expectedMatchedIndex)
text
- String, the text to matchpartialMatch
- boolean, if the text is substring of fullstringexpectedMatchedIndex
- int, the times to match, 0-based
that is to match item N in a list/tab/tree containing duplicate entriespublic TextMatchingCriterion(java.lang.String path, boolean partialMatch, int[] expectedMatchedIndices)
path
- String, the path to matchpartialMatch
- boolean, if the text is substring of fullstringexpectedMatchedIndex
- int[], the times to match of each level, 0-basedpublic TextMatchingCriterion(java.lang.String path, boolean partialMatch, java.lang.String indexPathStr)
path
- String, the path to matchpartialMatch
- boolean, if the text is substring of fullstringindexPathStr
- String, a separated string containing indices, 1-based, for example 3->2->4public TextMatchingCriterion(java.lang.String path, boolean partialMatch, java.lang.String indexPathStr, java.lang.String separator)
path
- String, the path to matchpartialMatch
- boolean, if the text is substring of fullstringindexPathStr
- String, a separated string containing indices, 1-based, for example 3->2->4separator
- String, the separator to separate index in indexPathStrpublic java.lang.String getSeparator()
protected void setText(java.lang.String text)
public boolean matchIndexHierarchically()
isHierarchical()
is true, but this method may return false. In that situation,isHierarchical()
public boolean isHierarchical()
public int[] getExpectedMatchedIndices()
public int getExpectedMatchedIndex()
public void setExpectedMatchedIndex(int expectedMatchedIndex)
public java.lang.String getText()
public boolean isPartialMatch()
public boolean matchText(java.lang.String actualText)
getText()
.actualText
- String, the actual text of the itempublic boolean matchText(java.lang.String actualText, int level)
pathArray
at index.actualText
- String, the actual text of the itemlevel
- int, the level in the path, 0-basedpublic java.lang.String toString()
toString
in class java.lang.Object
Copyright © SAS Institute. All Rights Reserved.