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();
}
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();
}
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();
}
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();
}
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();
}
Aggregations