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());
}
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);
}
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"));
}
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");
}
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);
}
Aggregations