Search in sources :

Example 1 with LanguageNavigation

use of com.adobe.cq.wcm.core.components.it.seljup.util.components.languagenavigation.v1.LanguageNavigation 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)

Aggregations

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