Search in sources :

Example 16 with PageEditorPage

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

the class TitleIT method setup.

public void setup() throws ClientException {
    // 1.
    testPage = authorClient.createPage("testPage", "Test Page Title", rootPage, defaultPageTemplate).getSlingPath();
    redirectPage = authorClient.createPage("redirectPage", "Redirect Page Title", rootPage, defaultPageTemplate).getSlingPath();
    // 2.
    String policySuffix = "/structure/page/new_policy";
    HashMap<String, String> data = new HashMap<String, String>();
    data.put("jcr:title", "New Policy");
    data.put("sling:resourceType", "wcm/core/components/policy/policy");
    data.put("clientlibs", clientlibs);
    String policyPath1 = "/conf/" + label + "/settings/wcm/policies/core-component/components";
    String policyPath = Commons.createPolicy(adminClient, policySuffix, data, policyPath1);
    // 3.
    String policyLocation = "core-component/components";
    String policyAssignmentPath = defaultPageTemplate + "/policies/jcr:content";
    data.clear();
    data.put("cq:policy", policyLocation + policySuffix);
    data.put("sling:resourceType", "wcm/core/components/policies/mappings");
    Commons.assignPolicy(adminClient, "", data, policyAssignmentPath);
    // 4.
    proxyPath = Commons.createProxyComponent(adminClient, titleRT, Commons.proxyPath, null, null);
    // 5.
    cmpPath = Commons.addComponent(adminClient, proxyPath, testPage + Commons.relParentCompPath, componentName, null);
    // 6.
    editorPage = new PageEditorPage(testPage);
    editorPage.open();
    // 7.
    title = new Title();
}
Also used : HashMap(java.util.HashMap) PageEditorPage(com.adobe.cq.testing.selenium.pageobject.PageEditorPage) Title(com.adobe.cq.wcm.core.components.it.seljup.util.components.title.v1.Title)

Example 17 with PageEditorPage

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

the class TabsIT method setupBeforeEach.

/**
 * Before Test Case
 *
 * 1. create test page
 * 2. create clientlib page policy
 * 3. assign clientlib page policy
 * 4. create the proxy component
 * 5. set cq:isContainer property true
 * 6. add the proxy component to the page
 * 7. open the test page in the editor
 * 8. Get Tabs component
 *
 * @throws ClientException
 */
@BeforeEach
public void setupBeforeEach() throws ClientException {
    // 1.
    testPage = authorClient.createPage("testPage", "Test Page Title", rootPage, defaultPageTemplate).getSlingPath();
    // 2.
    String policySuffix = "/structure/page/new_policy";
    HashMap<String, String> data = new HashMap<String, String>();
    data.put("jcr:title", "New Policy");
    data.put("sling:resourceType", "wcm/core/components/policy/policy");
    data.put("clientlibs", clientlibs);
    String policyPath1 = "/conf/" + label + "/settings/wcm/policies/core-component/components";
    policyPath = Commons.createPolicy(adminClient, policySuffix, data, policyPath1);
    // 3.
    String policyLocation = "core-component/components";
    String policyAssignmentPath = defaultPageTemplate + "/policies/jcr:content";
    data.clear();
    data.put("cq:policy", policyLocation + policySuffix);
    data.put("sling:resourceType", "wcm/core/components/policies/mappings");
    Commons.assignPolicy(adminClient, "", data, policyAssignmentPath);
    // 4.
    proxyPath = Commons.createProxyComponent(adminClient, Commons.rtTabs_v1, Commons.proxyPath, null, null);
    // 5.
    data.clear();
    data.put("cq:isContainer", "true");
    Commons.editNodeProperties(adminClient, proxyPath, data);
    // 6.
    cmpPath = Commons.addComponent(adminClient, proxyPath, testPage + Commons.relParentCompPath, componentName, null);
    // 7.
    editorPage = new PageEditorPage(testPage);
    editorPage.open();
    // 8.
    tabs = new Tabs();
}
Also used : HashMap(java.util.HashMap) PageEditorPage(com.adobe.cq.testing.selenium.pageobject.PageEditorPage) Tabs(com.adobe.cq.wcm.core.components.it.seljup.util.components.tabs.v1.Tabs) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 18 with PageEditorPage

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

the class LanguageNavigationIT method setup.

