com.atlassian.jira.webtest.framework.impl.selenium.component
Class AbstractSeleniumDropdown<P extends PageObject>

java.lang.Object
  extended by com.atlassian.jira.webtest.framework.impl.selenium.core.SeleniumContextAware
      extended by com.atlassian.jira.webtest.framework.impl.selenium.core.AbstractSeleniumPageObject
          extended by com.atlassian.jira.webtest.framework.impl.selenium.core.AbstractLocatorBasedPageObject
              extended by com.atlassian.jira.webtest.framework.impl.selenium.core.component.AbstractSeleniumComponent<P>
                  extended by com.atlassian.jira.webtest.framework.impl.selenium.component.AbstractSeleniumDropdown<P>
All Implemented Interfaces:
AjsDropdown<P>, Component<P>, Localizable, Openable<AjsDropdown<P>>, PageObject
Direct Known Subclasses:
AbstractFcSuggestions, SeleniumDDDropDown

public abstract class AbstractSeleniumDropdown<P extends PageObject>
extends AbstractSeleniumComponent<P>
implements AjsDropdown<P>, Localizable

Abstract implementation of the AjsDropdown interface.

Since:
v4.3

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.atlassian.jira.webtest.framework.component.AjsDropdown
AjsDropdown.CloseMode<PP extends PageObject>, AjsDropdown.Item<R extends PageObject>, AjsDropdown.Section<Q extends PageObject>
 
Field Summary
 
Fields inherited from class com.atlassian.jira.webtest.framework.impl.selenium.core.SeleniumContextAware
assertThat, client, context, timeouts
 
Constructor Summary
protected AbstractSeleniumDropdown(String id, P parent, SeleniumContext ctx)
          Requires a unique id of the dropdown list used to evaluate its presence on the page.
 
Method Summary
 TimedQuery<List<AjsDropdown.Section<P>>> allSections()
          Get all sections of this drop-down.
 AjsDropdown.CloseMode<P> close()
          Close this drop-down
protected  SeleniumLocator detector()
          Main locator of this page object.
 TimedCondition hasItem(String itemText)
          Check if this drop-down has item with given itemText.
 TimedCondition hasSection(String id)
          Check if this drop-down has section with given id.
 TimedCondition isClosed()
          A timed condition that queries, whether this component is currently closed.
 TimedCondition isOpen()
          Checks if this component is open.
 TimedCondition isOpenable()
           Represents a question: is this component capable of being opened in the current test context?
