com.atlassian.jira.functest.framework
Class NavigationImpl

java.lang.Object
  extended by com.atlassian.jira.functest.framework.AbstractFuncTestUtil
      extended by com.atlassian.jira.functest.framework.NavigationImpl
All Implemented Interfaces:
FuncTestLogger, Navigation

public class NavigationImpl
extends AbstractFuncTestUtil
implements Navigation, FuncTestLogger

Implementation of Navigation

Since:
v3.13

Field Summary
static String BUTTON_NEXT
           
 
Fields inherited from class com.atlassian.jira.functest.framework.AbstractFuncTestUtil
environmentData, FS, locators, logger, logIndentLevel, tester
 
Constructor Summary
NavigationImpl(net.sourceforge.jwebunit.WebTester tester, JIRAEnvironmentData environmentData)
          Note: if you need to construct this for an old-style JIRAWebTest, you may want to consider using FuncTestHelperFactory instead.
 
Method Summary
 void browseComponentTabPanel(String projectKey, String componentName)
          Navigates to Browse Component page of the specified component
 void browseComponentTabPanel(String projectKey, String componentName, String tab)
          Navigates to the component tab panel for the specified component.
 void browseProject(String projectKey)
          Navigates to the project's Browse page
 void browseProjectTabPanel(String projectKey, String tab)
          Navigates to the project tab panel for the specified project.
 void browseVersionTabPanel(String projectKey, String versionName)
          Navigates to Browse Version page of the specified component
 void browseVersionTabPanel(String projectKey, String versionName, String tab)
          Navigates to the component tab panel for the specified component.
 void clickLink(com.meterware.httpunit.WebLink webLink)
          Follows the URL in the given WebLink.
 void clickLinkInTableCell(String tableId, int row, int col, String linkText)
          Click on a link in a particular table cell with the given text.
 void clickLinkInTableCell(com.meterware.httpunit.WebTable table, int row, int col, String linkText)
          Click on a link in a particular table cell with the given text.
 void clickLinkWithExactText(String text)
          Finds the first link on the page with the exact text and follows the URL.
 void clickOnNext()
          Clicks on the 'Next' button (useful for bulk edits and such)
 Dashboard dashboard()
          Navigates to the dashboard, returning it.
 void disableWebSudo()
          Historically this connected to a REST endpoint in the jira-functest-plugin to disable WebSudo Currently this does nothing
 void doLogin(String userName, String userPassword, boolean useCookie, boolean assertSuccess)
           
 FilterNavigation filterPickerPopup()
           
 String getCurrentPage()
          Returns the relative path of the current page.
 void gotoAdmin()
          Goes to the admin section, or, if already in the admin section, does nothing.
 void gotoAdminSection(String linkId)
          Navigates to a particular page of the admin section
 void gotoCustomFields()
          Navigates to the 'Custom Fields' page in the administration section
 void gotoDashboard()
          Goto the current user's dashboard.
 void gotoPage(String url)
          Navigates to the given relative URL.
 void gotoResource(String resourcePath)
           Navigates to the relative resource path.
 void gotoWorkflows()
          Navigates to the workflows table in the admin section
 IssueNavigation issue()
          Access API to navigate through issues.
 IssueNavigatorNavigation issueNavigator()
          Access API to navigate through issue navigator.
 void jiraLog(String logMessage)
          Writes the specified message to the atlassian-jira.log on the server side.
 void login(String userName)
          This assumes the standard JIRA test behaviour of having the user name the same value as the password
 void login(String userName, String userPassword)
          Login the given user.
 void login(String userName, String userPassword, boolean useCookie)
           
 void loginAttempt(String userName, String userPassword)
          Attempts to login the given user without asserting success.
 void loginUsingForm(String userName, String userPassword)
           
 void loginUsingForm(String userName, String userPassword, boolean useCookie, boolean assertSuccess)
          Login by navigating to the Dashboard and filling out the login form and submitting it
 void loginUsingURLParameters(String userName, String userPassword, boolean useCookie)
          Login by adding parameters to the Dashboard URL e.g.
 void logout()
           
 FilterNavigation manageFilters()
          Go to the 'Manage filters' screen.
 void runReport(Long projectId, String reportKey)
          Run the given report for the given project
 void runReport(Long projectId, String reportKey, Long filterId, String mapper)
          Run the given report for the given project using the given mapper
 UserProfile userProfile()
           
 void webSudoAuthenticate(String password)
          Checks if we have been redirected to the websudo login form and logs in.
 void webSudoAuthenticateUsingLastPassword()
          Checks if we have been redirected to the websudo login form and logs in using the last password
 Workflows workflows()
           
 
