From 7e0a70f9583d16cc3af39d442455a8c3526aa24f Mon Sep 17 00:00:00 2001 From: Maya Afanaseva Date: Wed, 18 Oct 2023 15:10:59 +0300 Subject: [PATCH] 4987-88-refactoringSelectMoveToNewPage --- .../main/java/io/github/com/StaticSite.java | 4 + .../java/io/github/com/pages/AngularPage.java | 1 - .../SelectSection.java => SelectPage.java} | 91 ++++++++++--------- .../complex/select/BasicMatSelectTests.java | 13 ++- .../select/BasicNativeSelectTests.java | 5 +- .../select/CustomPanelStylingSelectTests.java | 5 +- .../select/CustomTriggerTextSelectTests.java | 14 +-- .../complex/select/DisableMatSelectTests.java | 7 +- .../select/DisableNativeSelectTests.java | 5 +- .../select/FormMatFeatureSelectTests.java | 5 +- .../complex/select/FormMatSelectTests.java | 7 +- .../select/FormNativeFeatureSelectTests.java | 5 +- .../complex/select/FormNativeSelectTests.java | 7 +- .../MatErrorStateMatcherSelectTests.java | 5 +- .../complex/select/MultipleSelectTests.java | 13 ++- .../NativeErrorStateMatcherSelectTests.java | 5 +- .../select/NoOptionRippleSelectTests.java | 5 +- .../select/OptionGroupsMatSelectTests.java | 5 +- .../select/OptionGroupsNativeSelectTests.java | 5 +- .../complex/select/ResetMatSelectTests.java | 5 +- .../select/ResetNativeSelectTests.java | 5 +- .../complex/select/TestsSelectBase.java | 14 ++- .../complex/select/TwoBindingSelectTests.java | 7 +- .../angular/elements/complex/Select.java | 2 +- 24 files changed, 96 insertions(+), 144 deletions(-) rename jdi-light-angular-tests/src/main/java/io/github/com/pages/{sections/SelectSection.java => SelectPage.java} (89%) diff --git a/jdi-light-angular-tests/src/main/java/io/github/com/StaticSite.java b/jdi-light-angular-tests/src/main/java/io/github/com/StaticSite.java index 25d5b152cc5..7ea6926101e 100644 --- a/jdi-light-angular-tests/src/main/java/io/github/com/StaticSite.java +++ b/jdi-light-angular-tests/src/main/java/io/github/com/StaticSite.java @@ -9,6 +9,7 @@ import io.github.com.pages.ButtonsPage; import io.github.com.pages.ProgressBarPage; import io.github.com.pages.ProgressSpinnerPage; +import io.github.com.pages.SelectPage; @JSite("https://jdi-testing.github.io/jdi-light/angular-page/#/") public class StaticSite { @@ -33,4 +34,7 @@ public class StaticSite { @Url("autocompletes") public static AutocompletePage autocompletePage; + + @Url("select") + public static SelectPage selectPage; } diff --git a/jdi-light-angular-tests/src/main/java/io/github/com/pages/AngularPage.java b/jdi-light-angular-tests/src/main/java/io/github/com/pages/AngularPage.java index 8aaf06a4784..2aef78da0f3 100644 --- a/jdi-light-angular-tests/src/main/java/io/github/com/pages/AngularPage.java +++ b/jdi-light-angular-tests/src/main/java/io/github/com/pages/AngularPage.java @@ -21,7 +21,6 @@ public class AngularPage extends WebPage { public static ToolbarSection toolbarSection; public static SlideToggleSection slideToggleSection; public static InputSection inputSection; - public static SelectSection selectSection; public static ListSection listSection; public static GridListSection gridListSection; public static SnackbarSection snackbarSection; diff --git a/jdi-light-angular-tests/src/main/java/io/github/com/pages/sections/SelectSection.java b/jdi-light-angular-tests/src/main/java/io/github/com/pages/SelectPage.java similarity index 89% rename from jdi-light-angular-tests/src/main/java/io/github/com/pages/sections/SelectSection.java rename to jdi-light-angular-tests/src/main/java/io/github/com/pages/SelectPage.java index e1977484a7c..7f86dbb2d6c 100644 --- a/jdi-light-angular-tests/src/main/java/io/github/com/pages/sections/SelectSection.java +++ b/jdi-light-angular-tests/src/main/java/io/github/com/pages/SelectPage.java @@ -1,45 +1,46 @@ -package io.github.com.pages.sections; - -import com.epam.jdi.light.angular.elements.common.Checkbox; -import com.epam.jdi.light.angular.elements.complex.MaterialSelector; -import com.epam.jdi.light.angular.elements.complex.NativeSelector; -import com.epam.jdi.light.elements.composite.Section; -import com.epam.jdi.light.ui.html.elements.common.Text; - -public class SelectSection extends Section { - public static MaterialSelector basicMatSelect; - public static NativeSelector basicNativeSelect; - - public static MaterialSelector twoBindingSelect; - public static Text selectBindingConfirm; - - public static MaterialSelector formMatSelect; - public static Text formMatSelectConfirm; - - public static NativeSelector formNativeSelect; - public static Text formNativeSelectConfirm; - - public static MaterialSelector formMatFeatureSelect; - public static NativeSelector formNativeFeatureSelect; - - public static MaterialSelector disableMatSelect; - public static NativeSelector disableNativeSelect; - public static Checkbox disableCheckboxSelect; - - public static MaterialSelector resetMatSelect; - public static NativeSelector resetNativeSelect; - - public static MaterialSelector optionGroupsMatSelect; - public static NativeSelector optionGroupsNativeSelect; - - public static MaterialSelector multipleSelect; - - public static MaterialSelector customTriggerTextSelect; - - public static MaterialSelector noOptionRippleSelect; - - public static MaterialSelector customPanelStylingSelect; - - public static MaterialSelector matErrorStateMatcherSelect; - public static NativeSelector nativeErrorStateMatcherSelect; -} +package io.github.com.pages; + +import com.epam.jdi.light.angular.elements.common.Checkbox; +import com.epam.jdi.light.angular.elements.complex.MaterialSelector; +import com.epam.jdi.light.angular.elements.complex.NativeSelector; +import com.epam.jdi.light.ui.html.elements.common.Text; + +public class SelectPage extends NewAngularPage { + + public static MaterialSelector basicMatSelect; + public static NativeSelector basicNativeSelect; + + public static MaterialSelector twoBindingSelect; + public static Text selectBindingConfirm; + + public static MaterialSelector formMatSelect; + public static Text formMatSelectConfirm; + + public static NativeSelector formNativeSelect; + public static Text formNativeSelectConfirm; + + public static MaterialSelector formMatFeatureSelect; + public static NativeSelector formNativeFeatureSelect; + + public static MaterialSelector disableMatSelect; + public static NativeSelector disableNativeSelect; + public static Checkbox disableCheckboxSelect; + + public static MaterialSelector resetMatSelect; + public static NativeSelector resetNativeSelect; + + public static MaterialSelector optionGroupsMatSelect; + public static NativeSelector optionGroupsNativeSelect; + + public static MaterialSelector multipleSelect; + + public static MaterialSelector customTriggerTextSelect; + + public static MaterialSelector noOptionRippleSelect; + + public static MaterialSelector customPanelStylingSelect; + + public static MaterialSelector matErrorStateMatcherSelect; + public static NativeSelector nativeErrorStateMatcherSelect; + +} diff --git a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/BasicMatSelectTests.java b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/BasicMatSelectTests.java index afd93a9d124..e52e31d619b 100644 --- a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/BasicMatSelectTests.java +++ b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/BasicMatSelectTests.java @@ -1,24 +1,23 @@ package io.github.epam.angular.tests.elements.complex.select; import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Ignore; import org.testng.annotations.Test; import java.util.Arrays; import java.util.Collections; import static com.epam.jdi.light.settings.JDISettings.ELEMENT; -import static io.github.com.StaticSite.angularPage; -import static io.github.com.pages.sections.SelectSection.basicMatSelect; +import static com.jdiai.tools.Timer.waitCondition; +import static io.github.com.StaticSite.selectPage; +import static io.github.com.pages.SelectPage.basicMatSelect; import static org.hamcrest.Matchers.hasItems; -// TODO Move to the new page -@Ignore public class BasicMatSelectTests extends TestsSelectBase { @BeforeMethod(alwaysRun = true) public void before() { - angularPage.shouldBeOpened(); - basicMatSelect.show(); + selectPage.open(); + waitCondition(() -> selectPage.isOpened()); + selectPage.checkOpened(); } @Test diff --git a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/BasicNativeSelectTests.java b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/BasicNativeSelectTests.java index 52ae8c0fc17..c5339539574 100644 --- a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/BasicNativeSelectTests.java +++ b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/BasicNativeSelectTests.java @@ -1,17 +1,14 @@ package io.github.epam.angular.tests.elements.complex.select; import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Ignore; import org.testng.annotations.Test; import java.util.Arrays; import java.util.Collections; -import static io.github.com.pages.sections.SelectSection.basicNativeSelect; +import static io.github.com.pages.SelectPage.basicNativeSelect; import static org.hamcrest.Matchers.*; -// TODO Move to the new page -@Ignore public class BasicNativeSelectTests extends TestsSelectBase { @BeforeMethod(alwaysRun = true) public void before() { diff --git a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/CustomPanelStylingSelectTests.java b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/CustomPanelStylingSelectTests.java index 960f745bfbb..5ce9ac124f9 100644 --- a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/CustomPanelStylingSelectTests.java +++ b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/CustomPanelStylingSelectTests.java @@ -1,16 +1,13 @@ package io.github.epam.angular.tests.elements.complex.select; import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Ignore; import org.testng.annotations.Test; import java.util.Arrays; -import static io.github.com.pages.sections.SelectSection.customPanelStylingSelect; +import static io.github.com.pages.SelectPage.customPanelStylingSelect; import static org.hamcrest.Matchers.hasItems; -// TODO Move to the new page -@Ignore public class CustomPanelStylingSelectTests extends TestsSelectBase { @BeforeMethod(alwaysRun = true) public void before() { diff --git a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/CustomTriggerTextSelectTests.java b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/CustomTriggerTextSelectTests.java index 8f2e19a3191..befdbab8922 100644 --- a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/CustomTriggerTextSelectTests.java +++ b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/CustomTriggerTextSelectTests.java @@ -1,23 +1,23 @@ package io.github.epam.angular.tests.elements.complex.select; import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Ignore; import org.testng.annotations.Test; import java.util.Arrays; -import static io.github.com.StaticSite.angularPage; -import static io.github.com.pages.sections.SelectSection.customTriggerTextSelect; +import static com.jdiai.tools.Timer.waitCondition; +import static io.github.com.StaticSite.selectPage; +import static io.github.com.pages.SelectPage.customTriggerTextSelect; + -// TODO Move to the new page -@Ignore public class CustomTriggerTextSelectTests extends TestsSelectBase { private String[] multiOptions = new String[1]; @BeforeMethod(alwaysRun = true) public void before() { - angularPage.shouldBeOpened(); - customTriggerTextSelect.show(); + selectPage.open(); + waitCondition(() -> selectPage.isOpened()); + selectPage.checkOpened(); } @Test diff --git a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/DisableMatSelectTests.java b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/DisableMatSelectTests.java index 16e6cd1ba29..31019f51e63 100644 --- a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/DisableMatSelectTests.java +++ b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/DisableMatSelectTests.java @@ -1,17 +1,14 @@ package io.github.epam.angular.tests.elements.complex.select; import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Ignore; import org.testng.annotations.Test; import java.util.Arrays; import static com.epam.jdi.light.settings.JDISettings.ELEMENT; -import static io.github.com.pages.sections.SelectSection.disableCheckboxSelect; -import static io.github.com.pages.sections.SelectSection.disableMatSelect; +import static io.github.com.pages.SelectPage.disableCheckboxSelect; +import static io.github.com.pages.SelectPage.disableMatSelect; -// TODO Move to the new page -@Ignore public class DisableMatSelectTests extends TestsSelectBase { private static final String ARIA_DISABLED = "aria-disabled"; private static final String OPTION_2_DISABLED = "Option 2 (disabled)"; diff --git a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/DisableNativeSelectTests.java b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/DisableNativeSelectTests.java index 3c60a6c0845..a2de4d34cf3 100644 --- a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/DisableNativeSelectTests.java +++ b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/DisableNativeSelectTests.java @@ -1,16 +1,13 @@ package io.github.epam.angular.tests.elements.complex.select; import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Ignore; import org.testng.annotations.Test; import java.util.Arrays; import static com.epam.jdi.light.settings.JDISettings.ELEMENT; -import static io.github.com.pages.sections.SelectSection.disableNativeSelect; +import static io.github.com.pages.SelectPage.disableNativeSelect; -// TODO Move to the new page -@Ignore public class DisableNativeSelectTests extends TestsSelectBase { private static final String DISABLED = "disabled"; diff --git a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/FormMatFeatureSelectTests.java b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/FormMatFeatureSelectTests.java index d90628a22cb..e41c734020a 100644 --- a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/FormMatFeatureSelectTests.java +++ b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/FormMatFeatureSelectTests.java @@ -1,16 +1,13 @@ package io.github.epam.angular.tests.elements.complex.select; import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Ignore; import org.testng.annotations.Test; import java.util.Arrays; -import static io.github.com.pages.sections.SelectSection.formMatFeatureSelect; +import static io.github.com.pages.SelectPage.formMatFeatureSelect; import static org.hamcrest.Matchers.matchesPattern; -// TODO Move to the new page -@Ignore public class FormMatFeatureSelectTests extends TestsSelectBase { @BeforeMethod(alwaysRun = true) public void before() { diff --git a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/FormMatSelectTests.java b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/FormMatSelectTests.java index 7d48e0b44dd..2d2f7b11691 100644 --- a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/FormMatSelectTests.java +++ b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/FormMatSelectTests.java @@ -1,19 +1,16 @@ package io.github.epam.angular.tests.elements.complex.select; import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Ignore; import org.testng.annotations.Test; import java.util.Arrays; import java.util.Collections; import static com.epam.jdi.light.settings.JDISettings.ELEMENT; -import static io.github.com.pages.sections.SelectSection.formMatSelect; -import static io.github.com.pages.sections.SelectSection.formMatSelectConfirm; +import static io.github.com.pages.SelectPage.formMatSelect; +import static io.github.com.pages.SelectPage.formMatSelectConfirm; import static org.hamcrest.Matchers.hasItems; -// TODO Move to the new page -@Ignore public class FormMatSelectTests extends TestsSelectBase { @BeforeMethod(alwaysRun = true) public void before() { diff --git a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/FormNativeFeatureSelectTests.java b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/FormNativeFeatureSelectTests.java index 03b721c7a14..a4f2f283ccb 100644 --- a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/FormNativeFeatureSelectTests.java +++ b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/FormNativeFeatureSelectTests.java @@ -1,17 +1,14 @@ package io.github.epam.angular.tests.elements.complex.select; import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Ignore; import org.testng.annotations.Test; import java.util.Arrays; -import static io.github.com.pages.sections.SelectSection.formNativeFeatureSelect; +import static io.github.com.pages.SelectPage.formNativeFeatureSelect; import static org.hamcrest.Matchers.hasItem; import static org.hamcrest.Matchers.hasItems; -// TODO Move to the new page -@Ignore public class FormNativeFeatureSelectTests extends TestsSelectBase { @BeforeMethod(alwaysRun = true) public void before() { diff --git a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/FormNativeSelectTests.java b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/FormNativeSelectTests.java index 5ba05a8cd36..d0e12115d65 100644 --- a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/FormNativeSelectTests.java +++ b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/FormNativeSelectTests.java @@ -1,17 +1,14 @@ package io.github.epam.angular.tests.elements.complex.select; import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Ignore; import org.testng.annotations.Test; import java.util.Arrays; -import static io.github.com.pages.sections.SelectSection.formNativeSelect; -import static io.github.com.pages.sections.SelectSection.formNativeSelectConfirm; +import static io.github.com.pages.SelectPage.formNativeSelect; +import static io.github.com.pages.SelectPage.formNativeSelectConfirm; import static org.hamcrest.Matchers.*; -// TODO Move to the new page -@Ignore public class FormNativeSelectTests extends TestsSelectBase { @BeforeMethod(alwaysRun = true) public void before() { diff --git a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/MatErrorStateMatcherSelectTests.java b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/MatErrorStateMatcherSelectTests.java index e746cead37e..9d083604974 100644 --- a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/MatErrorStateMatcherSelectTests.java +++ b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/MatErrorStateMatcherSelectTests.java @@ -1,17 +1,14 @@ package io.github.epam.angular.tests.elements.complex.select; import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Ignore; import org.testng.annotations.Test; import java.util.Arrays; -import static io.github.com.pages.sections.SelectSection.matErrorStateMatcherSelect; +import static io.github.com.pages.SelectPage.matErrorStateMatcherSelect; import static org.hamcrest.Matchers.hasItems; import static org.hamcrest.Matchers.matchesPattern; -// TODO Move to the new page -@Ignore public class MatErrorStateMatcherSelectTests extends TestsSelectBase { private static final String CLEAR = "Clear"; diff --git a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/MultipleSelectTests.java b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/MultipleSelectTests.java index 42039c40453..57f2fbffd78 100644 --- a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/MultipleSelectTests.java +++ b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/MultipleSelectTests.java @@ -1,25 +1,24 @@ package io.github.epam.angular.tests.elements.complex.select; import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Ignore; import org.testng.annotations.Test; import java.util.Arrays; -import static io.github.com.StaticSite.angularPage; -import static io.github.com.pages.sections.SelectSection.multipleSelect; +import static com.jdiai.tools.Timer.waitCondition; +import static io.github.com.StaticSite.selectPage; +import static io.github.com.pages.SelectPage.multipleSelect; import static org.hamcrest.Matchers.hasItems; -// TODO Move to the new page -@Ignore public class MultipleSelectTests extends TestsSelectBase { private String[] multiOptions = new String[3]; private int[] multiSelect = new int[1]; @BeforeMethod(alwaysRun = true) public void before() { - angularPage.shouldBeOpened(); - multipleSelect.show(); + selectPage.open(); + waitCondition(() -> selectPage.isOpened()); + selectPage.checkOpened(); } @Test diff --git a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/NativeErrorStateMatcherSelectTests.java b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/NativeErrorStateMatcherSelectTests.java index ebd80ebae71..fb2a33a873f 100644 --- a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/NativeErrorStateMatcherSelectTests.java +++ b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/NativeErrorStateMatcherSelectTests.java @@ -1,17 +1,14 @@ package io.github.epam.angular.tests.elements.complex.select; import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Ignore; import org.testng.annotations.Test; import java.util.Arrays; import java.util.Collections; -import static io.github.com.pages.sections.SelectSection.nativeErrorStateMatcherSelect; +import static io.github.com.pages.SelectPage.nativeErrorStateMatcherSelect; import static org.hamcrest.Matchers.matchesPattern; -// TODO Move to the new page -@Ignore public class NativeErrorStateMatcherSelectTests extends TestsSelectBase { @BeforeMethod(alwaysRun = true) public void before() { diff --git a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/NoOptionRippleSelectTests.java b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/NoOptionRippleSelectTests.java index 41e3b3fa3d1..5c1d2c3e0a7 100644 --- a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/NoOptionRippleSelectTests.java +++ b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/NoOptionRippleSelectTests.java @@ -1,16 +1,13 @@ package io.github.epam.angular.tests.elements.complex.select; import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Ignore; import org.testng.annotations.Test; import java.util.Arrays; -import static io.github.com.pages.sections.SelectSection.noOptionRippleSelect; +import static io.github.com.pages.SelectPage.noOptionRippleSelect; import static org.hamcrest.Matchers.hasItems; -// TODO Move to the new page -@Ignore public class NoOptionRippleSelectTests extends TestsSelectBase { @BeforeMethod(alwaysRun = true) public void before() { diff --git a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/OptionGroupsMatSelectTests.java b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/OptionGroupsMatSelectTests.java index 82931f8ef9e..62c0662073e 100644 --- a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/OptionGroupsMatSelectTests.java +++ b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/OptionGroupsMatSelectTests.java @@ -1,17 +1,14 @@ package io.github.epam.angular.tests.elements.complex.select; import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Ignore; import org.testng.annotations.Test; import java.util.Arrays; import static com.epam.jdi.light.settings.JDISettings.ELEMENT; -import static io.github.com.pages.sections.SelectSection.optionGroupsMatSelect; +import static io.github.com.pages.SelectPage.optionGroupsMatSelect; import static org.hamcrest.Matchers.matchesPattern; -// TODO Move to the new page -@Ignore public class OptionGroupsMatSelectTests extends TestsSelectBase { @BeforeMethod(alwaysRun = true) public void before() { diff --git a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/OptionGroupsNativeSelectTests.java b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/OptionGroupsNativeSelectTests.java index 99b88476772..2abbffb7b40 100644 --- a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/OptionGroupsNativeSelectTests.java +++ b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/OptionGroupsNativeSelectTests.java @@ -1,15 +1,12 @@ package io.github.epam.angular.tests.elements.complex.select; import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Ignore; import org.testng.annotations.Test; import java.util.Arrays; -import static io.github.com.pages.sections.SelectSection.optionGroupsNativeSelect; +import static io.github.com.pages.SelectPage.optionGroupsNativeSelect; -// TODO Move to the new page -@Ignore public class OptionGroupsNativeSelectTests extends TestsSelectBase { @BeforeMethod(alwaysRun = true) public void before() { diff --git a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/ResetMatSelectTests.java b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/ResetMatSelectTests.java index bb5d1dbcc6c..b4436e4b10d 100644 --- a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/ResetMatSelectTests.java +++ b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/ResetMatSelectTests.java @@ -1,17 +1,14 @@ package io.github.epam.angular.tests.elements.complex.select; import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Ignore; import org.testng.annotations.Test; import java.util.Arrays; import static com.epam.jdi.light.settings.JDISettings.ELEMENT; -import static io.github.com.pages.sections.SelectSection.resetMatSelect; +import static io.github.com.pages.SelectPage.resetMatSelect; import static org.hamcrest.Matchers.matchesPattern; -// TODO Move to the new page -@Ignore public class ResetMatSelectTests extends TestsSelectBase { @BeforeMethod(alwaysRun = true) public void before() { diff --git a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/ResetNativeSelectTests.java b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/ResetNativeSelectTests.java index 3b69e29a354..b0e728c9611 100644 --- a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/ResetNativeSelectTests.java +++ b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/ResetNativeSelectTests.java @@ -1,17 +1,14 @@ package io.github.epam.angular.tests.elements.complex.select; import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Ignore; import org.testng.annotations.Test; import java.util.Arrays; import static com.epam.jdi.light.settings.JDISettings.ELEMENT; -import static io.github.com.pages.sections.SelectSection.resetNativeSelect; +import static io.github.com.pages.SelectPage.resetNativeSelect; import static org.hamcrest.Matchers.*; -// TODO Move to the new page -@Ignore public class ResetNativeSelectTests extends TestsSelectBase { @BeforeMethod(alwaysRun = true) public void before() { diff --git a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/TestsSelectBase.java b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/TestsSelectBase.java index 4f4bcf1b5cc..b4e152bd726 100644 --- a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/TestsSelectBase.java +++ b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/TestsSelectBase.java @@ -2,19 +2,16 @@ import io.github.epam.TestsInit; import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Ignore; import java.util.Arrays; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import static io.github.com.StaticSite.angularPage; -import static io.github.com.pages.sections.SelectSection.disableCheckboxSelect; -import static io.github.epam.site.steps.States.shouldBeLoggedIn; +import static com.jdiai.tools.Timer.waitCondition; +import static io.github.com.StaticSite.selectPage; +import static io.github.com.pages.SelectPage.disableCheckboxSelect; -// TODO Move to the new page -@Ignore public class TestsSelectBase extends TestsInit { public static final String PIZZA = "Pizza"; public static final String STEAK = "Steak"; @@ -60,8 +57,9 @@ public class TestsSelectBase extends TestsInit { @BeforeMethod(alwaysRun = true) public void beforeStartTest() { - shouldBeLoggedIn(); - angularPage.shouldBeOpened(); + selectPage.open(); + waitCondition(() -> selectPage.isOpened()); + selectPage.checkOpened(); } public static Map> getPokemonsMap() { diff --git a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/TwoBindingSelectTests.java b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/TwoBindingSelectTests.java index d4cc1160b37..12ca4321f8c 100644 --- a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/TwoBindingSelectTests.java +++ b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/select/TwoBindingSelectTests.java @@ -1,18 +1,15 @@ package io.github.epam.angular.tests.elements.complex.select; import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Ignore; import org.testng.annotations.Test; import java.util.Arrays; -import static io.github.com.pages.sections.SelectSection.selectBindingConfirm; -import static io.github.com.pages.sections.SelectSection.twoBindingSelect; +import static io.github.com.pages.SelectPage.selectBindingConfirm; +import static io.github.com.pages.SelectPage.twoBindingSelect; import static org.hamcrest.Matchers.hasItems; import static org.hamcrest.Matchers.matchesPattern; -// TODO Move to the new page -@Ignore public class TwoBindingSelectTests extends TestsSelectBase { private static final String NONE = "None"; diff --git a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/elements/complex/Select.java b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/elements/complex/Select.java index 3fe555ea974..d44ce82361c 100644 --- a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/elements/complex/Select.java +++ b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/elements/complex/Select.java @@ -58,7 +58,7 @@ public boolean hideSingleSelectionIndicator() { return attrs().has("hidesingleselectionindicator"); } - @JDIAction() + @JDIAction public boolean labelDisabled() { return core().getAttribute("aria-disabled").equalsIgnoreCase("true"); }