Search in sources :

Example 1 with Navigation

use of com.adobe.cq.wcm.core.components.it.seljup.util.components.navigation.v1.Navigation in project aem-core-wcm-components by Adobe-Marketing-Cloud.

the class NavigationIT method setup.

protected void setup() throws ClientException {
    // level 1
    page1path = authorClient.createPage("page_1", "page_1", rootPage, defaultPageTemplate).getSlingPath();
    HashMap<String, String> data = new HashMap<String, String>();
    data.put("_charset_", "UTF-8");
    data.put("./jcr:content/navTitle", "Page 1");
    Commons.editNodeProperties(adminClient, page1path, data);
    // level 2
    String page11path = authorClient.createPage("page_1_1", "page_1_1", page1path, defaultPageTemplate).getSlingPath();
    data.clear();
    data.put("_charset_", "UTF-8");
    data.put("./jcr:content/navTitle", "Page 1.1");
    data.put("./jcr:content/sling:vanityPath", "/page_1_1_vanity");
    Commons.editNodeProperties(adminClient, page11path, data);
    // level 2 1
    String page111path = authorClient.createPage("page_1_1_1", "page_1_1_1", page11path, defaultPageTemplate).getSlingPath();
    data.clear();
    data.put("_charset_", "UTF-8");
    data.put("./jcr:content/navTitle", "Page 1.1.1");
    Commons.editNodeProperties(adminClient, page111path, data);
    // level 2 2
    String page112path = authorClient.createPage("page_1_1_2", "page_1_1_2", page11path, defaultPageTemplate).getSlingPath();
    data.clear();
    data.put("_charset_", "UTF-8");
    data.put("./jcr:content/hideInNav", "true");
    Commons.editNodeProperties(adminClient, page112path, data);
    // level 2 3
    String page113path = authorClient.createPage("page_1_1_3", "page_1_1_3", page11path, defaultPageTemplate).getSlingPath();
    data.clear();
    data.put("_charset_", "UTF-8");
    data.put("./jcr:content/navTitle", "Page 1.1.3");
    Commons.editNodeProperties(adminClient, page113path, data);
    // create a proxy component
    proxyPath = Commons.createProxyComponent(adminClient, navigationRT, Commons.proxyPath, null, null);
    // add the component to test page
    compPath = Commons.addComponent(adminClient, proxyPath, page11path + Commons.relParentCompPath, "navigation", null);
    // open test page in page editor
    editorPage = new PageEditorPage(page11path);
    editorPage.open();
    navigation = new Navigation();
}
Also used : Navigation(com.adobe.cq.wcm.core.components.it.seljup.util.components.navigation.v1.Navigation) HashMap(java.util.HashMap) PageEditorPage(com.adobe.cq.testing.selenium.pageobject.PageEditorPage)

Aggregations

PageEditorPage (com.adobe.cq.testing.selenium.pageobject.PageEditorPage)1 Navigation (com.adobe.cq.wcm.core.components.it.seljup.util.components.navigation.v1.Navigation)1 HashMap (java.util.HashMap)1