Search in sources :

Example 16 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 testAdvancedSeoPageProperties.

public void testAdvancedSeoPageProperties() throws InterruptedException, ClientException {
    // Open properties page
    PropertiesPage propertiesPage = new PropertiesPage(testPage);
    propertiesPage.open();
    // open the Advanced tab
    propertiesPage.clickTab("advanced", AdvancedTab.class);
    // tests for the SEO options
    page.setRobotsTags("index", "follow");
    page.setGenerateSitemap(true);
    // save the configuration and open again the page property
    propertiesPage.saveAndClose();
    Commons.webDriverWait(RequestConstants.WEBDRIVER_WAIT_TIME_MS);
    propertiesPage.open();
    propertiesPage.clickTab("advanced", AdvancedTab.class);
    // check the SEO Configuration
    assertArrayEquals(new String[] { "index", "follow" }, page.getRobotsTags());
    assertTrue(page.getGenerateSitemap());
    // validate the actual persisted values
    JsonNode content = adminClient.doGetJson(testPage + "/_jcr_content", 1, HttpStatus.SC_OK);
    JsonNode robotsTags = content.get("cq:robotsTags");
    assertTrue(robotsTags.isArray());
    assertEquals(2, robotsTags.size());
    assertEquals("index", robotsTags.get(0).getTextValue());
    assertEquals("follow", robotsTags.get(1).getTextValue());
    JsonNode sitemapRoot = content.get("sling:sitemapRoot");
    assertEquals("true", sitemapRoot.getTextValue());
}
Also used : PropertiesPage(com.adobe.cq.testing.selenium.pageobject.cq.sites.PropertiesPage) JsonNode(org.codehaus.jackson.JsonNode)

Example 17 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 testSocialMediaPageProperties.

public void testSocialMediaPageProperties() throws InterruptedException {
    // Open properties page
    PropertiesPage propertiesPage = new PropertiesPage(testPage);
    propertiesPage.open();
    // Open the Social Media tab
    SocialMediaTab socialMediaTab = propertiesPage.clickTab("social media", SocialMediaTab.class);
    // test social media sharing
    socialMediaTab.socialMediaSharing("facebook").click();
    socialMediaTab.socialMediaSharing("pinterest").click();
    page.setVariantPath(variantPath);
    // save the configuration and open again the page property
    propertiesPage.saveAndClose();
    Commons.webDriverWait(RequestConstants.WEBDRIVER_WAIT_TIME_MS);
    propertiesPage.open();
    socialMediaTab = propertiesPage.clickTab("social media", SocialMediaTab.class);
    // check if facebook is checked
    assertTrue(socialMediaTab.socialMediaSharing("facebook").isChecked(), "Social media sharing should be enabled for Facebook");
    // check if pinterest is checked
    assertTrue(socialMediaTab.socialMediaSharing("pinterest").isChecked(), "Social media sharing should be enabled for Pinterest");
    // check if variant path is set correctly
    assertTrue(page.getVariantPath().equals(variantPath), "Variant path should be set to " + variantPath);
}
Also used : PropertiesPage(com.adobe.cq.testing.selenium.pageobject.cq.sites.PropertiesPage) SocialMediaTab(com.adobe.cq.testing.selenium.pagewidgets.cq.tabs.SocialMediaTab)

Example 18 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 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)

Example 19 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 testBasicOnOffTimePageProperties.

public void testBasicOnOffTimePageProperties() throws InterruptedException {
    // Open properties page
    PropertiesPage propertiesPage = new PropertiesPage(testPage);
    propertiesPage.open();
    // set onTime to first day next month
    page.setOnTime();
    // set offTime to second day next month
    page.setOffTime();
    // save the configuration and open again the page property
    propertiesPage.saveAndClose();
    Commons.webDriverWait(RequestConstants.WEBDRIVER_WAIT_TIME_MS);
    propertiesPage.open();
    // Check if on time and off time are correctly set
    assertTrue(!page.getOnTime().isEmpty(), "OnTime should be set");
    assertTrue(!page.getOffTime().isEmpty(), "OffTime should be set");
}
Also used : PropertiesPage(com.adobe.cq.testing.selenium.pageobject.cq.sites.PropertiesPage)

Example 20 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 ImageTests method setPageImage.

/**
 * Sets the featured image for a page.
 */
private void setPageImage(boolean aem65, String page, String asset, boolean altFromDam) throws ClientException, InterruptedException {
    String assetSelector;
    if (aem65) {
        assetSelector = "*[data-foundation-collection-item-id='/content/dam/core-components/" + asset + "'] coral-columnview-item-thumbnail";
    } else {
        assetSelector = "*[data-foundation-collection-item-id='/content/dam/core-components/" + asset + "'] coral-checkbox";
    }
    // set page resource type to page v3
    adminClient.setPageProperty(page, "sling:resourceType", "core/wcm/components/page/v3/page", 200);
    PropertiesPage pageProperties = new PropertiesPage(page);
    pageProperties.open();
    $("coral-tab[data-foundation-tracking-event*='images']").click();
    $(".cq-FileUpload-picker").click();
    $("*[data-foundation-collection-item-id='/content/dam/core-components']").click();
    $(assetSelector).click();
    clickableClick($(".granite-pickerdialog-submit"));
    if (altFromDam) {
        // inherit alt text from DAM
        String altValueFromDAMSelector = ".cq-siteadmin-admin-properties coral-checkbox[name='./cq:featuredimage/altValueFromDAM']";
        CoralCheckbox altValueFromDAMCheckbox = new CoralCheckbox(altValueFromDAMSelector);
        altValueFromDAMCheckbox.click();
    }
    pageProperties.saveAndClose();
    Commons.webDriverWait(RequestConstants.WEBDRIVER_WAIT_TIME_MS);
}
Also used : CoralCheckbox(com.adobe.cq.testing.selenium.pagewidgets.coral.CoralCheckbox) 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