Skip to content

Commit

Permalink
rework Angular element: Button
Browse files Browse the repository at this point in the history
- modify AngularColors
- add CustomColors
- deprecate RadioButtonAssert #color(AngularColors expectedColor)
  • Loading branch information
Aleksandr_Vorobev committed Mar 21, 2024
1 parent 6cd3801 commit 0bf85b0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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());
}

}
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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));
return this;
}

@JDIAction(value = "Assert that '{name}' color is '{0}'", isAssert = true)
public CheckboxAssert color(String expectedColor) {
jdiAssert(element().color(), Matchers.is(expectedColor));
Expand Down

0 comments on commit 0bf85b0

Please sign in to comment.