Methods inherited from class com.atlassian.jira.functest.framework.AbstractFuncTestUtil
childLogIndentLevel, getAssertions, getEnvironmentData, getFuncTestHelperFactory, getLogger, log, log, navigation, submitAtPage
 
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.functest.framework.log.FuncTestLogger
log, log
 

Field Detail

BUTTON_NEXT

public static final String BUTTON_NEXT
See Also:
Constant Field Values
Constructor Detail

NavigationImpl

public NavigationImpl(net.sourceforge.jwebunit.WebTester tester,
                      JIRAEnvironmentData environmentData)
Note: if you need to construct this for an old-style JIRAWebTest, you may want to consider using FuncTestHelperFactory instead.

Parameters:
tester - the tester
environmentData - the environment data
Method Detail

login

public void login(String userName)
Description copied from interface: Navigation
This assumes the standard JIRA test behaviour of having the user name the same value as the password

Specified by:
login in interface Navigation
Parameters:
userName - the user name and password to login as

login

public void login(String userName,
                  String userPassword)
Description copied from interface: Navigation
Login the given user.

Note that this will assert that the login suceeded.

Specified by:
login in interface Navigation
Parameters:
userName - the user name and password to login as
See Also:
Navigation.loginAttempt(String, String)

loginAttempt

public void loginAttempt(String userName,
                         String userPassword)
Description copied from interface: Navigation
Attempts to login the given user without asserting success.

Specified by:
loginAttempt in interface Navigation

login

public void login(String userName,
                  String userPassword,
                  boolean useCookie)
Specified by:
login in interface Navigation

doLogin

public void doLogin(String userName,
                    String userPassword,
                    boolean useCookie,
                    boolean assertSuccess)

loginUsingForm

public void loginUsingForm(String userName,
                           String userPassword)
Specified by:
loginUsingForm in interface Navigation

loginUsingForm

public void loginUsingForm(String userName,
                           String userPassword,
                           boolean useCookie,
                           boolean assertSuccess)
Description copied from interface: Navigation
Login by navigating to the Dashboard and filling out the login form and submitting it

Specified by:
loginUsingForm in interface Navigation

loginUsingURLParameters

public void loginUsingURLParameters(String userName,
                                    String userPassword,
                                    boolean useCookie)
Description copied from interface: Navigation
Login by adding parameters to the Dashboard URL e.g. http://localhost:8090/jira/secure/Dashboard.jspa?os_username=admin&os_password=admin

Specified by:
loginUsingURLParameters in interface Navigation

logout

public void logout()
Specified by:
logout in interface Navigation

getCurrentPage

public String getCurrentPage()
Description copied from interface: Navigation
Returns the relative path of the current page. E.g. if currently at http://web.com:9999/jira/browse/HSP-1, this method will return "/browse/HSP-1". Also caters for situations when no context path is set, e.g. http://standalone.com/browse/HSP-1. Use this method with WebTester.gotoPage(java.lang.String).

Specified by:
getCurrentPage in interface Navigation
Returns:
the relative path of the current page.

clickLink

public void clickLink(com.meterware.httpunit.WebLink webLink)
Description copied from interface: Navigation
Follows the URL in the given WebLink.

Specified by:
clickLink in interface Navigation
Parameters:
webLink - WebLink

clickLinkWithExactText

public void clickLinkWithExactText(String text)
Description copied from interface: Navigation
Finds the first link on the page with the exact text and follows the URL. Note: This is not the same as WebTester.clickLinkWithText(String) as it does an exact text match, but also no onclick events are fired. It simply follows the URL specified by the link tag.

