Search in sources :

Example 6 with PageEditorPage

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

the class FormComponentsIT method setup.

protected void setup() throws ClientException {
    // create the test page, store page path in 'testPagePath'
    testPage = authorClient.createPage("testPage", "Test Page Title", rootPage, defaultPageTemplate).getSlingPath();
    // create a proxy component
    compPathContainer = Commons.createProxyComponent(adminClient, formContainerRT, Commons.proxyPath, null, null);
    // add the core form container component
    containerPath = Commons.addComponent(adminClient, compPathContainer, testPage + Commons.relParentCompPath, "container", null);
    // create a proxy component
    compPathText = Commons.createProxyComponent(adminClient, formTextRT, Commons.proxyPath, null, null);
    // inside the form add a form text input field
    String inputPath = Commons.addComponent(adminClient, compPathText, containerPath + "/", "text", null);
    // set name and default value for the input field
    HashMap<String, String> data = new HashMap<String, String>();
    data.put("name", "inputName");
    data.put("defaultValue", "inputValue");
    Commons.editNodeProperties(adminClient, inputPath, data);
    // create a proxy component
    compPathHidden = Commons.createProxyComponent(adminClient, formHiddenRT, Commons.proxyPath, null, null);
    // inside the form add a hidden field component
    String hiddenPath = Commons.addComponent(adminClient, compPathHidden, containerPath + "/", "hidden", null);
    // set name and default value for the hidden field component
    data.clear();
    data.put("name", "hiddenName");
    data.put("value", "hiddenValue");
    Commons.editNodeProperties(adminClient, hiddenPath, data);
    // create a proxy component
    compPathOptions = Commons.createProxyComponent(adminClient, formOptionsRT, Commons.proxyPath, null, null);
    ;
    // inside the form add a form option component
    String optionPath = Commons.addComponent(adminClient, compPathOptions, containerPath + "/", "options", null);
    // create an option list items
    data.clear();
    data.put("./name", "optionName");
    data.put("./type", "checkbox");
    data.put("./items/item0/selected", "true");
    data.put("./items/item0/text", "text1");
    data.put("./items/item0/value", "value1");
    data.put("./items/item1/selected", "false");
    data.put("./items/item1/text", "text2");
    data.put("./items/item1/value", "value2");
    Commons.editNodeProperties(adminClient, optionPath, data);
    // create a proxy component
    compPathButton = Commons.createProxyComponent(adminClient, formButtonRT, Commons.proxyPath, null, null);
    // add a button to the form
    String buttonPath = Commons.addComponent(adminClient, compPathButton, containerPath + "/", "button", null);
    // make sure the button is a submit button
    data.clear();
    data.put("type", "submit");
    data.put("caption", "Submit");
    Commons.editNodeProperties(adminClient, buttonPath, data);
    // open the page in the editor
    editorPage = new PageEditorPage(testPage);
    editorPage.open();
    formComponents = new FormComponents();
}
Also used : HashMap(java.util.HashMap) PageEditorPage(com.adobe.cq.testing.selenium.pageobject.PageEditorPage) FormComponents(com.adobe.cq.wcm.core.components.it.seljup.util.components.formcomponents.v1.FormComponents)

Example 7 with PageEditorPage

use of com.adobe.cq.testing.selenium.pageobject.PageEditorPage 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)

Example 8 with PageEditorPage

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

the class FormContainerIT method setup.

protected void setup() throws ClientException {
    // create the test page, store page path in 'testPagePath'
    testPage = authorClient.createPage("testPage", "Test Page Title", rootPage, defaultPageTemplate).getSlingPath();
    // create a proxy component
    compPathContainer = Commons.createProxyComponent(adminClient, formContainerRT, Commons.proxyPath, null, null);
    // add the core form container component
    containerPath = Commons.addComponent(adminClient, compPathContainer, testPage + Commons.relParentCompPath, "container", null);
    // create a proxy component
    compPathText = Commons.createProxyComponent(adminClient, formTextRT, Commons.proxyPath, null, null);
    // inside the form add a form text input field
    String inputPath = Commons.addComponent(adminClient, compPathText, containerPath + "/", "text", null);
    // set name and default value for the input field
    HashMap<String, String> data = new HashMap<String, String>();
    data.put("name", "inputName");
    data.put("defaultValue", "inputValue");
    Commons.editNodeProperties(adminClient, inputPath, data);
    // create a proxy component
    compPathButton = Commons.createProxyComponent(adminClient, formButtonRT, Commons.proxyPath, null, null);
    // add a button to the form
    String buttonPath = Commons.addComponent(adminClient, compPathButton, containerPath + "/", "button", null);
    // create an option list items
    data.clear();
    data.put("type", "submit");
    data.put("title", "submit");
    Commons.editNodeProperties(adminClient, buttonPath, data);
    // open the page in the editor
    editorPage = new PageEditorPage(testPage);
    editorPage.open();
    formComponents = new FormComponents();
}
Also used : HashMap(java.util.HashMap) PageEditorPage(com.adobe.cq.testing.selenium.pageobject.PageEditorPage) FormComponents(com.adobe.cq.wcm.core.components.it.seljup.util.components.formcomponents.v1.FormComponents)

Example 9 with PageEditorPage

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

the class FormOptionsIT method setup.

protected void setup() throws ClientException {
    // create the test page, store page path in 'testPagePath'
    testPage = authorClient.createPage("testPage", "Test Page Title", rootPage, defaultPageTemplate).getSlingPath();
    // create a proxy component
    compPath = Commons.createProxyComponent(adminClient, formOptionsRT, Commons.proxyPath, null, null);
    // add the core form container component
    optionPath = Commons.addComponent(adminClient, compPath, testPage + Commons.relParentCompPath, "formoption", null);
    // open the page in the editor
    editorPage = new PageEditorPage(testPage);
    editorPage.open();
}
Also used : PageEditorPage(com.adobe.cq.testing.selenium.pageobject.PageEditorPage)

Example 10 with PageEditorPage

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

the class FormTextTests method setup.

public void setup(CQClient client, String formTextRT, String rootPage, String defaultPageTemplate, BaseFormText formText) throws ClientException {
    // create the test page, store page path in 'testPagePath'
    testPage = client.createPage("testPage", "Test Page Title", rootPage, defaultPageTemplate).getSlingPath();
    // create a proxy component
    compPath = Commons.createProxyComponent(client, formTextRT, Commons.proxyPath, null, null);
    // add the core form container component
    formTextPath = Commons.addComponent(client, compPath, testPage + Commons.relParentCompPath, "formtext", null);
    this.formText = formText;
    // open the page in the editor
    editorPage = new PageEditorPage(testPage);
    editorPage.open();
}
Also used : PageEditorPage(com.adobe.cq.testing.selenium.pageobject.PageEditorPage)

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