com.atlassian.jira.webtest.framework.impl.selenium.page.dashboard
Class DashboardTabImpl

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.component.tab.AbstractNamedTab<DashboardTab>
                  extended by com.atlassian.jira.webtest.framework.impl.selenium.page.dashboard.DashboardTabImpl
All Implemented Interfaces:
NamedTab<DashboardTab>, Tab<DashboardTab>, Localizable, Openable<DashboardTab>, PageObject, DashboardTab

public class DashboardTabImpl
extends AbstractNamedTab<DashboardTab>
implements DashboardTab

Default implementation of DashboardTab.

Since:
v4.3

Field Summary
 
Fields inherited from class com.atlassian.jira.webtest.framework.impl.selenium.core.SeleniumContextAware
assertThat, client, context, timeouts
 
Constructor Summary
DashboardTabImpl(Dashboard dashboard, String tabName, SeleniumContext context)
           
 
Method Summary
protected  Locator detector()
          Main locator of this page object.
<T extends Gadget>
T
gadget(Class<T> gadgetType)
           Find gadget of given gadgetType.
<T extends Gadget>
T
gadget(Class<T> gadgetType, int gadgetId)
           Find gadget of given gadgetType and with given ID.
 TimedCondition hasGadget(Class<? extends Gadget> gadgetType)
           Check if dashboard has a given gadget.
 TimedCondition hasGadget(Class<? extends Gadget> gadgetType, int gadgetId)
           Check if dashboard has gadget of given type and with given gadgetId.
 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?
 Locator locator()
          Locator unambiguously locating this page object.
 DashboardTab open()
           Open this component and return this instance.
 
Methods inherited from class com.atlassian.jira.webtest.framework.impl.selenium.component.tab.AbstractNamedTab
name
 
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.component.tab.NamedTab
name
 
Methods inherited from interface com.atlassian.jira.webtest.framework.core.PageObject
context, isReady
 

Constructor Detail

DashboardTabImpl

public DashboardTabImpl(Dashboard dashboard,
                        String tabName,
                        SeleniumContext context)
Method Detail

detector

protected Locator 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 TimedCondition isOpen()
Description copied from interface: Openable
Checks if this component is open.

Specified by:
isOpen in interface Openable<DashboardTab>
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<DashboardTab>
Returns:
timed condition: is this component closed?
See Also:
TimedCondition

isOpenable

public 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<DashboardTab>
Returns:
timed condition: is this component openable in the current context?

open

public DashboardTab open()
Description copied from interface: Openable

Open this component and return this instance.

A pre-condition for this action is that the Openable.isClosed() and Openable.isOpenable() condition is met.

NOTE: this method, like most action methods in the framework, does not verify its results (as opposed to pre-conditions), as in some cases it might be legitimate to attempt to open a component given the test context state deliberately set up to make this attempt fail and then verify that the failure did happen. Thus, invoking clients are responsible for validation results of this action, which may be done by calling Openable.isOpen().

Specified by:
open in interface Openable<DashboardTab>
Returns:
timed query for this component's instance

hasGadget

public TimedCondition hasGadget(Class<? extends Gadget> gadgetType)
Description copied from interface: DashboardTab

Check if dashboard has a given gadget.

NOTE: there may be more than one gadgets on a given Dashboard page and this method will not convey information about how many gadgets are there. Use DashboardTab.hasGadget(Class, int) to check for a gadget with particular ID.

Specified by:
hasGadget in interface DashboardTab
Parameters:
gadgetType - type of the gadget
Returns:
timed condition checking, whether the given gadget exists on this dashboard
See Also:
DashboardTab.hasGadget(Class, int)

hasGadget

public TimedCondition hasGadget(Class<? extends Gadget> gadgetType,
                                int gadgetId)
Description copied from interface: DashboardTab

Check if dashboard has gadget of given type and with given gadgetId.

Specified by:
hasGadget in interface DashboardTab
Parameters:
gadgetType - type of the gadget
gadgetId - ID of the gadget
Returns:
timed condition checking, whether the given gadget exists on this dashboard

gadget

public <T extends Gadget> T gadget(Class<T> gadgetType)
Description copied from interface: DashboardTab

Find gadget of given gadgetType.

NOTE: if there are multiple gadget of gadgetType on the particular dashboard, the first found one will be returned

Specified by:
gadget in interface DashboardTab
Type Parameters:
T - type parameter of gadget
Parameters:
gadgetType - gadget class
Returns:
gadget instance. NOTE: this will return gadget instance (if given gadget type is supported), even if it is not present on current dashboard. This may be checked by PageObject.isReady(), or by DashboardTab.hasGadget(Class).

gadget

public <T extends Gadget> T gadget(Class<T> gadgetType,
                                   int gadgetId)
Description copied from interface: DashboardTab

Find gadget of given gadgetType and with given ID.

Specified by:
gadget in interface DashboardTab
Type Parameters:
T - type parameter of gadget
Parameters:
gadgetType - gadget class
gadgetId - ID of the gadget
Returns:
gadget instance. NOTE: this will return gadget instance (if given gadget type is supported), even if it is not present on current dashboard. This may be checked by PageObject.isReady(), or by DashboardTab.hasGadget(Class, int).


Copyright © 2002-2012 Atlassian. All Rights Reserved.