Specified by:
clickLinkWithExactText in interface Navigation
Parameters:
text - the text of the link to match

clickLinkInTableCell

public void clickLinkInTableCell(com.meterware.httpunit.WebTable table,
                                 int row,
                                 int col,
                                 String linkText)
Description copied from interface: Navigation
Click on a link in a particular table cell with the given text.

Specified by:
clickLinkInTableCell in interface Navigation
Parameters:
table - The table whose link we're clicking
row - The table row that contains the link
col - The table column that contains the link
linkText - The text of the link

clickLinkInTableCell

public void clickLinkInTableCell(String tableId,
                                 int row,
                                 int col,
                                 String linkText)
Description copied from interface: Navigation
Click on a link in a particular table cell with the given text.

Specified by:
clickLinkInTableCell in interface Navigation
Parameters:
tableId - The id of the table whose link we're clicking
row - The table row that contains the link
col - The table column that contains the link
linkText - The text of the link

jiraLog

public void jiraLog(String logMessage)
Description copied from interface: Navigation
Writes the specified message to the atlassian-jira.log on the server side. Works because we have a magic servlet ready for this log messages.

Specified by:
jiraLog in interface Navigation
Parameters:
logMessage - the message to log

gotoDashboard

public void gotoDashboard()
Description copied from interface: Navigation
Goto the current user's dashboard. This is a quick way to call dashboard().navigateTo().

Specified by:
gotoDashboard in interface Navigation

dashboard

public Dashboard dashboard()
Description copied from interface: Navigation
Navigates to the dashboard, returning it.

Specified by:
dashboard in interface Navigation
Returns:
the Dashboard.

workflows

public Workflows workflows()
Specified by:
workflows in interface Navigation

clickOnNext

public void clickOnNext()
Description copied from interface: Navigation
Clicks on the 'Next' button (useful for bulk edits and such)

Specified by:
clickOnNext in interface Navigation

gotoAdmin

public void gotoAdmin()
Goes to the admin section, or, if already in the admin section, does nothing.

Specified by:
gotoAdmin in interface Navigation

webSudoAuthenticate

public void webSudoAuthenticate(String password)
Description copied from interface: Navigation
Checks if we have been redirected to the websudo login form and logs in.

Specified by:
webSudoAuthenticate in interface Navigation

webSudoAuthenticateUsingLastPassword

public void webSudoAuthenticateUsingLastPassword()
Description copied from interface: Navigation
Checks if we have been redirected to the websudo login form and logs in using the last password

Specified by:
webSudoAuthenticateUsingLastPassword in interface Navigation

disableWebSudo

public void disableWebSudo()
Description copied from interface: Navigation
Historically this connected to a REST endpoint in the jira-functest-plugin to disable WebSudo Currently this does nothing

Specified by:
disableWebSudo in interface Navigation

gotoPage

public void gotoPage(String url)
Description copied from interface: Navigation
Navigates to the given relative URL.

Note that the "base URL" is automatically prepended to the given URL including the context. eg: If the URL on your dev machine is "http://localhost:8091/jira/secure/Signup!default.jspa", then you would supply "secure/Signup!default.jspa" as the URL parameter to this method.

Specified by:
gotoPage in interface Navigation
Parameters:
url - URL to navigate to.

gotoResource

public void gotoResource(String resourcePath)
Description copied from interface: Navigation

Navigates to the relative resource path.

Note that the This method will prepend current location to the resource path, e.g. if the current location is "http://localhost:8091/jira/secure/Signup!default.jspa", and given resource is "Signout.jspa, the resulting URL will be "http://localhost:8091/jira/secure/Signout.jspa".

Specified by:
gotoResource in interface Navigation
Parameters:
resourcePath - path to navigate to.

gotoAdminSection

public void gotoAdminSection(String linkId)
Description copied from interface: Navigation
Navigates to a particular page of the admin section

Specified by:
gotoAdminSection in interface Navigation
Parameters:
linkId - the link id of the admin section

gotoCustomFields

public void gotoCustomFields()
Description copied from interface: Navigation
Navigates to the 'Custom Fields' page in the administration section

