use of com.adobe.cq.testing.selenium.pageobject.PageEditorPage in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class ContentFragmentIT method setupBeforeEach.
@BeforeEach
public void setupBeforeEach() 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, Commons.rtContentFragment_v1, Commons.proxyPath, null, null);
// add the core form container component
cmpPath = Commons.addComponent(adminClient, proxyPath, testPage + Commons.relParentCompPath, "formtext", null);
contentFragment = new ContentFragment();
// 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 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_v2, "Proxy Form Button", "formbutton");
addPathtoComponentPolicy(responsiveGridPath, proxyComponentPath);
cmpPath = Commons.addComponent(adminClient, proxyComponentPath, testPage + Commons.relParentCompPath, componentName, null);
formButton = new FormButton();
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 TabsIT method testAllowedComponents.
/**
* Test: Allowed components
*/
@Test
@DisplayName("Test: Allowed components")
public void testAllowedComponents() throws ClientException, InterruptedException, TimeoutException {
String teaserProxyPath = Commons.createProxyComponent(adminClient, Commons.rtTeaser_v1, Commons.proxyPath, null, null);
String policySuffix = "/tabs/new_policy";
HashMap<String, String> data = new HashMap<String, String>();
data.clear();
data.put("jcr:title", "New Policy");
data.put("sling:resourceType", "wcm/core/components/policy/policy");
data.put("components", teaserProxyPath);
String policyPath1 = "/conf/" + label + "/settings/wcm/policies/core-component/components";
policyPath = Commons.createPolicy(adminClient, policySuffix, data, policyPath1);
// add a policy for tabs component
String policyLocation = "core-component/components";
String policyAssignmentPath = defaultPageTemplate + "/policies/jcr:content/root/responsivegrid/core-component/components";
data.clear();
data.put("cq:policy", policyLocation + policySuffix);
data.put("sling:resourceType", "wcm/core/components/policies/mappings");
Commons.assignPolicy(adminClient, "/tabs", data, policyAssignmentPath, 200, 201);
String testPage = authorClient.createPage("testPage", "Test Page Title", rootPage, defaultPageTemplate).getSlingPath();
String compPath = Commons.addComponent(adminClient, proxyPath, testPage + Commons.relParentCompPath, "tabs", null);
// open test page in page editor
editorPage = new PageEditorPage(testPage);
editorPage.open();
String component = "[data-type='Editable'][data-path='" + compPath + "']";
final WebDriver webDriver = WebDriverRunner.getWebDriver();
new WebDriverWait(webDriver, RequestConstants.TIMEOUT_TIME_SEC).until(ExpectedConditions.elementToBeClickable(By.cssSelector(component)));
EditableToolbar editableToolbar = editorPage.openEditableToolbar(compPath);
// 2.
EditableToolbarAssertion editableToolbarAssertion = new EditableToolbarAssertion(editableToolbar, "editable toolbar of none style selector enabled component - %s button is displayed while it should not");
editableToolbarAssertion.assertInsertButton(true);
editableToolbar.getInsertButton().click();
Commons.webDriverWait(RequestConstants.WEBDRIVER_WAIT_TIME_MS);
assertTrue(Commons.isComponentPresentInInsertDialog(teaserProxyPath), "teaser component should be present in insert dialog");
Commons.deleteProxyComponent(adminClient, teaserProxyPath);
}
use of com.adobe.cq.testing.selenium.pageobject.PageEditorPage in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class StyleTabIT method setup.
private 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
proxyPath = Commons.createProxyComponent(adminClient, Commons.rtText_v2, Commons.proxyPath, null, null);
// add the core form container component
compPath = Commons.addComponent(adminClient, proxyPath, testPage + Commons.relParentCompPath, "text", null);
// open the page in the editor
editorPage = new PageEditorPage(testPage);
editorPage.open();
// create component policy and add the styles nodes to it
String policyPath = createComponentPolicy(proxyPath.substring(proxyPath.lastIndexOf('/')), new HashMap<String, String>() {
{
}
});
addStyleNodesToPolicy(policyPath);
}
use of com.adobe.cq.testing.selenium.pageobject.PageEditorPage in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class TeaserIT method setup.
protected void setup(String imageResourceType) throws ClientException {
testPage = authorClient.createPage(pageName, pageTitle, rootPage, defaultPageTemplate).getSlingPath();
secondTestPage = authorClient.createPage(secondPageName, secondPageTitle, rootPage, defaultPageTemplate).getSlingPath();
thirdTestPage = authorClient.createPage(thirdPageName, thirdPageTitle, rootPage, defaultPageTemplate).getSlingPath();
// Update test page description
java.util.List<NameValuePair> props = new ArrayList();
props.add(new BasicNameValuePair("jcr:description", pageDescription));
Commons.setPageProperties(adminClient, testPage, props, 200, 201);
String policySuffix = "/structure/page/new_policy";
HashMap<String, String> data = new HashMap();
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";
String 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);
proxyPath = Commons.createProxyComponent(adminClient, teaserRT, Commons.proxyPath, null, null);
imageProxyPath = Commons.createProxyComponent(adminClient, imageResourceType, Commons.proxyPath, null, null);
data.clear();
data.put("imageDelegate", imageProxyPath);
Commons.editNodeProperties(adminClient, proxyPath, data);
cmpPath = Commons.addComponent(adminClient, proxyPath, testPage + Commons.relParentCompPath, componentName, null);
editorPage = new PageEditorPage(testPage);
editorPage.open();
assetFinder = new AssetFinder();
}
Aggregations