protected abstract  TimedCondition isOpenableByContext()
          Whether there is appropriate context to open this drop-down (e.g.
 TimedQuery<AjsDropdown.Item<P>> item(String text)
          Find first position matching test
 TimedQuery<Integer> itemCount()
          Number of items in this drop-down
 Locator locator()
          Locator unambiguously locating this page object.
 TimedQuery<AjsDropdown.Section<P>> section(String id)
          Find section with given id.
 TimedQuery<AjsDropdown.Item<P>> selectedItem()
          Get currently selected position of in the list.
 
Methods inherited from class com.atlassian.jira.webtest.framework.impl.selenium.core.component.AbstractSeleniumComponent
parent
 
Methods inherited from class com.atlassian.jira.webtest.framework.impl.selenium.core.AbstractLocatorBasedPageObject
isReady
 
Methods inherited from class com.atlassian.jira.webtest.framework.impl.selenium.core.AbstractSeleniumPageObject
body, conditions, css, forClass, id, jQuery, locatorFor, name, queries, waitFor, xpath
 
Methods inherited from class com.atlassian.jira.webtest.framework.impl.selenium.core.SeleniumContextAware
context
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.jira.webtest.framework.core.component.Component
parent
 
Methods inherited from interface com.atlassian.jira.webtest.framework.core.Openable
open
 
Methods inherited from interface com.atlassian.jira.webtest.framework.core.PageObject
context, isReady
 

Constructor Detail

AbstractSeleniumDropdown

protected AbstractSeleniumDropdown(String id,
                                   P parent,
                                   SeleniumContext ctx)
Requires a unique id of the dropdown list used to evaluate its presence on the page.

Parameters:
id - unique id of this dropdown that is assigned to the container div
parent - parent component of this dropdown
ctx - Selenium context
Method Detail

detector

protected SeleniumLocator detector()
Description copied from class: AbstractLocatorBasedPageObject
Main locator of this page object. Its presence means that this object is ready to be manipulated in the test.

Specified by:
detector in class AbstractLocatorBasedPageObject
Returns:
main locator of this page object

locator

public Locator locator()
Description copied from interface: Localizable
Locator unambiguously locating this page object.

Specified by:
locator in interface Localizable
Returns:
locator

isOpen

public final TimedCondition isOpen()
Description copied from interface: Openable
Checks if this component is open.

Specified by:
isOpen in interface Openable<AjsDropdown<P extends PageObject>>
Returns:
timed condition representing a query if this component is open
See Also:
TimedCondition

isClosed

public TimedCondition isClosed()
Description copied from interface: Openable
A timed condition that queries, whether this component is currently closed.

Specified by:
isClosed in interface Openable<AjsDropdown<P extends PageObject>>
Returns:
timed condition: is this component closed?
See Also:
TimedCondition

isOpenable

public final TimedCondition isOpenable()
Description copied from interface: Openable

Represents a question: is this component capable of being opened in the current test context?

If the returned condition evaluates to true, this component may be safely opened by means of Openable.open().

NOTE: if Openable.isOpen() evaluates to true, this condition will automatically evaluate to false, as it is not possible to open a component that is already open.

Specified by:
isOpenable in interface Openable<AjsDropdown<P extends PageObject>>
Returns:
timed condition: is this component openable in the current context?

isOpenableByContext

protected abstract TimedCondition isOpenableByContext()
Whether there is appropriate context to open this drop-down (e.g. page/dialog/component that contains it has loaded)

Returns:
timed condition querying if a valid context for opening this drop-down is in place

hasItem

public TimedCondition hasItem(String itemText)
Description copied from interface: AjsDropdown
Check if this drop-down has item with given itemText.

Specified by:
hasItem in interface AjsDropdown<P extends PageObject>
Parameters:
itemText - text of the position to find
Returns:
condition querying whether a position with given text exists in this drop-down

hasSection

public TimedCondition hasSection(String id)
Description copied from interface: AjsDropdown
Check if this drop-down has section with given id.

Specified by:
hasSection in interface AjsDropdown<P extends PageObject>
Parameters:
id - unique pag ID of the section to find
Returns:
condition querying whether a section with given ID exists in this drop-down

itemCount

public TimedQuery<Integer> itemCount()
Description copied from interface: AjsDropdown
Number of items in this drop-down

Specified by:
itemCount in interface AjsDropdown<P extends PageObject>
Returns:
total number of items

allSections

public TimedQuery<List<AjsDropdown.Section<P>>> allSections()
Description copied from interface: AjsDropdown
Get all sections of this drop-down.

Specified by:
allSections in interface AjsDropdown<P extends PageObject>
Returns:
list of all sections

item

public TimedQuery<AjsDropdown.Item<P>> item(String text)
Description copied from interface: AjsDropdown
Find first position matching test

Specified by:
item in interface AjsDropdown<P extends PageObject>
Parameters:
text - text of the position to find
Returns:
position matching text, or null, if position with given text does not exist in this drop-down
See Also:
AjsDropdown.hasItem(String)

section

public TimedQuery<AjsDropdown.Section<P>> section(String id)
Description copied from interface: AjsDropdown
Find section with given id. Id of the section must be known by the client. Some sections do not have headings, so retrieving sections by their id is impractical.

Specified by:
section in interface AjsDropdown<P extends PageObject>
Parameters:
id - unique page ID of the section
Returns:
section with given ID, or null, if such section does not exist within this drop-down
See Also:
AjsDropdown.hasItem(String)

selectedItem

public TimedQuery<AjsDropdown.Item<P>> selectedItem()
Description copied from interface: AjsDropdown
Get currently selected position of in the list.

Specified by:
selectedItem in interface AjsDropdown<P extends PageObject>
Returns:
timed query for selected position

close

public AjsDropdown.CloseMode<P> close()
Description copied from interface: AjsDropdown
Close this drop-down

Specified by:
close in interface AjsDropdown<P extends PageObject>
Returns:
close mode with the target parent instance


Copyright © 2002-2013 Atlassian. All Rights Reserved.