diff --git a/jdi-light-vuetify-tests/src/test/java/io/github/epam/vuetify/tests/complex/SlideGroupsTests.java b/jdi-light-vuetify-tests/src/test/java/io/github/epam/vuetify/tests/complex/SlideGroupsTests.java index cd8d0a66fc..1ce056fec7 100644 --- a/jdi-light-vuetify-tests/src/test/java/io/github/epam/vuetify/tests/complex/SlideGroupsTests.java +++ b/jdi-light-vuetify-tests/src/test/java/io/github/epam/vuetify/tests/complex/SlideGroupsTests.java @@ -1,8 +1,7 @@ package io.github.epam.vuetify.tests.complex; import io.github.epam.TestsInit; -import io.github.epam.vuetify.tests.data.SlideGroupTestsData; -import java.util.List; +import org.hamcrest.Matchers; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -18,10 +17,6 @@ public class SlideGroupsTests extends TestsInit { - private final String minusIcon = ".v-icon.mdi-minus"; - - private final String plusIcon = ".v-icon.mdi-plus"; - @BeforeClass public void before() { slideGroupsPage.open(); @@ -43,7 +38,6 @@ public void activeClassSlideGroupTests() { @Test(enabled = false, description="Test checks slide group feature 'center-active'") public void centerActiveSlideGroupTests() { - List slidesPositions = new SlideGroupTestsData().centerActiveSlideGroupTestData(); centerActiveSlideGroup.show(); centerActiveSlideGroup.hasAttribute("style"); centerActiveSlideGroup.is().displayed(); @@ -62,13 +56,12 @@ public void centerActiveSlideGroupTests() { } } - @Test(description="Test checks slide group feature: 'icon' and theme = 'light'") - public void customIconsSlideGroupTests() { + @Test(description="Test checks slide group feature: theme = 'light'") + public void themeSlideGroupTests() { customIconsSlideGroup.show(); customIconsSlideGroup.is().displayed(); - customIconsSlideGroup.has().iconSlidesVisible(minusIcon); - customIconsSlideGroup.has().iconSlidesVisible(plusIcon); + // @todo #5318 content can have links, so wee need additional method to select customIconsSlideGroup.slideByIndex(1).click(); customIconsSlideGroup.has().slideSelected(1); diff --git a/jdi-light-vuetify-tests/src/test/java/io/github/epam/vuetify/tests/complex/TabsTests.java b/jdi-light-vuetify-tests/src/test/java/io/github/epam/vuetify/tests/complex/TabsTests.java index a37c7af62b..f5ba45abab 100644 --- a/jdi-light-vuetify-tests/src/test/java/io/github/epam/vuetify/tests/complex/TabsTests.java +++ b/jdi-light-vuetify-tests/src/test/java/io/github/epam/vuetify/tests/complex/TabsTests.java @@ -82,8 +82,8 @@ public static void centerActiveTabsTest() { @Test(description = "Test checks tabs custom icons") public static void customIconsTabsTest() { customIconsTabs.show(); - clickWhileClickable(customIconsTabs.navigation().getNextButton()); - clickWhileClickable(customIconsTabs.navigation().getPreviousButton()); + clickWhileClickable(customIconsTabs.navigation().nextButton()); + clickWhileClickable(customIconsTabs.navigation().previousButton()); customIconsTabs.icons().get(0).is().visible(); customIconsTabs.icons().get(0).has().type(ARROW_LEFT_BOLD_BOX_OUTLINE.mdi()); customIconsTabs.icons().get(1).is().visible(); diff --git a/jdi-light-vuetify-tests/src/test/java/io/github/epam/vuetify/tests/data/SlideGroupTestsData.java b/jdi-light-vuetify-tests/src/test/java/io/github/epam/vuetify/tests/data/SlideGroupTestsData.java deleted file mode 100644 index b7ffcdc0ac..0000000000 --- a/jdi-light-vuetify-tests/src/test/java/io/github/epam/vuetify/tests/data/SlideGroupTestsData.java +++ /dev/null @@ -1,11 +0,0 @@ -package io.github.epam.vuetify.tests.data; - -import java.util.Arrays; -import java.util.List; - -public class SlideGroupTestsData { - - public List centerActiveSlideGroupTestData() { - return Arrays.asList(-130, -262, -394, -526, -658, -790, -922, -1054, -1186); - } -} diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/SlideGroupAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/SlideGroupAssert.java index 2f60fd6d14..adf6725192 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/SlideGroupAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/SlideGroupAssert.java @@ -31,13 +31,6 @@ public SlideGroupAssert slideNotSelected(int index) { return this; } - // @todo #5048 Check method functionality, there is no specific for any icon functionality - @JDIAction(value = "Assert that '{name}' icon is visible", isAssert = true) - public SlideGroupAssert iconSlidesVisible(String by) { - jdiAssert(element().find(by).isDisplayed(), Matchers.is(true), "SlideGroup icons are not displayed"); - return this; - } - @JDIAction(value = "Assert that '{name}' icon is visible", isAssert = true) public SlideGroupAssert previousButtonActive() { jdiAssert(element().isPreviousButtonDisabled(), Matchers.is(false), "Previous Button is disabled"); diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/elements/complex/SlideGroup.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/elements/complex/SlideGroup.java index 93d4a98ac3..7c670b7518 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/elements/complex/SlideGroup.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/elements/complex/SlideGroup.java @@ -7,30 +7,26 @@ import com.epam.jdi.light.vuetify.elements.common.VuetifyButton; import com.epam.jdi.light.vuetify.interfaces.HasIcon; import com.epam.jdi.light.vuetify.interfaces.HasTheme; -import org.openqa.selenium.By; import org.openqa.selenium.WebElement; -import java.util.List; - /** * To see an example of SlideGroup web element please visit https://v2.vuetifyjs.com/en/components/slide-groups/ */ - public class SlideGroup extends UIBaseElement implements HasIcon, HasTheme { @JDIAction("Get '{name}'s 'next slides' button") - public VuetifyButton getNextButton() { + public VuetifyButton nextButton() { return new VuetifyButton(core().find(".v-slide-group__next")); } @JDIAction("Get '{name}'s 'previous slides' button") - public VuetifyButton getPreviousButton() { + public VuetifyButton previousButton() { return new VuetifyButton(core().find(".v-slide-group__prev")); } @JDIAction("Get '{name}' slide by index") public Card slideByIndex(int index) { - return this.finds(".v-card").get(index).with(Card.class); + return this.slides().get(index).with(Card.class); } @JDIAction("Get if slide is selected in {name}") @@ -39,14 +35,9 @@ public boolean slideIsSelected(int index) { return cardClass.contains("success") || cardClass.contains("active"); } - @JDIAction("Click on 'next slides' button") - public void clickOnNextButton() { - getNextButton().click(); - } - @JDIAction("Click on 'next slides' button") public boolean isNextButtonDisabled() { - return getNextButton().hasClass("v-slide-group__next--disabled"); + return nextButton().hasClass("v-slide-group__next--disabled"); } @JDIAction("Click on 'next slides' button") @@ -56,17 +47,21 @@ public boolean isNextButtonActive() { @JDIAction("Click on 'previous slides' button") public boolean isPreviousButtonDisabled() { - return getPreviousButton().hasClass("v-slide-group__prev--disabled"); + return previousButton().hasClass("v-slide-group__prev--disabled"); } - public WebList getSlides() { + // @todo #5318 Slides can be not only v-cards, but any element, + // we should receive childs for .v-slide-group__content + // Check the page from the header, there is an example with buttons + @JDIAction("Get {name}'s slides") + public WebList slides() { return this.finds(".v-card"); } @JDIAction("Get position of the '{name}'") public int position() { int index = 0; - for (WebElement slideCard : getSlides()) { + for (WebElement slideCard : slides()) { index++; if (slideCard.getAttribute("class").contains("active")) { return index; @@ -75,10 +70,6 @@ public int position() { return -1; } - public List getAllSlides(By by) { - return core().findElements(by); - } - public SlideGroupAssert is() { return new SlideGroupAssert().set(this); }