Specified by:
gotoCustomFields in interface Navigation

gotoWorkflows

public void gotoWorkflows()
Description copied from interface: Navigation
Navigates to the workflows table in the admin section

Specified by:
gotoWorkflows in interface Navigation

runReport

public void runReport(Long projectId,
                      String reportKey)
Description copied from interface: Navigation
Run the given report for the given project

Specified by:
runReport in interface Navigation
Parameters:
projectId - The id of the project
reportKey - The key of the report.

runReport

public void runReport(Long projectId,
                      String reportKey,
                      Long filterId,
                      String mapper)
Description copied from interface: Navigation
Run the given report for the given project using the given mapper

Specified by:
runReport in interface Navigation
Parameters:
projectId - The id of the project
reportKey - The key of the report
filterId - The filter id used for the report
mapper - The mapper used for the report (e.g. "labels")

browseProject

public void browseProject(String projectKey)
Description copied from interface: Navigation
Navigates to the project's Browse page

Specified by:
browseProject in interface Navigation
Parameters:
projectKey - the key of the project e.g. "HSP"

browseProjectTabPanel

public void browseProjectTabPanel(String projectKey,
                                  String tab)
Description copied from interface: Navigation
Navigates to the project tab panel for the specified project.

Specified by:
browseProjectTabPanel in interface Navigation
Parameters:
projectKey - the key of the project e.g. "HSP"
tab - the key of the project tab panel e.g. "summary", "issues", "changelog", "popularissues", etc.

browseComponentTabPanel

public void browseComponentTabPanel(String projectKey,
                                    String componentName,
                                    String tab)
Description copied from interface: Navigation
Navigates to the component tab panel for the specified component.

Specified by:
browseComponentTabPanel in interface Navigation
Parameters:
projectKey - the key of the project e.g. "HSP"
componentName - the name of the component e.g. "New Component 1"
tab - the key of the project tab panel e.g. "summary", "issues", "changelog", "popularissues", etc.

browseVersionTabPanel

public void browseVersionTabPanel(String projectKey,
                                  String versionName,
                                  String tab)
Description copied from interface: Navigation
Navigates to the component tab panel for the specified component.

Specified by:
browseVersionTabPanel in interface Navigation
Parameters:
projectKey - the key of the project e.g. "HSP"
versionName - the name of the version e.g. "New Version 1"
tab - the key of the project tab panel e.g. "summary", "issues", "changelog", "popularissues", etc.

browseComponentTabPanel

public void browseComponentTabPanel(String projectKey,
                                    String componentName)
Description copied from interface: Navigation
Navigates to Browse Component page of the specified component

Specified by:
browseComponentTabPanel in interface Navigation
Parameters:
projectKey - the key of the project e.g. "HSP"
componentName - the name of the component e.g. "New Component 1"

browseVersionTabPanel

public void browseVersionTabPanel(String projectKey,
                                  String versionName)
Description copied from interface: Navigation
Navigates to Browse Version page of the specified component

Specified by:
browseVersionTabPanel in interface Navigation
Parameters:
projectKey - the key of the project e.g. "HSP"
versionName - the name of the version e.g. "New Version 1"

manageFilters

public FilterNavigation manageFilters()
Description copied from interface: Navigation
Go to the 'Manage filters' screen. Access API to navigate through issue filters.

Specified by:
manageFilters in interface Navigation
Returns:
filter navigation

filterPickerPopup

public FilterNavigation filterPickerPopup()
Specified by:
filterPickerPopup in interface Navigation

userProfile

public UserProfile userProfile()
Specified by:
userProfile in interface Navigation

issue

public IssueNavigation issue()
Description copied from interface: Navigation
Access API to navigate through issues.

Specified by:
issue in interface Navigation
Returns:
issue navigation
See Also:
IssueNavigation

issueNavigator

public IssueNavigatorNavigation issueNavigator()
Description copied from interface: Navigation
Access API to navigate through issue navigator.

Specified by:
issueNavigator in interface Navigation
Returns:
issue navigator navigation
See Also:
IssueNavigatorNavigation


Copyright © 2002-2012 Atlassian. All Rights Reserved.