protected void setup() throws ClientException {
    // site root
    siteRoot = authorClient.createPage("site_root", "site_root", rootPage, defaultPageTemplate).getSlingPath();
    HashMap<String, String> data = new HashMap<String, String>();
    data.put("_charset_", "UTF-8");
    data.put("./jcr:content/navTitle", "Site Root");
    Commons.editNodeProperties(adminClient, siteRoot, data);
    // 1
    String locale1 = authorClient.createPage("LOCALE_1", "LOCALE_1", siteRoot, defaultPageTemplate).getSlingPath();
    data.clear();
    data.put("_charset_", "UTF-8");
    data.put("./jcr:content/navTitle", "LOCALE 1");
    Commons.editNodeProperties(adminClient, locale1, data);
    // 1.1
    String locale31 = authorClient.createPage("LOCALE_3", "LOCALE_3", locale1, defaultPageTemplate).getSlingPath();
    data.clear();
    data.put("_charset_", "UTF-8");
    data.put("./jcr:content/navTitle", "LOCALE 3 1");
    Commons.editNodeProperties(adminClient, locale31, data);
    // 1.2
    String locale4 = authorClient.createPage("LOCALE_4", "LOCALE_4", locale1, defaultPageTemplate).getSlingPath();
    data.clear();
    data.put("_charset_", "UTF-8");
    data.put("./jcr:content/navTitle", "LOCALE 4");
    data.put("./jcr:content/sling:vanityPath", "/LOCALE_4_vanity");
    Commons.editNodeProperties(adminClient, locale4, data);
    // 1.1.1
    String about1 = authorClient.createPage("about", "about", locale31, defaultPageTemplate).getSlingPath();
    data.clear();
    data.put("_charset_", "UTF-8");
    data.put("./jcr:content/navTitle", "About Us");
    Commons.editNodeProperties(adminClient, about1, data);
    // 2
    String locale2 = authorClient.createPage("LOCALE_2", "LOCALE_2", siteRoot, defaultPageTemplate).getSlingPath();
    data.clear();
    data.put("_charset_", "UTF-8");
    data.put("./jcr:content/navTitle", "LOCALE 2");
    Commons.editNodeProperties(adminClient, locale2, data);
    // 2.1
    String locale32 = authorClient.createPage("LOCALE_3", "LOCALE_3", locale2, defaultPageTemplate).getSlingPath();
    data.clear();
    data.put("_charset_", "UTF-8");
    data.put("./jcr:content/navTitle", "LOCALE 3 2");
    Commons.editNodeProperties(adminClient, locale32, data);
    // 2.2
    String locale5 = authorClient.createPage("LOCALE_5", "LOCALE_5", locale2, defaultPageTemplate).getSlingPath();
    data.clear();
    data.put("_charset_", "UTF-8");
    data.put("./jcr:content/navTitle", "LOCALE 5");
    Commons.editNodeProperties(adminClient, locale5, data);
    // 2.2.1
    String about2 = authorClient.createPage("about", "about", locale32, defaultPageTemplate).getSlingPath();
    data.clear();
    data.put("_charset_", "UTF-8");
    data.put("./jcr:content/navTitle", "About Us");
    Commons.editNodeProperties(adminClient, about2, data);
    // 3
    String hideInNav = authorClient.createPage("hideInNav", "hideInNav", siteRoot, defaultPageTemplate).getSlingPath();
    data.clear();
    data.put("_charset_", "UTF-8");
    data.put("./jcr:content/hideInNav", "true");
    Commons.editNodeProperties(adminClient, hideInNav, data);
    // no structure
    noStructure = authorClient.createPage("no_structure", "no_structure", rootPage, defaultPageTemplate).getSlingPath();
    data.clear();
    data.put("_charset_", "UTF-8");
    data.put("./jcr:content/navTitle", "No Structure");
    Commons.editNodeProperties(adminClient, noStructure, data);
    // create a proxy component
    proxyPath = Commons.createProxyComponent(adminClient, languageNavigationRT, Commons.proxyPath, null, null);
    compPath = Commons.addComponent(adminClient, proxyPath, about1 + Commons.relParentCompPath, "languagenavigation", null);
    editorPage = new PageEditorPage(about1);
    editorPage.open();
    languageNavigation = new LanguageNavigation();
}
Also used : LanguageNavigation(com.adobe.cq.wcm.core.components.it.seljup.util.components.languagenavigation.v1.LanguageNavigation) HashMap(java.util.HashMap) PageEditorPage(com.adobe.cq.testing.selenium.pageobject.PageEditorPage)

Example 19 with PageEditorPage

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

the class TextIT method setup.

protected void setup() throws ClientException {
    // create the test page, store page path in 'testPagePath'
    testPage = authorClient.createPage("testPage", "Test Page Title", rootPage, defaultPageTemplate).getSlingPath();
    // create a proxy component
    proxyPath = Commons.createProxyComponent(adminClient, textRT, Commons.proxyPath, null, null);
    // add the core form container component
    compPath = Commons.addComponent(adminClient, proxyPath, testPage + Commons.relParentCompPath, "text", null);
    // open the page in the editor
    editorPage = new PageEditorPage(testPage);
    editorPage.open();
}
Also used : PageEditorPage(com.adobe.cq.testing.selenium.pageobject.PageEditorPage)

Example 20 with PageEditorPage

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

the class ListIT method setup.

