use of com.adobe.cq.testing.selenium.pagewidgets.cq.tabs.PermissionsTab in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class PageTests method testAddPermissionsPageProperties.
public void testAddPermissionsPageProperties() throws InterruptedException {
// Open properties page
PropertiesPage propertiesPage = new PropertiesPage(testPage);
propertiesPage.open();
// Open Permission tab
PermissionsTab permissions = propertiesPage.clickTab("permissions", PermissionsTab.class);
final ElementsCollection currentPermissionsList = permissions.permissionsList();
// Check no permission set
currentPermissionsList.shouldHaveSize(0);
// Add permission
final PermissionsTab.AddPermissionsDialog addPermissionsDialog = permissions.addPermission();
addPermissionsDialog.waitVisible();
final AutoCompleteField authList = addPermissionsDialog.authorizableList();
authList.sendKeys(userPrincipalName);
authList.buttonlist().selectByValue(userPrincipalName);
addPermissionsDialog.read().click();
addPermissionsDialog.modify().click();
addPermissionsDialog.delete().click();
addPermissionsDialog.clickPrimary();
// Check the permission set
currentPermissionsList.shouldHaveSize(1);
currentPermissionsList.shouldHave(CollectionCondition.texts(userName));
assertTrue(permissions.isReadPermissionGranted(userName), "Read permission has been given, should be checked");
assertTrue(permissions.isDeletePermissionGranted(userName), "Delete permission has been given, should be checked");
assertTrue(permissions.isModifyPermissionGranted(userName), "Modify permission has been given, should be checked");
assertTrue(!permissions.isReplicatePermissionGranted(userName), "Replicate permission has not been given, should not be checked");
assertTrue(!permissions.isCreatePermissionGranted(userName), "Create permission has not been given, should not be checked");
// Edit the permission
final PermissionsTab.EditPermissionDialog editPermissionDialog = permissions.editPermission(userName);
editPermissionDialog.replicate().click();
editPermissionDialog.clickPrimary();
Commons.webDriverWait(RequestConstants.WEBDRIVER_WAIT_TIME_MS);
assertTrue(permissions.isReplicatePermissionGranted(userName), "Replicate permission has been given, should be checked");
// Delete the permission
permissions.deleteUserPermission(userName);
currentPermissionsList.shouldHaveSize(0);
}
use of com.adobe.cq.testing.selenium.pagewidgets.cq.tabs.PermissionsTab in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class PageTests method testEffectivePermissionsPageProperties.
public void testEffectivePermissionsPageProperties() throws InterruptedException {
// Open properties page
PropertiesPage propertiesPage = new PropertiesPage(testPage);
propertiesPage.open();
// Open Permission tab
PermissionsTab permissions = propertiesPage.clickTab("permissions", PermissionsTab.class);
PermissionsTab.EffectivePermissionDialog effectivePermissionDialog = permissions.openEffectivePermissions();
// Wait for Dialog to open
Commons.webDriverWait(RequestConstants.WEBDRIVER_WAIT_TIME_MS);
assertTrue(effectivePermissionDialog.isVisible(), "Effective Permission dialog should be open");
// Close Effective Permission Dialog
effectivePermissionDialog.close();
}
use of com.adobe.cq.testing.selenium.pagewidgets.cq.tabs.PermissionsTab in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class PageTests method testEditUserGroupPermissionsPageProperties.
public void testEditUserGroupPermissionsPageProperties() {
// Open properties page
PropertiesPage propertiesPage = new PropertiesPage(testPage);
propertiesPage.open();
// Open Permission tab
PermissionsTab permissions = propertiesPage.clickTab("permissions", PermissionsTab.class);
// Check current CUG list is empty
final ElementsCollection currentCUGList = permissions.cugList();
currentCUGList.shouldHaveSize(0);
// Add CUG permission
final PermissionsTab.EditCUGDialog editCUG = permissions.editCUG();
editCUG.waitVisible();
final AutoCompleteField cugList = editCUG.cugFinder();
cugList.sendKeys("corecomp");
cugList.buttonlist().selectByValue("corecomp");
editCUG.clickPrimary();
// Check the added CUG permission
currentCUGList.shouldHaveSize(1);
currentCUGList.shouldHave(CollectionCondition.texts("CoreComponent Test"));
}
Aggregations