com.atlassian.confluence.selenium.client
Class PagePermissionsEditor

java.lang.Object
  extended by com.atlassian.confluence.selenium.client.Dialog
      extended by com.atlassian.confluence.selenium.client.PagePermissionsEditor

public class PagePermissionsEditor
extends Dialog


Field Summary
static String PERMISSIONS_DIALOG_ID
           
 
Fields inherited from class com.atlassian.confluence.selenium.client.Dialog
client, id
 
Method Summary
 void addContentPermission(ContentPermission contentPermission)
           
 void addEntitiesViaInputField(String entitiesStr)
           
 void assertHasInheritedPermission(ContentPermission contentPermission, Page ancestor)
           
 void assertHasNoInheritedPermission(ContentPermission contentPermission, Page ancestor)
           
 void assertHasNoPermission(ContentPermission contentPermission)
           
 void assertHasPermission(ContentPermission contentPermission)
           
 void cancel()
          Clicks the Permissions dialog's "Cancel" button, to close the dialog without saving changes.
 GroupPickerPopup chooseGroup()
           
 UserPickerPopup chooseUser()
           
 void clickChooseMe()
           
 QuickNavBox getAutocomplete()
           
 ContentPermissionType getCurrentPermissionType()
           
 String getDuplicateUserFlaggedJS(ContentPermission contentPermission)
          Returns true if the specified user is flagged as duplicated in the permissions table.
 String getInheritedPermissionRowSelectorJS(ContentPermission contentPermission, Page ancestor)
           
 String getPermissionRowSelectorJS(ContentPermission contentPermission)
           
 List<String> getPermissions(ContentPermissionType permissionType, ContentPermissionEntityType entityType)
          Returns a list of the user names currently in the direct permission table with the given permission and entity type.
 String getRemovePermissionRowLinkId(ContentPermission contentPermission)
           
 int getScrollPositionOfElement(String selector)
          Returns the scrollTop of the element for the passed selector.
 boolean isPermissionInViewport(ContentPermission contentPermission)
          Returns true if the row for the passed permission is viewable in the scrollable tables div.
 boolean isUpdateButtonEnabled()
           
 boolean isUpdateButtonVisible()
           
 void removePermission(ContentPermission contentPermission)
          Removed the permission for the given user or group with the supplied permission type.
 void setCurrentPermissionType(ContentPermissionType currentPermissionType)
          Sets the current ContentPermissionType choice in the PagePermissionsEditor by clicking the appropriate radio button.
 void typeUserName(String name)
          Types text in the username "smart field", launching the field's dropdown if enough text is entered.
 void update()
          Clicks the Permissions dialog's "Update" button, which may either save the edited Permissions to the Page editor form (for Edit mode) or save the edited Permissions with AJAX (for View mode).
 void waitForPermissionToScrollIntoViewport(ContentPermission contentPermission)
           
 void waitForUserNameDropDown()
          Waits until a 'smart field' drop down visible for the user name field
 void waitForUserNameDropDownToClose()
          Waits until a 'smart field' drop down is not visible for the user name field
 
Methods inherited from class com.atlassian.confluence.selenium.client.Dialog
clickButton, clickCancel, clickLink, clickPageMenu, getId, getTitle, hasButton, hasLink, hasPageMenu, isButtonDisabled, isVisible, pressEscape, pressEscapeOnly, waitForRemoval, waitUntilClosed, waitUntilVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PERMISSIONS_DIALOG_ID

public static final String PERMISSIONS_DIALOG_ID
See Also:
Constant Field Values
Method Detail

setCurrentPermissionType

public void setCurrentPermissionType(ContentPermissionType currentPermissionType)
Sets the current ContentPermissionType choice in the PagePermissionsEditor by clicking the appropriate radio button. This method will not fail if the restrictionTypeToAdd is already selected.


getCurrentPermissionType

public ContentPermissionType getCurrentPermissionType()

clickChooseMe

public void clickChooseMe()

addContentPermission

public void addContentPermission(ContentPermission contentPermission)

addEntitiesViaInputField

public void addEntitiesViaInputField(String entitiesStr)

typeUserName

public void typeUserName(String name)
Types text in the username "smart field", launching the field's dropdown if enough text is entered.


waitForUserNameDropDown

public void waitForUserNameDropDown()
Waits until a 'smart field' drop down visible for the user name field


waitForUserNameDropDownToClose

public void waitForUserNameDropDownToClose()
Waits until a 'smart field' drop down is not visible for the user name field


update

public void update()
Clicks the Permissions dialog's "Update" button, which may either save the edited Permissions to the Page editor form (for Edit mode) or save the edited Permissions with AJAX (for View mode).


isUpdateButtonVisible

public boolean isUpdateButtonVisible()

isUpdateButtonEnabled

public boolean isUpdateButtonEnabled()

cancel

public void cancel()
Clicks the Permissions dialog's "Cancel" button, to close the dialog without saving changes.


removePermission

public void removePermission(ContentPermission contentPermission)
Removed the permission for the given user or group with the supplied permission type.

Parameters:
contentPermission -

chooseUser

public UserPickerPopup chooseUser()

chooseGroup

public GroupPickerPopup chooseGroup()

getPermissions

public List<String> getPermissions(ContentPermissionType permissionType,
                                   ContentPermissionEntityType entityType)
Returns a list of the user names currently in the direct permission table with the given permission and entity type.

Parameters:
permissionType - type of permission to retrieve, either "view" or "edit"
entityType - type of entity to retrieve, either "Users" or "Group" (note case)

assertHasPermission

public void assertHasPermission(ContentPermission contentPermission)

assertHasInheritedPermission

public void assertHasInheritedPermission(ContentPermission contentPermission,
                                         Page ancestor)

assertHasNoPermission

public void assertHasNoPermission(ContentPermission contentPermission)

assertHasNoInheritedPermission

public void assertHasNoInheritedPermission(ContentPermission contentPermission,
                                           Page ancestor)

getAutocomplete

public QuickNavBox getAutocomplete()

getDuplicateUserFlaggedJS

public String getDuplicateUserFlaggedJS(ContentPermission contentPermission)
Returns true if the specified user is flagged as duplicated in the permissions table. This was by error message previously but is now done by highlighting the duplicate row.

Parameters:
contentPermission -

getPermissionRowSelectorJS

public String getPermissionRowSelectorJS(ContentPermission contentPermission)

getInheritedPermissionRowSelectorJS

public String getInheritedPermissionRowSelectorJS(ContentPermission contentPermission,
                                                  Page ancestor)

getRemovePermissionRowLinkId

public String getRemovePermissionRowLinkId(ContentPermission contentPermission)

isPermissionInViewport

public boolean isPermissionInViewport(ContentPermission contentPermission)
Returns true if the row for the passed permission is viewable in the scrollable tables div.


waitForPermissionToScrollIntoViewport

public void waitForPermissionToScrollIntoViewport(ContentPermission contentPermission)

getScrollPositionOfElement

public int getScrollPositionOfElement(String selector)
Returns the scrollTop of the element for the passed selector.



Copyright © 2003-2012 Atlassian. All Rights Reserved.