Package org.xwiki.test.ui.po
Class XWikiSelectWidget
- java.lang.Object
-
- org.xwiki.test.ui.po.BaseElement
-
- org.xwiki.test.ui.po.XWikiSelectWidget
-
- Direct Known Subclasses:
PageTypePicker
public class XWikiSelectWidget extends BaseElement
Represents the XWiki Select Widget (select.js).- Since:
- 14.10
- Version:
- $Id: 0e7f898acfb21cc354fcd02ec6ec9617e83df568 $
-
-
Constructor Summary
Constructors Constructor Description XWikiSelectWidget(org.openqa.selenium.By selector, String fieldName)
XWikiSelectWidget(org.openqa.selenium.WebElement container, String fieldName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
filter(String text)
Filter the options that match the specified text.List<String>
getCategoryNames()
String
getDisplayedCategorySize(String categoryName)
List<String>
getLabelsInCategory(String categoryName)
protected Optional<org.openqa.selenium.WebElement>
getOptionByLabel(String label)
protected org.openqa.selenium.WebElement
getOptionByValue(String value)
protected org.openqa.selenium.WebElement
getOptionInput(org.openqa.selenium.WebElement option)
protected Stream<org.openqa.selenium.WebElement>
getOptionInputsStream()
protected Stream<org.openqa.selenium.WebElement>
getOptionsStream()
boolean
hasOptionWithLabel(String label)
void
selectByLabel(String label)
Select the option with the specified label.void
selectByValue(String value)
Select the option with the specified value.-
Methods inherited from class org.xwiki.test.ui.po.BaseElement
getDriver, getUtil, isElementVisible, setContext, waitForNotificationErrorMessage, waitForNotificationInProgressMessage, waitForNotificationSuccessMessage, waitForNotificationWarningMessage, waitUntilPageIsReady
-
-
-
-
Field Detail
-
container
protected final org.openqa.selenium.WebElement container
-
fieldName
protected final String fieldName
-
-
Method Detail
-
selectByValue
public void selectByValue(String value)
Select the option with the specified value. The option must be visible.- Parameters:
value
- the option value to look for
-
selectByLabel
public void selectByLabel(String label)
Select the option with the specified label. The option must be visible.- Parameters:
label
- the option label to look for
-
getDisplayedCategorySize
public String getDisplayedCategorySize(String categoryName)
- Parameters:
categoryName
- the name of a category- Returns:
- the category size displayed after the category name
-
getLabelsInCategory
public List<String> getLabelsInCategory(String categoryName)
- Parameters:
categoryName
- the name of a category- Returns:
- the labels of the options available in the specified category
-
getOptionByValue
protected org.openqa.selenium.WebElement getOptionByValue(String value)
-
getOptionsStream
protected Stream<org.openqa.selenium.WebElement> getOptionsStream()
-
getOptionInput
protected org.openqa.selenium.WebElement getOptionInput(org.openqa.selenium.WebElement option)
-
getOptionInputsStream
protected Stream<org.openqa.selenium.WebElement> getOptionInputsStream()
-
filter
public void filter(String text)
Filter the options that match the specified text.- Parameters:
text
- the text to match
-
hasOptionWithLabel
public boolean hasOptionWithLabel(String label)
- Parameters:
label
- the label of the option to look for- Returns:
true
if the specified option is present,false
otherwise
-
-