Search in sources :

Example 1 with AutoCompleteField

use of com.adobe.cq.testing.selenium.pagewidgets.cq.AutoCompleteField 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 AutoCompleteField

use of com.adobe.cq.testing.selenium.pagewidgets.cq.AutoCompleteField in project aem-core-wcm-components by Adobe-Marketing-Cloud.

the class Commons method selectInAutocomplete.

/**
 * Selects a value in a Granite UI autocomplete field
 *
 * @param selector {String} Specific selector for the autocomplete (ex. "[name='./myField']")
 * @param value {String} The value to be selected
 */
public static void selectInAutocomplete(String selector, String value) {
    AutoCompleteField autoCompleteField = new AutoCompleteField("css:" + selector);
    autoCompleteField.sendKeys(value);
    autoCompleteField.suggestions().selectByValue(value);
}
Also used : AutoCompleteField(com.adobe.cq.testing.selenium.pagewidgets.cq.AutoCompleteField)

Example 3 with AutoCompleteField

use of com.adobe.cq.testing.selenium.pagewidgets.cq.AutoCompleteField in project aem-core-wcm-components by Adobe-Marketing-Cloud.

the class NavigationEditDialog method setNavigationRoot.

public void setNavigationRoot(String path) {
    AutoCompleteField autoCompleteField = new AutoCompleteField("css:" + navigationRoot);
    autoCompleteField.sendKeys(path);
    autoCompleteField.suggestions().selectByValue(path);
}
Also used : AutoCompleteField(com.adobe.cq.testing.selenium.pagewidgets.cq.AutoCompleteField)

Example 4 with AutoCompleteField

use of com.adobe.cq.testing.selenium.pagewidgets.cq.AutoCompleteField in project aem-core-wcm-components by Adobe-Marketing-Cloud.

the class Page method setVariantPath.

public void setVariantPath(String path) throws InterruptedException {
    AutoCompleteField autoCompleteField = new AutoCompleteField("css:" + variantPath);
    autoCompleteField.sendKeys(path);
    Commons.webDriverWait(RequestConstants.WEBDRIVER_WAIT_TIME_MS);
}
Also used : AutoCompleteField(com.adobe.cq.testing.selenium.pagewidgets.cq.AutoCompleteField)

Example 5 with AutoCompleteField

use of com.adobe.cq.testing.selenium.pagewidgets.cq.AutoCompleteField in project aem-core-wcm-components by Adobe-Marketing-Cloud.

the class Page method setContextHubPath.

public void setContextHubPath(String path) {
    AutoCompleteField autoCompleteField = new AutoCompleteField("css:" + contextHubPath);
    autoCompleteField.sendKeys(path);
}
Also used : AutoCompleteField(com.adobe.cq.testing.selenium.pagewidgets.cq.AutoCompleteField)

Aggregations

AutoCompleteField (com.adobe.cq.testing.selenium.pagewidgets.cq.AutoCompleteField)16 PropertiesPage (com.adobe.cq.testing.selenium.pageobject.cq.sites.PropertiesPage)2 PermissionsTab (com.adobe.cq.testing.selenium.pagewidgets.cq.tabs.PermissionsTab)2 ElementsCollection (com.codeborne.selenide.ElementsCollection)2 WebDriver (org.openqa.selenium.WebDriver)1 WebDriverWait (org.openqa.selenium.support.ui.WebDriverWait)1