Class Select2Element

  • All Implemented Interfaces:
    com.atlassian.pageobjects.elements.PageElement, com.atlassian.pageobjects.elements.PageElementFinder, com.atlassian.pageobjects.elements.search.PageElementSearch

    public class Select2Element
    extends com.atlassian.pageobjects.elements.WebDriverElement
    • Field Detail

      • elementFinder

        @Inject
        protected com.atlassian.pageobjects.elements.PageElementFinder elementFinder
    • Constructor Detail

      • Select2Element

        @Inject
        public Select2Element​(org.openqa.selenium.By locator)
      • Select2Element

        @Inject
        public Select2Element​(org.openqa.selenium.By locator,
                              com.atlassian.pageobjects.elements.WebDriverLocatable parent)
      • Select2Element

        @Inject
        public Select2Element​(org.openqa.selenium.By locator,
                              com.atlassian.pageobjects.elements.timeout.TimeoutType timeoutType)
      • Select2Element

        @Inject
        public Select2Element​(org.openqa.selenium.By locator,
                              com.atlassian.pageobjects.elements.WebDriverLocatable parent,
                              com.atlassian.pageobjects.elements.timeout.TimeoutType timeoutType)
    • Method Detail

      • isVisible

        public boolean isVisible()
        Specified by:
        isVisible in interface com.atlassian.pageobjects.elements.PageElement
        Overrides:
        isVisible in class com.atlassian.pageobjects.elements.WebDriverElement
      • isEnabled

        public boolean isEnabled()
        Specified by:
        isEnabled in interface com.atlassian.pageobjects.elements.PageElement
        Overrides:
        isEnabled in class com.atlassian.pageobjects.elements.WebDriverElement
      • getContainer

        public com.atlassian.pageobjects.elements.PageElement getContainer()
      • getDropdownTrigger

        public com.atlassian.pageobjects.elements.PageElement getDropdownTrigger()
      • getDropDown

        public com.atlassian.pageobjects.elements.PageElement getDropDown()
      • isMultiSelect

        public boolean isMultiSelect()
      • getInput

        public com.atlassian.pageobjects.elements.PageElement getInput()
      • enterValue

        public Select2Element enterValue​(String choiceToSelect)
        Selects the given choice.
        Parameters:
        choiceToSelect - determines which option to choose
      • enterValue

        public Select2Element enterValue​(String search,
                                         String choiceToSelect)
        Enter search term and select the given choice.
        Parameters:
        search - search term
        choiceToSelect - determines which option to choose
      • enterValue

        public Select2Element enterValue​(String search,
                                         Predicate<String> choicePredicate)
        Enter search term and select a choice that matches the predicate.
        Parameters:
        search - search term
        choicePredicate - determines which option to choose
      • enterValue

        public Select2Element enterValue​(String search,
                                         Predicate<String> choicePredicate,
                                         String expectedSelection)
        Enter search term and select a choice that matches the predicate. Use this method directly only if the selection is formatted differently than options to select.
        Parameters:
        search - search term
        choicePredicate - determines which option to choose
        expectedSelection - what result is expected to be selected in the end
      • clickElement

        public void clickElement​(String jQuerySelector)
      • waitForJQueryToBeActive

        public void waitForJQueryToBeActive()
      • clickDropDownDontWait

        public Select2Element clickDropDownDontWait()
      • countChoices

        public int countChoices()
      • clear

        public Select2Element clear()
        Specified by:
        clear in interface com.atlassian.pageobjects.elements.PageElement
        Overrides:
        clear in class com.atlassian.pageobjects.elements.WebDriverElement
      • getValues

        @NotNull
        public <T> @NotNull List<T> getValues​(Function<com.atlassian.pageobjects.elements.PageElement,​T> f)
      • getValues

        @NotNull
        public @NotNull List<String> getValues()
      • isDisabled

        public com.atlassian.pageobjects.elements.query.TimedCondition isDisabled()
      • getSelectedValue

        @Nullable
        public @Nullable String getSelectedValue()
        Get currently selected value from a single-select element.
      • getSelectedValues

        @NotNull
        public @NotNull List<String> getSelectedValues()
        Get all selected values from a multi-select element.
      • isValueSelected

        public boolean isValueSelected​(@NotNull
                                       @NotNull String value)
      • isDropDownOpen

        public com.atlassian.pageobjects.elements.query.TimedCondition isDropDownOpen()
      • select

        public void select​(String value)
        Select value from dropdown list without interaction with search. Usefull for Select2Element without search field.
      • selectByOptionValue

        public void selectByOptionValue​(String optionValue)
      • getOptionValue

        public String getOptionValue()