com.atlassian.jira.webtest.framework.impl.selenium.dialog.gadget
Class AddGadgetDialogImpl

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.dialog.AbstractSeleniumDialog<T>
                  extended by com.atlassian.jira.webtest.framework.impl.selenium.dialog.AbstractSeleniumAuiDialog<D>
                      extended by com.atlassian.jira.webtest.framework.impl.selenium.dialog.AbstractSeleniumAuiPageDialog<AddGadgetDialog,Dashboard>
                          extended by com.atlassian.jira.webtest.framework.impl.selenium.dialog.gadget.AddGadgetDialogImpl
All Implemented Interfaces:
Localizable, Openable<AddGadgetDialog>, PageObject, AddGadgetDialog, Dialog<AddGadgetDialog>, PageDialog<AddGadgetDialog,Dashboard>

public class AddGadgetDialogImpl
extends AbstractSeleniumAuiPageDialog<AddGadgetDialog,Dashboard>
implements AddGadgetDialog

Default implementation of AddGadgetDialog.

Since:
v4.3

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.atlassian.jira.webtest.framework.dialog.AddGadgetDialog
AddGadgetDialog.CloseMode
 
Field Summary
 
Fields inherited from class com.atlassian.jira.webtest.framework.impl.selenium.core.SeleniumContextAware
assertThat, client, context, timeouts
 
Constructor Summary
AddGadgetDialogImpl(Dashboard page, SeleniumContext ctx)
           
 
Method Summary
<T extends Gadget>
AddGadgetDialog
addGadget(Class<T> gadgetType)
           Add gadget of given type to the dashboard.
<T extends Gadget>
AddGadgetDialog
addGadget(Class<T> gadgetType, String sourceUrl)
           Add gadget of given type and sourceUrl to the dashboard.
 TimedCondition canAddGadget(Class<? extends Gadget> gadgetType)
          Check if given gadget type can be added.
 TimedCondition canAddGadget(Class<? extends Gadget> gadgetType, String sourceUrl)
           Check if given gadget type can be added.
 AddGadgetDialog.CloseMode close()
          Close the dialog.
protected  String getOpenDialogClass()
           
 Locator locator()
          Locator unambiguously locating this page object.
 AddGadgetDialog open()
           Open this component and return this instance.
protected  SeleniumLocator openDialogLocator()
          Unique locator of an open dialog.
 
Methods inherited from class com.atlassian.jira.webtest.framework.impl.selenium.dialog.AbstractSeleniumAuiPageDialog
isOpenableInContext, page
 
Methods inherited from class com.atlassian.jira.webtest.framework.impl.selenium.dialog.AbstractSeleniumAuiDialog
cancelLinkLocator
 
Methods inherited from class com.atlassian.jira.webtest.framework.impl.selenium.dialog.AbstractSeleniumDialog
detector, isClosed, isOpen, isOpenable
 
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.dialog.PageDialog
page
 
Methods inherited from interface com.atlassian.jira.webtest.framework.core.Openable
isClosed, isOpen, isOpenable
 
Methods inherited from interface com.atlassian.jira.webtest.framework.core.PageObject
context, isReady
 

Constructor Detail

AddGadgetDialogImpl

public AddGadgetDialogImpl(Dashboard page,
                           SeleniumContext ctx)
Method Detail

getOpenDialogClass

protected String getOpenDialogClass()
Overrides:
getOpenDialogClass in class AbstractSeleniumAuiDialog<AddGadgetDialog>

locator

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

Specified by:
locator in interface Localizable
Overrides:
locator in class AbstractSeleniumDialog<AddGadgetDialog>
Returns:
locator

openDialogLocator

protected SeleniumLocator openDialogLocator()
Description copied from class: AbstractSeleniumDialog
Unique locator of an open dialog.

Overrides:
openDialogLocator in class AbstractSeleniumAuiDialog<AddGadgetDialog>
Returns:
open dialog locator

addGadget

public <T extends Gadget> AddGadgetDialog addGadget(Class<T> gadgetType)
Description copied from interface: AddGadgetDialog

Add gadget of given type to the dashboard. This will also close the dialog.

NOTE: there may be more then one gadgets of given type to add. Use AddGadgetDialog.addGadget(Class, String) to add a gadget from particular source.

Specified by:
addGadget in interface AddGadgetDialog
Type Parameters:
T - type parameter
Parameters:
gadgetType - class of gadget to add
Returns:
gadget instance

addGadget

public <T extends Gadget> AddGadgetDialog addGadget(Class<T> gadgetType,
                                                    String sourceUrl)
Description copied from interface: AddGadgetDialog

Add gadget of given type and sourceUrl to the dashboard. This will also close the dialog.

Specified by:
addGadget in interface AddGadgetDialog
Type Parameters:
T - type parameter
Parameters:
gadgetType - class of gadget to add
sourceUrl - URL of the gadget spec source
Returns:
gadget instance

canAddGadget

public TimedCondition canAddGadget(Class<? extends Gadget> gadgetType)
Description copied from interface: AddGadgetDialog
Check if given gadget type can be added. This means that the dialog is open and the 'Add gadget' button is available (i.e. not already waiting for adding a gadget).

Specified by:
canAddGadget in interface AddGadgetDialog
Parameters:
gadgetType - type of the gadget to add.
Returns:
condition checking, if gadget of given type can be added

canAddGadget

public TimedCondition canAddGadget(Class<? extends Gadget> gadgetType,
                                   String sourceUrl)
Description copied from interface: AddGadgetDialog

Check if given gadget type can be added. This means that the dialog is open and the 'Add gadget' button is available (i.e. not already waiting for adding a gadget).

Use this method if there are more than one gadgets of given type, coming from different applications.

Specified by:
canAddGadget in interface AddGadgetDialog
Parameters:
gadgetType - type of the gadget to add.
sourceUrl - URL of the gadget source
Returns:
condition checking, if gadget of given type and from given source can be added

open

public AddGadgetDialog 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<AddGadgetDialog>
Returns:
timed query for this component's instance

close

public AddGadgetDialog.CloseMode close()
Description copied from interface: AddGadgetDialog
Close the dialog.

Specified by:
close in interface AddGadgetDialog
Returns:
close mode


Copyright © 2002-2013 Atlassian. All Rights Reserved.