Search in sources :

Example 1 with Carousel

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

the class CarouselIT 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
 */
@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.rtCarousel_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.
    carousel = new Carousel();
}
Also used : HashMap(java.util.HashMap) Carousel(com.adobe.cq.wcm.core.components.it.seljup.util.components.carousel.v1.Carousel) PageEditorPage(com.adobe.cq.testing.selenium.pageobject.PageEditorPage) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

PageEditorPage (com.adobe.cq.testing.selenium.pageobject.PageEditorPage)1 Carousel (com.adobe.cq.wcm.core.components.it.seljup.util.components.carousel.v1.Carousel)1 HashMap (java.util.HashMap)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1