Search in sources :

Example 1 with PropertiesPage

use of com.adobe.cq.testing.selenium.pageobject.cq.sites.PropertiesPage in project aem-core-wcm-components by Adobe-Marketing-Cloud.

the class PageTests method testPersonalizationPageProperties.

public void testPersonalizationPageProperties() throws InterruptedException {
    // Open properties page
    PropertiesPage propertiesPage = new PropertiesPage(testPage);
    propertiesPage.open();
    // Open Personalization tab
    clickableClick(propertiesPage.getCoralTabs().filter(Condition.matchText("Personalization")).first());
    // set the contextHub path
    page.setContextHubPath(contextHubPath);
    // set the segments path
    page.setContextHubSegmentsPath(segmentPath);
    Commons.webDriverWait(RequestConstants.WEBDRIVER_WAIT_TIME_MS);
    // save the configuration and open again the page property
    propertiesPage.saveAndClose();
    Commons.webDriverWait(RequestConstants.WEBDRIVER_WAIT_TIME_MS);
    propertiesPage.open();
    clickableClick(propertiesPage.getCoralTabs().filter(Condition.matchText("Personalization")).first());
    // check the contextHub path
    assertTrue(page.getContextHubPath().equals(contextHubPath), "ContextHub path should be set to " + contextHubPath);
    // check the segments path
    assertTrue(page.getContextHubSegmentsPath().equals(segmentPath), "ContextHub Segments path should be set to " + segmentPath);
}
Also used : PropertiesPage(com.adobe.cq.testing.selenium.pageobject.cq.sites.PropertiesPage)

Example 2 with PropertiesPage

use of com.adobe.cq.testing.selenium.pageobject.cq.sites.PropertiesPage 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 3 with PropertiesPage

use of com.adobe.cq.testing.selenium.pageobject.cq.sites.PropertiesPage in project aem-core-wcm-components by Adobe-Marketing-Cloud.

the class PageTests method testBlueprintPageProperties.

public void testBlueprintPageProperties() throws ClientException, InterruptedException {
    // create the live copy page, store page path in 'testLiveCopyPagePath'
    String testLiveCopyPagePath = Commons.createLiveCopy(adminClient, testPage, rootPage, "testLiveCopy", "testLiveCopy", 200);
    // Open properties page
    PropertiesPage propertiesPage = new PropertiesPage(testPage);
    propertiesPage.open();
    // open the Blueprint tab
    BlueprintTab blueprintTab = propertiesPage.clickTab("blueprint", BlueprintTab.class);
    RolloutDialog rolloutDialog = blueprintTab.rollout();
    Commons.webDriverWait(RequestConstants.WEBDRIVER_WAIT_TIME_MS);
    // check livecopy is present for rollout
    assertTrue(rolloutDialog.numberOfLiveCopies() == 1, "There should be 1 livecopy");
    assertTrue(rolloutDialog.isLiveCopySelected(testLiveCopyPagePath), "Livecopy should be selected");
    // Check cancel rollout
    rolloutDialog.close();
    // Open Blueprint tab
    Commons.webDriverWait(RequestConstants.WEBDRIVER_WAIT_TIME_MS);
    propertiesPage.clickTab("blueprint", BlueprintTab.class);
    rolloutDialog = blueprintTab.rollout();
    // check rollout now
    rolloutDialog.rolloutNow();
    // Delete the created livecopy page
    adminClient.deletePageWithRetry(testLiveCopyPagePath, true, false, RequestConstants.TIMEOUT_TIME_MS, RequestConstants.RETRY_TIME_INTERVAL, HttpStatus.SC_OK);
}
Also used : BlueprintTab(com.adobe.cq.testing.selenium.pagewidgets.cq.tabs.BlueprintTab) RolloutDialog(com.adobe.cq.testing.selenium.pagewidgets.cq.RolloutDialog) PropertiesPage(com.adobe.cq.testing.selenium.pageobject.cq.sites.PropertiesPage)

Example 4 with PropertiesPage

use of com.adobe.cq.testing.selenium.pageobject.cq.sites.PropertiesPage 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 5 with PropertiesPage

