com.atlassian.studio.haup.pageobjects
Class ApplicationAccessPage

java.lang.Object
  extended by com.atlassian.studio.haup.pageobjects.AbstractHaupPage
      extended by com.atlassian.studio.haup.pageobjects.ApplicationAccessPage
All Implemented Interfaces:
com.atlassian.pageobjects.Page

public class ApplicationAccessPage
extends AbstractHaupPage

Represents the Application Access page, which you can find in the Administration menu of Jira / Jira Studio.


Field Summary
 
Fields inherited from class com.atlassian.studio.haup.pageobjects.AbstractHaupPage
driver, finder, footer, pageBinder, title
 
Constructor Summary
ApplicationAccessPage()
           
 
Method Summary
 boolean allCheckboxesForAppDisabled(SupportedApplication application)
           
 boolean allCheckboxesForAppEnabled(SupportedApplication application)
           
 ApplicationAccessPage applyChanges()
          Applies changes to application accesses.
 ApplicationAccessPage cancelChanges()
          Cancels changes to application accesses.
 List<SupportedApplication> getApplicationsWithAllUsersGranted()
          Returns the applications that all the users on the page have access to.
 int getCurrentPageNumber()
          Returns the current page number.
 List<String> getFailedUsers(SupportedApplication application, AccessAction action)
          Returns the list of failed users of the application and operation.
 Set<SupportedApplication> getGrantedApplications(String username)
          Returns the set of granted applications.
 int getNumberOfSuccessfulUsers(SupportedApplication application, AccessAction action)
          Returns the number of successful users of the application and operation.
protected  String getPageTitle()
          Returns the title of the page.
 RemainingAccessSection getRemainingAccessSection()
          Returns the remaining access section on the page.
 SupportedApplication getSearchApplication()
          Returns the name of the application to restrict the search on.
 String getSearchText()
          Returns the value of the search text.
 String getTableMessage()
           
 String getUrl()
           
 Set<String> getUsernames()
          Returns all the usernames on the page.
 List<Integer> getVisiblePagination()
          Returns all the visible page numbers in sorted order.
 ApplicationAccessPage goToPageNumber(int pageNumber)
          Navigates to the specified page number of the results.
 ApplicationAccessPage grantAccess(String username, Set<SupportedApplication> applications)
          Grants the user access to the specified applications.
 ApplicationAccessPage grantAccess(String username, SupportedApplication application)
          Grants the user access to the application.
 ApplicationAccessPage grantAll(SupportedApplication application)
          Grants all users shown on the page to have access to the specified application.
 boolean hasErrors()
          Returns true if errors are displayed in the page
 boolean isApplicationSearchOption(SupportedApplication application)
           
 boolean isGranted(String username, SupportedApplication application)
          Returns true if the user has been granted access to the specified application.
 ApplicationAccessPage revokeAccess(String username, Set<SupportedApplication> applications)
          Revokes the user's access to the specified applications.
 ApplicationAccessPage revokeAccess(String username, SupportedApplication application)
          Revokes the user's access to the application.
 RevokeAccessWarningMessageDialog revokeAccessExpectingWarningMessage(String username, SupportedApplication application)
          Revokes the user's access to the application, and expects a warning message dialog pops up.
 ApplicationAccessPage revokeAll(SupportedApplication application)
          Revoke all users shown on the page to have access to the specified application.
 RevokeAccessWarningMessageDialog revokeAllExpectingWarningMessage(SupportedApplication application)
          Revoke all users shown on the page to have access to the specified application, and expect a warning message dialog pops up.
 ApplicationAccessPage searchUsers(String searchText)
          Performs the search for users with no restriction on application access.
 ApplicationAccessPage searchUsersWithApplicationAccess(String searchText, SupportedApplication application)
          Performs the search for users with access to the specified application.
 ApplicationAccessPage setAccess(String username, Set<SupportedApplication> applications)
          Sets the applications that the user will have access to.
 
