Search in sources :

Example 1 with PageEditorPage

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

the class AccordionIT 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 Accordion 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.rtAccordion_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.
    accordion = new Accordion();
}
Also used : Accordion(com.adobe.cq.wcm.core.components.it.seljup.util.components.accordion.v1.Accordion) HashMap(java.util.HashMap) PageEditorPage(com.adobe.cq.testing.selenium.pageobject.PageEditorPage) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 2 with PageEditorPage

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

the class ContentFragmentListIT method setup.

protected void setup() throws ClientException {
    // create the test page, store page path in 'testPagePath'
    testPage = adminClient.createPage("testPage", "Test Page Title", rootPage, defaultPageTemplate).getSlingPath();
    // create a proxy component
    proxyPath = Commons.createProxyComponent(adminClient, contentFragmentListRT, Commons.proxyPath, null, null);
    // add the core form container component
    cmpPath = Commons.addComponent(adminClient, proxyPath, testPage + Commons.relParentCompPath, "formtext", null);
    contentFragment = new ContentFragment();
    contentFragmentList = new ContentFragmentList();
    // open the page in the editor
    editorPage = new PageEditorPage(testPage);
    editorPage.open();
}
Also used : ContentFragment(com.adobe.cq.wcm.core.components.it.seljup.util.components.contentfragment.v1.ContentFragment) ContentFragmentList(com.adobe.cq.wcm.core.components.it.seljup.util.components.contentfragmentlist.v1.ContentFragmentList) PageEditorPage(com.adobe.cq.testing.selenium.pageobject.PageEditorPage)

Example 3 with PageEditorPage

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

the class BreadcrumbTests method setup.

public void setup(CQClient client, String rtBreadcrumb, String rootPage, String defaultPageTemplate, String clientlib, BaseBreadcrumbItems breadcrumbItems) throws ClientException {
    createTestpages(client, rootPage, defaultPageTemplate, 5);
    proxyPath = Commons.createProxyComponent(client, rtBreadcrumb, Commons.proxyPath, null, null);
    cmpPath = Commons.addComponent(client, proxyPath, testPages.get(4) + Commons.relParentCompPath, componentName, null);
    Commons.checkProxiedClientLibrary(client, clientlib);
    editorPage = new PageEditorPage(testPages.get(4));
    editorPage.open();
    this.breadcrumbItems = breadcrumbItems;
}
Also used : PageEditorPage(com.adobe.cq.testing.selenium.pageobject.PageEditorPage)

Example 4 with PageEditorPage

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

the class ButtonIT method setup.

protected void setup() throws ClientException {
    testPage = authorClient.createPage("testPage", "Test Page", rootPage, defaultPageTemplate, 200, 201).getSlingPath();
    proxyComponentPath = Commons.creatProxyComponent(adminClient, buttonRT, "Proxy Button", componentName);
    addPathtoComponentPolicy(responsiveGridPath, proxyComponentPath);
    cmpPath = Commons.addComponent(adminClient, proxyComponentPath, testPage + Commons.relParentCompPath, componentName, null);
    editorPage = new PageEditorPage(testPage);
    button = new Button();
    editorPage.open();
}
Also used : Button(com.adobe.cq.wcm.core.components.it.seljup.util.components.button.v1.Button) PageEditorPage(com.adobe.cq.testing.selenium.pageobject.PageEditorPage)

Example 5 with PageEditorPage

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

the class FormButtonIT method setupBefore.

/**
 * Before Test Case
 */
@BeforeEach
public void setupBefore() throws ClientException {
    testPage = authorClient.createPage("testPage", "Test Page", rootPage, defaultPageTemplate, 200, 201).getSlingPath();
    proxyComponentPath = Commons.creatProxyComponent(adminClient, Commons.rtFormButton_v1, "Proxy Form Button", componentName);
    addPathtoComponentPolicy(responsiveGridPath, proxyComponentPath);
    cmpPath = Commons.addComponent(adminClient, proxyComponentPath, testPage + Commons.relParentCompPath, componentName, null);
    formButton = new FormButton();
    editorPage = new PageEditorPage(testPage);
    editorPage.open();
}
Also used : BaseFormButton(com.adobe.cq.wcm.core.components.it.seljup.util.components.formbutton.BaseFormButton) FormButton(com.adobe.cq.wcm.core.components.it.seljup.util.components.formbutton.v1.FormButton) PageEditorPage(com.adobe.cq.testing.selenium.pageobject.PageEditorPage) BeforeEach(org.junit.jupiter.api.BeforeEach)

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