use of com.adobe.cq.testing.selenium.pageobject.cq.sites.PropertiesPage in project aem-core-wcm-components by Adobe-Marketing-Cloud.

the class PageTests method testBasicTitleAndTagsPageProperties.

public void testBasicTitleAndTagsPageProperties() throws ClientException, InterruptedException {
    // create tags
    String tag1FullPath = Commons.addTag(adminClient, tag1);
    String tag2FullPath = Commons.addTag(adminClient, tag2);
    // open the properties page
    PropertiesPage propertiesPage = new PropertiesPage(testPage);
    propertiesPage.open();
    // open the Basic tab
    PropertiesPage.Tabs.Basic basicTab = propertiesPage.tabs().basic();
    // check the page title
    assertTrue(basicTab.title().getValue().equals(pageTitle), "Title value should be set as page title");
    // change the page title
    basicTab.title().setValue("Page");
    Commons.webDriverWait(RequestConstants.WEBDRIVER_WAIT_TIME_MS);
    // add two tags
    Commons.selectInTags("[name='./cq:tags']", tag1Path);
    Commons.selectInTags("[name='./cq:tags']", tag2Path);
    // set the Hide in Navigation
    basicTab.hideInNav().click();
    // save the configuration and open again the page property
    propertiesPage.saveAndClose();
    Commons.webDriverWait(RequestConstants.WEBDRIVER_WAIT_TIME_MS);
    propertiesPage.open();
    // check the page title
    assertTrue(basicTab.title().getValue().equals("Page"), "Title value should be set as new value: Page");
    // check if 'Hide in Navigation' is checked
    assertTrue(basicTab.hideInNav().isChecked(), "HideNav should be checked");
    // check if the tags were saved
    assertTrue(basicTab.isTagPresent(tag1), "Tag " + tag1 + " should br present");
    assertTrue(basicTab.isTagPresent(tag2), "Tag " + tag2 + " should br present");
    adminClient.deletePath("/content/cq:tags/default/" + tag1FullPath, HttpStatus.SC_OK);
    adminClient.deletePath("/content/cq:tags/default/" + tag2FullPath, HttpStatus.SC_OK);
}
Also used : PropertiesPage(com.adobe.cq.testing.selenium.pageobject.cq.sites.PropertiesPage)

Aggregations

PropertiesPage (com.adobe.cq.testing.selenium.pageobject.cq.sites.PropertiesPage)23 AdvancedTab (com.adobe.cq.testing.selenium.pagewidgets.cq.tabs.AdvancedTab)4 CoralCheckbox (com.adobe.cq.testing.selenium.pagewidgets.coral.CoralCheckbox)3 PermissionsTab (com.adobe.cq.testing.selenium.pagewidgets.cq.tabs.PermissionsTab)3 CoralMultiField (com.adobe.cq.testing.selenium.pagewidgets.coral.CoralMultiField)2 AutoCompleteField (com.adobe.cq.testing.selenium.pagewidgets.cq.AutoCompleteField)2 RolloutDialog (com.adobe.cq.testing.selenium.pagewidgets.cq.RolloutDialog)2 ElementsCollection (com.codeborne.selenide.ElementsCollection)2 PageEditorPage (com.adobe.cq.testing.selenium.pageobject.PageEditorPage)1 Dialog (com.adobe.cq.testing.selenium.pagewidgets.coral.Dialog)1 BlueprintTab (com.adobe.cq.testing.selenium.pagewidgets.cq.tabs.BlueprintTab)1 CloudServicesTab (com.adobe.cq.testing.selenium.pagewidgets.cq.tabs.CloudServicesTab)1 ImageTab (com.adobe.cq.testing.selenium.pagewidgets.cq.tabs.ImageTab)1 LiveCopyTab (com.adobe.cq.testing.selenium.pagewidgets.cq.tabs.LiveCopyTab)1 SocialMediaTab (com.adobe.cq.testing.selenium.pagewidgets.cq.tabs.SocialMediaTab)1 ThumbnailTab (com.adobe.cq.testing.selenium.pagewidgets.cq.tabs.ThumbnailTab)1 HashMap (java.util.HashMap)1 JsonNode (org.codehaus.jackson.JsonNode)1