Class XWikiSelectWidget

  • Direct Known Subclasses:
    PageTypePicker

    public class XWikiSelectWidget
    extends BaseElement
    Represents the XWiki Select Widget (select.js).
    Since:
    14.10
    Version:
    $Id: 0e7f898acfb21cc354fcd02ec6ec9617e83df568 $
    • Field Detail

      • container

        protected final org.openqa.selenium.WebElement container
      • fieldName

        protected final String fieldName
    • Constructor Detail

      • XWikiSelectWidget

        public XWikiSelectWidget​(org.openqa.selenium.By selector,
                                 String fieldName)
      • XWikiSelectWidget

        public XWikiSelectWidget​(org.openqa.selenium.WebElement container,
                                 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
      • getCategoryNames

        public List<String> getCategoryNames()
        Returns:
        the list of category names
      • 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
      • getOptionByLabel

        protected Optional<org.openqa.selenium.WebElement> getOptionByLabel​(String label)
      • 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