protected void setup() throws ClientException {
    // add 2 tags
    tag1Path = Commons.addTag(adminClient, tag1);
    tag2Path = Commons.addTag(adminClient, tag2);
    // create a separate parent page
    parentPath = authorClient.createPage("parent_page", "parent_page", rootPage, defaultPageTemplate).getSlingPath();
    // add page 1
    page1Path = authorClient.createPage("page_1", "page_1", parentPath, defaultPageTemplate).getSlingPath();
    // set tag on the page
    String[] tags = new String[] { tag1 };
    Commons.setTagsToPage(adminClient, page1Path, tags, 200);
    HashMap<String, String> data = new HashMap<String, String>();
    data.put("jcr:description", description);
    Commons.editNodeProperties(adminClient, page1Path + "/jcr:content", data);
    // add page 2
    page2Path = authorClient.createPage("page_2", "page_2", parentPath, defaultPageTemplate).getSlingPath();
    // add a text component
    String text1Path = Commons.addComponent(adminClient, Commons.rtText_v1, page2Path + Commons.relParentCompPath, "text", null);
    // set some text in the text component
    data.clear();
    data.put("text", searchValue);
    Commons.editNodeProperties(adminClient, text1Path, data);
    // create subpage for page 2
    page21Path = authorClient.createPage("sub_2_1", "sub_2_1", page2Path, defaultPageTemplate).getSlingPath();
    // create second sub page for page 2
    page22Path = authorClient.createPage("sub_2_2", "sub_2_2", page2Path, defaultPageTemplate).getSlingPath();
    // add page 3
    page3Path = authorClient.createPage("page_3", "page_3", parentPath, defaultPageTemplate).getSlingPath();
    // set 2 tags on the page
    tags = new String[] { tag1, tag2 };
    Commons.setTagsToPage(adminClient, page3Path, tags, 200);
    // create page 4
    page4Path = authorClient.createPage("page_4", "page_4", parentPath, defaultPageTemplate).getSlingPath();
    // create a sub page for page 4
    String page41Path = authorClient.createPage("sub_4_1", "sub_4_1", page4Path, defaultPageTemplate).getSlingPath();
    // add a text component
    String text2Path = Commons.addComponent(adminClient, Commons.rtText_v1, page41Path + Commons.relParentCompPath, "text", null);
    // set some text in the text component
    data.clear();
    data.put("text", searchValue);
    Commons.editNodeProperties(adminClient, text2Path, data);
    // create page 5
    page5Path = authorClient.createPage("page_5", "page_5", parentPath, defaultPageTemplate).getSlingPath();
    // set tag on the page
    tags = new String[] { tag2 };
    Commons.setTagsToPage(adminClient, page5Path, tags, 200);
    // create the test page containing the list component, store page path in 'testPagePath'
    testPage = authorClient.createPage("testPage", "Test Page Title", rootPage, defaultPageTemplate).getSlingPath();
    // create a proxy component
    proxyPath = Commons.createProxyComponent(adminClient, listRT, Commons.proxyPath, null, null);
    // add the component to test page
    compPath = Commons.addComponent(adminClient, proxyPath, testPage + Commons.relParentCompPath, "list", null);
    // open test page in page editor
    editorPage = new PageEditorPage(testPage);
    editorPage.open();
    list = new List();
}
Also used : HashMap(java.util.HashMap) PageEditorPage(com.adobe.cq.testing.selenium.pageobject.PageEditorPage) List(com.adobe.cq.wcm.core.components.it.seljup.util.components.list.v1.List)

Aggregations

PageEditorPage (com.adobe.cq.testing.selenium.pageobject.PageEditorPage)28 HashMap (java.util.HashMap)16 BeforeEach (org.junit.jupiter.api.BeforeEach)8 EditableToolbar (com.adobe.cq.testing.selenium.pagewidgets.cq.EditableToolbar)3 AuthorBaseUITest (com.adobe.cq.wcm.core.components.it.seljup.AuthorBaseUITest)3 EditableToolbarAssertion (com.adobe.cq.wcm.core.components.it.seljup.util.assertion.EditableToolbarAssertion)3 DisplayName (org.junit.jupiter.api.DisplayName)3 Test (org.junit.jupiter.api.Test)3 WebDriver (org.openqa.selenium.WebDriver)3 WebDriverWait (org.openqa.selenium.support.ui.WebDriverWait)3 ContentFragment (com.adobe.cq.wcm.core.components.it.seljup.util.components.contentfragment.v1.ContentFragment)2 FormComponents (com.adobe.cq.wcm.core.components.it.seljup.util.components.formcomponents.v1.FormComponents)2 PropertiesPage (com.adobe.cq.testing.selenium.pageobject.cq.sites.PropertiesPage)1 Accordion (com.adobe.cq.wcm.core.components.it.seljup.util.components.accordion.v1.Accordion)1 Button (com.adobe.cq.wcm.core.components.it.seljup.util.components.button.v1.Button)1 Carousel (com.adobe.cq.wcm.core.components.it.seljup.util.components.carousel.v1.Carousel)1 AssetFinder (com.adobe.cq.wcm.core.components.it.seljup.util.components.commons.AssetFinder)1 ContentFragmentList (com.adobe.cq.wcm.core.components.it.seljup.util.components.contentfragmentlist.v1.ContentFragmentList)1 UrlProcessors (com.adobe.cq.wcm.core.components.it.seljup.util.components.embed.UrlProcessors)1 OEmbed (com.adobe.cq.wcm.core.components.it.seljup.util.components.embed.UrlProcessors.OEmbed)1