Search in sources :

Example 1 with PermissionsTab

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);
}
Also used : AutoCompleteField(com.adobe.cq.testing.selenium.pagewidgets.cq.AutoCompleteField) ElementsCollection(com.codeborne.selenide.ElementsCollection) PropertiesPage(com.adobe.cq.testing.selenium.pageobject.cq.sites.PropertiesPage) PermissionsTab(com.adobe.cq.testing.selenium.pagewidgets.cq.tabs.PermissionsTab)

Example 2 with PermissionsTab

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();
}
Also used : PropertiesPage(com.adobe.cq.testing.selenium.pageobject.cq.sites.PropertiesPage) PermissionsTab(com.adobe.cq.testing.selenium.pagewidgets.cq.tabs.PermissionsTab)

Example 3 with PermissionsTab

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"));
}
Also used : AutoCompleteField(com.adobe.cq.testing.selenium.pagewidgets.cq.AutoCompleteField) ElementsCollection(com.codeborne.selenide.ElementsCollection) PropertiesPage(com.adobe.cq.testing.selenium.pageobject.cq.sites.PropertiesPage) PermissionsTab(com.adobe.cq.testing.selenium.pagewidgets.cq.tabs.PermissionsTab)

Aggregations

PropertiesPage (com.adobe.cq.testing.selenium.pageobject.cq.sites.PropertiesPage)3 PermissionsTab (com.adobe.cq.testing.selenium.pagewidgets.cq.tabs.PermissionsTab)3 AutoCompleteField (com.adobe.cq.testing.selenium.pagewidgets.cq.AutoCompleteField)2 ElementsCollection (com.codeborne.selenide.ElementsCollection)2