com.atlassian.jira.pageobjects.dialogs
Class FormDialog

java.lang.Object
  extended by com.atlassian.jira.pageobjects.dialogs.FormDialog
Direct Known Subclasses:
AbstractIssueDialog, AddFieldConfigurationDialog, AddFieldConfigurationSchemeDialog, AddFieldScreenDialog, AddFieldScreenSchemeDialog, AddIssueTypeDialog, AddIssueTypeScreenSchemeDialog, AddIssueTypeToFieldConfigurationDialog, AddIssueTypeToScreenSchemeAssociationDialog, AddNewIssueTypeToSchemeDialog, AddProjectDialog, AddSubtaskTypeDialog, AddWorkflowDialog, AdministrationSearchDialog, AssignIssueDialog, AssociateIssueOperationToScreenDialog, AvatarDialog, CloseIssueDialog, CommentDialog, CopyWorkflowDialog, DeleteIssueDialog, DiscardDraftDialog, EditProjectDialog, EditProjectLeadAndDefaultAssigneeDialog, EditWorkflowNameAndDescriptionDialog, IssueActionsDialog, JiraSudoFormDialog, LabelsDialog, LinkIssueDialog, ProjectIntroVideoDialog, PublishDialog, ResolveIssueDialog, WorkflowTransitionDialog, XsrfDialog

public class FormDialog
extends Object

Represents a JIRA from dialog. These type of Dialogs basically slurp HTML from the server and display it on the client side. Input is submitted to a back end action. This action will either indicate that the action was a success or will return HTML with errors in it for display to the user.

Since:
v4.4

Field Summary
protected  com.atlassian.pageobjects.PageBinder binder
           
protected  com.atlassian.webdriver.AtlassianWebDriver driver
           
protected  com.atlassian.pageobjects.elements.PageElement form
           
protected  com.atlassian.pageobjects.elements.PageElement header
           
protected  String id
           
protected  com.atlassian.pageobjects.elements.PageElement loading
           
protected  com.atlassian.pageobjects.elements.PageElementFinder locator
           
 
Constructor Summary
FormDialog(String id)
           
 
Method Summary
protected  void assertDialogClosed()
           
protected  void assertDialogOpen()
           
 void close()
          Close the dialog by clicking on the kindly ever-present cancel button.
 void escape()
          Closes the dialog by hitting ESC
protected  com.atlassian.pageobjects.elements.PageElement find(org.openqa.selenium.By locator)
           
protected
<T extends com.atlassian.pageobjects.elements.PageElement>
T
find(org.openqa.selenium.By locator, Class<T> elementClass)
           
 AuiMessage getAuiMessage()
           
protected  com.atlassian.pageobjects.elements.PageElement getDialogElement()
           
 List<String> getFormErrorList()
          Return a list of the form errors currently on the dialog.
 Map<String,String> getFormErrors()
          Return a mapping of the errors currently on the form.
 String getTitle()
           
 boolean hasFormErrors()
          Return true iff the dialog has error messages contained in its associated form.
 void initAbstractDialog()
           
 boolean isOpen()
           
 com.atlassian.pageobjects.elements.query.TimedCondition isOpenTimed()
           
 void ready()
          Called when the dialog is first displayed.
protected static void setElement(com.atlassian.pageobjects.elements.PageElement element, String value)
           
protected  boolean submit(org.openqa.selenium.By locator)
          Do a submit on the passed element found using the passed locator.
protected  boolean submit(com.atlassian.pageobjects.elements.PageElement pageElement)
          Do a submit on the passed element.
protected  boolean submit(String name)
          Do a submit on the passed the form element with the passed name.
 FormDialog waitForFormErrors()
          Waits for at least one error to be visible
protected  void waitUntilClosed()
           
protected  void waitUntilHidden()
           
protected  void waitWhileSubmitting()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

locator

@Inject
protected com.atlassian.pageobjects.elements.PageElementFinder locator

driver

@Inject
protected com.atlassian.webdriver.AtlassianWebDriver driver

binder

@Inject
protected com.atlassian.pageobjects.PageBinder binder

loading

protected com.atlassian.pageobjects.elements.PageElement loading

form

protected com.atlassian.pageobjects.elements.PageElement form

header

protected com.atlassian.pageobjects.elements.PageElement header

id

protected String id
Constructor Detail

FormDialog

public FormDialog(String id)
Method Detail

ready

public final void ready()
Called when the dialog is first displayed. Waits util the dialog is ready to work with before exiting.


initAbstractDialog

public final void initAbstractDialog()

getAuiMessage

public AuiMessage getAuiMessage()

isOpen

public boolean isOpen()

isOpenTimed

public com.atlassian.pageobjects.elements.query.TimedCondition isOpenTimed()

submit

protected boolean submit(com.atlassian.pageobjects.elements.PageElement pageElement)
Do a submit on the passed element. The method will then wait for the response from the server before returning.

Parameters:
pageElement - the page element to submit.
Returns:
true if the dialog is still open.

submit

protected boolean submit(org.openqa.selenium.By locator)
Do a submit on the passed element found using the passed locator. The method will then wait for the response from the server before returning.

Parameters:
locator - for the element to select.
Returns:
true if the dialog is still open.

submit

protected boolean submit(String name)
Do a submit on the passed the form element with the passed name. The method will then wait for the response from the server before returning.

Parameters:
name - the name of the element to submit.
Returns:
true if the dialog is still open.

escape

public void escape()
Closes the dialog by hitting ESC


close

public void close()
Close the dialog by clicking on the kindly ever-present cancel button.


hasFormErrors

public boolean hasFormErrors()
Return true iff the dialog has error messages contained in its associated form.

Returns:
true iff the dialog has error messages contained in its associated form.

getFormErrorList

public List<String> getFormErrorList()
Return a list of the form errors currently on the dialog.

Returns:
a list of form errors currently on the dialog.

waitForFormErrors

public FormDialog waitForFormErrors()
Waits for at least one error to be visible

Returns:
this

getFormErrors

public Map<String,String> getFormErrors()
Return a mapping of the errors currently on the form. The mapping if from parameterName -> error.

Returns:
a mapping from parameterName -> error of all the errors currently on the form.

getTitle

public String getTitle()

assertDialogOpen

protected void assertDialogOpen()

assertDialogClosed

protected void assertDialogClosed()

waitWhileSubmitting

protected void waitWhileSubmitting()

waitUntilClosed

protected void waitUntilClosed()

waitUntilHidden

protected void waitUntilHidden()

setElement

protected static void setElement(com.atlassian.pageobjects.elements.PageElement element,
                                 String value)

getDialogElement

protected com.atlassian.pageobjects.elements.PageElement getDialogElement()

find

protected com.atlassian.pageobjects.elements.PageElement find(org.openqa.selenium.By locator)

find

protected <T extends com.atlassian.pageobjects.elements.PageElement> T find(org.openqa.selenium.By locator,
                                                                            Class<T> elementClass)


Copyright © 2002-2012 Atlassian. All Rights Reserved.