Class Select2Element
- java.lang.Object
-
- com.atlassian.pageobjects.elements.WebDriverElement
-
- com.atlassian.bamboo.pageobjects.elements.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 Summary
Fields Modifier and Type Field Description protected com.atlassian.pageobjects.elements.PageElementFinderelementFinder
-
Constructor Summary
Constructors Constructor Description Select2Element(org.openqa.selenium.By locator)Select2Element(org.openqa.selenium.By locator, com.atlassian.pageobjects.elements.timeout.TimeoutType timeoutType)Select2Element(org.openqa.selenium.By locator, com.atlassian.pageobjects.elements.WebDriverLocatable parent)Select2Element(org.openqa.selenium.By locator, com.atlassian.pageobjects.elements.WebDriverLocatable parent, com.atlassian.pageobjects.elements.timeout.TimeoutType timeoutType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Select2Elementclear()Select2ElementclickDropDown()Select2ElementclickDropDownDontWait()voidclickElement(String jQuerySelector)Select2ElementcloseDropdown()intcountChoices()Select2ElemententerValue(String choiceToSelect)Selects the given choice.Select2ElemententerValue(String search, String choiceToSelect)Enter search term and select the given choice.Select2ElemententerValue(String search, Predicate<String> choicePredicate)Enter search term and select a choice that matches the predicate.Select2ElemententerValue(String search, Predicate<String> choicePredicate, String expectedSelection)Enter search term and select a choice that matches the predicate.com.atlassian.pageobjects.elements.PageElementgetContainer()com.atlassian.pageobjects.elements.PageElementgetDropDown()com.atlassian.pageobjects.elements.PageElementgetDropdownTrigger()com.atlassian.pageobjects.elements.PageElementgetInput()StringgetOptionValue()@Nullable StringgetSelectedValue()Get currently selected value from a single-select element.@NotNull List<String>getSelectedValues()Get all selected values from a multi-select element.@NotNull List<String>getValues()<T> @NotNull List<T>getValues(Function<com.atlassian.pageobjects.elements.PageElement,T> f)com.atlassian.pageobjects.elements.query.TimedConditionisDisabled()com.atlassian.pageobjects.elements.query.TimedConditionisDropDownOpen()booleanisEnabled()booleanisMultiSelect()booleanisValueSelected(@NotNull String value)booleanisVisible()Select2ElementopenDropDown()Select2ElementsearchAndWait(String searchTerm, boolean expectResults)voidselect(String value)Select value from dropdown list without interaction with search.voidselectByOptionValue(String optionValue)Select2Elementtype(String value)voidwaitForJQueryToBeActive()-
Methods inherited from class com.atlassian.pageobjects.elements.WebDriverElement
asWebElement, bind, click, createTimout, find, find, find, find, findAll, findAll, findAll, findAll, getAttribute, getCssClasses, getDefaultTimeout, getId, getLocation, getSize, getTagName, getText, getValue, hasAttribute, hasClass, isPresent, isSelected, javascript, search, select, timed, timeout, toLocatable, toString, type, waitForWebElement, waitForWebElement, withTimeout
-
-
-
-
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:
isVisiblein interfacecom.atlassian.pageobjects.elements.PageElement- Overrides:
isVisiblein classcom.atlassian.pageobjects.elements.WebDriverElement
-
isEnabled
public boolean isEnabled()
- Specified by:
isEnabledin interfacecom.atlassian.pageobjects.elements.PageElement- Overrides:
isEnabledin classcom.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 termchoiceToSelect- 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 termchoicePredicate- 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 termchoicePredicate- determines which option to chooseexpectedSelection- what result is expected to be selected in the end
-
clickDropDown
public Select2Element clickDropDown()
-
clickElement
public void clickElement(String jQuerySelector)
-
waitForJQueryToBeActive
public void waitForJQueryToBeActive()
-
clickDropDownDontWait
public Select2Element clickDropDownDontWait()
-
openDropDown
public Select2Element openDropDown()
-
closeDropdown
public Select2Element closeDropdown()
-
searchAndWait
public Select2Element searchAndWait(String searchTerm, boolean expectResults)
-
countChoices
public int countChoices()
-
clear
public Select2Element clear()
- Specified by:
clearin interfacecom.atlassian.pageobjects.elements.PageElement- Overrides:
clearin classcom.atlassian.pageobjects.elements.WebDriverElement
-
type
public Select2Element type(String value)
-
getValues
@NotNull public <T> @NotNull List<T> getValues(Function<com.atlassian.pageobjects.elements.PageElement,T> f)
-
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()
-
-