public class

NavigationImpl

extends AbstractFuncTestUtil
implements Navigation FuncTestLogger
java.lang.Object
   ↳ com.atlassian.jira.functest.framework.AbstractFuncTestUtil
     ↳ com.atlassian.jira.functest.framework.NavigationImpl

Class Overview

Implementation of Navigation

Summary

Constants
String BUTTON_NEXT
String PROJECT_PLUGIN_PREFIX
[Expand]
Inherited Fields
From class com.atlassian.jira.functest.framework.AbstractFuncTestUtil
Public Constructors
NavigationImpl(WebTester tester, JIRAEnvironmentData environmentData)
Note: if you need to construct this for an old-style JIRAWebTest, you may want to consider using FuncTestHelperFactory instead.
Public Methods
void browseComponentTabPanel(String projectKey, String componentName, String tab)
Navigates to the component tab panel for the specified component.
void browseComponentTabPanel(String projectKey, String componentName)
Navigates to Browse Component page of 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(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(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)
CommentNavigation comment()
Access API to navigate through comments.
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(Navigation.AdminSection section)
Navigates to a particular AdminSection.
void gotoCustomFields()
Navigates to the 'Custom Fields' page in the administration section
void gotoDashboard()
Goto the current user's dashboard.
void gotoFullContentView(String jql)
void gotoPage(String url)
Navigates to the given relative URL.
<T extends WebTestPage> T gotoPage(Class<T> pageClass)
<T extends WebTestPage> T gotoPageWithParams(Class<T> pageClass, String params)
void gotoResource(String resourcePath)

Navigates to the relative resource path.

void gotoWorkflows()
Navigates to the workflows table in the admin section
void gotoXmlView(String jql)
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, String userPassword)
Login the given user.
void login(String userName, String userPassword, boolean useCookie)
void login(String userName)
This assumes the standard JIRA test behaviour of having the user name the same value as the password
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()
Logout current user.
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()
[Expand]
Inherited Methods
From class com.atlassian.jira.functest.framework.AbstractFuncTestUtil
From class java.lang.Object
From interface com.atlassian.jira.functest.framework.Navigation
From interface com.atlassian.jira.testkit.client.log.FuncTestLogger

Constants

public static final String BUTTON_NEXT

Constant Value: "Next"

public static final String PROJECT_PLUGIN_PREFIX

Constant Value: "com.atlassian.jira.jira-projects-plugin:"

Public Constructors

public NavigationImpl (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

Public Methods

public void browseComponentTabPanel (String projectKey, String componentName, String tab)

Navigates to the component tab panel for the specified component.

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", etc.

public void browseComponentTabPanel (String projectKey, String componentName)

Navigates to Browse Component page of the specified component

Parameters
projectKey the key of the project e.g. "HSP"
componentName the name of the component e.g. "New Component 1"

public void browseProject (String projectKey)

Navigates to the project's Browse page

Parameters
projectKey the key of the project e.g. "HSP"

public void browseProjectTabPanel (String projectKey, String tab)

Navigates to the project tab panel for the specified project.

Parameters
projectKey the key of the project e.g. "HSP"
tab the key of the project tab panel e.g. "summary", "issues", "changelog", etc.

public void browseVersionTabPanel (String projectKey, String versionName)

Navigates to Browse Version page of the specified component

Parameters
projectKey the key of the project e.g. "HSP"
versionName the name of the version e.g. "New Version 1"

public void browseVersionTabPanel (String projectKey, String versionName, String tab)

Navigates to the component tab panel for the specified component.

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", etc.

public void clickLink (WebLink webLink)

Follows the URL in the given WebLink.

Parameters
webLink WebLink

public void clickLinkInTableCell (String tableId, int row, int col, String linkText)

Click on a link in a particular table cell with the given text.

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

public void clickLinkInTableCell (WebTable table, int row, int col, String linkText)

Click on a link in a particular table cell with the given text.

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

public void clickLinkWithExactText (String text)

Finds the first link on the page with the exact text and follows the URL.

Note: This is not the same as 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.

Parameters
text the text of the link to match

public void clickOnNext ()

Clicks on the 'Next' button (useful for bulk edits and such)

public CommentNavigation comment ()

Access API to navigate through comments.

Returns
  • comment navigation

public Dashboard dashboard ()

Navigates to the dashboard, returning it.

Returns
  • the Dashboard.

public void disableWebSudo ()

Historically this connected to a REST endpoint in the jira-functest-plugin to disable WebSudo Currently this does nothing

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

public FilterNavigation filterPickerPopup ()

public String getCurrentPage ()

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 gotoPage(String).

Returns
  • the relative path of the current page.

public void gotoAdmin ()

Goes to the admin section, or, if already in the admin section, does nothing.

public void gotoAdminSection (Navigation.AdminSection section)

Navigates to a particular AdminSection.

Parameters
section the section to navigate to

public void gotoCustomFields ()

Navigates to the 'Custom Fields' page in the administration section

public void gotoDashboard ()

Goto the current user's dashboard. This is a quick way to call dashboard().navigateTo().

public void gotoFullContentView (String jql)

public void gotoPage (String url)

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.

Parameters
url URL to navigate to.

public T gotoPage (Class<T> pageClass)

public T gotoPageWithParams (Class<T> pageClass, String params)

public void gotoResource (String resourcePath)

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".

Parameters
resourcePath path to navigate to.

public void gotoWorkflows ()

Navigates to the workflows table in the admin section

public void gotoXmlView (String jql)

public IssueNavigation issue ()

Access API to navigate through issues.

Returns
  • issue navigation

public IssueNavigatorNavigation issueNavigator ()

Access API to navigate through issue navigator.

Returns
  • issue navigator navigation

public void jiraLog (String logMessage)

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.

Parameters
logMessage the message to log

public void login (String userName, String userPassword)

Login the given user.

Note that this will assert that the login suceeded.

Parameters
userName the user name and password to login as

public void login (String userName, String userPassword, boolean useCookie)

public void login (String userName)

This assumes the standard JIRA test behaviour of having the user name the same value as the password

Parameters
userName the user name and password to login as

public void loginAttempt (String userName, String userPassword)

Attempts to login the given user without asserting success.

public void loginUsingForm (String userName, String userPassword)

public 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

public void loginUsingURLParameters (String userName, String userPassword, boolean useCookie)

Login by adding parameters to the Dashboard URL

e.g. http://localhost:8090/jira/secure/Dashboard.jspa?os_username=admin&os_password=admin

public void logout ()

Logout current user.

public FilterNavigation manageFilters ()

Go to the 'Manage filters' screen. Access API to navigate through issue filters.

Returns
  • filter navigation

public void runReport (Long projectId, String reportKey)

Run the given report for the given project

Parameters
projectId The id of the project
reportKey The key of the report.

public void runReport (Long projectId, String reportKey, Long filterId, String mapper)

Run the given report for the given project using the given mapper

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")

public UserProfile userProfile ()

public void webSudoAuthenticate (String password)

Checks if we have been redirected to the websudo login form and logs in.

public void webSudoAuthenticateUsingLastPassword ()

Checks if we have been redirected to the websudo login form and logs in using the last password

public Workflows workflows ()