Search in sources :

Example 31 with CoralCheckbox

use of com.adobe.cq.testing.selenium.pagewidgets.coral.CoralCheckbox in project aem-core-wcm-components by Adobe-Marketing-Cloud.

the class AccordionIT method testSingleItemExpansion.

/**
 * Test: Edit Dialog : Single item expansion
 *
 * 1. create new items with titles
 * 2. open the edit dialog
 * 3. switch to the properties tab
 * 4. verify that the expanded items select is enabled, expanded item select is disabled and single item expansion disabled.
 * 5. enable single item expansion
 * 6. verify that the expanded items select is disabled and expanded item select is enabled.
 * 7. save the edit dialog
 * 8. verify that the first item is expanded
 *
 * @throws InterruptedException
 */
@Test
@DisplayName("Test: Edit Dialog : Single item expansion")
public void testSingleItemExpansion() throws InterruptedException {
    // 1.
    createItem();
    // 2.
    AccordionEditDialog editDialog = accordion.openEditDialog(cmpPath);
    AccordionEditDialog.EditDialogProperties properties = editDialog.getEditDialogProperties();
    // 3.
    properties.openProperties();
    // 4.
    CoralCheckbox singleExpansion = properties.getSingleExpansion();
    assertTrue(singleExpansion.isChecked() == false, "SingleExpansion should not be checked");
    assertTrue(properties.isExpandedSelectVisible() == true, "Expanded select should be visible");
    assertTrue(properties.isExpandedSelectDisabled() == false, "Expanded select should not be disabled");
    assertTrue(properties.isExpandedSelectSingleVisible() == false, "Expanded select single should not be visible");
    assertTrue(properties.isExpandedSelectSingleDisabled() == true, "Expanded select single should be disabled");
    // 5.
    singleExpansion.setSelected(true);
    // 6.
    assertTrue(singleExpansion.isChecked() == true, "SingleExpansion should be checked");
    assertTrue(properties.isExpandedSelectVisible() == false, "Expanded select should not be visible");
    assertTrue(properties.isExpandedSelectDisabled() == true, "Expanded select should be disabled");
    assertTrue(properties.isExpandedSelectSingleVisible() == true, "Expanded select single should be visible");
    assertTrue(properties.isExpandedSelectSingleDisabled() == false, "Expanded select single should not be disabled");
    // 7.
    Commons.saveConfigureDialog();
    // 8.
    ArrayList<String> items = new ArrayList<>();
    items.add("item0");
    verifyExpandedItems(items);
}
Also used : CoralCheckbox(com.adobe.cq.testing.selenium.pagewidgets.coral.CoralCheckbox) AccordionEditDialog(com.adobe.cq.wcm.core.components.it.seljup.util.components.accordion.AccordionEditDialog) ArrayList(java.util.ArrayList) AuthorBaseUITest(com.adobe.cq.wcm.core.components.it.seljup.AuthorBaseUITest) Test(org.junit.jupiter.api.Test) DisplayName(org.junit.jupiter.api.DisplayName)

Example 32 with CoralCheckbox

use of com.adobe.cq.testing.selenium.pagewidgets.coral.CoralCheckbox in project aem-core-wcm-components by Adobe-Marketing-Cloud.

the class ImageTests method setPageImage.

/**
 * Sets the featured image for a page.
 */
private void setPageImage(boolean aem65, String page, String asset, boolean altFromDam) throws ClientException, InterruptedException {
    String assetSelector;
    if (aem65) {
        assetSelector = "*[data-foundation-collection-item-id='/content/dam/core-components/" + asset + "'] coral-columnview-item-thumbnail";
    } else {
        assetSelector = "*[data-foundation-collection-item-id='/content/dam/core-components/" + asset + "'] coral-checkbox";
    }
    // set page resource type to page v3
    adminClient.setPageProperty(page, "sling:resourceType", "core/wcm/components/page/v3/page", 200);
    PropertiesPage pageProperties = new PropertiesPage(page);
    pageProperties.open();
    $("coral-tab[data-foundation-tracking-event*='images']").click();
    $(".cq-FileUpload-picker").click();
    $("*[data-foundation-collection-item-id='/content/dam/core-components']").click();
    $(assetSelector).click();
    clickableClick($(".granite-pickerdialog-submit"));
    if (altFromDam) {
        // inherit alt text from DAM
        String altValueFromDAMSelector = ".cq-siteadmin-admin-properties coral-checkbox[name='./cq:featuredimage/altValueFromDAM']";
        CoralCheckbox altValueFromDAMCheckbox = new CoralCheckbox(altValueFromDAMSelector);
        altValueFromDAMCheckbox.click();
    }
    pageProperties.saveAndClose();
    Commons.webDriverWait(RequestConstants.WEBDRIVER_WAIT_TIME_MS);
}
Also used : CoralCheckbox(com.adobe.cq.testing.selenium.pagewidgets.coral.CoralCheckbox) PropertiesPage(com.adobe.cq.testing.selenium.pageobject.cq.sites.PropertiesPage)

Example 33 with CoralCheckbox

use of com.adobe.cq.testing.selenium.pagewidgets.coral.CoralCheckbox in project aem-core-wcm-components by Adobe-Marketing-Cloud.

the class TeaserEditDialog method clickDescriptionFromPage.

public void clickDescriptionFromPage() {
    CoralCheckbox checkbox = new CoralCheckbox(descriptionFromPage);
    checkbox.click();
}
Also used : CoralCheckbox(com.adobe.cq.testing.selenium.pagewidgets.coral.CoralCheckbox)

Example 34 with CoralCheckbox

use of com.adobe.cq.testing.selenium.pagewidgets.coral.CoralCheckbox in project aem-core-wcm-components by Adobe-Marketing-Cloud.

the class TeaserEditDialog method clickLinkTarget.

public void clickLinkTarget() {
    CoralCheckbox checkbox = new CoralCheckbox(linkTarget);
    checkbox.click();
}
Also used : CoralCheckbox(com.adobe.cq.testing.selenium.pagewidgets.coral.CoralCheckbox)

Aggregations

CoralCheckbox (com.adobe.cq.testing.selenium.pagewidgets.coral.CoralCheckbox)34 PropertiesPage (com.adobe.cq.testing.selenium.pageobject.cq.sites.PropertiesPage)3 AuthorBaseUITest (com.adobe.cq.wcm.core.components.it.seljup.AuthorBaseUITest)2 DisplayName (org.junit.jupiter.api.DisplayName)2 Test (org.junit.jupiter.api.Test)2 AdvancedTab (com.adobe.cq.testing.selenium.pagewidgets.cq.tabs.AdvancedTab)1 AccordionEditDialog (com.adobe.cq.wcm.core.components.it.seljup.util.components.accordion.AccordionEditDialog)1 CarouselEditDialog (com.adobe.cq.wcm.core.components.it.seljup.util.components.carousel.CarouselEditDialog)1 ArrayList (java.util.ArrayList)1