Search in sources :

Example 1 with Embed

use of com.adobe.cq.wcm.core.components.it.seljup.util.components.embed.v1.Embed in project aem-core-wcm-components by adobe.

the class EmbedIT method setup.

/**
 * Setup Before Test Case
 *
 * 1. create test page
 * 2. create the policy
 * 3. assign the policy
 * 4. create proxy component
 * 5. add the component to the page
 * 6. open the new page in the editor
 */
protected void setup() throws ClientException {
    // 1.
    testPage = authorClient.createPage("testPage", "Test Page Title", rootPage, defaultPageTemplate).getSlingPath();
    // 2.
    String policySuffix = "/embed" + "/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("allowedEmbeddables", youtubeEmbedField);
    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/root/responsivegrid";
    data.clear();
    data.put("cq:policy", policyLocation + policySuffix);
    data.put("sling:resourceType", "wcm/core/components/policies/mappings");
    Commons.assignPolicy(adminClient, "/core-component/components/embed", data, policyAssignmentPath, 200, 201);
    // 4.
    proxyPath = Commons.createProxyComponent(adminClient, embedRT, Commons.proxyPath, null, null);
    // 5.
    cmpPath = Commons.addComponent(adminClient, proxyPath, testPage + Commons.relParentCompPath, componentName, null);
    // 6.
    editorPage = new PageEditorPage(testPage);
    editorPage.open();
    embed = new Embed();
    urlProcessors = new UrlProcessors();
}
Also used : UrlProcessors(com.adobe.cq.wcm.core.components.it.seljup.util.components.embed.UrlProcessors) HashMap(java.util.HashMap) OEmbed(com.adobe.cq.wcm.core.components.it.seljup.util.components.embed.UrlProcessors.OEmbed) Embed(com.adobe.cq.wcm.core.components.it.seljup.util.components.embed.v1.Embed) PageEditorPage(com.adobe.cq.testing.selenium.pageobject.PageEditorPage)

Example 2 with Embed

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

the class EmbedIT method setup.

/**
 * Setup Before Test Case
 *
 * 1. create test page
 * 2. create the policy
 * 3. assign the policy
 * 4. create proxy component
 * 5. add the component to the page
 * 6. open the new page in the editor
 */
protected void setup() throws ClientException {
    // 1.
    testPage = authorClient.createPage("testPage", "Test Page Title", rootPage, defaultPageTemplate).getSlingPath();
    // 2.
    String policySuffix = "/embed" + "/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("allowedEmbeddables", youtubeEmbedField);
    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/root/responsivegrid";
    data.clear();
    data.put("cq:policy", policyLocation + policySuffix);
    data.put("sling:resourceType", "wcm/core/components/policies/mappings");
    Commons.assignPolicy(adminClient, "/core-component/components/embed", data, policyAssignmentPath, 200, 201);
    // 4.
    proxyPath = Commons.createProxyComponent(adminClient, embedRT, Commons.proxyPath, null, null);
    // 5.
    cmpPath = Commons.addComponent(adminClient, proxyPath, testPage + Commons.relParentCompPath, componentName, null);
    // 6.
    editorPage = new PageEditorPage(testPage);
    editorPage.open();
    embed = new Embed();
    urlProcessors = new UrlProcessors();
}
Also used : UrlProcessors(com.adobe.cq.wcm.core.components.it.seljup.util.components.embed.UrlProcessors) HashMap(java.util.HashMap) OEmbed(com.adobe.cq.wcm.core.components.it.seljup.util.components.embed.UrlProcessors.OEmbed) Embed(com.adobe.cq.wcm.core.components.it.seljup.util.components.embed.v1.Embed) PageEditorPage(com.adobe.cq.testing.selenium.pageobject.PageEditorPage)

Aggregations

PageEditorPage (com.adobe.cq.testing.selenium.pageobject.PageEditorPage)2 UrlProcessors (com.adobe.cq.wcm.core.components.it.seljup.util.components.embed.UrlProcessors)2 OEmbed (com.adobe.cq.wcm.core.components.it.seljup.util.components.embed.UrlProcessors.OEmbed)2 Embed (com.adobe.cq.wcm.core.components.it.seljup.util.components.embed.v1.Embed)2 HashMap (java.util.HashMap)2