Methods inherited from class com.atlassian.studio.haup.pageobjects.AbstractHaupPage
getMessages, getMessages, getMessages, waitForPageLoad
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApplicationAccessPage

public ApplicationAccessPage()
Method Detail

getUrl

public String getUrl()

getPageTitle

protected String getPageTitle()
Description copied from class: AbstractHaupPage
Returns the title of the page. The page will wait until this title appears to determine that the correct page has been loaded. The title must be in the <h1> tag.

Specified by:
getPageTitle in class AbstractHaupPage
Returns:
title of the page

hasErrors

public boolean hasErrors()
Returns true if errors are displayed in the page

Returns:
true if there are errors displayed in the page

getSearchText

public String getSearchText()
Returns the value of the search text.

Returns:
search text

getSearchApplication

public SupportedApplication getSearchApplication()
Returns the name of the application to restrict the search on. If there are no application restrictions, null will be returned.

Returns:
name of the application to restrict the search on. null if there are no application restrictions.
Throws:
IllegalStateException - if the application name could not be converted to a SupportedApplication

isApplicationSearchOption

public boolean isApplicationSearchOption(SupportedApplication application)

searchUsersWithApplicationAccess

public ApplicationAccessPage searchUsersWithApplicationAccess(String searchText,
                                                              SupportedApplication application)
Performs the search for users with access to the specified application. To search for users with no restriction on application access, use searchUsers(String).

Parameters:
searchText - search text
application - application to restrict search to. Must be a valid name from SupportedApplication#name().
Returns:
ApplicationAccessPage

searchUsers

public ApplicationAccessPage searchUsers(String searchText)
Performs the search for users with no restriction on application access.

Parameters:
searchText - search text
Returns:
ApplicationAccessPage

getUsernames

public Set<String> getUsernames()
Returns all the usernames on the page.

Returns:
all the usernames on the page

getVisiblePagination

public List<Integer> getVisiblePagination()
Returns all the visible page numbers in sorted order. Use only when there are results in the page.

Returns:
all the visible page numbers in sorted order

getCurrentPageNumber

public int getCurrentPageNumber()
Returns the current page number. Use only when there are results in the page.

Returns:
current page number

goToPageNumber

public ApplicationAccessPage goToPageNumber(int pageNumber)
Navigates to the specified page number of the results.

Parameters:
pageNumber - page number to navigate to
Returns:
ApplicationAccessPage

grantAll

public ApplicationAccessPage grantAll(SupportedApplication application)
Grants all users shown on the page to have access to the specified application. Changes will not be applied until applyChanges() is called. It proceeds by ticking the master checkbox.

Parameters:
application - application to grant to all users on the page
Returns:
ApplicationAccessPage

revokeAll

public ApplicationAccessPage revokeAll(SupportedApplication application)
                                throws IllegalStateException
Revoke all users shown on the page to have access to the specified application. Changes will not be applied until applyChanges() is called. It proceeds by unticking the master checkbox. The master must be ticked before the call

Parameters:
application - application to grant to all users on the page
Returns:
ApplicationAccessPage
Throws:
IllegalStateException - if the master checkbox isn't ticked

revokeAllExpectingWarningMessage

public RevokeAccessWarningMessageDialog revokeAllExpectingWarningMessage(SupportedApplication application)
Revoke all users shown on the page to have access to the specified application, and expect a warning message dialog pops up. Changes will not be applied until applyChanges() is called. It proceeds by unticking the master checkbox. The master must be ticked before the call

Parameters:
application - application to grant to all users on the page
Returns:
RevokeAccessWarningMessageDialog
Throws:
IllegalStateException - if the master checkbox isn't ticked

grantAccess

public ApplicationAccessPage grantAccess(String username,
                                         SupportedApplication application)
Grants the user access to the application. Changes will not be applied until applyChanges() is called.

Parameters:
username - name of user to grant access to applications
application - application to grant the user access to
Returns:
ApplicationAccessPage

grantAccess

