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.PageElementFinder
elementFinder
-
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 Select2Element
clear()
Select2Element
clickDropDown()
Select2Element
clickDropDownDontWait()
void
clickElement(String jQuerySelector)
Select2Element
closeDropdown()
int
countChoices()
Select2Element
enterValue(String choiceToSelect)
Selects the given choice.Select2Element
enterValue(String search, String choiceToSelect)
Enter search term and select the given choice.Select2Element
enterValue(String search, Predicate<String> choicePredicate)
Enter search term and select a choice that matches the predicate.Select2Element
enterValue(String search, Predicate<String> choicePredicate, String expectedSelection)
Enter search term and select a choice that matches the predicate.com.atlassian.pageobjects.elements.PageElement
getContainer()
com.atlassian.pageobjects.elements.PageElement
getDropDown()
com.atlassian.pageobjects.elements.PageElement
getDropdownTrigger()
com.atlassian.pageobjects.elements.PageElement
getInput()
String
getOptionValue()
@Nullable String
getSelectedValue()
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.TimedCondition
isDisabled()
com.atlassian.pageobjects.elements.query.TimedCondition
isDropDownOpen()
boolean
isEnabled()
boolean
isMultiSelect()
boolean
isValueSelected(@NotNull String value)
boolean
isVisible()
Select2Element
openDropDown()
void
select(String value)
Select value from dropdown list without interaction with search.void
selectByOptionValue(String optionValue)
Select2Element
type(String value)
void
waitForJQueryToBeActive()
-
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:
isVisible
in interfacecom.atlassian.pageobjects.elements.PageElement
- Overrides:
isVisible
in classcom.atlassian.pageobjects.elements.WebDriverElement
-
isEnabled
public boolean isEnabled()
- Specified by:
isEnabled
in interfacecom.atlassian.pageobjects.elements.PageElement
- Overrides:
isEnabled
in 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()
-
countChoices
public int countChoices()
-
clear
public Select2Element clear()
- Specified by:
clear
in interfacecom.atlassian.pageobjects.elements.PageElement
- Overrides:
clear
in 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()
-
-