diff --git a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/common/ButtonsTests.java b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/common/ButtonsTests.java index 4c6c4264ec..5df32749e1 100644 --- a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/common/ButtonsTests.java +++ b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/common/ButtonsTests.java @@ -1,13 +1,13 @@ package io.github.epam.angular.tests.elements.common; +import java.util.Random; + import com.epam.jdi.light.angular.elements.common.Button; import com.epam.jdi.light.angular.elements.enums.AngularColors; import io.github.epam.TestsInit; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; -import java.util.Random; - import static com.epam.jdi.light.angular.elements.enums.ButtonsTypes.BASIC; import static com.epam.jdi.light.angular.elements.enums.ButtonsTypes.EXTENDED_FAB; import static com.epam.jdi.light.angular.elements.enums.ButtonsTypes.FAB; @@ -18,21 +18,18 @@ import static com.epam.jdi.light.angular.elements.enums.ButtonsTypes.STROKED; import static com.jdiai.tools.Timer.waitCondition; import static io.github.com.StaticSite.buttonsPage; - -import static org.hamcrest.Matchers.containsString; +import static io.github.com.pages.ButtonsPage.accentColorButtons; import static io.github.com.pages.ButtonsPage.basicButtons; -import static io.github.com.pages.ButtonsPage.basicbuttonLabel; import static io.github.com.pages.ButtonsPage.defaultColorButton; import static io.github.com.pages.ButtonsPage.extendedFabButtons; -import static io.github.com.pages.ButtonsPage.primaryColorButtons; -import static io.github.com.pages.ButtonsPage.accentColorButtons; -import static io.github.com.pages.ButtonsPage.warnColorButtons; import static io.github.com.pages.ButtonsPage.fabButtons; import static io.github.com.pages.ButtonsPage.flatButtons; import static io.github.com.pages.ButtonsPage.iconButtons; import static io.github.com.pages.ButtonsPage.miniFabButtons; +import static io.github.com.pages.ButtonsPage.primaryColorButtons; import static io.github.com.pages.ButtonsPage.raisedButtons; import static io.github.com.pages.ButtonsPage.strokedButtons; +import static io.github.com.pages.ButtonsPage.warnColorButtons; public class ButtonsTests extends TestsInit { Random rand = new Random(); @@ -147,6 +144,6 @@ public void colorButtonsTest() { accentColorButtons.get(rand.nextInt(accentColorButtons.size()) + 1) .has().color(AngularColors.ACCENT); warnColorButtons.get(rand.nextInt(warnColorButtons.size()) + 1) - .has().color(AngularColors.WARN.getColor()); + .has().color(AngularColors.WARN); } } diff --git a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/common/CheckboxTests.java b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/common/CheckboxTests.java index 048fc10d59..c3704a8545 100644 --- a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/common/CheckboxTests.java +++ b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/common/CheckboxTests.java @@ -1,15 +1,17 @@ package io.github.epam.angular.tests.elements.common; -import com.epam.jdi.light.angular.elements.enums.AngularColors; import io.github.epam.TestsInit; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; -import static io.github.com.enums.CheckBoxAlignPosition.AFTER; -import static io.github.com.enums.CheckBoxAlignPosition.BEFORE; +import static com.epam.jdi.light.angular.elements.enums.CustomColors.BLACK_SEMI_TRANSPARENT; +import static com.epam.jdi.light.angular.elements.enums.CustomColors.PURPLE; +import static com.epam.jdi.light.angular.elements.enums.CustomColors.RED; +import static com.epam.jdi.light.angular.elements.enums.CustomColors.YELLOW; import static com.jdiai.tools.Timer.waitCondition; - import static io.github.com.StaticSite.checkBoxPage; +import static io.github.com.enums.CheckBoxAlignPosition.AFTER; +import static io.github.com.enums.CheckBoxAlignPosition.BEFORE; import static io.github.com.pages.CheckBoxPage.accentColorCheckbox; import static io.github.com.pages.CheckBoxPage.basicCheckbox; import static io.github.com.pages.CheckBoxPage.disabledCheckbox; @@ -86,16 +88,16 @@ public void isRequiredCheckboxTest() { public void angularColorCheckBoxTest() { //Check color for checkboxes with attribute 'color' primaryColorCheckbox.uncheck(); - primaryColorCheckbox.has().color(AngularColors.UNSELECTED); + primaryColorCheckbox.has().color(BLACK_SEMI_TRANSPARENT.getColor()); primaryColorCheckbox.check(); - primaryColorCheckbox.has().color(AngularColors.PRIMARY); + primaryColorCheckbox.has().color(PURPLE.getColor()); accentColorCheckbox.check(); - accentColorCheckbox.has().color(AngularColors.ACCENT); + accentColorCheckbox.has().color(YELLOW.getColor()); warnColorCheckbox.check(); - warnColorCheckbox.has().color(AngularColors.WARN); + warnColorCheckbox.has().color(RED.getColor()); //Check color for checkbox without attribute 'color' requiredCheckbox.check(); - requiredCheckbox.has().color(AngularColors.ACCENT); + requiredCheckbox.has().color(YELLOW.getColor()); } } diff --git a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/RadioButtonTests.java b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/RadioButtonTests.java index cb2cd8e85f..52e5b12b47 100644 --- a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/RadioButtonTests.java +++ b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/RadioButtonTests.java @@ -4,10 +4,22 @@ import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; -import static com.epam.jdi.light.angular.elements.enums.AngularColors.*; +import static com.epam.jdi.light.angular.elements.enums.CustomColors.BLACK_SEMI_TRANSPARENT; +import static com.epam.jdi.light.angular.elements.enums.CustomColors.PURPLE; +import static com.epam.jdi.light.angular.elements.enums.CustomColors.RED; +import static com.epam.jdi.light.angular.elements.enums.CustomColors.YELLOW; import static com.jdiai.tools.Timer.waitCondition; import static io.github.com.StaticSite.radioButtonPage; -import static io.github.com.pages.RadioButtonPage.*; +import static io.github.com.pages.RadioButtonPage.accentRadioButton; +import static io.github.com.pages.RadioButtonPage.basicRadioGroup; +import static io.github.com.pages.RadioButtonPage.beforePositionRadioGroup; +import static io.github.com.pages.RadioButtonPage.colorRadioGroup; +import static io.github.com.pages.RadioButtonPage.disabledRadioGroup; +import static io.github.com.pages.RadioButtonPage.elementPositionRadioGroup; +import static io.github.com.pages.RadioButtonPage.labelPositionRadioGroup; +import static io.github.com.pages.RadioButtonPage.primaryRadioButton; +import static io.github.com.pages.RadioButtonPage.requiredRadioGroup; +import static io.github.com.pages.RadioButtonPage.warnRadioButton; public class RadioButtonTests extends TestsInit { @BeforeClass @@ -79,13 +91,12 @@ public void colorButtonsTest() { colorRadioGroup.show(); colorRadioGroup.is().displayed(); primaryRadioButton.click(); - primaryRadioButton.has().color(PRIMARY); - accentRadioButton.has().color(UNSELECTED); + primaryRadioButton.has().color(PURPLE.getColor()); + accentRadioButton.has().color(BLACK_SEMI_TRANSPARENT.getColor()); warnRadioButton.click(); - warnRadioButton.has().color(WARN); - primaryRadioButton.has().color(UNSELECTED); + warnRadioButton.has().color(RED.getColor()); + primaryRadioButton.has().color(BLACK_SEMI_TRANSPARENT.getColor()); accentRadioButton.click(); - accentRadioButton.has().color(ACCENT); + accentRadioButton.has().color(YELLOW.getColor()); } - } diff --git a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/ButtonAssert.java b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/ButtonAssert.java index 3c546d6511..7252d4ef12 100644 --- a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/ButtonAssert.java +++ b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/ButtonAssert.java @@ -6,6 +6,7 @@ import com.epam.jdi.light.angular.elements.interfaces.asserts.HasBadgeAssert; import com.epam.jdi.light.asserts.generic.UIAssert; import com.epam.jdi.light.common.JDIAction; +import org.hamcrest.Matcher; import org.hamcrest.Matchers; import static com.epam.jdi.light.asserts.core.SoftAssert.jdiAssert; @@ -22,7 +23,7 @@ public ButtonAssert text(String expectedText) { public ButtonAssert focused() { boolean actualFocused = element().focused(); jdiAssert(actualFocused, Matchers.is(true), - "Element is not focused"); + "Element is not focused"); return this; } @@ -34,14 +35,14 @@ public ButtonAssert color(String expectedColor) { @JDIAction(value = "Assert that '{name}' color is '{0}'", isAssert = true) public ButtonAssert color(AngularColors expectedColor) { - jdiAssert(element().color(), Matchers.is(expectedColor.getColor())); + jdiAssert(element().color(), Matchers.is(expectedColor.getType())); return this; } @JDIAction(value = "Assert that '{name}' has default color", isAssert = true) public ButtonAssert defaultColor() { jdiAssert(element().defaultColor(), Matchers.is(true), - "Element doesn't have default color."); + "Element doesn't have default color."); return this; } @@ -55,7 +56,19 @@ public ButtonAssert visualType(ButtonsTypes expectedType) { @JDIAction(value = "Assert that '{name}' has icon", isAssert = true) public ButtonAssert hasIcon() { jdiAssert(element().hasIcon(), Matchers.is(true), - "Element doesn't have icon inside"); + "Element doesn't have icon inside"); + return this; + } + + @JDIAction(value = "Assert that '{name}' has link", isAssert = true) + public ButtonAssert hasLink() { + jdiAssert(element().hasLink(), Matchers.is(true), "Element doesn't have link inside"); + return this; + } + + @JDIAction("Assert that '{name}' ref {0}") + public ButtonAssert ref(Matcher condition) { + jdiAssert(element().ref(), condition); return this; } } diff --git a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/CheckboxAssert.java b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/CheckboxAssert.java index f6c55111c0..9ec714f52c 100644 --- a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/CheckboxAssert.java +++ b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/CheckboxAssert.java @@ -1,7 +1,6 @@ package com.epam.jdi.light.angular.asserts; import com.epam.jdi.light.angular.elements.common.Checkbox; -import com.epam.jdi.light.angular.elements.enums.AngularColors; import com.epam.jdi.light.asserts.generic.UIAssert; import com.epam.jdi.light.common.JDIAction; import org.hamcrest.Matchers; @@ -71,12 +70,6 @@ public CheckboxAssert notRequired() { return this; } - @JDIAction(value = "Assert that '{name}' angular color is '{0}'", isAssert = true) - public CheckboxAssert color(AngularColors expectedColor) { - jdiAssert(element().color(), Matchers.is(expectedColor.getColor())); - return this; - } - @JDIAction(value = "Assert that '{name}' color is '{0}'", isAssert = true) public CheckboxAssert color(String expectedColor) { jdiAssert(element().color(), Matchers.is(expectedColor)); diff --git a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/radiobuttons/RadioButtonAssert.java b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/radiobuttons/RadioButtonAssert.java index 57dec8a895..28cc3de221 100644 --- a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/radiobuttons/RadioButtonAssert.java +++ b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/radiobuttons/RadioButtonAssert.java @@ -1,13 +1,12 @@ package com.epam.jdi.light.angular.asserts.radiobuttons; -import static com.epam.jdi.light.asserts.core.SoftAssert.jdiAssert; - import com.epam.jdi.light.angular.elements.complex.radiobuttons.RadioButton; -import com.epam.jdi.light.angular.elements.enums.AngularColors; import com.epam.jdi.light.asserts.generic.UIAssert; import com.epam.jdi.light.common.JDIAction; import org.hamcrest.Matchers; +import static com.epam.jdi.light.asserts.core.SoftAssert.jdiAssert; + public class RadioButtonAssert extends UIAssert { @Override @@ -24,12 +23,6 @@ public RadioButtonAssert enabled() { return this; } - @JDIAction(value = "Assert that '{name}' color is '{0}'", isAssert = true) - public RadioButtonAssert color(AngularColors expectedColor) { - jdiAssert(AngularColors.fromColor(element().color()), Matchers.is(expectedColor)); - return this; - } - @JDIAction(value = "Assert that '{name}' color is '{0}'", isAssert = true) public RadioButtonAssert color(String expectedColor) { jdiAssert(element().color(), Matchers.is(expectedColor)); @@ -38,15 +31,13 @@ public RadioButtonAssert color(String expectedColor) { @JDIAction(value = "'{name}' element label is in before position", isAssert = true) public RadioButtonAssert labelBeforePosition() { - jdiAssert(element().hasLabelBeforePosition(), Matchers.is(true), - "Radio button label is not in before position"); + jdiAssert(element().hasLabelBeforePosition(), Matchers.is(true), "Radio button label is not in before position"); return this; } @JDIAction(value = "'{name}' element label is in before position", isAssert = true) public RadioButtonAssert labelAfterPosition() { - jdiAssert(element().hasLabelBeforePosition(), Matchers.is(false), - "Radio button label is not in after position"); + jdiAssert(element().hasLabelBeforePosition(), Matchers.is(false), "Radio button label is not in after position"); return this; } @@ -64,7 +55,8 @@ public RadioButtonAssert notChecked() { @JDIAction(value = "'{name}' has label with value '{0}'", isAssert = true) public RadioButtonAssert label(String value) { - jdiAssert(element().label().getValue(), Matchers.is(value)); + jdiAssert(element().label() + .getValue(), Matchers.is(value)); return this; } } diff --git a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/elements/common/Button.java b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/elements/common/Button.java index 680f63eef4..e3768c6e36 100644 --- a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/elements/common/Button.java +++ b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/elements/common/Button.java @@ -1,16 +1,17 @@ package com.epam.jdi.light.angular.elements.common; import com.epam.jdi.light.angular.asserts.ButtonAssert; -import com.epam.jdi.light.angular.elements.enums.AngularColors; import com.epam.jdi.light.angular.elements.enums.ButtonsTypes; import com.epam.jdi.light.angular.elements.interfaces.HasBadge; import com.epam.jdi.light.common.JDIAction; import com.epam.jdi.light.elements.base.UIBaseElement; import com.epam.jdi.light.elements.interfaces.base.HasClick; +import com.epam.jdi.light.elements.interfaces.base.HasColor; +import com.epam.jdi.light.elements.interfaces.base.HasLink; import com.epam.jdi.light.elements.interfaces.common.IsText; import com.jdiai.tools.map.MapArray; -public class Button extends UIBaseElement implements HasBadge, HasClick, IsText { +public class Button extends UIBaseElement implements HasBadge, HasClick, IsText, HasLink, HasColor { private static final String ICON_LOCATOR = ".//mat-icon"; private static final String LABEL_LOCATOR = ".mdc-button__label"; @@ -20,10 +21,11 @@ public boolean focused() { return core().hasClass("cdk-focused"); } + @Override @JDIAction("Get '{name}' color") public String color() { if (core().hasAttribute("color")) { - return AngularColors.fromName(core().attr("color")).getColor(); + return core().attr("color"); } return core().getCssValue("background-color"); } @@ -52,7 +54,7 @@ public ButtonsTypes visualType() { @JDIAction("Get if there is icon inside the button") public boolean hasIcon() { - return !core().finds(ICON_LOCATOR).isEmpty(); + return core().finds(ICON_LOCATOR).isExist(); } @JDIAction("Get icon inside the button") diff --git a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/elements/complex/BottomSheet.java b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/elements/complex/BottomSheet.java index 560d283b83..c73a8e834a 100644 --- a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/elements/complex/BottomSheet.java +++ b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/elements/complex/BottomSheet.java @@ -1,10 +1,10 @@ package com.epam.jdi.light.angular.elements.complex; import com.epam.jdi.light.angular.asserts.BottomSheetAssert; +import com.epam.jdi.light.angular.elements.common.Button; import com.epam.jdi.light.elements.base.UIBaseElement; import com.epam.jdi.light.elements.common.UIElement; import com.epam.jdi.light.elements.complex.WebList; -import com.epam.jdi.light.ui.html.elements.common.Button; import org.openqa.selenium.By; import java.util.List; diff --git a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/elements/complex/Dialog.java b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/elements/complex/Dialog.java index 9325b7bc7d..c00775bfe6 100644 --- a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/elements/complex/Dialog.java +++ b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/elements/complex/Dialog.java @@ -1,9 +1,9 @@ package com.epam.jdi.light.angular.elements.complex; import com.epam.jdi.light.angular.asserts.DialogAssert; +import com.epam.jdi.light.angular.elements.common.Button; import com.epam.jdi.light.elements.base.UIBaseElement; import com.epam.jdi.light.elements.common.UIElement; -import com.epam.jdi.light.ui.html.elements.common.Button; import org.openqa.selenium.By; import org.openqa.selenium.Keys; diff --git a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/elements/complex/NestedDropdownMenu.java b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/elements/complex/NestedDropdownMenu.java index a62384c18a..3ed6e4b451 100644 --- a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/elements/complex/NestedDropdownMenu.java +++ b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/elements/complex/NestedDropdownMenu.java @@ -1,12 +1,12 @@ package com.epam.jdi.light.angular.elements.complex; import com.epam.jdi.light.angular.asserts.NestedDropdownMenuAssert; +import com.epam.jdi.light.angular.elements.common.Button; import com.epam.jdi.light.common.ElementArea; import com.epam.jdi.light.common.JDIAction; import com.epam.jdi.light.elements.base.UIBaseElement; import com.epam.jdi.light.elements.common.UIElement; import com.epam.jdi.light.elements.complex.WebList; -import com.epam.jdi.light.ui.html.elements.common.Button; import org.openqa.selenium.By; import java.util.ArrayList; diff --git a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/elements/enums/AngularColors.java b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/elements/enums/AngularColors.java index 1f8af4edd8..204ad1d0f8 100644 --- a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/elements/enums/AngularColors.java +++ b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/elements/enums/AngularColors.java @@ -2,49 +2,28 @@ import java.util.Arrays; -public enum AngularColors { +public enum AngularColors { - PRIMARY("mat-primary", "rgba(103, 58, 183, 1)"), - ACCENT("mat-accent", "rgba(255, 215, 64, 1)"), - WARN("mat-warn", "rgba(244, 67, 54, 1)"), - UNSELECTED("unselected", "rgba(0, 0, 0, 0.54)"), - DEFAULT("default", "rgba(0, 0, 0, 1)"), - UNDEFINED("undefined", "rgba(0, 0, 0, 0)"); + PRIMARY("primary"), + ACCENT("accent"), + WARN("warn"), + UNSELECTED("unselected"), + DEFAULT("default"), + UNDEFINED("undefined"); - private final String styleName; - private final String color; + String type; - AngularColors(String styleName, String color) { - this.styleName = styleName; - this.color = color; + AngularColors(String type) { + this.type = type; } - - public String getStyle() { - return this.styleName; - } - - public String getColor() { - return this.color; - } - - public static AngularColors fromStyle(String styleName) { - return Arrays.stream(AngularColors.values()) - .filter(c -> c.styleName.equalsIgnoreCase(styleName)) - .findFirst() - .orElse(AngularColors.UNDEFINED); - } - - public static AngularColors fromColor(String color) { - return Arrays.stream(AngularColors.values()) - .filter(c -> c.color.equalsIgnoreCase(color)) - .findFirst() - .orElse(AngularColors.UNDEFINED); + public String getType() { + return this.type; } - public static AngularColors fromName(String name) { - return Arrays.stream(AngularColors.values()) - .filter(c -> c.name().equalsIgnoreCase(name)) + public static AngularColors fromType(String type) { + return Arrays.stream(values()) + .filter(t -> t.type.equalsIgnoreCase(type)) .findFirst() - .orElse(AngularColors.UNDEFINED); + .orElse(UNDEFINED); } } diff --git a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/elements/enums/CustomColors.java b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/elements/enums/CustomColors.java new file mode 100644 index 0000000000..9fdc20c34a --- /dev/null +++ b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/elements/enums/CustomColors.java @@ -0,0 +1,30 @@ +package com.epam.jdi.light.angular.elements.enums; + +import java.util.Arrays; + +public enum CustomColors { + + PURPLE("rgba(103, 58, 183, 1)"), + YELLOW("rgba(255, 215, 64, 1)"), + RED("rgba(244, 67, 54, 1)"), + BLACK_SEMI_TRANSPARENT("rgba(0, 0, 0, 0.54)"), + BLACK("rgba(0, 0, 0, 1)"), + TRANSPARENT("rgba(0, 0, 0, 0)"); + + private final String color; + + CustomColors(String color) { + this.color = color; + } + + public String getColor() { + return this.color; + } + + public static CustomColors fromColor(String color) { + return Arrays.stream(CustomColors.values()) + .filter(c -> c.color.equalsIgnoreCase(color)) + .findFirst() + .orElse(CustomColors.TRANSPARENT); + } +} diff --git a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/elements/interfaces/HasBadge.java b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/elements/interfaces/HasBadge.java index cb45bdd032..e6f95700f1 100644 --- a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/elements/interfaces/HasBadge.java +++ b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/elements/interfaces/HasBadge.java @@ -1,5 +1,8 @@ package com.epam.jdi.light.angular.elements.interfaces; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + import com.epam.jdi.light.angular.elements.common.Badge; import com.epam.jdi.light.angular.elements.enums.AngularColors; import com.epam.jdi.light.angular.elements.enums.BadgePosition; @@ -7,9 +10,6 @@ import com.epam.jdi.light.common.JDIAction; import com.epam.jdi.light.elements.interfaces.base.ICoreElement; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - /** * In angular any element can be with Badge, so this interface can be used to work with it */ @@ -74,6 +74,6 @@ default boolean isBadgeEnabled() { } default AngularColors badgeColor() { - return AngularColors.fromName(core().attr("matbadgecolor")); + return AngularColors.fromType(core().attr("matbadgecolor")); } }