public ApplicationAccessPage grantAccess(String username,
                                         Set<SupportedApplication> applications)
Grants the user access to the specified applications. This method will not revoke a user's access to applications not specified in the parameter. Changes will not be applied until applyChanges() is called.

Parameters:
username - name of user to grant access to applications
applications - applications to grant the user access to
Returns:
ApplicationAccessPage

revokeAccess

public ApplicationAccessPage revokeAccess(String username,
                                          Set<SupportedApplication> applications)
Revokes the user's access to the specified applications. This method will not revoke a user's access to applications not specified in the parameter. Changes will not be applied until applyChanges() is called.

Parameters:
username - name of user to grant access to applications
applications - applications to revoke the user's access from
Returns:
ApplicationAccessPage

revokeAccess

public ApplicationAccessPage revokeAccess(String username,
                                          SupportedApplication application)
Revokes the user's access to the application. Changes will not be applied until applyChanges() is called.

Parameters:
username - name of user to grant access to applications
application - application to revoke the user's access from
Returns:
ApplicationAccessPage

revokeAccessExpectingWarningMessage

public RevokeAccessWarningMessageDialog revokeAccessExpectingWarningMessage(String username,
                                                                            SupportedApplication application)
Revokes the user's access to the application, and expects a warning message dialog pops up. Changes will not be applied until applyChanges() is called.

Parameters:
username - name of user to grant access to applications
application - application to revoke the user's access from
Returns:
RevokeAccessWarningMessageDialog

setAccess

public ApplicationAccessPage setAccess(String username,
                                       Set<SupportedApplication> applications)
Sets the applications that the user will have access to. This method will revoke a user's access to applications not specified in the parameter. Changes will not be applied until applyChanges() is called.

Parameters:
username - name of user to grant access to applications
applications - absolute list of applications that the user will have access to
Returns:
ApplicationAccessPage

applyChanges

public ApplicationAccessPage applyChanges()
Applies changes to application accesses. Use only when there are results in the page.

Returns:
ApplicationAccessPage

cancelChanges

public ApplicationAccessPage cancelChanges()
Cancels changes to application accesses. Use only when there are results in the page.

Returns:
ApplicationAccessPage

isGranted

public boolean isGranted(String username,
                         SupportedApplication application)
Returns true if the user has been granted access to the specified application.

Parameters:
username - name of the user
application - application
Returns:
true if the user has been granted access to the specified application
Throws:
IllegalArgumentException - if the user could not be found

getGrantedApplications

public Set<SupportedApplication> getGrantedApplications(String username)
Returns the set of granted applications.

Parameters:
username - username to check access for
Returns:
set of granted applications

allCheckboxesForAppEnabled

public boolean allCheckboxesForAppEnabled(SupportedApplication application)

allCheckboxesForAppDisabled

public boolean allCheckboxesForAppDisabled(SupportedApplication application)

getRemainingAccessSection

public RemainingAccessSection getRemainingAccessSection()
Returns the remaining access section on the page.

Returns:
remaining access section

getTableMessage

public String getTableMessage()
Returns:
the message in the table, or null if no message is displayed

getApplicationsWithAllUsersGranted

public List<SupportedApplication> getApplicationsWithAllUsersGranted()
Returns the applications that all the users on the page have access to.

Returns:
the applications that all the users on the page have access to

getFailedUsers

public List<String> getFailedUsers(SupportedApplication application,
                                   AccessAction action)
Returns the list of failed users of the application and operation. If there are no users, an empty list will be returned.

Parameters:
application - application to return failed users for
action - action that was performed
Returns:
list of failed users of the application and operation. Returns an empty list if there are no users matching

getNumberOfSuccessfulUsers

public int getNumberOfSuccessfulUsers(SupportedApplication application,
                                      AccessAction action)
Returns the number of successful users of the application and operation.

Parameters:
application - application
action - action that was performed
Returns:
number of successful users of the application and operation


Copyright © 2002-2012 Atlassian. All Rights Reserved.