From 681d4e7339c65547e3dfc7297b1bd6992276bd07 Mon Sep 17 00:00:00 2001 From: Andrzej Dolinski Date: Mon, 21 Oct 2019 15:14:55 +0200 Subject: [PATCH 1/3] 373 provdiding CRUD tests for Breadcrumb v2 component, adding needed test pages, configurations and page objects --- .../corecomponents/BreadcrumbComponent.java | 19 +++ .../BreadcrumbComponentTest.java | 113 ++++++++++++++++++ .../hidden-navigation-item-true.yaml | 4 + .../breadcrumb/hide-current-page-true.yaml | 4 + .../max-navigation-start-level.yaml | 4 + .../min-navigation-start-level.yaml | 4 + .../breadcrumb/modify-all-properties.yaml | 10 ++ .../breadcrumbComponentHiddenTestPage.xml | 16 +++ .../breadcrumbComponentMiddleTestPage.xml | 16 +++ .../breadcrumbComponentTestPage.xml | 20 ++++ 10 files changed, 210 insertions(+) create mode 100644 aem65/src/main/java/com/cognifide/qa/bb/aem65/tests/pageobjects/corecomponents/BreadcrumbComponent.java create mode 100644 aem65/src/test/java/com/cognifide/qa/bb/aem65/tests/corecomponents/BreadcrumbComponentTest.java create mode 100644 aem65/src/test/resources/component-configs/core-components/breadcrumb/hidden-navigation-item-true.yaml create mode 100644 aem65/src/test/resources/component-configs/core-components/breadcrumb/hide-current-page-true.yaml create mode 100644 aem65/src/test/resources/component-configs/core-components/breadcrumb/max-navigation-start-level.yaml create mode 100644 aem65/src/test/resources/component-configs/core-components/breadcrumb/min-navigation-start-level.yaml create mode 100644 aem65/src/test/resources/component-configs/core-components/breadcrumb/modify-all-properties.yaml create mode 100644 aem65/src/test/resources/testpages/core-components/breadcrumb/breadcrumbComponentHiddenTestPage.xml create mode 100644 aem65/src/test/resources/testpages/core-components/breadcrumb/breadcrumbComponentMiddleTestPage.xml create mode 100644 aem65/src/test/resources/testpages/core-components/breadcrumb/breadcrumbComponentTestPage.xml diff --git a/aem65/src/main/java/com/cognifide/qa/bb/aem65/tests/pageobjects/corecomponents/BreadcrumbComponent.java b/aem65/src/main/java/com/cognifide/qa/bb/aem65/tests/pageobjects/corecomponents/BreadcrumbComponent.java new file mode 100644 index 0000000..e9b38c4 --- /dev/null +++ b/aem65/src/main/java/com/cognifide/qa/bb/aem65/tests/pageobjects/corecomponents/BreadcrumbComponent.java @@ -0,0 +1,19 @@ +package com.cognifide.qa.bb.aem65.tests.pageobjects.corecomponents; + +import com.cognifide.qa.bb.qualifier.CurrentScope; +import com.cognifide.qa.bb.qualifier.PageObject; +import org.openqa.selenium.WebElement; + +import com.google.inject.Inject; + +@PageObject(css = ".cmp-breadcrumb") +public class BreadcrumbComponent { + + @Inject + @CurrentScope + private WebElement component; + + public String getText() { + return component.getText(); + } +} diff --git a/aem65/src/test/java/com/cognifide/qa/bb/aem65/tests/corecomponents/BreadcrumbComponentTest.java b/aem65/src/test/java/com/cognifide/qa/bb/aem65/tests/corecomponents/BreadcrumbComponentTest.java new file mode 100644 index 0000000..caceaa6 --- /dev/null +++ b/aem65/src/test/java/com/cognifide/qa/bb/aem65/tests/corecomponents/BreadcrumbComponentTest.java @@ -0,0 +1,113 @@ +package com.cognifide.qa.bb.aem65.tests.corecomponents; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; + +import com.cognifide.qa.bb.aem.core.api.AemActions; +import com.cognifide.qa.bb.aem.core.component.actions.ConfigureComponentData; +import com.cognifide.qa.bb.aem.core.component.configuration.ResourceFileLocation; +import com.cognifide.qa.bb.aem.core.pages.sling.SlingDataXMLBuilder; +import com.cognifide.qa.bb.aem.core.pages.sling.SlingPageData; +import com.cognifide.qa.bb.aem65.tests.AbstractAemAuthorTest; +import com.cognifide.qa.bb.aem65.tests.pageobjects.corecomponents.BreadcrumbComponent; +import com.cognifide.qa.bb.aem65.tests.pages.TestPage; +import com.cognifide.qa.bb.api.actions.ActionException; +import com.cognifide.qa.bb.junit5.guice.Modules; +import com.cognifide.qa.bb.modules.BobcatRunModule; + +import io.qameta.allure.Epic; +import io.qameta.allure.Feature; + +@Modules(BobcatRunModule.class) +@Epic("Core Components authoring tests") +@Feature("Breadcrumb Component configuration") +@DisplayName("Author can configure for Breadcrumb Component the...") +public class BreadcrumbComponentTest extends AbstractAemAuthorTest { + + private static final String HIDDEN_PAGE_PATH = "/content/core-components-examples/breadcrumbhiddentestpage"; + private static final String COMPONENT_PAGE_PATH = + "/content/core-components-examples/breadcrumbhiddentestpage/breadcrumbtestpage"; + + private TestPage testPage; + private BreadcrumbComponent component; + + @BeforeEach + public void createAndOpenTestPage() throws ActionException { + controller.execute(AemActions.CREATE_PAGE_VIA_SLING, new SlingPageData(HIDDEN_PAGE_PATH, + SlingDataXMLBuilder.buildFromFile( + "testpages/core-components/breadcrumb/breadcrumbComponentHiddenTestPage.xml"))); + + controller.execute(AemActions.CREATE_PAGE_VIA_SLING, new SlingPageData(COMPONENT_PAGE_PATH, + SlingDataXMLBuilder.buildFromFile( + "testpages/core-components/breadcrumb/breadcrumbComponentTestPage.xml"))); + + testPage = bobcatPageFactory.create("/editor.html" + COMPONENT_PAGE_PATH + ".html", TestPage.class); + testPage.open(); + } + + @Test + @DisplayName("navigation start level - decrease default value") + public void decreaseNavigationStartLevel() throws ActionException { + controller.execute(AemActions.CONFIGURE_COMPONENT, + new ConfigureComponentData("container", "Breadcrumb (v2)", 0, + new ResourceFileLocation( + "component-configs/core-components/breadcrumb/min-navigation-start-level.yaml"))); + component = testPage.getContent(BreadcrumbComponent.class, 0); + assertThat(component.getText()).as("Check if the root name is present") + .contains("Core Components"); + } + + @Test + @DisplayName("navigation start level - increase default value") + public void increaseNavigationStartLevel() throws ActionException { + controller.execute(AemActions.CONFIGURE_COMPONENT, + new ConfigureComponentData("container", "Breadcrumb (v2)", 0, + new ResourceFileLocation("component-configs/core-components/breadcrumb/max-navigation-start-level.yaml"))); + component = testPage.getContent(BreadcrumbComponent.class, 0); + assertThat(component.getText()).as("Check if breadcrumb value is equal to page title") + .doesNotContain("breadcrumbHiddenTestPage"); + } + + @Test + @DisplayName("show hidden navigation items checkbox") + public void showHiddenNavigationItems() throws ActionException { + controller.execute(AemActions.CONFIGURE_COMPONENT, + new ConfigureComponentData("container", "Breadcrumb (v2)", 0, + new ResourceFileLocation("component-configs/core-components/breadcrumb/hidden-navigation-item-true.yaml"))); + component = testPage.getContent(BreadcrumbComponent.class, 0); + assertThat(component.getText()).as("Check if hidden page is visible in breadcrumb") + .contains("breadcrumbHiddenTestPage"); + } + + @Test + @DisplayName("hide current page checkbox") + public void hideCurrentPage() throws ActionException { + controller.execute(AemActions.CONFIGURE_COMPONENT, + new ConfigureComponentData("container", "Breadcrumb (v2)", 0, + new ResourceFileLocation("component-configs/core-components/breadcrumb/hide-current-page-true.yaml"))); + component = testPage.getContent(BreadcrumbComponent.class, 0); + assertThat(component.getText()).as("Check if title of current page is not visible in breadcrumb") + .doesNotContain("breadcrumbTestPage"); + } + + @Test + @DisplayName("check combination of all properties") + public void modifeAllProperties() throws ActionException { + controller.execute(AemActions.CONFIGURE_COMPONENT, + new ConfigureComponentData("container", "Breadcrumb (v2)", 0, + new ResourceFileLocation("component-configs/core-components/breadcrumb/modify-all-properties.yaml"))); + component = testPage.getContent(BreadcrumbComponent.class, 0); + assertThat(component.getText()).as("Check if combination of all properties does not break anything") + .doesNotContain("breadcrumbTestPage").contains("Core Components"); + } + + @AfterEach + public void deleteTestPage() throws ActionException { + controller.execute(AemActions.DELETE_PAGE_VIA_SLING, new SlingPageData(COMPONENT_PAGE_PATH)); + controller.execute(AemActions.DELETE_PAGE_VIA_SLING, new SlingPageData(HIDDEN_PAGE_PATH)); + } +} diff --git a/aem65/src/test/resources/component-configs/core-components/breadcrumb/hidden-navigation-item-true.yaml b/aem65/src/test/resources/component-configs/core-components/breadcrumb/hidden-navigation-item-true.yaml new file mode 100644 index 0000000..34ed736 --- /dev/null +++ b/aem65/src/test/resources/component-configs/core-components/breadcrumb/hidden-navigation-item-true.yaml @@ -0,0 +1,4 @@ +Properties: +- label: Show hidden navigation items + type: CHECKBOX + value: true \ No newline at end of file diff --git a/aem65/src/test/resources/component-configs/core-components/breadcrumb/hide-current-page-true.yaml b/aem65/src/test/resources/component-configs/core-components/breadcrumb/hide-current-page-true.yaml new file mode 100644 index 0000000..65b48e7 --- /dev/null +++ b/aem65/src/test/resources/component-configs/core-components/breadcrumb/hide-current-page-true.yaml @@ -0,0 +1,4 @@ +Properties: + - label: Hide current page + type: CHECKBOX + value: true \ No newline at end of file diff --git a/aem65/src/test/resources/component-configs/core-components/breadcrumb/max-navigation-start-level.yaml b/aem65/src/test/resources/component-configs/core-components/breadcrumb/max-navigation-start-level.yaml new file mode 100644 index 0000000..a15279f --- /dev/null +++ b/aem65/src/test/resources/component-configs/core-components/breadcrumb/max-navigation-start-level.yaml @@ -0,0 +1,4 @@ +Properties: +- label: Navigation Start Level + type: TEXTFIELD + value: 3 \ No newline at end of file diff --git a/aem65/src/test/resources/component-configs/core-components/breadcrumb/min-navigation-start-level.yaml b/aem65/src/test/resources/component-configs/core-components/breadcrumb/min-navigation-start-level.yaml new file mode 100644 index 0000000..5cd9ab0 --- /dev/null +++ b/aem65/src/test/resources/component-configs/core-components/breadcrumb/min-navigation-start-level.yaml @@ -0,0 +1,4 @@ +Properties: +- label: Navigation Start Level + type: TEXTFIELD + value: 1 \ No newline at end of file diff --git a/aem65/src/test/resources/component-configs/core-components/breadcrumb/modify-all-properties.yaml b/aem65/src/test/resources/component-configs/core-components/breadcrumb/modify-all-properties.yaml new file mode 100644 index 0000000..e695a6b --- /dev/null +++ b/aem65/src/test/resources/component-configs/core-components/breadcrumb/modify-all-properties.yaml @@ -0,0 +1,10 @@ +Properties: +- label: Navigation Start Level + type: TEXTFIELD + value: 1 +- label: Show hidden navigation items + type: CHECKBOX + value: true +- label: Hide current page + type: CHECKBOX + value: true \ No newline at end of file diff --git a/aem65/src/test/resources/testpages/core-components/breadcrumb/breadcrumbComponentHiddenTestPage.xml b/aem65/src/test/resources/testpages/core-components/breadcrumb/breadcrumbComponentHiddenTestPage.xml new file mode 100644 index 0000000..fe1ff59 --- /dev/null +++ b/aem65/src/test/resources/testpages/core-components/breadcrumb/breadcrumbComponentHiddenTestPage.xml @@ -0,0 +1,16 @@ + + + + + + + + + \ No newline at end of file diff --git a/aem65/src/test/resources/testpages/core-components/breadcrumb/breadcrumbComponentMiddleTestPage.xml b/aem65/src/test/resources/testpages/core-components/breadcrumb/breadcrumbComponentMiddleTestPage.xml new file mode 100644 index 0000000..45623eb --- /dev/null +++ b/aem65/src/test/resources/testpages/core-components/breadcrumb/breadcrumbComponentMiddleTestPage.xml @@ -0,0 +1,16 @@ + + + + + + + + s + \ No newline at end of file diff --git a/aem65/src/test/resources/testpages/core-components/breadcrumb/breadcrumbComponentTestPage.xml b/aem65/src/test/resources/testpages/core-components/breadcrumb/breadcrumbComponentTestPage.xml new file mode 100644 index 0000000..dc4887a --- /dev/null +++ b/aem65/src/test/resources/testpages/core-components/breadcrumb/breadcrumbComponentTestPage.xml @@ -0,0 +1,20 @@ + + + + + + + + + + \ No newline at end of file From c872ebd2d1442f8e9cbffa679ef377051cbc4b1f Mon Sep 17 00:00:00 2001 From: "volodymyr.vashchuk" Date: Tue, 22 Oct 2019 14:25:16 +0200 Subject: [PATCH 2/3] Add tests and test content for Content Fragment List --- .../ContentFragmentListComponent.java | 31 +++++ .../ContentFragmentListComponentTest.java | 113 ++++++++++++++++++ .../content-fragment-list/elements.yaml | 7 ++ .../content-fragment-list/max-items.yaml | 4 + .../content-fragment-list/model.yaml | 4 + .../content-fragment-list/parent-path.yaml | 4 + .../contentFragmentListComponentTestPage.xml | 40 +++++++ 7 files changed, 203 insertions(+) create mode 100644 aem65/src/main/java/com/cognifide/qa/bb/aem65/tests/pageobjects/corecomponents/ContentFragmentListComponent.java create mode 100644 aem65/src/test/java/com/cognifide/qa/bb/aem65/tests/corecomponents/ContentFragmentListComponentTest.java create mode 100644 aem65/src/test/resources/component-configs/core-components/content-fragment-list/elements.yaml create mode 100644 aem65/src/test/resources/component-configs/core-components/content-fragment-list/max-items.yaml create mode 100644 aem65/src/test/resources/component-configs/core-components/content-fragment-list/model.yaml create mode 100644 aem65/src/test/resources/component-configs/core-components/content-fragment-list/parent-path.yaml create mode 100644 aem65/src/test/resources/testpages/core-components/contentFragmentListComponentTestPage.xml diff --git a/aem65/src/main/java/com/cognifide/qa/bb/aem65/tests/pageobjects/corecomponents/ContentFragmentListComponent.java b/aem65/src/main/java/com/cognifide/qa/bb/aem65/tests/pageobjects/corecomponents/ContentFragmentListComponent.java new file mode 100644 index 0000000..1c93fa2 --- /dev/null +++ b/aem65/src/main/java/com/cognifide/qa/bb/aem65/tests/pageobjects/corecomponents/ContentFragmentListComponent.java @@ -0,0 +1,31 @@ +package com.cognifide.qa.bb.aem65.tests.pageobjects.corecomponents; + +import java.util.List; +import java.util.stream.Collectors; + +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.FindBy; + +import com.cognifide.qa.bb.qualifier.CurrentScope; +import com.cognifide.qa.bb.qualifier.PageObject; +import com.google.inject.Inject; + +@PageObject(css = ".cmp-contentfragmentlist") +public class ContentFragmentListComponent { + + @Inject + @CurrentScope + private WebElement component; + + @FindBy(css = "article") + private List articles; + + public List getArticleTexts() { + return articles.stream().map(WebElement::getText).collect(Collectors.toList()); + } + + public String getCollectiveText() { + return component.getText(); + } + +} diff --git a/aem65/src/test/java/com/cognifide/qa/bb/aem65/tests/corecomponents/ContentFragmentListComponentTest.java b/aem65/src/test/java/com/cognifide/qa/bb/aem65/tests/corecomponents/ContentFragmentListComponentTest.java new file mode 100644 index 0000000..770126d --- /dev/null +++ b/aem65/src/test/java/com/cognifide/qa/bb/aem65/tests/corecomponents/ContentFragmentListComponentTest.java @@ -0,0 +1,113 @@ +package com.cognifide.qa.bb.aem65.tests.corecomponents; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.assertj.core.api.SoftAssertions; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; + +import com.cognifide.qa.bb.aem.core.api.AemActions; +import com.cognifide.qa.bb.aem.core.component.actions.ConfigureComponentData; +import com.cognifide.qa.bb.aem.core.component.configuration.ResourceFileLocation; +import com.cognifide.qa.bb.aem.core.pages.sling.SlingDataXMLBuilder; +import com.cognifide.qa.bb.aem.core.pages.sling.SlingPageData; +import com.cognifide.qa.bb.aem65.tests.AbstractAemAuthorTest; +import com.cognifide.qa.bb.aem65.tests.pageobjects.corecomponents.ContentFragmentListComponent; +import com.cognifide.qa.bb.aem65.tests.pages.TestPage; +import com.cognifide.qa.bb.api.actions.ActionException; +import com.cognifide.qa.bb.junit5.guice.Modules; +import com.cognifide.qa.bb.modules.BobcatRunModule; + +import io.qameta.allure.Epic; +import io.qameta.allure.Feature; + +@Modules(BobcatRunModule.class) +@Epic("Core Components authoring tests") +@Feature("Content Fragment List Component configuration") +@DisplayName("Author can configure for Content Fragment List the...") +public class ContentFragmentListComponentTest extends AbstractAemAuthorTest { + + private static final String TEST_PAGE_PATH = + "/content/core-components-examples/library/content-fragment-list-component-test-page"; + + private TestPage page; + private ContentFragmentListComponent component; + + @BeforeEach + public void setup() throws ActionException { + controller.execute(AemActions.CREATE_PAGE_VIA_SLING, new SlingPageData(TEST_PAGE_PATH, + SlingDataXMLBuilder + .buildFromFile("testpages/core-components/contentFragmentListComponentTestPage.xml"))); + page = bobcatPageFactory.create("/editor.html" + TEST_PAGE_PATH + ".html", TestPage.class); + page.open(); + } + + @Test + @DisplayName("model") + public void configureModel() throws ActionException { + controller.execute(AemActions.CONFIGURE_COMPONENT, + new ConfigureComponentData("container", "Content Fragment List (v1)", 2, + new ResourceFileLocation( + "component-configs/core-components/content-fragment-list/model.yaml"))); + component = page.getContent(ContentFragmentListComponent.class, 2); + assertThat(component.getArticleTexts().get(0)).as("Check if the model is configured properly") + .matches("^48 hours of Wilderness(.*|\\n)*move on to the next\\.$"); + } + + @Test + @DisplayName("parent path") + public void configureParentPath() throws ActionException { + controller.execute(AemActions.CONFIGURE_COMPONENT, + new ConfigureComponentData("container", "Content Fragment List (v1)", 1, + new ResourceFileLocation( + "component-configs/core-components/content-fragment-list/parent-path.yaml"))); + component = page.getContent(ContentFragmentListComponent.class, 1); + SoftAssertions softly = new SoftAssertions(); + softly.assertThat(component.getArticleTexts().get(0)) + .as("Check if the first article from the parent path is displayed") + .matches("^Accepted Currency(.*|\\n)*processing$"); + softly.assertThat(component.getArticleTexts().get(3)) + .as("Check if the last article from the parent path is displayed") + .matches("^Cancellations(.*|\\n)*processing$"); + softly.assertAll(); + } + + @Test + @DisplayName("max items") + public void configureMaxItems() throws ActionException { + controller.execute(AemActions.CONFIGURE_COMPONENT, + new ConfigureComponentData("container", "Content Fragment List (v1)", 0, + new ResourceFileLocation( + "component-configs/core-components/content-fragment-list/max-items.yaml"))); + component = page.getContent(ContentFragmentListComponent.class, 0); + assertThat(component.getCollectiveText()) + .as("Check if the max items limit is configured properly") + .matches("^Adobe Research Schweiz AG(.*|\\n)*europe-middleeast-africa$"); + } + + @Test + @DisplayName("elements to display") + public void configureElementsToDisplay() throws ActionException { + controller.execute(AemActions.CONFIGURE_COMPONENT, + new ConfigureComponentData("container", "Content Fragment List (v1)", 1, + new ResourceFileLocation( + "component-configs/core-components/content-fragment-list/elements.yaml"))); + component = page.getContent(ContentFragmentListComponent.class, 1); + SoftAssertions softly = new SoftAssertions(); + softly.assertThat(component.getArticleTexts().get(0)) + .as("Check if the element selection is configured properly for the first article") + .matches("^The Company Name(.*|\\n)*\"We.Retail\"\\?"); + softly.assertThat(component.getArticleTexts().get(2)) + .as("Check if the element selection is configured properly for the last article") + .matches("^Real Company(.*|\\n)*company\\?"); + softly.assertAll(); + } + + @AfterEach + public void cleanup() throws ActionException { + controller.execute(AemActions.DELETE_PAGE_VIA_SLING, new SlingPageData(TEST_PAGE_PATH)); + } + +} diff --git a/aem65/src/test/resources/component-configs/core-components/content-fragment-list/elements.yaml b/aem65/src/test/resources/component-configs/core-components/content-fragment-list/elements.yaml new file mode 100644 index 0000000..e9f74b2 --- /dev/null +++ b/aem65/src/test/resources/component-configs/core-components/content-fragment-list/elements.yaml @@ -0,0 +1,7 @@ +Elements: +- label: Elements + type: MULTIFIELD + value: + - item: + - type: SELECT + value: Question \ No newline at end of file diff --git a/aem65/src/test/resources/component-configs/core-components/content-fragment-list/max-items.yaml b/aem65/src/test/resources/component-configs/core-components/content-fragment-list/max-items.yaml new file mode 100644 index 0000000..8729063 --- /dev/null +++ b/aem65/src/test/resources/component-configs/core-components/content-fragment-list/max-items.yaml @@ -0,0 +1,4 @@ +Properties: +- label: Max Items + type: NUMBER_INPUT + value: 1 \ No newline at end of file diff --git a/aem65/src/test/resources/component-configs/core-components/content-fragment-list/model.yaml b/aem65/src/test/resources/component-configs/core-components/content-fragment-list/model.yaml new file mode 100644 index 0000000..a3aa166 --- /dev/null +++ b/aem65/src/test/resources/component-configs/core-components/content-fragment-list/model.yaml @@ -0,0 +1,4 @@ +Properties: +- label: Model + type: SELECT + value: We.Retail Experience \ No newline at end of file diff --git a/aem65/src/test/resources/component-configs/core-components/content-fragment-list/parent-path.yaml b/aem65/src/test/resources/component-configs/core-components/content-fragment-list/parent-path.yaml new file mode 100644 index 0000000..6c2f34c --- /dev/null +++ b/aem65/src/test/resources/component-configs/core-components/content-fragment-list/parent-path.yaml @@ -0,0 +1,4 @@ +Properties: +- label: Parent Path + type: PATHBROWSER + value: /content/dam/we-retail/en/faqs/orders \ No newline at end of file diff --git a/aem65/src/test/resources/testpages/core-components/contentFragmentListComponentTestPage.xml b/aem65/src/test/resources/testpages/core-components/contentFragmentListComponentTestPage.xml new file mode 100644 index 0000000..efcfb50 --- /dev/null +++ b/aem65/src/test/resources/testpages/core-components/contentFragmentListComponentTestPage.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + From 31254bdb3a2f7782bdcdd6cfbbfd66d9a10690d4 Mon Sep 17 00:00:00 2001 From: "volodymyr.vashchuk" Date: Tue, 22 Oct 2019 16:24:33 +0200 Subject: [PATCH 3/3] Revert "373 provdiding CRUD tests for Breadcrumb v2 component, adding needed test pages, configurations and page objects" This reverts commit 681d4e7339c65547e3dfc7297b1bd6992276bd07. --- .../corecomponents/BreadcrumbComponent.java | 19 --- .../BreadcrumbComponentTest.java | 113 ------------------ .../hidden-navigation-item-true.yaml | 4 - .../breadcrumb/hide-current-page-true.yaml | 4 - .../max-navigation-start-level.yaml | 4 - .../min-navigation-start-level.yaml | 4 - .../breadcrumb/modify-all-properties.yaml | 10 -- .../breadcrumbComponentHiddenTestPage.xml | 16 --- .../breadcrumbComponentMiddleTestPage.xml | 16 --- .../breadcrumbComponentTestPage.xml | 20 ---- 10 files changed, 210 deletions(-) delete mode 100644 aem65/src/main/java/com/cognifide/qa/bb/aem65/tests/pageobjects/corecomponents/BreadcrumbComponent.java delete mode 100644 aem65/src/test/java/com/cognifide/qa/bb/aem65/tests/corecomponents/BreadcrumbComponentTest.java delete mode 100644 aem65/src/test/resources/component-configs/core-components/breadcrumb/hidden-navigation-item-true.yaml delete mode 100644 aem65/src/test/resources/component-configs/core-components/breadcrumb/hide-current-page-true.yaml delete mode 100644 aem65/src/test/resources/component-configs/core-components/breadcrumb/max-navigation-start-level.yaml delete mode 100644 aem65/src/test/resources/component-configs/core-components/breadcrumb/min-navigation-start-level.yaml delete mode 100644 aem65/src/test/resources/component-configs/core-components/breadcrumb/modify-all-properties.yaml delete mode 100644 aem65/src/test/resources/testpages/core-components/breadcrumb/breadcrumbComponentHiddenTestPage.xml delete mode 100644 aem65/src/test/resources/testpages/core-components/breadcrumb/breadcrumbComponentMiddleTestPage.xml delete mode 100644 aem65/src/test/resources/testpages/core-components/breadcrumb/breadcrumbComponentTestPage.xml diff --git a/aem65/src/main/java/com/cognifide/qa/bb/aem65/tests/pageobjects/corecomponents/BreadcrumbComponent.java b/aem65/src/main/java/com/cognifide/qa/bb/aem65/tests/pageobjects/corecomponents/BreadcrumbComponent.java deleted file mode 100644 index e9b38c4..0000000 --- a/aem65/src/main/java/com/cognifide/qa/bb/aem65/tests/pageobjects/corecomponents/BreadcrumbComponent.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.cognifide.qa.bb.aem65.tests.pageobjects.corecomponents; - -import com.cognifide.qa.bb.qualifier.CurrentScope; -import com.cognifide.qa.bb.qualifier.PageObject; -import org.openqa.selenium.WebElement; - -import com.google.inject.Inject; - -@PageObject(css = ".cmp-breadcrumb") -public class BreadcrumbComponent { - - @Inject - @CurrentScope - private WebElement component; - - public String getText() { - return component.getText(); - } -} diff --git a/aem65/src/test/java/com/cognifide/qa/bb/aem65/tests/corecomponents/BreadcrumbComponentTest.java b/aem65/src/test/java/com/cognifide/qa/bb/aem65/tests/corecomponents/BreadcrumbComponentTest.java deleted file mode 100644 index caceaa6..0000000 --- a/aem65/src/test/java/com/cognifide/qa/bb/aem65/tests/corecomponents/BreadcrumbComponentTest.java +++ /dev/null @@ -1,113 +0,0 @@ -package com.cognifide.qa.bb.aem65.tests.corecomponents; - -import static org.assertj.core.api.Assertions.assertThat; - -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; - -import com.cognifide.qa.bb.aem.core.api.AemActions; -import com.cognifide.qa.bb.aem.core.component.actions.ConfigureComponentData; -import com.cognifide.qa.bb.aem.core.component.configuration.ResourceFileLocation; -import com.cognifide.qa.bb.aem.core.pages.sling.SlingDataXMLBuilder; -import com.cognifide.qa.bb.aem.core.pages.sling.SlingPageData; -import com.cognifide.qa.bb.aem65.tests.AbstractAemAuthorTest; -import com.cognifide.qa.bb.aem65.tests.pageobjects.corecomponents.BreadcrumbComponent; -import com.cognifide.qa.bb.aem65.tests.pages.TestPage; -import com.cognifide.qa.bb.api.actions.ActionException; -import com.cognifide.qa.bb.junit5.guice.Modules; -import com.cognifide.qa.bb.modules.BobcatRunModule; - -import io.qameta.allure.Epic; -import io.qameta.allure.Feature; - -@Modules(BobcatRunModule.class) -@Epic("Core Components authoring tests") -@Feature("Breadcrumb Component configuration") -@DisplayName("Author can configure for Breadcrumb Component the...") -public class BreadcrumbComponentTest extends AbstractAemAuthorTest { - - private static final String HIDDEN_PAGE_PATH = "/content/core-components-examples/breadcrumbhiddentestpage"; - private static final String COMPONENT_PAGE_PATH = - "/content/core-components-examples/breadcrumbhiddentestpage/breadcrumbtestpage"; - - private TestPage testPage; - private BreadcrumbComponent component; - - @BeforeEach - public void createAndOpenTestPage() throws ActionException { - controller.execute(AemActions.CREATE_PAGE_VIA_SLING, new SlingPageData(HIDDEN_PAGE_PATH, - SlingDataXMLBuilder.buildFromFile( - "testpages/core-components/breadcrumb/breadcrumbComponentHiddenTestPage.xml"))); - - controller.execute(AemActions.CREATE_PAGE_VIA_SLING, new SlingPageData(COMPONENT_PAGE_PATH, - SlingDataXMLBuilder.buildFromFile( - "testpages/core-components/breadcrumb/breadcrumbComponentTestPage.xml"))); - - testPage = bobcatPageFactory.create("/editor.html" + COMPONENT_PAGE_PATH + ".html", TestPage.class); - testPage.open(); - } - - @Test - @DisplayName("navigation start level - decrease default value") - public void decreaseNavigationStartLevel() throws ActionException { - controller.execute(AemActions.CONFIGURE_COMPONENT, - new ConfigureComponentData("container", "Breadcrumb (v2)", 0, - new ResourceFileLocation( - "component-configs/core-components/breadcrumb/min-navigation-start-level.yaml"))); - component = testPage.getContent(BreadcrumbComponent.class, 0); - assertThat(component.getText()).as("Check if the root name is present") - .contains("Core Components"); - } - - @Test - @DisplayName("navigation start level - increase default value") - public void increaseNavigationStartLevel() throws ActionException { - controller.execute(AemActions.CONFIGURE_COMPONENT, - new ConfigureComponentData("container", "Breadcrumb (v2)", 0, - new ResourceFileLocation("component-configs/core-components/breadcrumb/max-navigation-start-level.yaml"))); - component = testPage.getContent(BreadcrumbComponent.class, 0); - assertThat(component.getText()).as("Check if breadcrumb value is equal to page title") - .doesNotContain("breadcrumbHiddenTestPage"); - } - - @Test - @DisplayName("show hidden navigation items checkbox") - public void showHiddenNavigationItems() throws ActionException { - controller.execute(AemActions.CONFIGURE_COMPONENT, - new ConfigureComponentData("container", "Breadcrumb (v2)", 0, - new ResourceFileLocation("component-configs/core-components/breadcrumb/hidden-navigation-item-true.yaml"))); - component = testPage.getContent(BreadcrumbComponent.class, 0); - assertThat(component.getText()).as("Check if hidden page is visible in breadcrumb") - .contains("breadcrumbHiddenTestPage"); - } - - @Test - @DisplayName("hide current page checkbox") - public void hideCurrentPage() throws ActionException { - controller.execute(AemActions.CONFIGURE_COMPONENT, - new ConfigureComponentData("container", "Breadcrumb (v2)", 0, - new ResourceFileLocation("component-configs/core-components/breadcrumb/hide-current-page-true.yaml"))); - component = testPage.getContent(BreadcrumbComponent.class, 0); - assertThat(component.getText()).as("Check if title of current page is not visible in breadcrumb") - .doesNotContain("breadcrumbTestPage"); - } - - @Test - @DisplayName("check combination of all properties") - public void modifeAllProperties() throws ActionException { - controller.execute(AemActions.CONFIGURE_COMPONENT, - new ConfigureComponentData("container", "Breadcrumb (v2)", 0, - new ResourceFileLocation("component-configs/core-components/breadcrumb/modify-all-properties.yaml"))); - component = testPage.getContent(BreadcrumbComponent.class, 0); - assertThat(component.getText()).as("Check if combination of all properties does not break anything") - .doesNotContain("breadcrumbTestPage").contains("Core Components"); - } - - @AfterEach - public void deleteTestPage() throws ActionException { - controller.execute(AemActions.DELETE_PAGE_VIA_SLING, new SlingPageData(COMPONENT_PAGE_PATH)); - controller.execute(AemActions.DELETE_PAGE_VIA_SLING, new SlingPageData(HIDDEN_PAGE_PATH)); - } -} diff --git a/aem65/src/test/resources/component-configs/core-components/breadcrumb/hidden-navigation-item-true.yaml b/aem65/src/test/resources/component-configs/core-components/breadcrumb/hidden-navigation-item-true.yaml deleted file mode 100644 index 34ed736..0000000 --- a/aem65/src/test/resources/component-configs/core-components/breadcrumb/hidden-navigation-item-true.yaml +++ /dev/null @@ -1,4 +0,0 @@ -Properties: -- label: Show hidden navigation items - type: CHECKBOX - value: true \ No newline at end of file diff --git a/aem65/src/test/resources/component-configs/core-components/breadcrumb/hide-current-page-true.yaml b/aem65/src/test/resources/component-configs/core-components/breadcrumb/hide-current-page-true.yaml deleted file mode 100644 index 65b48e7..0000000 --- a/aem65/src/test/resources/component-configs/core-components/breadcrumb/hide-current-page-true.yaml +++ /dev/null @@ -1,4 +0,0 @@ -Properties: - - label: Hide current page - type: CHECKBOX - value: true \ No newline at end of file diff --git a/aem65/src/test/resources/component-configs/core-components/breadcrumb/max-navigation-start-level.yaml b/aem65/src/test/resources/component-configs/core-components/breadcrumb/max-navigation-start-level.yaml deleted file mode 100644 index a15279f..0000000 --- a/aem65/src/test/resources/component-configs/core-components/breadcrumb/max-navigation-start-level.yaml +++ /dev/null @@ -1,4 +0,0 @@ -Properties: -- label: Navigation Start Level - type: TEXTFIELD - value: 3 \ No newline at end of file diff --git a/aem65/src/test/resources/component-configs/core-components/breadcrumb/min-navigation-start-level.yaml b/aem65/src/test/resources/component-configs/core-components/breadcrumb/min-navigation-start-level.yaml deleted file mode 100644 index 5cd9ab0..0000000 --- a/aem65/src/test/resources/component-configs/core-components/breadcrumb/min-navigation-start-level.yaml +++ /dev/null @@ -1,4 +0,0 @@ -Properties: -- label: Navigation Start Level - type: TEXTFIELD - value: 1 \ No newline at end of file diff --git a/aem65/src/test/resources/component-configs/core-components/breadcrumb/modify-all-properties.yaml b/aem65/src/test/resources/component-configs/core-components/breadcrumb/modify-all-properties.yaml deleted file mode 100644 index e695a6b..0000000 --- a/aem65/src/test/resources/component-configs/core-components/breadcrumb/modify-all-properties.yaml +++ /dev/null @@ -1,10 +0,0 @@ -Properties: -- label: Navigation Start Level - type: TEXTFIELD - value: 1 -- label: Show hidden navigation items - type: CHECKBOX - value: true -- label: Hide current page - type: CHECKBOX - value: true \ No newline at end of file diff --git a/aem65/src/test/resources/testpages/core-components/breadcrumb/breadcrumbComponentHiddenTestPage.xml b/aem65/src/test/resources/testpages/core-components/breadcrumb/breadcrumbComponentHiddenTestPage.xml deleted file mode 100644 index fe1ff59..0000000 --- a/aem65/src/test/resources/testpages/core-components/breadcrumb/breadcrumbComponentHiddenTestPage.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/aem65/src/test/resources/testpages/core-components/breadcrumb/breadcrumbComponentMiddleTestPage.xml b/aem65/src/test/resources/testpages/core-components/breadcrumb/breadcrumbComponentMiddleTestPage.xml deleted file mode 100644 index 45623eb..0000000 --- a/aem65/src/test/resources/testpages/core-components/breadcrumb/breadcrumbComponentMiddleTestPage.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - s - \ No newline at end of file diff --git a/aem65/src/test/resources/testpages/core-components/breadcrumb/breadcrumbComponentTestPage.xml b/aem65/src/test/resources/testpages/core-components/breadcrumb/breadcrumbComponentTestPage.xml deleted file mode 100644 index dc4887a..0000000 --- a/aem65/src/test/resources/testpages/core-components/breadcrumb/breadcrumbComponentTestPage.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - \ No newline at end of file