com.atlassian.jira.webtest.selenium.framework.dialogs
Class AbstractDialog<T extends AbstractDialog<T>>

java.lang.Object
  extended by com.atlassian.jira.webtest.selenium.framework.core.AbstractSeleniumPageObject
      extended by com.atlassian.jira.webtest.selenium.framework.dialogs.AbstractDialog<T>
All Implemented Interfaces:
LocalizablePageObject, PageObject, Dialog
Direct Known Subclasses:
AbstractSubmittableDialog, ActionsDialog

public abstract class AbstractDialog<T extends AbstractDialog<T>>
extends AbstractSeleniumPageObject
implements Dialog

Abstract implementation of Dialog in terms of a locator marking this dialog's visible contents. The locator is provided by concrete implementations of dialogs.

Since:
v4.2

Field Summary
 
Fields inherited from class com.atlassian.jira.webtest.selenium.framework.core.AbstractSeleniumPageObject
assertThat, client, context
 
Constructor Summary
protected AbstractDialog(SeleniumContext ctx, Class<T> targetType)
           
 
Method Summary
 void assertReady(long timeout)
          Assert that this object is loaded and ready to be exercised by Selenium.
protected  T asTargetType()
           
protected  String dialogContentsReadyLocator()
           Subclasses may override this method to provide dialog-specific contents locator, whose presence will indicate that the dialog contents have been loaded and the dialog is generally ready to use.
 String inDialog(String jqueryLocator)
           Returns full in-dialog jQuery locator for the locator passed in argument.
 boolean isClosed()
          Test if this dialog is closed.
 boolean isOpen()
          Test if this dialog is open.
 String locator()
          Locator of this page object.
protected abstract  String visibleDialogContentsLocator()
          jQuery locator of the main dialog component (when visible).
 
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.selenium.framework.dialogs.Dialog
isOpenable, open
 

Constructor Detail

AbstractDialog

protected AbstractDialog(SeleniumContext ctx,
                         Class<T> targetType)
Method Detail

visibleDialogContentsLocator

protected abstract String visibleDialogContentsLocator()
jQuery locator of the main dialog component (when visible).

Returns:
jQuery locator

dialogContentsReadyLocator

protected String dialogContentsReadyLocator()

Subclasses may override this method to provide dialog-specific contents locator, whose presence will indicate that the dialog contents have been loaded and the dialog is generally ready to use.

If the locator has not prefix, it must be relative to the dialog contents locator, as it will be appended to the main dialog locator. Locators containing prefix will be used as the stand.

Returns:
dialog-specific locator of a characteristic element of dialog contents.

locator

public final String locator()
Description copied from interface: LocalizablePageObject
Locator of this page object.

Specified by:
locator in interface LocalizablePageObject
Returns:
locator

assertReady

public final void assertReady(long timeout)
Description copied from interface: PageObject
Assert that this object is loaded and ready to be exercised by Selenium.

Specified by:
assertReady in interface PageObject
Parameters:
timeout - timeout to wait

inDialog

public final String inDialog(String jqueryLocator)
Description copied from interface: Dialog

Returns full in-dialog jQuery locator for the locator passed in argument. The returned locator will only locate an element on an open dialog.

jqueryLocator should not contain the 'jquery=' prefix.

Specified by:
inDialog in interface Dialog
Parameters:
jqueryLocator - locator of an element within dialog
Returns:
full jQuery locator ready to use with selenium

isOpen

public final boolean isOpen()
Description copied from interface: Dialog
Test if this dialog is open.

Specified by:
isOpen in interface Dialog
Returns:
true, if this dialog is open

isClosed

public final boolean isClosed()
Description copied from interface: Dialog
Test if this dialog is closed. That is, either Dialog.isOpenable(), or Dialog.isOpen() return false.

Specified by:
isClosed in interface Dialog
Returns:
true, if this dialog is NOT open (this includes situation where this dialog cannot be opened, se Dialog.isOpenable().

asTargetType

protected final T asTargetType()


Copyright © 2002-2013 Atlassian. All Rights Reserved.