Skip to content

Commit

Permalink
4987-88-refactoringSelectMoveToNewPage
Browse files Browse the repository at this point in the history
  • Loading branch information
MayaElf committed Oct 18, 2023
1 parent e1ee9e6 commit 7e0a70f
Show file tree
Hide file tree
Showing 24 changed files with 96 additions and 144 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -33,4 +34,7 @@ public class StaticSite {

@Url("autocompletes")
public static AutocompletePage autocompletePage;

@Url("select")
public static SelectPage selectPage;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;

}
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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)";
Expand Down
Original file line number Diff line number Diff line change
@@ -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";

Expand Down
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down
Original file line number Diff line number Diff line change
@@ -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";

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading

0 comments on commit 7e0a70f

Please sign in to comment.