diff --git a/jdi-eyes-demo/src/test/java/com/jdi/testng/TestNGListener.java b/jdi-eyes-demo/src/test/java/com/jdi/testng/TestNGListener.java index c45fcf4911..2e3a80f922 100644 --- a/jdi-eyes-demo/src/test/java/com/jdi/testng/TestNGListener.java +++ b/jdi-eyes-demo/src/test/java/com/jdi/testng/TestNGListener.java @@ -21,7 +21,7 @@ import static java.lang.System.currentTimeMillis; public class TestNGListener implements IInvokedMethodListener { - private Long start = currentTimeMillis(); + private long start = currentTimeMillis(); @Override public void beforeInvocation(IInvokedMethod m, ITestResult tr) { diff --git a/jdi-light-angular-tests-with-mocks/src/test/java/io/github/epam/testng/TestNGListener.java b/jdi-light-angular-tests-with-mocks/src/test/java/io/github/epam/testng/TestNGListener.java index ff6805dab3..342b21ddaf 100644 --- a/jdi-light-angular-tests-with-mocks/src/test/java/io/github/epam/testng/TestNGListener.java +++ b/jdi-light-angular-tests-with-mocks/src/test/java/io/github/epam/testng/TestNGListener.java @@ -16,7 +16,7 @@ public class TestNGListener implements IInvokedMethodListener { - private Long start = currentTimeMillis(); + private long start = currentTimeMillis(); @Override public void beforeInvocation(IInvokedMethod m, ITestResult tr) { diff --git a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/common/SlideToggleTests.java b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/common/SlideToggleTests.java index 37eac0339b..379ab2cce4 100644 --- a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/common/SlideToggleTests.java +++ b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/common/SlideToggleTests.java @@ -1,6 +1,5 @@ package io.github.epam.angular.tests.elements.common; -import com.epam.jdi.light.elements.interfaces.base.ICoreElement; import io.github.epam.TestsInit; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -19,6 +18,8 @@ public class SlideToggleTests extends TestsInit { + private static final String SLIDE_ME = "Slide me!"; + @BeforeClass public void before() { slideTogglePage.open(); @@ -28,7 +29,7 @@ public void before() { @Test(description = "Test verifies functionality of basic slide toggle") public void basicToggleCheckedTest() { - basicSlideToggle.waitFor(ICoreElement::isEnabled); + basicSlideToggle.show(); basicSlideToggle.check(); basicSlideToggle.is().selected(); basicSlideToggle.uncheck(); @@ -67,6 +68,8 @@ public void resultToggleDisableTest() { public void labelButtonTogglePositionTest() { beforeLabelPositionRadioButton.click(); resultSlideToggle.has().labelBeforePosition(); + resultSlideToggle.has().label(SLIDE_ME); basicSlideToggle.has().labelAfterPosition(); + basicSlideToggle.has().label(SLIDE_ME); } } diff --git a/jdi-light-angular-tests/src/test/java/io/github/epam/testng/TestNGListener.java b/jdi-light-angular-tests/src/test/java/io/github/epam/testng/TestNGListener.java index 08762143af..f91e11bbc1 100644 --- a/jdi-light-angular-tests/src/test/java/io/github/epam/testng/TestNGListener.java +++ b/jdi-light-angular-tests/src/test/java/io/github/epam/testng/TestNGListener.java @@ -16,7 +16,7 @@ import static java.lang.System.currentTimeMillis; public class TestNGListener implements IInvokedMethodListener { - private Long start = currentTimeMillis(); + private long start = currentTimeMillis(); @Override public void beforeInvocation(IInvokedMethod m, ITestResult tr) { diff --git a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/AutoCompleteAssert.java b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/AutoCompleteAssert.java index d56411a0c4..d85b74afc8 100644 --- a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/AutoCompleteAssert.java +++ b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/AutoCompleteAssert.java @@ -14,100 +14,100 @@ public class AutoCompleteAssert extends UIAssert implements ITextAssert { - @JDIAction("Assert that '{name}' is expanded") + @JDIAction(value = "Assert that '{name}' is expanded", isAssert = true) public AutoCompleteAssert expanded() { jdiAssert(element().expanded(), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name}' is collapsed") + @JDIAction(value = "Assert that '{name}' is collapsed", isAssert = true) public AutoCompleteAssert collapsed() { jdiAssert(element().collapsed(), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name}' text {0}") + @JDIAction(value = "Assert that '{name}' text {0}", isAssert = true) @Override public AutoCompleteAssert text(String expected) { jdiAssert(element().getText(), Matchers.is(expected)); return this; } - @JDIAction("Assert that '{name}' text {0}") + @JDIAction(value = "Assert that '{name}' text {0}", isAssert = true) @Override public AutoCompleteAssert text(Matcher condition) { jdiAssert(element().getValue(), condition); return this; } - @JDIAction("Assert that '{name}' has placeholder {0}") + @JDIAction(value = "Assert that '{name}' has placeholder {0}", isAssert = true) public AutoCompleteAssert placeholder(String expected) { jdiAssert(element().placeholder(), Matchers.is(expected)); return this; } - @JDIAction("Assert that '{name} is mandatory") + @JDIAction(value = "Assert that '{name} is mandatory", isAssert = true) public AutoCompleteAssert mandatory() { jdiAssert(element().isMandatory(), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name} is not mandatory") + @JDIAction(value = "Assert that '{name} is not mandatory", isAssert = true) public AutoCompleteAssert notMandatory() { jdiAssert(element().isMandatory(), Matchers.is(false), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name}' has empty value") + @JDIAction(value = "Assert that '{name}' has empty value", isAssert = true) @Override public AutoCompleteAssert empty() { jdiAssert(element().getValue(), Matchers.is("")); return this; } - @JDIAction("Assert that '{name} is invalid") + @JDIAction(value = "Assert that '{name} is invalid", isAssert = true) public AutoCompleteAssert invalid() { jdiAssert(element().isInvalidated(), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name} is valid") + @JDIAction(value = "Assert that '{name} is valid", isAssert = true) public AutoCompleteAssert valid() { jdiAssert(element().isInvalidated(), Matchers.is(false), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name}' has display value") + @JDIAction(value = "Assert that '{name}' has display value", isAssert = true) public AutoCompleteAssert displayValue(String expected) { jdiAssert(element().getValue(), Matchers.is(expected)); return this; } - @JDIAction("Assert that '{name}' has options") + @JDIAction(value = "Assert that '{name}' has options", isAssert = true) public AutoCompleteAssert options(List options) { jdiAssert(element().options(), Matchers.is(options)); return this; } - @JDIAction("Assert that '{name}' has groups") + @JDIAction(value = "Assert that '{name}' has groups", isAssert = true) public AutoCompleteAssert groups(List groups) { jdiAssert(element().groups(), Matchers.is(groups)); return this; } - @JDIAction("Assert that '{name}' has groups and options") + @JDIAction(value = "Assert that '{name}' has groups and options", isAssert = true) public AutoCompleteAssert groupsAndOptions(Map> expectedGroupsAndOptions) { jdiAssert(element().groupsAndOptionsValues(), Matchers.is(expectedGroupsAndOptions)); return this; } - @JDIAction("Assert that '{name}' has the {0} option being highlighted") + @JDIAction(value = "Assert that '{name}' has the {0} option being highlighted", isAssert = true) public AutoCompleteAssert optionHighlighted(String option) { jdiAssert(element().isOptionHighlighted(option), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name}' has the {0} option being not highlighted") + @JDIAction(value = "Assert that '{name}' has the {0} option being not highlighted", isAssert = true) public AutoCompleteAssert optionNotHighlighted(String option) { jdiAssert(element().isOptionHighlighted(option), Matchers.is(false), "ERROR MESSAGE IS REQUIRED"); return this; diff --git a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/BadgeAssert.java b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/BadgeAssert.java index 09f8a96ced..f1a03fea9e 100644 --- a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/BadgeAssert.java +++ b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/BadgeAssert.java @@ -9,14 +9,14 @@ public class BadgeAssert extends UIAssert { - @JDIAction("Assert that '{name}' has '{0}' color") + @JDIAction(value = "Assert that '{name}' has '{0}' color", isAssert = true) public BadgeAssert color(String value) { String actualColor = element().color(); jdiAssert(actualColor, Matchers.equalTo(value)); return this; } - @JDIAction("Assert that '{name}' has text {0}") + @JDIAction(value = "Assert that '{name}' has text {0}", isAssert = true) public BadgeAssert text(String value) { final String actualText = element().getText(); jdiAssert(actualText, Matchers.is(value)); diff --git a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/BottomSheetAssert.java b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/BottomSheetAssert.java index 18e4493ada..7b21081999 100644 --- a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/BottomSheetAssert.java +++ b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/BottomSheetAssert.java @@ -14,7 +14,7 @@ public class BottomSheetAssert extends UIAssert { - @JDIAction("Assert that '{name}' has values '{0}'") + @JDIAction(value = "Assert that '{name}' has values '{0}'", isAssert = true) public BottomSheetAssert values(final Matcher> condition) { jdiAssert(element().values(), condition); return this; 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 4a416a11fc..3c546d6511 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 @@ -12,13 +12,13 @@ public class ButtonAssert extends UIAssert implements HasBadgeAssert { - @JDIAction("Assert that '{name}' has text '{0}'") + @JDIAction(value = "Assert that '{name}' has text '{0}'", isAssert = true) public ButtonAssert text(String expectedText) { jdiAssert(element().text(), Matchers.is(expectedText)); return this; } - @JDIAction("Assert that '{name}' is focused") + @JDIAction(value = "Assert that '{name}' is focused", isAssert = true) public ButtonAssert focused() { boolean actualFocused = element().focused(); jdiAssert(actualFocused, Matchers.is(true), @@ -26,33 +26,33 @@ public ButtonAssert focused() { return this; } - @JDIAction("Assert that '{name}' color is '{0}'") + @JDIAction(value = "Assert that '{name}' color is '{0}'", isAssert = true) public ButtonAssert color(String expectedColor) { jdiAssert(element().color(), Matchers.equalToIgnoringCase(expectedColor.toLowerCase())); return this; } - @JDIAction("Assert that '{name}' color is '{0}'") + @JDIAction(value = "Assert that '{name}' color is '{0}'", isAssert = true) public ButtonAssert color(AngularColors expectedColor) { jdiAssert(element().color(), Matchers.is(expectedColor.getColor())); return this; } - @JDIAction("Assert that '{name}' has default color") + @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."); return this; } - @JDIAction("Assert that '{name}' has visual type '{0}'") + @JDIAction(value = "Assert that '{name}' has visual type '{0}'", isAssert = true) public ButtonAssert visualType(ButtonsTypes expectedType) { ButtonsTypes actualVisualType = element().visualType(); jdiAssert(actualVisualType.getType(), Matchers.is(expectedType.getType())); return this; } - @JDIAction("Assert that '{name}' has icon") + @JDIAction(value = "Assert that '{name}' has icon", isAssert = true) public ButtonAssert hasIcon() { jdiAssert(element().hasIcon(), Matchers.is(true), "Element doesn't have icon inside"); diff --git a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/ButtonToggleAssert.java b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/ButtonToggleAssert.java index 78739d95b6..1b4335e526 100644 --- a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/ButtonToggleAssert.java +++ b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/ButtonToggleAssert.java @@ -9,84 +9,84 @@ public class ButtonToggleAssert extends UIAssert { - @JDIAction("Assert that '{name}' has '{0}' class") + @JDIAction(value = "Assert that '{name}' has '{0}' class", isAssert = true) public ButtonToggleAssert assertButtonToggleIsSelected(String value) { jdiAssert(element().isButtonToggleSelected(value), Matchers.is(true), "Button toggle element is not selected"); return this; } - @JDIAction("Assert that '{name}' has '{0}' class") + @JDIAction(value = "Assert that '{name}' has '{0}' class", isAssert = true) public ButtonToggleAssert assertButtonToggleIsNotSelected(String value) { jdiAssert(element().isButtonToggleSelected(value), Matchers.is(false), "Button toggle element is selected"); return this; } - @JDIAction("Assert that '{name}' has attr '{0}'") + @JDIAction(value = "Assert that '{name}' has attr '{0}'", isAssert = true) public ButtonToggleAssert assertButtonToggleButtonIsPressed(String value) { jdiAssert(element().isButtonToggleButtonPressed(value), Matchers.is(true), "Button toggle element is not pressed"); return this; } - @JDIAction("Assert that '{name}' with value '{0}' has text '{1}'") + @JDIAction(value = "Assert that '{name}' with value '{0}' has text '{1}'", isAssert = true) public ButtonToggleAssert assertButtonToggleButtonHasText(String value, String text) { jdiAssert(element().buttonToggleHasText(value, text), Matchers.is(true), "Button toggle element text is not equal " + text); return this; } - @JDIAction("Assert that '{name}' has value '{0}'") + @JDIAction(value = "Assert that '{name}' has value '{0}'", isAssert = true) public ButtonToggleAssert assertButtonToggleHasValue(String value) { jdiAssert(element().buttonToggleHasValue(value), Matchers.is(true), "Button toggle element value is not equal " + value); return this; } - @JDIAction("Assert that '{name}' with value '{0}' has aria-label '{1}'") + @JDIAction(value = "Assert that '{name}' with value '{0}' has aria-label '{1}'", isAssert = true) public ButtonToggleAssert assertButtonToggleHasAriaLabel(String value, String ariaLabel) { jdiAssert(element().buttonToggleHasAriaLabel(value, ariaLabel), Matchers.is(true), "Button toggle aria-label is not equal " + ariaLabel); return this; } - @JDIAction("Assert that '{name}' has attr legacy appearance") + @JDIAction(value = "Assert that '{name}' has attr legacy appearance", isAssert = true) public ButtonToggleAssert assertButtonToggleHasLegacyAppearance() { jdiAssert(element().buttonToggleHasLegacyAppearance(), Matchers.is(true), "Button toggle appearance is not legacy"); return this; } - @JDIAction("Assert that '{name} is disabled'") + @JDIAction(value = "Assert that '{name} is disabled'", isAssert = true) public ButtonToggleAssert assertButtonToggleIsDisabled() { jdiAssert(element().buttonToggleDisabled(), Matchers.is(true), "Button toggle is enabled"); return this; } - @JDIAction("Assert that '{name}' in button-toggle is disabled") + @JDIAction(value = "Assert that '{name}' in button-toggle is disabled", isAssert = true) public ButtonToggleAssert assertButtonInButtonToggleIsDisabled(String value) { jdiAssert(element().isButtonToggleDisabled(value), Matchers.is(true), "Button toggle element is enabled"); return this; } - @JDIAction("Assert that '{name}' is vertical") + @JDIAction(value = "Assert that '{name}' is vertical", isAssert = true) public ButtonToggleAssert assertButtonToggleVertical() { jdiAssert(element().buttonToggleVertical(), Matchers.is(true), "Button toggle is horizontal"); return this; } - @JDIAction("Assert that '{name}' has ripple effect") + @JDIAction(value = "Assert that '{name}' has ripple effect", isAssert = true) public ButtonToggleAssert assertButtonToggleWithRipple(String value) { jdiAssert(element().buttonToggleHasNoRippleEffect(value), Matchers.is(false), "Button toggle element does not have ripple effect"); return this; } - @JDIAction("Assert that '{name}' has no ripple effect") + @JDIAction(value = "Assert that '{name}' has no ripple effect", isAssert = true) public ButtonToggleAssert assertButtonToggleNoRipple(String value) { jdiAssert(element().buttonToggleHasNoRippleEffect(value), Matchers.is(true), "Button toggle element has ripple effect"); diff --git a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/CardAssert.java b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/CardAssert.java index c66043c599..f3fd8cac0e 100644 --- a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/CardAssert.java +++ b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/CardAssert.java @@ -8,25 +8,25 @@ import static com.epam.jdi.light.asserts.core.SoftAssert.jdiAssert; public class CardAssert extends UIAssert { - @JDIAction("Assert that '{name}' has text '{0}'") + @JDIAction(value = "Assert that '{name}' has text '{0}'", isAssert = true) public CardAssert assertCardText(String value) { jdiAssert(element().getCardText().equals(value), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name}' alt image attribute has text '{0}'") + @JDIAction(value = "Assert that '{name}' alt image attribute has text '{0}'", isAssert = true) public CardAssert assertAltImageAttribute(String value) { jdiAssert(element().getImage().getAttribute("alt").contains(value), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name}' src image attribute has text '{0}'") + @JDIAction(value = "Assert that '{name}' src image attribute has text '{0}'", isAssert = true) public CardAssert assertSrcImageAttribute(String value) { jdiAssert(element().getImage().getAttribute("src").contains(value), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name}' has '{0}' buttons") + @JDIAction(value = "Assert that '{name}' has '{0}' buttons", isAssert = true) public CardAssert assertNumberOfButtonsOnCard(int number) { jdiAssert(element().getButtons().size() == number, Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); 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 3598936928..f6c55111c0 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 @@ -9,75 +9,75 @@ import static com.epam.jdi.light.asserts.core.SoftAssert.jdiAssert; public class CheckboxAssert extends UIAssert { - @JDIAction("Assert that '{name}' is selected") + @JDIAction(value = "Assert that '{name}' is selected", isAssert = true) public CheckboxAssert selected() { jdiAssert(element().isSelected(), Matchers.is(true), "Checkbox is not selected"); return this; } - @JDIAction("Assert that '{name}' is not selected") + @JDIAction(value = "Assert that '{name}' is not selected", isAssert = true) public CheckboxAssert notSelected() { jdiAssert(element().isSelected(), Matchers.is(false), "Checkbox is selected"); return this; } - @JDIAction("Assert that '{name}' is indeterminate") + @JDIAction(value = "Assert that '{name}' is indeterminate", isAssert = true) public CheckboxAssert indeterminate() { jdiAssert(element().isIndeterminate(), Matchers.is(true), "Checkbox is determinate"); return this; } - @JDIAction("Assert that '{name}' is not indeterminate") + @JDIAction(value = "Assert that '{name}' is not indeterminate", isAssert = true) public CheckboxAssert notIndeterminate() { jdiAssert(element().isIndeterminate(), Matchers.is(false), "Checkbox is indeterminate"); return this; } - @JDIAction("Assert that '{name}' is enabled") + @JDIAction(value = "Assert that '{name}' is enabled", isAssert = true) @Override public CheckboxAssert enabled() { jdiAssert(element().isEnabled(), Matchers.is(true), "Checkbox is disabled"); return this; } - @JDIAction("Assert that '{name}' is disabled") + @JDIAction(value = "Assert that '{name}' is disabled", isAssert = true) @Override public CheckboxAssert disabled() { jdiAssert(element().isDisabled(), Matchers.is(true), "Checkbox is enabled"); return this; } - @JDIAction("Assert that '{name}' is aligned in before position") + @JDIAction(value = "Assert that '{name}' is aligned in before position", isAssert = true) public CheckboxAssert alignedBefore() { jdiAssert(element().isAlignedBefore(), Matchers.is(true), "Checkbox is aligned after"); return this; } - @JDIAction("Assert that '{name}' is aligned in after position") + @JDIAction(value = "Assert that '{name}' is aligned in after position", isAssert = true) public CheckboxAssert alignedAfter() { jdiAssert(element().isAlignedBefore(), Matchers.is(false), "Checkbox is aligned before"); return this; } - @JDIAction("Assert that '{name}' is required") + @JDIAction(value = "Assert that '{name}' is required", isAssert = true) public CheckboxAssert required() { jdiAssert(element().isRequired(), Matchers.is(true), "Checkbox does not have feature: required"); return this; } - @JDIAction("Assert that '{name}' is not required") + @JDIAction(value = "Assert that '{name}' is not required", isAssert = true) public CheckboxAssert notRequired() { jdiAssert(element().isRequired(), Matchers.is(false), "Checkbox has feature: required"); return this; } - @JDIAction("Assert that '{name}' angular color is '{0}'") + @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("Assert that '{name}' color is '{0}'") + @JDIAction(value = "Assert that '{name}' color is '{0}'", isAssert = true) public CheckboxAssert color(String expectedColor) { jdiAssert(element().color(), Matchers.is(expectedColor)); return this; diff --git a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/ChipsAssert.java b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/ChipsAssert.java index 2162558ebb..9d2dab6467 100644 --- a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/ChipsAssert.java +++ b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/ChipsAssert.java @@ -12,19 +12,19 @@ public class ChipsAssert extends UIAssert { - @JDIAction("Assert that '{name}' enabled") + @JDIAction(value = "Assert that '{name}' enabled", isAssert = true) public ChipsAssert assertChipsIsEnabled() { jdiAssert(element().enabled(), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name}' has options") + @JDIAction(value = "Assert that '{name}' has options", isAssert = true) public ChipsAssert assertChipsHasOptions(List options) { jdiAssert(element().options(), Matchers.is(options)); return this; } - @JDIAction("Assert that '{name}' has placeholder '{0}'") + @JDIAction(value = "Assert that '{name}' has placeholder '{0}'", isAssert = true) public ChipsAssert assertChipsHasPlaceholder(String expected) { jdiAssert(element().getPlaceholderForChips(), Matchers.is(expected)); return this; diff --git a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/DatepickerAssert.java b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/DatepickerAssert.java index ee4be11513..589c50d91f 100644 --- a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/DatepickerAssert.java +++ b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/DatepickerAssert.java @@ -16,121 +16,121 @@ import static com.epam.jdi.light.asserts.core.SoftAssert.jdiAssert; public class DatepickerAssert extends UIAssert implements ITextAssert { - @JDIAction("Assert that '{name}' expanded") + @JDIAction(value = "Assert that '{name}' expanded", isAssert = true) public DatepickerAssert expanded() { jdiAssert(element().isExpanded(), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name}' collapsed") + @JDIAction(value = "Assert that '{name}' collapsed", isAssert = true) public DatepickerAssert collapsed() { jdiAssert(element().isCollapsed(), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name}' focused") + @JDIAction(value = "Assert that '{name}' focused", isAssert = true) public DatepickerAssert focused() { jdiAssert(element().isFocused(), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name}' has locale '{0}'") + @JDIAction(value = "Assert that '{name}' has locale '{0}'", isAssert = true) public DatepickerAssert locale(final Locale locale) { jdiAssert(element().isSelectedLocale(locale), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name}' has first input & change events '{0}'") + @JDIAction(value = "Assert that '{name}' has first input & change events '{0}'", isAssert = true) public DatepickerAssert firstInputChangeEvents(final List firstInputChangeEvents) { jdiAssert(element().isFirstInputChangeEvents(firstInputChangeEvents), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name}' has last input & change events '{0}'") + @JDIAction(value = "Assert that '{name}' has last input & change events '{0}'", isAssert = true) public DatepickerAssert lastInputChangeEvents(final List lastInputChangeEvents) { jdiAssert(element().isLastInputChangeEvents(lastInputChangeEvents), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name}' has last change event '{0}'") + @JDIAction(value = "Assert that '{name}' has last change event '{0}'", isAssert = true) public DatepickerAssert lastChangeEvent(final String lastChangeEvent) { jdiAssert(element().isLastChangeEvent(lastChangeEvent), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name}' has last input event '{0}'") + @JDIAction(value = "Assert that '{name}' has last input event '{0}'", isAssert = true) public DatepickerAssert lastInputEvent(final String lastInputEvent) { jdiAssert(element().isLastInputEvent(lastInputEvent), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name}' has valid value") + @JDIAction(value = "Assert that '{name}' has valid value", isAssert = true) public DatepickerAssert valid() { jdiAssert(element().isValid(), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name}' has invalid value") + @JDIAction(value = "Assert that '{name}' has invalid value", isAssert = true) public DatepickerAssert invalid() { jdiAssert(element().isInvalid(), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name}' enabled") + @JDIAction(value = "Assert that '{name}' enabled", isAssert = true) public DatepickerAssert enabled() { jdiAssert(element().isEnabled(), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name}' disabled") + @JDIAction(value = "Assert that '{name}' disabled", isAssert = true) public DatepickerAssert disabled() { jdiAssert(element().isDisabled(), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name}' has enabled toggle") + @JDIAction(value = "Assert that '{name}' has enabled toggle", isAssert = true) public DatepickerAssert enabledToggle() { jdiAssert(element().isToggleEnabled(), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name}' has disabled toggle") + @JDIAction(value = "Assert that '{name}' has disabled toggle", isAssert = true) public DatepickerAssert disabledToggle() { jdiAssert(element().isToggleDisabled(), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name}' has enabled input") + @JDIAction(value = "Assert that '{name}' has enabled input", isAssert = true) public DatepickerAssert enabledInput() { jdiAssert(element().isInputEnabled(), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name}' has disabled input") + @JDIAction(value = "Assert that '{name}' has disabled input", isAssert = true) public DatepickerAssert disabledInput() { jdiAssert(element().isInputDisabled(), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name}' has enabled values '{0}'") + @JDIAction(value = "Assert that '{name}' has enabled values '{0}'", isAssert = true) public DatepickerAssert enabledNavigation(final String... navigationElements) { jdiAssert(element().isEnabledNavigationElements(navigationElements), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name}' has disabled values '{0}'") + @JDIAction(value = "Assert that '{name}' has disabled values '{0}'", isAssert = true) public DatepickerAssert disabledNavigation(final String... navigationElements) { jdiAssert(element().isDisabledNavigationElements(navigationElements), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name}' text '{0}'") + @JDIAction(value = "Assert that '{name}' text '{0}'", isAssert = true) public DatepickerAssert text(final Matcher condition) { jdiAssert(element().text(), condition); return this; } - @JDIAction("Assert that '{name}' placeholder '{0}'") + @JDIAction(value = "Assert that '{name}' placeholder '{0}'", isAssert = true) public DatepickerAssert placeholder(final Matcher condition) { jdiAssert(element().placeholder(), condition); return this; @@ -140,7 +140,7 @@ public DatepickerAssert placeholder(final String date) { return placeholder(Matchers.is(date)); } - @JDIAction("Assert that '{name}' date '{0}'") + @JDIAction(value = "Assert that '{name}' date '{0}'", isAssert = true) public DatepickerAssert date(final Matcher date) { jdiAssert(element().getValue(), date); return this; @@ -150,7 +150,7 @@ public DatepickerAssert date(final String date) { return date(Matchers.is(date)); } - @JDIAction("Assert that '{name}' has selected date '{0}'") + @JDIAction(value = "Assert that '{name}' has selected date '{0}'", isAssert = true) public DatepickerAssert selectedDate(final Matcher selectedDate) { jdiAssert(element().selectedDate(), selectedDate); return this; @@ -160,7 +160,7 @@ public DatepickerAssert selectedDate(final LocalDate selectedDate) { return selectedDate(Matchers.is(selectedDate)); } - @JDIAction("Assert that '{name}' has selected date '{0}' with '{1}' locale") + @JDIAction(value = "Assert that '{name}' has selected date '{0}' with '{1}' locale", isAssert = true) public DatepickerAssert selectedDate(final Matcher selectedDate, final Locale locale) { jdiAssert(element().selectedDate(locale), selectedDate); return this; @@ -170,7 +170,7 @@ public DatepickerAssert selectedDate(final LocalDate selectedDate, final Locale return selectedDate(Matchers.is(selectedDate), locale); } - @JDIAction("Assert that '{name}' month '{0}'") + @JDIAction(value = "Assert that '{name}' month '{0}'", isAssert = true) public DatepickerAssert month(final Matcher month) { jdiAssert(element().getMonth(), month); return this; @@ -180,7 +180,7 @@ public DatepickerAssert month(final Month month) { return month(Matchers.is(month)); } - @JDIAction("Assert that '{name}' has selected month '{0}'") + @JDIAction(value = "Assert that '{name}' has selected month '{0}'", isAssert = true) public DatepickerAssert selectedMonth(final Matcher selectedMonth) { jdiAssert(element().selectedMonth(), selectedMonth); return this; @@ -190,7 +190,7 @@ public DatepickerAssert selectedMonth(final Month selectedMonth) { return selectedMonth(Matchers.is(selectedMonth)); } - @JDIAction("Assert that '{name}' has start month '{0}'") + @JDIAction(value = "Assert that '{name}' has start month '{0}'", isAssert = true) public DatepickerAssert startMonth(final Matcher startMonth) { jdiAssert(element().startMonth(), startMonth); return this; @@ -200,7 +200,7 @@ public DatepickerAssert startMonth(final Month startMonth) { return startMonth(Matchers.is(startMonth)); } - @JDIAction("Assert that '{name}' year '{0}'") + @JDIAction(value = "Assert that '{name}' year '{0}'", isAssert = true) public DatepickerAssert year(final Matcher year) { jdiAssert(element().getYear(), year); return this; @@ -210,7 +210,7 @@ public DatepickerAssert year(final Year year) { return year(Matchers.is(year)); } - @JDIAction("Assert that '{name}' has selected year '{0}'") + @JDIAction(value = "Assert that '{name}' has selected year '{0}'", isAssert = true) public DatepickerAssert selectedYear(final Matcher selectedYear) { jdiAssert(element().selectedYear(), selectedYear); return this; @@ -220,7 +220,7 @@ public DatepickerAssert selectedYear(final Year selectedYear) { return selectedYear(Matchers.is(selectedYear)); } - @JDIAction("Assert that '{name}' has start year '{0}'") + @JDIAction(value = "Assert that '{name}' has start year '{0}'", isAssert = true) public DatepickerAssert startYear(final Matcher startYear) { jdiAssert(element().startYear(), startYear); return this; @@ -230,7 +230,7 @@ public DatepickerAssert startYear(final Year startYear) { return startYear(Matchers.is(startYear)); } - @JDIAction("Assert that '{name}' day '{0}'") + @JDIAction(value = "Assert that '{name}' day '{0}'", isAssert = true) public DatepickerAssert day(final Matcher day) { jdiAssert(element().getDay(), day); return this; @@ -240,7 +240,7 @@ public DatepickerAssert day(final int day) { return day(Matchers.is(day)); } - @JDIAction("Assert that '{name}' has selected day '{0}'") + @JDIAction(value = "Assert that '{name}' has selected day '{0}'", isAssert = true) public DatepickerAssert selectedDay(final Matcher selectedDay) { jdiAssert(element().selectedDay(), selectedDay); return this; @@ -250,7 +250,7 @@ public DatepickerAssert selectedDay(final int selectedDay) { return selectedDay(Matchers.is(selectedDay)); } - @JDIAction("Assert that '{name}' has start day '{0}'") + @JDIAction(value = "Assert that '{name}' has start day '{0}'", isAssert = true) public DatepickerAssert startDay(final Matcher startDay) { jdiAssert(element().startDay(), startDay); return this; @@ -260,7 +260,7 @@ public DatepickerAssert startDay(final int startDay) { return startDay(Matchers.is(startDay)); } - @JDIAction("Assert that '{name}' has start day '{0}' with '{1}' locale") + @JDIAction(value = "Assert that '{name}' has start day '{0}' with '{1}' locale", isAssert = true) public DatepickerAssert startDay(final Matcher startDay, final Locale locale) { jdiAssert(element().startDay(locale), startDay); return this; @@ -270,7 +270,7 @@ public DatepickerAssert startDay(final int startDay, final Locale locale) { return startDay(Matchers.is(startDay), locale); } - @JDIAction("Assert that '{name}' has today day '{0}'") + @JDIAction(value = "Assert that '{name}' has today day '{0}'", isAssert = true) public DatepickerAssert todayDay(final Matcher todayDay) { jdiAssert(element().todayDay(), todayDay); return this; diff --git a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/DialogAssert.java b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/DialogAssert.java index 40f3f35200..20d88fb96b 100644 --- a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/DialogAssert.java +++ b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/DialogAssert.java @@ -2,26 +2,31 @@ import com.epam.jdi.light.angular.elements.complex.Dialog; 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 DialogAssert extends UIAssert { + @JDIAction(value = "Assert that '{name}' is opened", isAssert = true) public DialogAssert opened() { jdiAssert(element().isOpened(), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } + @JDIAction(value = "Assert that '{name}' closed", isAssert = true) public DialogAssert closed() { jdiAssert(element().isClosed(), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } + @JDIAction(value = "Assert that '{name}' name is {0}", isAssert = true) public DialogAssert nameText(String name) { jdiAssert(element().nameText(name), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } + @JDIAction(value = "Assert that '{name}' answer is {0}", isAssert = true) public DialogAssert answerText(String answer) { jdiAssert(element().answerText(answer), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; diff --git a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/DividerAssert.java b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/DividerAssert.java index d9617f2781..b1374648b9 100644 --- a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/DividerAssert.java +++ b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/DividerAssert.java @@ -17,7 +17,7 @@ public class DividerAssert extends UIAssert { * * @return this {@link DividerAssert} instance */ - @JDIAction("Assert that '{name}' is horizontal orientation") + @JDIAction(value = "Assert that '{name}' is horizontal orientation", isAssert = true) public DividerAssert horizontal() { jdiAssert(element().isHorizontal(), Matchers.is(true), "Divider is not horizontal"); return this; @@ -28,7 +28,7 @@ public DividerAssert horizontal() { * * @return this {@link DividerAssert} instance */ - @JDIAction("Assert that '{name}' is vertical orientation") + @JDIAction(value = "Assert that '{name}' is vertical orientation", isAssert = true) public DividerAssert vertical() { jdiAssert(element().isVertical(), Matchers.is(true), "Divider is not vertical"); return this; @@ -39,7 +39,7 @@ public DividerAssert vertical() { * * @return this {@link DividerAssert} instance */ - @JDIAction("Assert that '{name}' has inset") + @JDIAction(value = "Assert that '{name}' has inset", isAssert = true) public DividerAssert inset() { jdiAssert(element().hasInset(), Matchers.is(true), "Divider doesn't have inset"); return this; diff --git a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/ExpansionPanelAssert.java b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/ExpansionPanelAssert.java index 281b564ecb..09a7d5c122 100644 --- a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/ExpansionPanelAssert.java +++ b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/ExpansionPanelAssert.java @@ -9,19 +9,19 @@ import static com.epam.jdi.light.asserts.core.SoftAssert.jdiAssert; public class ExpansionPanelAssert extends UIAssert { - @JDIAction("Assert that '{name}' expanded") + @JDIAction(value = "Assert that '{name}' expanded", isAssert = true) public ExpansionPanelAssert expanded(final int indexNumber) { jdiAssert(element().isExpanded(indexNumber), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name}' collapsed") + @JDIAction(value = "Assert that '{name}' collapsed", isAssert = true) public ExpansionPanelAssert collapsed(final int indexNumber) { jdiAssert(element().isCollapsed(indexNumber), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name}' has field '{0}' with value '{1}'") + @JDIAction(value = "Assert that '{name}' has field '{0}' with value '{1}'", isAssert = true) public ExpansionPanelAssert value(final Matcher value, final String field) { jdiAssert(element().value(field), value); return this; @@ -31,7 +31,7 @@ public ExpansionPanelAssert value(final String value, final String field) { return value(Matchers.is(field), value); } - @JDIAction("Assert that '{name}' has title '{0}' with value '{1}'") + @JDIAction(value = "Assert that '{name}' has title '{0}' with value '{1}'", isAssert = true) public ExpansionPanelAssert title(final Matcher title, final int titleNumber) { jdiAssert(element().title(titleNumber), title); return this; @@ -41,7 +41,7 @@ public ExpansionPanelAssert title(final String title, final int titleNumber) { return title(Matchers.is(title), titleNumber); } - @JDIAction("Assert that '{name}' has description '{0}' with value '{1}'") + @JDIAction(value = "Assert that '{name}' has description '{0}' with value '{1}'", isAssert = true) public ExpansionPanelAssert description(final Matcher description, final int titleNumber) { jdiAssert(element().description(titleNumber), description); return this; @@ -51,7 +51,7 @@ public ExpansionPanelAssert description(final String description, final int titl return description(Matchers.is(description), titleNumber); } - @JDIAction("Assert that '{name}' has content '{0}' with value '{1}'") + @JDIAction(value = "Assert that '{name}' has content '{0}' with value '{1}'", isAssert = true) public ExpansionPanelAssert content(final Matcher content, final int titleNumber) { jdiAssert(element().content(titleNumber), content); return this; diff --git a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/FormFieldsAssert.java b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/FormFieldsAssert.java index f209000509..e1f1b59479 100644 --- a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/FormFieldsAssert.java +++ b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/FormFieldsAssert.java @@ -10,139 +10,139 @@ import static com.epam.jdi.light.asserts.core.SoftAssert.jdiAssert; public class FormFieldsAssert extends UIAssert implements HasAssert { - @JDIAction("Assert that '{name}' input with index {0} has value {1}") + @JDIAction(value = "Assert that '{name}' input with index {0} has value {1}", isAssert = true) public FormFieldsAssert inputText(int index, String expected) { jdiAssert(element().getInputValue(index), Matchers.is(expected)); return this; } - @JDIAction("Assert that '{name}' input with index {0} contains value {1}") + @JDIAction(value = "Assert that '{name}' input with index {0} contains value {1}", isAssert = true) public FormFieldsAssert inputText(int index, Matcher condition) { jdiAssert(element().getInputValue(index), condition); return this; } - @JDIAction("Assert that {name} text area with index {0} has value {1}") + @JDIAction(value = "Assert that {name} text area with index {0} has value {1}", isAssert = true) public FormFieldsAssert textAreaText(int index, String expected) { jdiAssert(element().getTextAreaValue(index), Matchers.is(expected)); return this; } - @JDIAction("Assert that {name} text area with index {0} contains value {1}") + @JDIAction(value = "Assert that {name} text area with index {0} contains value {1}", isAssert = true) public FormFieldsAssert textAreaText(int index, Matcher condition) { jdiAssert(element().getTextAreaValue(index), condition); return this; } - @JDIAction("Assert that {name} dropdown with index {0} value is {1}") + @JDIAction(value = "Assert that {name} dropdown with index {0} value is {1}", isAssert = true) public FormFieldsAssert dropdownText(int index, String expected) { jdiAssert(element().getDropdownValue(index), Matchers.is(expected)); return this; } - @JDIAction("Assert that {name} dropdown with index {0} value contains {1}") + @JDIAction(value = "Assert that {name} dropdown with index {0} value contains {1}", isAssert = true) public FormFieldsAssert dropdownText(int index, Matcher condition) { jdiAssert(element().getDropdownValue(index), condition); return this; } - @JDIAction("Assert that {name} input with index {0} has placeholder {1}") + @JDIAction(value = "Assert that {name} input with index {0} has placeholder {1}", isAssert = true) public FormFieldsAssert inputPlaceholder(int index, String expected) { jdiAssert(element().inputPlaceholder(index), Matchers.is(expected)); return this; } - @JDIAction("Assert that {name} input with index {0} contains placeholder {1}") + @JDIAction(value = "Assert that {name} input with index {0} contains placeholder {1}", isAssert = true) public FormFieldsAssert inputPlaceholder(int index, Matcher condition) { jdiAssert(element().inputPlaceholder(index), condition); return this; } - @JDIAction("Assert that {name} input with index {0} has label {1}") + @JDIAction(value = "Assert that {name} input with index {0} has label {1}", isAssert = true) public FormFieldsAssert inputLabel(int index, String expected) { jdiAssert(element().inputLabel(index), Matchers.is(expected)); return this; } - @JDIAction("Assert that {name} text area with index {0} has label {1}") + @JDIAction(value = "Assert that {name} text area with index {0} has label {1}", isAssert = true) public FormFieldsAssert textAreaLabel(int index, String expected) { jdiAssert(element().textAreaLabel(index), Matchers.is(expected)); return this; } - @JDIAction("Assert that {name} dropdown with index {0} has label {1}") + @JDIAction(value = "Assert that {name} dropdown with index {0} has label {1}", isAssert = true) public FormFieldsAssert dropdownLabel(int index, String expected) { jdiAssert(element().dropdownLabel(index), Matchers.is(expected)); return this; } - @JDIAction("Assert that {name} input with index {0} has hint {1}") + @JDIAction(value = "Assert that {name} input with index {0} has hint {1}", isAssert = true) public FormFieldsAssert inputHint(int index, String expected) { jdiAssert(element().inputHint(index), Matchers.is(expected)); return this; } - @JDIAction("Assert that {name} input with index {0} has error {1}") + @JDIAction(value = "Assert that {name} input with index {0} has error {1}", isAssert = true) public FormFieldsAssert inputError(int index, String expected) { jdiAssert(element().inputError(index), Matchers.is(expected)); return this; } - @JDIAction("Assert that {name} with index {0} has value {1}") + @JDIAction(value = "Assert that {name} with index {0} has value {1}", isAssert = true) public FormFieldsAssert value(int index, String expected) { jdiAssert(element().value(index), Matchers.is(expected)); return this; } - @JDIAction("Assert that {name} with index {0} contains value {1}") + @JDIAction(value = "Assert that {name} with index {0} contains value {1}", isAssert = true) public FormFieldsAssert value(int index, Matcher condition) { jdiAssert(element().value(index), condition); return this; } - @JDIAction("Assert that {name} with index {0} has hint {1}") + @JDIAction(value = "Assert that {name} with index {0} has hint {1}", isAssert = true) public FormFieldsAssert hint(int index, String expected) { jdiAssert(element().hint(index), Matchers.is(expected)); return this; } - @JDIAction("Assert that {name} with index {0} has icon {1}") + @JDIAction(value = "Assert that {name} with index {0} has icon {1}", isAssert = true) public FormFieldsAssert fieldIcon(int index, String expected) { jdiAssert(element().icon(index), Matchers.is(expected)); return this; } - @JDIAction("Assert that {name} with index {0} has font {1}") + @JDIAction(value = "Assert that {name} with index {0} has font {1}", isAssert = true) public FormFieldsAssert font(int index, String expected) { jdiAssert(element().font(index), Matchers.is(expected)); return this; } - @JDIAction("Assert that {name} with index {0} font contains {1} property") + @JDIAction(value = "Assert that {name} with index {0} font contains {1} property", isAssert = true) public FormFieldsAssert font(int index, Matcher condition) { jdiAssert(element().font(index), condition); return this; } - @JDIAction("Assert that {name} with index {0} has color {1}") + @JDIAction(value = "Assert that {name} with index {0} has color {1}", isAssert = true) public FormFieldsAssert color(int index, String expected) { jdiAssert(element().color(index), Matchers.is(expected)); return this; } - @JDIAction("Assert that {name} with index {0} has placeholder {1}") + @JDIAction(value = "Assert that {name} with index {0} has placeholder {1}", isAssert = true) public FormFieldsAssert placeholder(int index, String expected) { jdiAssert(element().placeholder(index), Matchers.is(expected)); return this; } - @JDIAction("Assert that {name} with index {0} has label {1}") + @JDIAction(value = "Assert that {name} with index {0} has label {1}", isAssert = true) public FormFieldsAssert label(int index, String expected) { jdiAssert(element().label(index), Matchers.is(expected)); return this; } - @JDIAction("Assert that {name} with index {0} has error {1}") + @JDIAction(value = "Assert that {name} with index {0} has error {1}", isAssert = true) public FormFieldsAssert error(int index, String expected) { jdiAssert(element().error(index), Matchers.is(expected)); return this; diff --git a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/IconAssert.java b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/IconAssert.java index c092469d95..e648ceb52c 100644 --- a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/IconAssert.java +++ b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/IconAssert.java @@ -10,7 +10,7 @@ public class IconAssert extends UIAssert implements HasBadgeAssert { - @JDIAction("Assert that '{name}' has type '{0}'") + @JDIAction(value = "Assert that '{name}' has type '{0}'", isAssert = true) public IconAssert type(String expectedType) { jdiAssert(element().type(), Matchers.equalToIgnoringCase(expectedType)); return this; diff --git a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/InputAssert.java b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/InputAssert.java index 96a44f6507..be57bb40e9 100644 --- a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/InputAssert.java +++ b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/InputAssert.java @@ -10,49 +10,49 @@ public class InputAssert extends UIAssert { - @JDIAction("Assert that '{name}' has typed text '{0}' in input field") + @JDIAction(value = "Assert that '{name}' has typed text '{0}' in input field", isAssert = true) public InputAssert value(String text) { jdiAssert(element().getValue(), Matchers.containsString(text)); return this; } - @JDIAction("Assert that '{name}' is readonly") + @JDIAction(value = "Assert that '{name}' is readonly", isAssert = true) public InputAssert readonly() { jdiAssert(element().isReadonly(), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name}' is not readonly") + @JDIAction(value = "Assert that '{name}' is not readonly", isAssert = true) public InputAssert notReadonly() { jdiAssert(element().isReadonly(), Matchers.is(false), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name}' has type '{0}'") + @JDIAction(value = "Assert that '{name}' has type '{0}'", isAssert = true) public InputAssert inputType(InputsTypes inputType) { jdiAssert(element().inputType(), Matchers.is(inputType)); return this; } - @JDIAction("Assert that '{name}' has placeholder '{0}'") + @JDIAction(value = "Assert that '{name}' has placeholder '{0}'", isAssert = true) public InputAssert placeholder(String placeholder) { jdiAssert(element().placeholder(), Matchers.containsString(placeholder)); return this; } - @JDIAction("Assert that '{name}' is focused") + @JDIAction(value = "Assert that '{name}' is focused", isAssert = true) public InputAssert focused() { jdiAssert(element().isFocused(), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name}' is not focused") + @JDIAction(value = "Assert that '{name}' is not focused", isAssert = true) public InputAssert notFocused() { jdiAssert(element().isFocused(), Matchers.is(false), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name}' has aria-label '{0}'") + @JDIAction(value = "Assert that '{name}' has aria-label '{0}'", isAssert = true) public InputAssert ariaLabel(String ariaLabel) { jdiAssert(element().hasAriaLabel(ariaLabel), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; diff --git a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/MaterialSelectorAssert.java b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/MaterialSelectorAssert.java index 74934d5e0c..0b770cb46e 100644 --- a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/MaterialSelectorAssert.java +++ b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/MaterialSelectorAssert.java @@ -16,25 +16,25 @@ import static org.hamcrest.Matchers.hasItems; public class MaterialSelectorAssert extends UIAssert { - @JDIAction("Assert that '{name}' expanded") + @JDIAction(value = "Assert that '{name}' expanded", isAssert = true) public MaterialSelectorAssert expanded() { jdiAssert(element().isExpanded(), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name}' collapsed") + @JDIAction(value = "Assert that '{name}' collapsed", isAssert = true) public MaterialSelectorAssert collapsed() { jdiAssert(element().isCollapsed(), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{0}' option selected for '{name}'") + @JDIAction(value = "Assert that '{0}' option selected for '{name}'", isAssert = true) public MaterialSelectorAssert selected(final Matcher condition) { jdiAssert(element().selected(), condition); return this; } - @JDIAction("Assert that '{0}' option selected for '{name}'") + @JDIAction(value = "Assert that '{0}' option selected for '{name}'", isAssert = true) public MaterialSelectorAssert selected(final String option) { return selected(Matchers.is(option)); } @@ -48,17 +48,17 @@ public > MaterialSelectorAssert value(final T option) { return this; } - @JDIAction("Assert that '{name}' value '{0}'") + @JDIAction(value = "Assert that '{name}' value '{0}'", isAssert = true) public MaterialSelectorAssert value(final Matcher condition) { return values(hasItem(condition)); } - @JDIAction("Assert that '{name}' has value '{0}'") + @JDIAction(value = "Assert that '{name}' has value '{0}'", isAssert = true) public MaterialSelectorAssert value(final String value) { return values(hasItem(value)); } - @JDIAction("Assert that '{name}' values '{0}'") + @JDIAction(value = "Assert that '{name}' values '{0}'", isAssert = true) public MaterialSelectorAssert values(final Matcher> condition) { jdiAssert(element().values(), condition); return this; @@ -72,7 +72,7 @@ public MaterialSelectorAssert values(final List values) { return values(toStringArray(values)); } - @JDIAction("Assert that '{name}' has groups '{0}'") + @JDIAction(value = "Assert that '{name}' has groups '{0}'", isAssert = true) public MaterialSelectorAssert groups(final Matcher> condition) { jdiAssert(element().groups(), condition); return this; @@ -86,13 +86,13 @@ public MaterialSelectorAssert groups(final String... values) { return groups(hasItems(values)); } - @JDIAction("Assert that '{name}' has groups and options '{0}'") + @JDIAction(value = "Assert that '{name}' has groups and options '{0}'", isAssert = true) public MaterialSelectorAssert groupsAndOptions(final Map> expectedGroupsAndOptions) { jdiAssert(element().groupsAndOptions(), Matchers.is(expectedGroupsAndOptions)); return this; } - @JDIAction("Assert that '{name}' has enabled values '{0}'") + @JDIAction(value = "Assert that '{name}' has enabled values '{0}'", isAssert = true) public MaterialSelectorAssert listEnabled(final Matcher> condition) { jdiAssert(element().listEnabled(), condition); return this; @@ -106,7 +106,7 @@ public MaterialSelectorAssert listEnabled(final String... values) { return listEnabled(hasItems(values)); } - @JDIAction("Assert that '{name}' has disabled values '{0}'") + @JDIAction(value = "Assert that '{name}' has disabled values '{0}'", isAssert = true) public MaterialSelectorAssert listDisabled(final Matcher> condition) { jdiAssert(element().listDisabled(), condition); return this; @@ -120,7 +120,7 @@ public MaterialSelectorAssert listDisabled(final String... values) { return listDisabled(hasItems(values)); } - @JDIAction("Assert that rgba({0}, {1}, {2}, {3}) is the specified color") + @JDIAction(value = "Assert that rgba({0}, {1}, {2}, {3}) is the specified color", isAssert = true) public MaterialSelectorAssert color(final int red, final int green, final int blue, final double a) { jdiAssert(element().color(red, green, blue, a), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; diff --git a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/NativeSelectorAssert.java b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/NativeSelectorAssert.java index be0ab82353..a81ff699fe 100644 --- a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/NativeSelectorAssert.java +++ b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/NativeSelectorAssert.java @@ -17,13 +17,13 @@ import static org.hamcrest.Matchers.hasItems; public class NativeSelectorAssert extends UIAssert { - @JDIAction("Assert that '{0}' option selected for '{name}'") + @JDIAction(value = "Assert that '{0}' option selected for '{name}'", isAssert = true) public NativeSelectorAssert selected(final Matcher condition) { jdiAssert(element().selected(), condition); return this; } - @JDIAction("Assert that '{0}' option selected for '{name}'") + @JDIAction(value = "Assert that '{0}' option selected for '{name}'", isAssert = true) public NativeSelectorAssert selected(final String option) { return selected(Matchers.is(option)); } @@ -37,17 +37,17 @@ public > NativeSelectorAssert value(final TEnum option) { return this; } - @JDIAction("Assert that '{name}' value '{0}'") + @JDIAction(value = "Assert that '{name}' value '{0}'", isAssert = true) public NativeSelectorAssert value(final Matcher condition) { return values(hasItem(condition)); } - @JDIAction("Assert that '{name}' has value '{0}'") + @JDIAction(value = "Assert that '{name}' has value '{0}'", isAssert = true) public NativeSelectorAssert value(final String value) { return values(hasItem(value)); } - @JDIAction("Assert that '{name}' values '{0}'") + @JDIAction(value = "Assert that '{name}' values '{0}'", isAssert = true) public NativeSelectorAssert values(final Matcher> condition) { jdiAssert(element().values(), condition); return this; @@ -61,7 +61,7 @@ public NativeSelectorAssert values(final List values) { return values(toStringArray(values)); } - @JDIAction("Assert that '{name}' values '{0}'") + @JDIAction(value = "Assert that '{name}' values '{0}'", isAssert = true) public NativeSelectorAssert values(final TextTypes type, final Matcher> condition) { jdiAssert(element().values(type), condition); return this; @@ -71,7 +71,7 @@ public NativeSelectorAssert values(final TextTypes type, final String... values) return values(type, hasItems(values)); } - @JDIAction("Assert that '{name}' has groups '{0}'") + @JDIAction(value = "Assert that '{name}' has groups '{0}'", isAssert = true) public NativeSelectorAssert groups(final Matcher> condition) { jdiAssert(element().groups(), condition); return this; @@ -85,13 +85,13 @@ public NativeSelectorAssert groups(final String... values) { return groups(hasItems(values)); } - @JDIAction("Assert that '{name}' has groups and options '{0}'") + @JDIAction(value = "Assert that '{name}' has groups and options '{0}'", isAssert = true) public NativeSelectorAssert groupsAndOptions(final Map> expectedGroupsAndOptions) { jdiAssert(element().groupsAndOptions(), Matchers.is(expectedGroupsAndOptions)); return this; } - @JDIAction("Assert that '{name}' has enabled values '{0}'") + @JDIAction(value = "Assert that '{name}' has enabled values '{0}'", isAssert = true) public NativeSelectorAssert listEnabled(final Matcher> condition) { jdiAssert(element().listEnabled(), condition); return this; @@ -105,7 +105,7 @@ public NativeSelectorAssert listEnabled(final String... values) { return listEnabled(hasItems(values)); } - @JDIAction("Assert that '{name}' has disabled values '{0}'") + @JDIAction(value = "Assert that '{name}' has disabled values '{0}'", isAssert = true) public NativeSelectorAssert listDisabled(final Matcher> condition) { jdiAssert(element().listDisabled(), condition); return this; diff --git a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/NestedDropdownMenuAssert.java b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/NestedDropdownMenuAssert.java index 1fcee666a1..55f84bc73b 100644 --- a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/NestedDropdownMenuAssert.java +++ b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/NestedDropdownMenuAssert.java @@ -8,31 +8,31 @@ import static com.epam.jdi.light.asserts.core.SoftAssert.jdiAssert; public class NestedDropdownMenuAssert extends UIAssert { - @JDIAction("Assert that {name} is expanded") + @JDIAction(value = "Assert that {name} is expanded", isAssert = true) public NestedDropdownMenuAssert isExpanded() { jdiAssert(element().isExpanded(), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that {name} is closed") + @JDIAction(value = "Assert that {name} is closed", isAssert = true) public NestedDropdownMenuAssert isClosed() { jdiAssert(element().isClosed(), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that {name} expected value '{0} and actual value '{1}' are equals") + @JDIAction(value = "Assert that {name} expected value '{0} and actual value '{1}' are equals", isAssert = true) public NestedDropdownMenuAssert checkValue(String expectedValue, String actualValue) { jdiAssert(element().checkValue(expectedValue, actualValue), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that {name} option '{0}' is disabled") + @JDIAction(value = "Assert that {name} option '{0}' is disabled", isAssert = true) public NestedDropdownMenuAssert isDisabledMenuWithIconsOption(String value) { jdiAssert(element().isDisabledMenuWithIconsOption(value), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that {name} option '{0}' is disabled") + @JDIAction(value = "Assert that {name} option '{0}' is disabled", isAssert = true) public NestedDropdownMenuAssert isDisabledNestedMenuOption(String... values) { jdiAssert(element().isDisabledNestedMenuOption(values), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; diff --git a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/PaginatorAssert.java b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/PaginatorAssert.java index d5997c86c5..a5b7062a30 100644 --- a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/PaginatorAssert.java +++ b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/PaginatorAssert.java @@ -11,48 +11,48 @@ import static com.jdiai.tools.StringUtils.format; public class PaginatorAssert extends UIAssert { - @JDIAction("Assert that '{name}' has '{0}' label") + @JDIAction(value = "Assert that '{name}' has '{0}' label", isAssert = true) public void label(String label) { jdiAssert(element().label(), Matchers.is(label)); } - @JDIAction("Assert that '{0}' option selected for '{name}'") + @JDIAction(value = "Assert that '{0}' option selected for '{name}'", isAssert = true) public void itemsPerPageSelected(final int number) { jdiAssert(element().selected(), Matchers.is(number)); } - @JDIAction("Assert that '{0}' options for '{name}'") + @JDIAction(value = "Assert that '{0}' options for '{name}'", isAssert = true) public void itemsPerPageList(final List options) { jdiAssert(element().options(), Matchers.is(options)); } - @JDIAction("Assert that range is '0' of '0' for '{name}'") + @JDIAction(value = "Assert that range is '0' of '0' for '{name}'", isAssert = true) public void range() { jdiAssert(element().range(), Matchers.is("0 of 0")); } - @JDIAction("Assert that range is '{0}' – '{1}' of '{2}' for '{name}'") + @JDIAction(value = "Assert that range is '{0}' – '{1}' of '{2}' for '{name}'", isAssert = true) public void range(final int from, final int to, final int total) { String expected = format("%d – %d of %d", from, to, total); jdiAssert(element().range(), Matchers.is(expected)); } - @JDIAction("Assert that previous button enabled for '{name}'") + @JDIAction(value = "Assert that previous button enabled for '{name}'", isAssert = true) public void previousEnabled() { jdiAssert(element().isPreviousEnabled(), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); } - @JDIAction("Assert that previous button disabled for '{name}'") + @JDIAction(value = "Assert that previous button disabled for '{name}'", isAssert = true) public void previousDisabled() { jdiAssert(element().isPreviousEnabled(), Matchers.is(false), "ERROR MESSAGE IS REQUIRED"); } - @JDIAction("Assert that next button enabled for '{name}'") + @JDIAction(value = "Assert that next button enabled for '{name}'", isAssert = true) public void nextEnabled() { jdiAssert(element().isNextEnabled(), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); } - @JDIAction("Assert that next button disabled for '{name}'") + @JDIAction(value = "Assert that next button disabled for '{name}'", isAssert = true) public void nextDisabled() { jdiAssert(element().isNextEnabled(), Matchers.is(false), "ERROR MESSAGE IS REQUIRED"); } diff --git a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/ProgressBarAssert.java b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/ProgressBarAssert.java index 315f293bbf..45b6f89c40 100644 --- a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/ProgressBarAssert.java +++ b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/ProgressBarAssert.java @@ -13,7 +13,7 @@ public class ProgressBarAssert extends UIAssert { - @JDIAction(value = "Get '{name}' value '{0}'") + @JDIAction(value = "Get '{name}' value '{0}'", isAssert = true) public ProgressBarAssert value(Matcher value) { jdiAssert(element().value(), value); return this; @@ -23,7 +23,7 @@ public ProgressBarAssert value(int value) { return value(Matchers.is(value)); } - @JDIAction("Get '{name}' min value '{0}'") + @JDIAction(value = "Get '{name}' min value '{0}'", isAssert = true) public ProgressBarAssert min(Matcher condition) { jdiAssert(element().min(), condition); return this; @@ -33,7 +33,7 @@ public ProgressBarAssert min(int minValue) { return min(Matchers.is(minValue)); } - @JDIAction("Get '{name}' max value '{0}'") + @JDIAction(value = "Get '{name}' max value '{0}'", isAssert = true) public ProgressBarAssert max(Matcher condition) { jdiAssert(element().max(), condition); return this; @@ -43,7 +43,7 @@ public ProgressBarAssert max(int maxValue) { return max(Matchers.is(maxValue)); } - @JDIAction(value = "Get '{name}' mode value '{0}'") + @JDIAction(value = "Get '{name}' mode value '{0}'", isAssert = true) public ProgressBarAssert mode(Matcher value) { jdiAssert(element().mode(), value); return this; @@ -53,7 +53,7 @@ public ProgressBarAssert mode(ProgressBarModes mode) { return mode(Matchers.is(mode.getMode())); } - @JDIAction("Assert that '{name}' does not appear during '{0}' seconds") + @JDIAction(value = "Assert that '{name}' does not appear during '{0}' seconds", isAssert = true) public ProgressBarAssert disappear(int timeoutSec) { boolean result = new Timer(timeoutSec * 1000L) .wait(() -> element().isHidden()); @@ -61,12 +61,12 @@ public ProgressBarAssert disappear(int timeoutSec) { return this; } - @JDIAction("Assert that '{name}' visible on th screen") + @JDIAction(value = "Assert that '{name}' visible on th screen", isAssert = true) public ProgressBarAssert color(ProgressBarColors color) { return cssClass(color.getColor()); } - @JDIAction("Assert that '{name}' has buffer value '{0}'") + @JDIAction(value = "Assert that '{name}' has buffer value '{0}'", isAssert = true) public ProgressBarAssert bufferValue(Matcher value) { jdiAssert(element().bufferValue(), value); return this; diff --git a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/ProgressSpinnerAssert.java b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/ProgressSpinnerAssert.java index 5a625ffbd7..f21abdcffe 100644 --- a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/ProgressSpinnerAssert.java +++ b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/ProgressSpinnerAssert.java @@ -10,21 +10,21 @@ public class ProgressSpinnerAssert extends UIAssert { - @JDIAction("Assert that '{name}' has color '{0}'") + @JDIAction(value = "Assert that '{name}' has color '{0}'", isAssert = true) public ProgressSpinnerAssert color(String color) { String actualColor = element().color(); jdiAssert(actualColor, Matchers.equalTo(color), actualColor + " is not equal to " + color); return this; } - @JDIAction(value = "Assert that '{name}' has mode value '{0}'") + @JDIAction(value = "Assert that '{name}' has mode value '{0}'", isAssert = true) public ProgressSpinnerAssert mode(ProgressSpinnerModes mode) { String actualMode = element().mode(); jdiAssert(actualMode, Matchers.equalTo(mode.getMode()), actualMode + " is not equal to " + mode.getMode()); return this; } - @JDIAction(value = "Assert that '{name}' has diameter '{0}'") + @JDIAction(value = "Assert that '{name}' has diameter '{0}'", isAssert = true) public ProgressSpinnerAssert diameter(String diameter) { String height = element().height(); String width = element().width(); @@ -33,14 +33,14 @@ public ProgressSpinnerAssert diameter(String diameter) { return this; } - @JDIAction(value = "Assert that '{name}' has stroke width '{0}'") + @JDIAction(value = "Assert that '{name}' has stroke width '{0}'", isAssert = true) public ProgressSpinnerAssert strokeWidth(String strokeWidth) { String actualStrokeWidth = element().strokeWidth(); jdiAssert(actualStrokeWidth, Matchers.equalTo(strokeWidth), actualStrokeWidth + " is not equal to " + actualStrokeWidth); return this; } - @JDIAction(value = "Assert that '{name}' has value '{0}'") + @JDIAction(value = "Assert that '{name}' has value '{0}'", isAssert = true) public ProgressSpinnerAssert value(int value) { int actualValue = element().value(); jdiAssert(actualValue, Matchers.equalTo(value), actualValue + " is not equal to " + value); diff --git a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/SlideToggleAssert.java b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/SlideToggleAssert.java index 5e7bbd4d21..8791990e32 100644 --- a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/SlideToggleAssert.java +++ b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/SlideToggleAssert.java @@ -1,49 +1,55 @@ package com.epam.jdi.light.angular.asserts; -import static com.epam.jdi.light.asserts.core.SoftAssert.jdiAssert; - import com.epam.jdi.light.angular.elements.common.SlideToggle; 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 SlideToggleAssert extends UIAssert { @Override - @JDIAction("Assert that '{name}' is disabled") + @JDIAction(value = "Assert that '{name}' is disabled", isAssert = true) public SlideToggleAssert disabled() { jdiAssert(element().isDisabled(), Matchers.is(true), "Slide toggle is enabled"); return this; } @Override - @JDIAction("Assert that '{name}' is disabled") + @JDIAction(value = "Assert that '{name}' is disabled", isAssert = true) public SlideToggleAssert enabled() { jdiAssert(element().isDisabled(), Matchers.is(false), "Slide toggle is disabled"); return this; } - @JDIAction("'{name}' element label is in before position") + @JDIAction(value = "'{name}' element label is in before position", isAssert = true) public SlideToggleAssert labelBeforePosition() { jdiAssert(element().hasLabelBeforePosition(), Matchers.is(true), - "Slide toggle label is not in before position"); + "Slide toggle label is not in before position"); return this; } - @JDIAction("'{name}' element label is in after position") + @JDIAction(value = "'{name}' element label is in after position", isAssert = true) public SlideToggleAssert labelAfterPosition() { jdiAssert(element().hasLabelBeforePosition(), Matchers.is(false), - "Slide toggle label is not in after position"); + "Slide toggle label is not in after position"); + return this; + } + + @JDIAction("'{name}' has label with value '{0}'") + public SlideToggleAssert label(String labelText) { + jdiAssert(element().label().getValue(), Matchers.is(labelText)); return this; } - @JDIAction("'{name}' is selected") + @JDIAction(value = "'{name}' is selected", isAssert = true) public SlideToggleAssert selected() { jdiAssert(element().isSelected(), Matchers.is(true), "Slide toggle is not selected"); return this; } - @JDIAction("'{name}' is not selected") + @JDIAction(value = "'{name}' is not selected", isAssert = true) public SlideToggleAssert notSelected() { jdiAssert(element().isSelected(), Matchers.is(false), "Slide toggle is selected"); return this; diff --git a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/SliderAssert.java b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/SliderAssert.java index e4b19ad6ef..02e1450b5d 100644 --- a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/SliderAssert.java +++ b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/SliderAssert.java @@ -9,7 +9,7 @@ import static com.epam.jdi.light.asserts.core.SoftAssert.jdiAssert; public class SliderAssert extends UIAssert { - @JDIAction("Assert that '{name}' volume {0}") + @JDIAction(value = "Assert that '{name}' volume {0}", isAssert = true) public SliderAssert value(Matcher value) { jdiAssert(element().value(), value); return this; @@ -19,7 +19,7 @@ public SliderAssert value(double value) { return value(Matchers.is(value)); } - @JDIAction("Assert that '{name}' min volume is {0}") + @JDIAction(value = "Assert that '{name}' min volume is {0}", isAssert = true) public SliderAssert minValue(Matcher min) { jdiAssert(element().min(), min); return this; @@ -30,7 +30,7 @@ public SliderAssert minValue(double minValue) { } - @JDIAction("Assert that '{name}' max volume {0}") + @JDIAction(value = "Assert that '{name}' max volume {0}", isAssert = true) public SliderAssert maxValue(Matcher max) { jdiAssert(element().max(), max); return this; @@ -40,20 +40,20 @@ public SliderAssert maxValue(double maxValue) { return maxValue(Matchers.is(maxValue)); } - @JDIAction("Assert that '{name}' orientation is vertical") + @JDIAction(value = "Assert that '{name}' orientation is vertical", isAssert = true) public SliderAssert orientation(String orientation) { jdiAssert(element().orientation(), Matchers.is(orientation)); return this; } - @JDIAction("Assert that '{name}' axis are inverted") + @JDIAction(value = "Assert that '{name}' axis are inverted", isAssert = true) public SliderAssert inverted(boolean value) { jdiAssert(element().isInverted(), Matchers.is(value)); return this; } - @JDIAction("Assert that '{name'} thumb label is displayed") + @JDIAction(value = "Assert that '{name'} thumb label is displayed", isAssert = true) public SliderAssert thumbLabelDisplayed(boolean value) { jdiAssert(element().isThumbLabelDisplayed(), Matchers.is(value)); return this; diff --git a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/SnackbarAssert.java b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/SnackbarAssert.java index 29031927b2..2f2d0da173 100644 --- a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/SnackbarAssert.java +++ b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/SnackbarAssert.java @@ -9,19 +9,19 @@ public class SnackbarAssert extends UIAssert { - @JDIAction("Assert that '{name}' has message '{0}'") + @JDIAction(value = "Assert that '{name}' has message '{0}'", isAssert = true) public SnackbarAssert message(String expected) { jdiAssert(element().getMessageText(), Matchers.is(expected)); return this; } - @JDIAction("Assert that '{name}' has no action") + @JDIAction(value = "Assert that '{name}' has no action", isAssert = true) public SnackbarAssert action() { jdiAssert(element().isActionDisplayed(), Matchers.is(false), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name}' has action {0}") + @JDIAction(value = "Assert that '{name}' has action {0}", isAssert = true) public SnackbarAssert action(String expected) { jdiAssert(element().getActionText(), Matchers.is(expected)); return this; diff --git a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/SortingOverviewAssert.java b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/SortingOverviewAssert.java index 2cf41a9dff..c234bf70a8 100644 --- a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/SortingOverviewAssert.java +++ b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/SortingOverviewAssert.java @@ -9,13 +9,13 @@ public class SortingOverviewAssert extends UIAssert { - @JDIAction("Assert that table is visible") + @JDIAction(value = "Assert that table is visible", isAssert = true) public SortingOverviewAssert tableIsVisible() { jdiAssert(element().isHeadersDisplayed(), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert arrow button clicked") + @JDIAction(value = "Assert arrow button clicked", isAssert = true) public SortingOverviewAssert arrowButtonClicked() { jdiAssert(element().headerButtonIsClicked(), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; diff --git a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/TabGroupAssert.java b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/TabGroupAssert.java index ee54c295eb..769f40a299 100644 --- a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/TabGroupAssert.java +++ b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/TabGroupAssert.java @@ -11,37 +11,37 @@ public class TabGroupAssert extends UIAssert { - @JDIAction("Assert that '{name}' has '{0}' tabs count") + @JDIAction(value = "Assert that '{name}' has '{0}' tabs count", isAssert = true) public TabGroupAssert assertTabsCount(int tabsCountForTest) { jdiAssert(element().getTabsCount(), Matchers.is(tabsCountForTest)); return this; } - @JDIAction("Assert that '{name}' has '{0}' value") + @JDIAction(value = "Assert that '{name}' has '{0}' value", isAssert = true) public TabGroupAssert assertTabPanelContent(String stringForTest) { jdiAssert(element().tabPanelContainsValue(stringForTest), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name}' has '{0}' values") + @JDIAction(value = "Assert that '{name}' has '{0}' values", isAssert = true) public TabGroupAssert assertTabsTitles(List condition) { jdiAssert(element().tabsTitlesContainValues(condition), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name}' is highlighted when '{0}' tab number is provided") + @JDIAction(value = "Assert that '{name}' is highlighted when '{0}' tab number is provided", isAssert = true) public TabGroupAssert assertTabIsHighlighted(int tabNumber) { jdiAssert(element().tabIsHighlighted(tabNumber), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name}' has '{0}' values") + @JDIAction(value = "Assert that '{name}' has '{0}' values", isAssert = true) public TabGroupAssert assertTabsLinksTitles(List condition) { jdiAssert(element().tabsLinksTitlesContainValues(condition), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name}' is highlighted when '{0}' tab number is provided") + @JDIAction(value = "Assert that '{name}' is highlighted when '{0}' tab number is provided", isAssert = true) public TabGroupAssert assertTabWithLinkIsHighlighted(String tabTitle) { jdiAssert(element().tabWithLinkIsHighlighted(tabTitle), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; diff --git a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/TextAreaAssert.java b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/TextAreaAssert.java index 64a024b27c..ed74be39e7 100644 --- a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/TextAreaAssert.java +++ b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/TextAreaAssert.java @@ -9,50 +9,50 @@ public class TextAreaAssert extends UIAssert { - @JDIAction("Assert that '{name}' has attribute auto-size") + @JDIAction(value = "Assert that '{name}' has attribute auto-size", isAssert = true) public TextAreaAssert autoSize() { jdiAssert(element().hasAutoSize(), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name}' has typed text '{0}' in input field") + @JDIAction(value = "Assert that '{name}' has typed text '{0}' in input field", isAssert = true) public TextAreaAssert value(String text) { jdiAssert(element().getValue(), Matchers.containsString(text)); return this; } - @JDIAction("Assert that '{name}' has placeholder '{0}'") + @JDIAction(value = "Assert that '{name}' has placeholder '{0}'", isAssert = true) public TextAreaAssert placeholder(String placeholder) { jdiAssert(element().placeholder(), Matchers.containsString(placeholder)); return this; } - @JDIAction("Assert that '{name}' has height '{0}'") + @JDIAction(value = "Assert that '{name}' has height '{0}'", isAssert = true) public TextAreaAssert height(int px) { jdiAssert(element().attr("style").contains(String.format("height: %spx", px)), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name}' has scroll up") + @JDIAction(value = "Assert that '{name}' has scroll up", isAssert = true) public TextAreaAssert scrollUp() { jdiAssert(element().hasScrollUp(), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name}' has no scroll up") + @JDIAction(value = "Assert that '{name}' has no scroll up", isAssert = true) public TextAreaAssert noScrollUp() { jdiAssert(element().hasScrollUp(), Matchers.is(false), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name}' has scroll down") + @JDIAction(value = "Assert that '{name}' has scroll down", isAssert = true) public TextAreaAssert scrollDown() { jdiAssert(element().hasScrollDown(), Matchers.is(true), "ERROR MESSAGE IS REQUIRED"); return this; } - @JDIAction("Assert that '{name}' has no scroll down") + @JDIAction(value = "Assert that '{name}' has no scroll down", isAssert = true) public TextAreaAssert noScrollDown() { jdiAssert(element().hasScrollDown(), Matchers.is(false), "ERROR MESSAGE IS REQUIRED"); return this; diff --git a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/TooltipAssert.java b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/TooltipAssert.java index 29aac2e078..6f9bc2e126 100644 --- a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/TooltipAssert.java +++ b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/TooltipAssert.java @@ -10,19 +10,19 @@ public class TooltipAssert extends UIAssert { - @JDIAction("Assert that '{name}' has '{0}' text") + @JDIAction(value = "Assert that '{name}' has '{0}' text", isAssert = true) public TooltipAssert assertTooltipText(String text) { jdiAssert(element().text(), Matchers.is(text)); return this; } - @JDIAction("Assert that '{name}' has '{0}' color") + @JDIAction(value = "Assert that '{name}' has '{0}' color", isAssert = true) public TooltipAssert assertTooltipColor(String color) { jdiAssert(element().color(), Matchers.is(color)); return this; } - @JDIAction("Assert that '{name}' has '{0}' position relative to '{1}' ") + @JDIAction(value = "Assert that '{name}' has '{0}' position relative to '{1}' ", isAssert = true) public TooltipAssert assertTooltipPosition(Tooltip.Position position, UIBaseElement e) { jdiAssert(element().position(e), Matchers.is(position)); return this; 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 53d1fdca43..57dec8a895 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 @@ -11,58 +11,58 @@ public class RadioButtonAssert extends UIAssert { @Override - @JDIAction("Assert that '{name}' is disabled") + @JDIAction(value = "Assert that '{name}' is disabled", isAssert = true) public RadioButtonAssert disabled() { jdiAssert(element().isDisabled(), Matchers.is(true), "Element is enabled"); return this; } @Override - @JDIAction("Assert that '{name}' is disabled") + @JDIAction(value = "Assert that '{name}' is disabled", isAssert = true) public RadioButtonAssert enabled() { jdiAssert(element().isDisabled(), Matchers.is(false), "Element is disabled"); return this; } - @JDIAction("Assert that '{name}' color is '{0}'") + @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("Assert that '{name}' color is '{0}'") + @JDIAction(value = "Assert that '{name}' color is '{0}'", isAssert = true) public RadioButtonAssert color(String expectedColor) { jdiAssert(element().color(), Matchers.is(expectedColor)); return this; } - @JDIAction("'{name}' element label is in before position") + @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"); return this; } - @JDIAction("'{name}' element label is in before position") + @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"); return this; } - @JDIAction("'{name}' is checked") + @JDIAction(value = "'{name}' is checked", isAssert = true) public RadioButtonAssert checked() { jdiAssert(element().isChecked(), Matchers.is(true), "Radio button is not checked"); return this; } - @JDIAction("'{name}' is not checked") + @JDIAction(value = "'{name}' is not checked", isAssert = true) public RadioButtonAssert notChecked() { jdiAssert(element().isChecked(), Matchers.is(false), "Radio button is checked"); return this; } - @JDIAction("'{name}' has label with value '{0}'") + @JDIAction(value = "'{name}' has label with value '{0}'", isAssert = true) public RadioButtonAssert label(String value) { jdiAssert(element().label().getValue(), Matchers.is(value)); return this; diff --git a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/radiobuttons/RadioGroupAssert.java b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/radiobuttons/RadioGroupAssert.java index 232e4d8d91..4dfa41c12a 100644 --- a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/radiobuttons/RadioGroupAssert.java +++ b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/radiobuttons/RadioGroupAssert.java @@ -9,26 +9,26 @@ public class RadioGroupAssert extends UISelectAssert { - @JDIAction("'{name}' is checked when '{0}' radio button value is provided") + @JDIAction(value = "'{name}' is checked when '{0}' radio button value is provided", isAssert = true) public RadioGroupAssert checked(String value) { jdiAssert(element().isChecked(value), Matchers.is(true), "Radio button is not checked"); return this; } - @JDIAction("'{name}' is not checked when '{0}' radio button value is provided") + @JDIAction(value = "'{name}' is not checked when '{0}' radio button value is provided", isAssert = true) public RadioGroupAssert notChecked(String value) { jdiAssert(element().isChecked(value), Matchers.is(false), "Radio button is checked"); return this; } - @JDIAction("'{name}' label is in before position") + @JDIAction(value = "'{name}' label is in before position", isAssert = true) public RadioGroupAssert groupBeforePosition() { jdiAssert(element().isLabelsBeforePosition(), Matchers.is(true), "Radio group label is not in before position"); return this; } - @JDIAction("'{name}' label is in after position") + @JDIAction(value = "'{name}' label is in after position", isAssert = true) public RadioGroupAssert groupAfterPosition() { jdiAssert(element().isLabelsBeforePosition(), Matchers.is(false), "Radio group label is not in after position"); @@ -36,42 +36,42 @@ public RadioGroupAssert groupAfterPosition() { } - @JDIAction("'{name}' is disabled") + @JDIAction(value = "'{name}' is disabled", isAssert = true) public RadioGroupAssert disabled() { jdiAssert(element().isDisabled(), Matchers.is(true), "Radio group is enabled"); return this; } - @JDIAction("'{name}' is enabled") + @JDIAction(value = "'{name}' is enabled", isAssert = true) public RadioGroupAssert enabled() { jdiAssert(element().isDisabled(), Matchers.is(false), "Radio group is disabled"); return this; } - @JDIAction("'{name}' is required") + @JDIAction(value = "'{name}' is required", isAssert = true) public RadioGroupAssert required() { jdiAssert(element().isRequired(), Matchers.is(true), "Radio group is not required"); return this; } - @JDIAction("'{name}' is not required") + @JDIAction(value = "'{name}' is not required", isAssert = true) public RadioGroupAssert notRequired() { jdiAssert(element().isRequired(), Matchers.is(false), "Radio group is required"); return this; } - @JDIAction("'{name}' has checked radio button") + @JDIAction(value = "'{name}' has checked radio button", isAssert = true) public RadioGroupAssert checkedRadioButton() { jdiAssert(element().checkedRadioButton(), Matchers.notNullValue(), "There is no checked radio button in the group"); return this; } - @JDIAction("'{name}' has no checked radio button") + @JDIAction(value = "'{name}' has no checked radio button", isAssert = true) public RadioGroupAssert noCheckedRadioButton() { jdiAssert(element().checkedRadioButton(), Matchers.nullValue(), "There is checked radio button in the group"); diff --git a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/elements/common/SlideToggle.java b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/elements/common/SlideToggle.java index 098c1d67ff..a794a5b80a 100644 --- a/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/elements/common/SlideToggle.java +++ b/jdi-light-angular/src/main/java/com/epam/jdi/light/angular/elements/common/SlideToggle.java @@ -3,17 +3,21 @@ import com.epam.jdi.light.angular.asserts.SlideToggleAssert; import com.epam.jdi.light.common.JDIAction; import com.epam.jdi.light.elements.base.UIBaseElement; +import com.epam.jdi.light.elements.common.Label; import com.epam.jdi.light.elements.common.UIElement; +import com.epam.jdi.light.elements.interfaces.base.HasLabel; /** * To see an example of SlideToggle web element please visit https://material.angular * .io/components/slide-toggle/overview. */ -public class SlideToggle extends UIBaseElement { +public class SlideToggle extends UIBaseElement implements HasLabel { private static final String FORM_FIELD_LOCATOR = ".mdc-form-field"; + private static final String BUTTON_LOCATOR = "button[role=switch]"; + public boolean isSelected() { return core().hasClass("mat-checked") || core().hasClass("mat-mdc-slide-toggle-checked"); } @@ -29,20 +33,27 @@ public boolean isDisabled() { return e.hasAttribute("disabled"); } - @JDIAction("'{name}' element label is in before position") + @Override + public Label label() { + return new Label().setCore(Label.class, core().find(".//label")); + } + + @JDIAction("Get if '{name}' element label is in before position") public boolean hasLabelBeforePosition() { return core().find(FORM_FIELD_LOCATOR).hasClass("mdc-form-field--align-end"); } + @JDIAction("Turn on the '{name}' switch button") public void check() { if (!isSelected()) { - core().find(FORM_FIELD_LOCATOR).click(); + core().find(BUTTON_LOCATOR).click(); } } + @JDIAction("Turn off the '{name}' switch button") public void uncheck() { if (isSelected()) { - core().find(FORM_FIELD_LOCATOR).click(); + core().find(BUTTON_LOCATOR).click(); } } diff --git a/jdi-light-bootstrap-tests/src/test/java/io/github/epam/testng/TestNGListener.java b/jdi-light-bootstrap-tests/src/test/java/io/github/epam/testng/TestNGListener.java index eda1de04f8..817767497a 100644 --- a/jdi-light-bootstrap-tests/src/test/java/io/github/epam/testng/TestNGListener.java +++ b/jdi-light-bootstrap-tests/src/test/java/io/github/epam/testng/TestNGListener.java @@ -19,7 +19,7 @@ import static java.lang.System.currentTimeMillis; public class TestNGListener implements IInvokedMethodListener { - private Long start = currentTimeMillis(); + private long start = currentTimeMillis(); @Override public void beforeInvocation(IInvokedMethod m, ITestResult tr) { if (m.isTestMethod()) { diff --git a/jdi-light-core/pom.xml b/jdi-light-core/pom.xml index 898cec6591..f63563fee4 100644 --- a/jdi-light-core/pom.xml +++ b/jdi-light-core/pom.xml @@ -66,7 +66,7 @@ io.github.bonigarcia webdrivermanager - 5.6.2 + 5.6.3 com.github.docker-java diff --git a/jdi-light-core/src/main/java/com/epam/jdi/light/actions/ActionHelper.java b/jdi-light-core/src/main/java/com/epam/jdi/light/actions/ActionHelper.java index d8f14d0547..5a894820ee 100644 --- a/jdi-light-core/src/main/java/com/epam/jdi/light/actions/ActionHelper.java +++ b/jdi-light-core/src/main/java/com/epam/jdi/light/actions/ActionHelper.java @@ -747,12 +747,12 @@ public static ActionObject newInfo(ProceedingJoinPoint jp, String name) { } private static long previousThread = -1; public static JAction CHECK_MULTI_THREAD = () -> { - if (previousThread == -1) + if (previousThread == -1) { previousThread = currentThread().getId(); - else { + } else { if (previousThread != currentThread().getId()) { MULTI_THREAD = true; - logger.trace("switch to getMultiThreadDriver"); + logger.trace("Switch to getMultiThreadDriver"); DRIVER.getFunc = WebDriverFactory::getMultiThreadDriver; CHECK_MULTI_THREAD = () -> {}; if (GETTING_DRIVER) { diff --git a/jdi-light-core/src/main/java/com/epam/jdi/light/driver/get/DriverInfo.java b/jdi-light-core/src/main/java/com/epam/jdi/light/driver/get/DriverInfo.java index 8ab2eef4df..3c1f191508 100644 --- a/jdi-light-core/src/main/java/com/epam/jdi/light/driver/get/DriverInfo.java +++ b/jdi-light-core/src/main/java/com/epam/jdi/light/driver/get/DriverInfo.java @@ -92,13 +92,14 @@ private WebDriver setupLocal() { Sleeper.SYSTEM_SLEEPER.sleep(Duration.ofMillis(1000)); return this.setupLocal(); } - isLoading = isBlank(DRIVER.path); + isLoading = isBlank(getProperty(properties)); String driverPath = isLoading ? DOWNLOAD_DRIVER_FUNC.execute(downloadType, getDriverPlatform(), DRIVER.version) - : path.execute(); + : getProperty(properties); logger.info("Use driver path: " + driverPath); logger.trace("setProperty(properties:%s, driverPath:%s)", properties, driverPath); setProperty(properties, driverPath); + DRIVER.path = driverPath; Capabilities caps = getCapabilities(); logger.trace("getDriver.execute(getCapabilities())", caps); isLoading = false; @@ -119,7 +120,8 @@ private WebDriver setupLocal() { private WebDriver tryToDownloadDriver() { try { - DOWNLOAD_DRIVER_FUNC.execute(downloadType, getDriverPlatform(), getBelowVersion()); + String dPath = DOWNLOAD_DRIVER_FUNC.execute(downloadType, getDriverPlatform(), getBelowVersion()); + setProperty(properties, dPath); return getDriver.execute(getCapabilities()); } catch (Throwable ex) { throw exception(ex, "Failed to download driver"); diff --git a/jdi-light-core/src/main/java/com/epam/jdi/light/elements/common/Cookies.java b/jdi-light-core/src/main/java/com/epam/jdi/light/elements/common/Cookies.java index 2f5252dbcc..55ef1b261e 100644 --- a/jdi-light-core/src/main/java/com/epam/jdi/light/elements/common/Cookies.java +++ b/jdi-light-core/src/main/java/com/epam/jdi/light/elements/common/Cookies.java @@ -73,7 +73,9 @@ public static void setCookies(Collection cookies) { */ @JDIAction("Delete all cookies") public static void clearAllCookies() { - manage().deleteAllCookies(); + try { + manage().deleteAllCookies(); + } catch (Exception ignore) { } } /** * Clear browsers cache diff --git a/jdi-light-core/src/main/java/com/epam/jdi/light/elements/composite/WebPage.java b/jdi-light-core/src/main/java/com/epam/jdi/light/elements/composite/WebPage.java index 87a5d11872..bb56615dc8 100644 --- a/jdi-light-core/src/main/java/com/epam/jdi/light/elements/composite/WebPage.java +++ b/jdi-light-core/src/main/java/com/epam/jdi/light/elements/composite/WebPage.java @@ -110,15 +110,25 @@ public static void checkUrl(String url) { init(); new WebPage(url).checkOpened(); } - @JDIAction + @JDIAction(value = "Verify that url contains {0}") public static boolean verifyUrl(String url) { - init(); - return getUrl().contains(url); + try { + init(); + return getUrl().contains(url); + } catch (Throwable ex) { + logger.error("Failed during verify url", ex); + } + return false; } - @JDIAction + @JDIAction(value = "Verify that title contains {0}") public static boolean verifyTitle(String title) { - init(); - return getTitle().contains(title); + try { + init(); + return getTitle().contains(title); + } catch (Throwable ex) { + logger.error("Failed during verify url", ex); + } + return false; } public static void checkTitle(String title) { init(); diff --git a/jdi-light-core/src/main/java/com/epam/jdi/light/elements/interfaces/base/HasPlaceholder.java b/jdi-light-core/src/main/java/com/epam/jdi/light/elements/interfaces/base/HasPlaceholder.java index 3cf46cf579..2344d66fa1 100644 --- a/jdi-light-core/src/main/java/com/epam/jdi/light/elements/interfaces/base/HasPlaceholder.java +++ b/jdi-light-core/src/main/java/com/epam/jdi/light/elements/interfaces/base/HasPlaceholder.java @@ -5,5 +5,7 @@ * Email: roman.iovlev.jdi@gmail.com; Skype: roman.iovlev */ public interface HasPlaceholder extends ICoreElement { - default String placeholder() { return core().placeholder(); } + default String placeholder() { + return core().placeholder(); + } } diff --git a/jdi-light-html-tests/src/test/java/io/github/epam/testng/TestNGListener.java b/jdi-light-html-tests/src/test/java/io/github/epam/testng/TestNGListener.java index 5cf331b703..58adc16296 100644 --- a/jdi-light-html-tests/src/test/java/io/github/epam/testng/TestNGListener.java +++ b/jdi-light-html-tests/src/test/java/io/github/epam/testng/TestNGListener.java @@ -21,7 +21,7 @@ import static java.lang.System.currentTimeMillis; public class TestNGListener implements IInvokedMethodListener { - private Long start = currentTimeMillis(); + private long start = currentTimeMillis(); @Override public void beforeInvocation(IInvokedMethod m, ITestResult tr) { diff --git a/jdi-light-material-ui-tests/src/test/java/io/github/epam/testng/TestNGListener.java b/jdi-light-material-ui-tests/src/test/java/io/github/epam/testng/TestNGListener.java index 36b106c135..9d0056ad69 100644 --- a/jdi-light-material-ui-tests/src/test/java/io/github/epam/testng/TestNGListener.java +++ b/jdi-light-material-ui-tests/src/test/java/io/github/epam/testng/TestNGListener.java @@ -16,7 +16,7 @@ import static java.lang.System.currentTimeMillis; public class TestNGListener implements IInvokedMethodListener { - private Long start = currentTimeMillis(); + private long start = currentTimeMillis(); @Override public void beforeInvocation(IInvokedMethod m, ITestResult tr) { diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/AvatarAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/AvatarAssert.java index a663f3b0af..e3578a3cc7 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/AvatarAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/AvatarAssert.java @@ -18,13 +18,13 @@ public class AvatarAssert extends UIAssert implements ITex HasImageAssert { @Override - @JDIAction("Assert that '{name}' text {0}") + @JDIAction(value = "Assert that '{name}' text {0}", isAssert = true) public AvatarAssert text(Matcher condition) { jdiAssert(element().getText(), condition); return this; } - @JDIAction("Assert that '{name}' variant is {0}") + @JDIAction(value = "Assert that '{name}' variant is {0}", isAssert = true) public AvatarAssert variant(VariantType value) { jdiAssert(element().variant(), equalTo(value)); return this; diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/BadgeAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/BadgeAssert.java index a494157970..7e9c2b18c7 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/BadgeAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/BadgeAssert.java @@ -15,7 +15,7 @@ public class BadgeAssert extends PositionAssert implements ITextAssert { @Override - @JDIAction("Assert that '{name}' text {0}") + @JDIAction(value = "Assert that '{name}' text {0}", isAssert = true) public BadgeAssert text(Matcher condition) { jdiAssert(element().text(), condition); return this; @@ -26,13 +26,13 @@ public BadgeAssert text(Matcher condition) { * * @return this {@link BadgeAssert} instance */ - @JDIAction("Assert that '{name}' has a dot") + @JDIAction(value = "Assert that '{name}' has a dot", isAssert = true) public BadgeAssert dot() { jdiAssert(element().hasDot(), Matchers.is(true), "Badge has not dot"); return this; } - @JDIAction("Assert that '{name}' is without a dot") + @JDIAction(value = "Assert that '{name}' is without a dot", isAssert = true) public BadgeAssert noDot() { jdiAssert(element().hasDot(), Matchers.is(false), "Badge has dot"); return this; diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/ChipAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/ChipAssert.java index 00adee4bcf..268f758d01 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/ChipAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/ChipAssert.java @@ -17,7 +17,7 @@ public class ChipAssert extends UIAssert { * * @return this {@link ChipAssert} instance */ - @JDIAction("Assert that '{name}' is deletable") + @JDIAction(value = "Assert that '{name}' is deletable", isAssert = true) public ChipAssert deletable() { jdiAssert(element().isDeletable(), Matchers.is(true), "Chip is not deletable"); return this; @@ -28,7 +28,7 @@ public ChipAssert deletable() { * * @return this {@link ChipAssert} instance */ - @JDIAction("Assert that '{name}' is clickable") + @JDIAction(value = "Assert that '{name}' is clickable", isAssert = true) public ChipAssert clickable() { jdiAssert(element().isClickable(), Matchers.is(true), "Chip is not clickable"); return this; @@ -39,7 +39,7 @@ public ChipAssert clickable() { * * @return this {@link ChipAssert} instance */ - @JDIAction("Assert that '{name}' is a link") + @JDIAction(value = "Assert that '{name}' is a link", isAssert = true) public ChipAssert link() { jdiAssert(element().isLink(), Matchers.is(true), "Chip is not a link"); return this; @@ -51,7 +51,7 @@ public ChipAssert link() { * @param href expected href * @return this {@link ChipAssert} instance */ - @JDIAction("Assert that '{name}' has href '{0}'") + @JDIAction(value = "Assert that '{name}' has href '{0}'", isAssert = true) public ChipAssert href(String href) { jdiAssert(element().href(), Matchers.is(href)); return this; diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/DividerAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/DividerAssert.java index 5a5f10bc85..5ad1990e0b 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/DividerAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/DividerAssert.java @@ -17,7 +17,7 @@ public class DividerAssert extends UIAssert { * * @return this {@link DividerAssert} instance */ - @JDIAction("Assert that '{name}' is inset") + @JDIAction(value = "Assert that '{name}' is inset", isAssert = true) public DividerAssert inset() { jdiAssert(element().isInset(), Matchers.is(true), "Divider is not inset"); return this; @@ -28,7 +28,7 @@ public DividerAssert inset() { * * @return this {@link Divider} instance */ - @JDIAction("Assert that '{name}' is vertical") + @JDIAction(value = "Assert that '{name}' is vertical", isAssert = true) public DividerAssert vertical() { jdiAssert(element().isVertical(), Matchers.is(true), "Divider is not vertical"); return this; diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/IconAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/IconAssert.java index 349e6efc9d..3daaf3f388 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/IconAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/IconAssert.java @@ -18,7 +18,7 @@ public class IconAssert extends UIAssert { * @param height expected icon height * @return this {@link IconAssert} instance */ - @JDIAction("Assert that {name} height is {0}") + @JDIAction(value = "Assert that {name} height is {0}", isAssert = true) public IconAssert height(int height) { jdiAssert(element().getSize().getHeight(), Matchers.is(height)); return this; @@ -30,7 +30,7 @@ public IconAssert height(int height) { * @param width expected icon width * @return this {@link IconAssert} instance */ - @JDIAction("Assert that {name} width is {0}") + @JDIAction(value = "Assert that {name} width is {0}", isAssert = true) public IconAssert width(int width) { jdiAssert(element().getSize().getWidth(), Matchers.is(width)); return this; diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/ListCommonAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/ListCommonAssert.java index 061df81689..831f5153df 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/ListCommonAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/ListCommonAssert.java @@ -20,7 +20,7 @@ public abstract class ListCommonAssert, E extends IMUIL * @param size expected size * @return the same assert for chaining */ - @JDIAction("Assert that '{name}' has size {0}") + @JDIAction(value = "Assert that '{name}' has size {0}", isAssert = true) public A size(int size) { jdiAssert(element().size(), Matchers.is(size)); return (A) this; @@ -30,7 +30,7 @@ public A size(int size) { * Checks that list is empty. * @return the same assert for chaining */ - @JDIAction("Assert that '{name}' is empty") + @JDIAction(value = "Assert that '{name}' is empty", isAssert = true) public A empty() { jdiAssert(element().isEmpty(), Matchers.is(true), "List is not empty"); return (A) this; @@ -40,7 +40,7 @@ public A empty() { * Checks that list is not empty. * @return the same assert for chaining */ - @JDIAction("Assert that '{name}' is not empty") + @JDIAction(value = "Assert that '{name}' is not empty", isAssert = true) public A notEmpty() { jdiAssert(element().isEmpty(), Matchers.is(false), "List is empty"); return (A) this; @@ -50,7 +50,7 @@ public A notEmpty() { * Checks that list has headers. * @return the same assert for chaining */ - @JDIAction("Assert that '{name}' has headers") + @JDIAction(value = "Assert that '{name}' has headers", isAssert = true) public A headers() { jdiAssert(element().hasHeaders(), Matchers.is(true), "List has no headers"); return (A) this; @@ -60,7 +60,7 @@ public A headers() { * Checks that list has headers. * @return the same assert for chaining */ - @JDIAction("Assert that '{name}' has no headers") + @JDIAction(value = "Assert that '{name}' has no headers", isAssert = true) public A noHeaders() { jdiAssert(!element().hasHeaders(), Matchers.is(true), "List has headers"); return (A) this; @@ -72,7 +72,7 @@ public A noHeaders() { * @param itemTexts expected items * @return the same assert for chaining */ - @JDIAction("Assert that '{name}' contains all items with texts '{0}'") + @JDIAction(value = "Assert that '{name}' contains all items with texts '{0}'", isAssert = true) public A itemsWithTexts(String... itemTexts) { if (itemTexts.length == 0) { throw runtimeException("Set containing expected item names should not be empty"); diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/ListItemAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/ListItemAssert.java index 4e43f3f046..f1e67cad6c 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/ListItemAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/ListItemAssert.java @@ -18,7 +18,7 @@ public class ListItemAssert extends UIAssert implements ITextAssert { @Override - @JDIAction("Assert that '{name}' text {0}") + @JDIAction(value = "Assert that '{name}' text {0}", isAssert = true) public ListItemAssert text(Matcher condition) { jdiAssert(element().getText(), condition); return this; @@ -30,7 +30,7 @@ public ListItemAssert text(Matcher condition) { * @param text expected primary text * @return this {@link ListItemAssert} instance */ - @JDIAction("Assert that '{name}' has primary text '{0}'") + @JDIAction(value = "Assert that '{name}' has primary text '{0}'", isAssert = true) public ListItemAssert primaryText(String text) { jdiAssert(element().getPrimaryText().text(), Matchers.is(text)); return this; @@ -42,7 +42,7 @@ public ListItemAssert primaryText(String text) { * @param text expected secondary text * @return this {@link ListItemAssert} instance */ - @JDIAction("Assert that '{name}' has secondary text '{0}'") + @JDIAction(value = "Assert that '{name}' has secondary text '{0}'", isAssert = true) public ListItemAssert secondaryText(String text) { jdiAssert(element().getSecondaryText().text(), Matchers.is(text)); return this; @@ -53,7 +53,7 @@ public ListItemAssert secondaryText(String text) { * * @return this {@link ListItemAssert} instance */ - @JDIAction("Assert that '{name}' is selected") + @JDIAction(value = "Assert that '{name}' is selected", isAssert = true) public ListItemAssert selected() { jdiAssert(element().isSelected(), Matchers.is(true), "Item is not selected"); return this; @@ -64,7 +64,7 @@ public ListItemAssert selected() { * * @return this {@link ListItemAssert} instance */ - @JDIAction("Assert that '{name}' is not selected") + @JDIAction(value = "Assert that '{name}' is not selected", isAssert = true) public ListItemAssert notSelected() { jdiAssert(!element().isSelected(), Matchers.is(false), "Item is selected"); return this; @@ -75,7 +75,7 @@ public ListItemAssert notSelected() { * * @return this {@link ListItemAssert} instance */ - @JDIAction("Assert that '{name}' is checked") + @JDIAction(value = "Assert that '{name}' is checked", isAssert = true) public ListItemAssert checked() { jdiAssert(element().checkbox().isChecked(), Matchers.is(true), "Item is not checked"); return this; @@ -86,7 +86,7 @@ public ListItemAssert checked() { * * @return this {@link ListItemAssert} instance */ - @JDIAction("Assert that '{name}' is unchecked") + @JDIAction(value = "Assert that '{name}' is unchecked", isAssert = true) public ListItemAssert unchecked() { jdiAssert(!element().checkbox().isChecked(), Matchers.is(false), "Item is unchecked"); return this; diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/TooltipAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/TooltipAssert.java index af09b2ed78..206e28fc66 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/TooltipAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/TooltipAssert.java @@ -15,7 +15,7 @@ public class TooltipAssert extends UIAssert implements ITextAssert { @Override - @JDIAction("Assert that '{name}' text {0}") + @JDIAction(value = "Assert that '{name}' text {0}", isAssert = true) public TooltipAssert text(Matcher condition) { jdiAssert(element().getValue(), condition); return this; @@ -26,13 +26,13 @@ public TooltipAssert text(Matcher condition) { * * @return this {@link TooltipAssert} instance */ - @JDIAction("Assert that '{name}' is interactive") + @JDIAction(value = "Assert that '{name}' is interactive", isAssert = true) public TooltipAssert interactive() { jdiAssert(element().isInteractive(), Matchers.is(true), "Tooltip is not interactive"); return this; } - @JDIAction("Assert that '{name}' is not interactive") + @JDIAction(value = "Assert that '{name}' is not interactive", isAssert = true) public TooltipAssert notInteractive() { jdiAssert(element().isInteractive(), Matchers.is(false), "Tooltip is interactive"); return this; diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/TypographyAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/TypographyAssert.java index 79eef0a136..21e0562627 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/TypographyAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/TypographyAssert.java @@ -17,7 +17,7 @@ public class TypographyAssert extends UIAssert implements ITextAssert { @Override - @JDIAction("Assert that '{name}' text {0}") + @JDIAction(value = "Assert that '{name}' text {0}", isAssert = true) public TypographyAssert text(Matcher condition) { jdiAssert(element().getText(), condition); return this; @@ -29,7 +29,7 @@ public TypographyAssert text(Matcher condition) { * @param style given style * @return this {@link TypographyAssert} instance */ - @JDIAction("Assert that '{name}' has '{0}' style") + @JDIAction(value = "Assert that '{name}' has '{0}' style", isAssert = true) public TypographyAssert style(TypographyComponentStyle style) { jdiAssert(element().getStyle(), Matchers.is(style)); return this; diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/table/MUITableAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/table/MUITableAssert.java index 6cdf9d730d..2c25e038f9 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/table/MUITableAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/table/MUITableAssert.java @@ -17,101 +17,101 @@ public class MUITableAssert extends UIAssert { - @JDIAction("Check that '{name}' is exist") + @JDIAction(value = "Check that '{name}' is exist", isAssert = true) public MUITableAssert exist() { SoftAssert.jdiAssert(element().isExist() ? "is exist" : "is not exist", Matchers.is("is exist")); return this; } - @JDIAction("Check that '{name}' is not exist") + @JDIAction(value = "Check that '{name}' is not exist", isAssert = true) public MUITableAssert notExist() { SoftAssert.jdiAssert(element().isNotExist() ? "is not exist" : "is exist", Matchers.is("is not exist")); return this; } - @JDIAction("Check that '{name}' is empty") + @JDIAction(value = "Check that '{name}' is empty", isAssert = true) public MUITableAssert empty() { SoftAssert.jdiAssert(element().isEmpty() ? "is empty" : "is not empty", Matchers.is("is empty")); return this; } - @JDIAction("Check that '{name}' is not empty") + @JDIAction(value = "Check that '{name}' is not empty", isAssert = true) public MUITableAssert notEmpty() { SoftAssert.jdiAssert(element().isEmpty() ? "is empty" : "is not empty", Matchers.is("is not empty")); return this; } - @JDIAction("Check that '{name}' horizontal size {0}") + @JDIAction(value = "Check that '{name}' horizontal size {0}", isAssert = true) public MUITableAssert horizontalSize(Matcher condition) { SoftAssert.jdiAssert(element().horizontalSize(), condition); return this; } - @JDIAction("Check that '{name}' horizontal size is {0}") + @JDIAction(value = "Check that '{name}' horizontal size is {0}", isAssert = true) public MUITableAssert horizontalSize(int size) { return horizontalSize(Matchers.is(size)); } - @JDIAction("Check that '{name}' vertical size {0}") + @JDIAction(value = "Check that '{name}' vertical size {0}", isAssert = true) public MUITableAssert verticalSize(Matcher condition) { SoftAssert.jdiAssert(element().verticalSize(), condition); return this; } - @JDIAction("Check that '{name}' vertical size is {0}") + @JDIAction(value = "Check that '{name}' vertical size is {0}", isAssert = true) public MUITableAssert verticalSize(int size) { return verticalSize(Matchers.is(size)); } - @JDIAction("Check that '{name}' has row {0}") + @JDIAction(value = "Check that '{name}' has row {0}", isAssert = true) public MUITableAssert row(int index) { SoftAssert.jdiAssert(element().row(index).isExist() ? "is exist" : "is not exist", Matchers.is("is exist")); return this; } - @JDIAction("Check that '{name}' has row with value '{1}' in column {0}") + @JDIAction(value = "Check that '{name}' has row with value '{1}' in column {0}", isAssert = true) public MUITableAssert row(int columnIndex, String value) { SoftAssert.jdiAssert(element().row(columnIndex, value).isExist() ? "is exist" : "is not exist", Matchers.is("is exist")); return this; } - @JDIAction("Check that '{name}' has row with value '{1}' in column '{0}'") + @JDIAction(value = "Check that '{name}' has row with value '{1}' in column '{0}'", isAssert = true) public MUITableAssert row(String columnHeader, String value) { SoftAssert.jdiAssert(element().row(columnHeader, value).isExist() ? "is exist" : "is not exist", Matchers.is("is exist")); return this; } - @JDIAction("Check that '{name}' has rows matching given condition") + @JDIAction(value = "Check that '{name}' has rows matching given condition", isAssert = true) public MUITableAssert rows(Predicate predicate, Matcher condition) { SoftAssert.jdiAssert((int) element().rows().stream().filter(predicate).count(), condition); return this; } - @JDIAction("Check that '{name}' has column '{0}' with cell type '{1}'") + @JDIAction(value = "Check that '{name}' has column '{0}' with cell type '{1}'", isAssert = true) public > MUITableAssert column(String columnHeader, Class cellType) { SoftAssert.jdiAssert(element().column(columnHeader, cellType).isExist() ? "is exist" : "is not exist", Matchers.is("is exist")); return this; } - @JDIAction("Check that '{name}' has column {0} with cell type '{1}'") + @JDIAction(value = "Check that '{name}' has column {0} with cell type '{1}'", isAssert = true) public > MUITableAssert column(int index, Class cellType) { SoftAssert.jdiAssert(element().column(index, cellType).isExist() ? "is exist" : "is not exist", Matchers.is("is exist")); return this; } - @JDIAction("Check that '{name}' has column with value '{1}' and cell type '{2}' in row {0}") + @JDIAction(value = "Check that '{name}' has column with value '{1}' and cell type '{2}' in row {0}", isAssert = true) public > MUITableAssert column(int rowIndex, String value, Class cellType) { SoftAssert.jdiAssert(element().column(rowIndex, value, cellType).isExist() ? "is exist" : "is not exist", Matchers.is("is exist")); return this; } - @JDIAction("Check that '{name}' has columns with cell type '{0}' matching given condition") + @JDIAction(value = "Check that '{name}' has columns with cell type '{0}' matching given condition", isAssert = true) public > MUITableAssert columns(Class cellType, Predicate> predicate, Matcher condition) { SoftAssert.jdiAssert((int) element().columns(cellType).stream().filter(predicate).count(), condition); return this; } - @JDIAction("Check that '{name}' has columns '{0}'") + @JDIAction(value = "Check that '{name}' has columns '{0}'", isAssert = true) public MUITableAssert columns(List columnHeaders) { List allHeaders = element().tableHeader().headerRows().get(0).cells().stream() .map(MUITableDefaultCell::getText) @@ -120,31 +120,31 @@ public MUITableAssert columns(List columnHeaders) { return this; } - @JDIAction("Check that '{name}' has column menu shown") + @JDIAction(value = "Check that '{name}' has column menu shown", isAssert = true) public MUITableAssert columnMenu() { SoftAssert.jdiAssert(element().columnMenu().isExist() ? "is exist" : "is not exist", Matchers.is("is exist")); return this; } - @JDIAction("Check that '{name}' has table header") + @JDIAction(value = "Check that '{name}' has table header", isAssert = true) public MUITableAssert tableHeader() { SoftAssert.jdiAssert(element().tableHeader().isExist() ? "is exist" : "is not exist", Matchers.is("is exist")); return this; } - @JDIAction("Check that '{name}' has table footer") + @JDIAction(value = "Check that '{name}' has table footer", isAssert = true) public MUITableAssert tableFooter() { SoftAssert.jdiAssert(element().tableFooter().isExist() ? "is exist" : "is not exist", Matchers.is("is exist")); return this; } - @JDIAction("Check that '{name}' has column filter shown") + @JDIAction(value = "Check that '{name}' has column filter shown", isAssert = true) public MUITableAssert columnFilter() { SoftAssert.jdiAssert(element().columnFilter().isExist() ? "is exist" : "is not exist", Matchers.is("is exist")); return this; } - @JDIAction("Check that '{name}' has column config shown") + @JDIAction(value = "Check that '{name}' has column config shown", isAssert = true) public MUITableAssert columnConfig() { SoftAssert.jdiAssert(element().columnConfig().isExist() ? "is exist" : "is not exist", Matchers.is("is exist")); return this; diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/table/MUITableCellAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/table/MUITableCellAssert.java index 5f7f9ccc1b..48d540cd3c 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/table/MUITableCellAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/table/MUITableCellAssert.java @@ -8,25 +8,25 @@ public class MUITableCellAssert, E extends MUITableCell> extends UIAssert { - @JDIAction("Check that '{name}' has row index {0}") + @JDIAction(value = "Check that '{name}' has row index {0}", isAssert = true) public MUITableCellAssert rowIndex(int index) { SoftAssert.jdiAssert(element().rowIndex(), Matchers.is(index)); return this; } - @JDIAction("Check that '{name}' has column index {0}") + @JDIAction(value = "Check that '{name}' has column index {0}", isAssert = true) public MUITableCellAssert columnIndex(int index) { SoftAssert.jdiAssert(element().columnIndex(), Matchers.is(index)); return this; } - @JDIAction("Check that '{name}' is exist") + @JDIAction(value = "Check that '{name}' is exist", isAssert = true) public MUITableCellAssert exist() { SoftAssert.jdiAssert(element().isExist() ? "is exist" : "is not exist", Matchers.is("is exist")); return this; } - @JDIAction("Check that '{name}' is not exist") + @JDIAction(value = "Check that '{name}' is not exist", isAssert = true) public MUITableCellAssert notExist() { SoftAssert.jdiAssert(element().isNotExist() ? "is not exist" : "is exist", Matchers.is("is not exist")); return this; diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/table/MUITableCellContainerAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/table/MUITableCellContainerAssert.java index da44ebb9f3..c8e642fa16 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/table/MUITableCellContainerAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/table/MUITableCellContainerAssert.java @@ -9,31 +9,31 @@ public class MUITableCellContainerAssert, E extends MUITableCellContainer> extends UIAssert { - @JDIAction("Check that '{name}' is exist") + @JDIAction(value = "Check that '{name}' is exist", isAssert = true) public MUITableCellContainerAssert exist() { SoftAssert.jdiAssert(element().isExist() ? "is exist" : "is not exist", Matchers.is("is exist")); return this; } - @JDIAction("Check that '{name}' is not exist") + @JDIAction(value = "Check that '{name}' is not exist", isAssert = true) public MUITableCellContainerAssert notExist() { SoftAssert.jdiAssert(element().isNotExist() ? "is not exist" : "is exist", Matchers.is("is not exist")); return this; } - @JDIAction("Check that '{name}' has index {0}") + @JDIAction(value = "Check that '{name}' has index {0}", isAssert = true) public MUITableCellContainerAssert index(int index) { SoftAssert.jdiAssert(element().index(), Matchers.is(index)); return this; } - @JDIAction("Check that '{name}' size is {0}") + @JDIAction(value = "Check that '{name}' size is {0}", isAssert = true) public MUITableCellContainerAssert size(int size) { SoftAssert.jdiAssert(element().size(), Matchers.is(size)); return this; } - @JDIAction("Check that '{name}' size {0}") + @JDIAction(value = "Check that '{name}' size {0}", isAssert = true) public MUITableCellContainerAssert size(Matcher condition) { SoftAssert.jdiAssert(element().size(), condition); return this; diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/table/MUITableColumnAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/table/MUITableColumnAssert.java index 3da8781369..bb8f384eda 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/table/MUITableColumnAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/table/MUITableColumnAssert.java @@ -13,37 +13,37 @@ public class MUITableColumnAssert> extends MUITableCellContainerAssert, MUITableColumn> { - @JDIAction("Check that '{name}' is sorted") + @JDIAction(value = "Check that '{name}' is sorted", isAssert = true) public MUITableColumnAssert sorted() { SoftAssert.jdiAssert(element().isSorted() ? "sorted" : "unsorted", Matchers.is("sorted")); return this; } - @JDIAction("Check that '{name}' is unsorted") + @JDIAction(value = "Check that '{name}' is unsorted", isAssert = true) public MUITableColumnAssert unsorted() { SoftAssert.jdiAssert(!element().isSorted() ? "unsorted" : "sorted", Matchers.is("unsorted")); return this; } - @JDIAction("Check that '{name}' has sorting '{0}'") + @JDIAction(value = "Check that '{name}' has sorting '{0}'", isAssert = true) public MUITableColumnAssert sorting(ColumnSorting columnSorting) { SoftAssert.jdiAssert(element().sorting(), Matchers.is(columnSorting)); return this; } - @JDIAction("Check that '{name}' has cell in row {0}") + @JDIAction(value = "Check that '{name}' has cell in row {0}", isAssert = true) public MUITableColumnAssert cell(int rowIndex) { SoftAssert.jdiAssert(element().cell(rowIndex).isExist() ? "is exist" : "is not exist", Matchers.is("is exist")); return this; } - @JDIAction("Check that '{name}' has cell with text '{0}'") + @JDIAction(value = "Check that '{name}' has cell with text '{0}'", isAssert = true) public MUITableColumnAssert cell(String text) { SoftAssert.jdiAssert(element().cell(text).isExist() ? "is exist" : "is not exist", Matchers.is("is exist")); return this; } - @JDIAction("Check that '{name}' has cells {0}") + @JDIAction(value = "Check that '{name}' has cells {0}", isAssert = true) public MUITableColumnAssert cells(Matcher> condition) { SoftAssert.jdiAssert(element().cells(), condition); return this; diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/table/MUITableColumnConfigAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/table/MUITableColumnConfigAssert.java index 4543e03a92..78e1b1d993 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/table/MUITableColumnConfigAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/table/MUITableColumnConfigAssert.java @@ -12,31 +12,31 @@ public class MUITableColumnConfigAssert extends UIAssert { - @JDIAction("Check that '{name}' is exist") + @JDIAction(value = "Check that '{name}' is exist", isAssert = true) public MUITableColumnConfigAssert exist() { SoftAssert.jdiAssert(element().isExist() ? "is exist" : "is not exist", Matchers.is("is exist")); return this; } - @JDIAction("Check that '{name}' is not exist") + @JDIAction(value = "Check that '{name}' is not exist", isAssert = true) public MUITableColumnConfigAssert notExist() { SoftAssert.jdiAssert(element().isNotExist() ? "is not exist" : "is exist", Matchers.is("is not exist")); return this; } - @JDIAction("Check that '{name}' has switch with text '{0}'") + @JDIAction(value = "Check that '{name}' has switch with text '{0}'", isAssert = true) public MUITableColumnConfigAssert switchElement(String labelText) { SoftAssert.jdiAssert(element().getSwitch(labelText).isExist() ? "is exist" : "is not exist", Matchers.is("is exist")); return this; } - @JDIAction("Check that '{name}' has {0} switches") + @JDIAction(value = "Check that '{name}' has {0} switches", isAssert = true) public MUITableColumnConfigAssert switchElements(int amount) { SoftAssert.jdiAssert(element().getSwitches().size(), Matchers.is(amount)); return this; } - @JDIAction("Check that '{name}' has switches with texts '{0}'") + @JDIAction(value = "Check that '{name}' has switches with texts '{0}'", isAssert = true) public MUITableColumnConfigAssert switchElements(List texts) { List switchTexts = element().getSwitches().stream() .map(Switch::labelText) diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/table/MUITableColumnFilterAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/table/MUITableColumnFilterAssert.java index 506d46709c..1365d0f814 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/table/MUITableColumnFilterAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/table/MUITableColumnFilterAssert.java @@ -8,13 +8,13 @@ public class MUITableColumnFilterAssert extends UIAssert { - @JDIAction("Check that '{name}' is exist") + @JDIAction(value = "Check that '{name}' is exist", isAssert = true) public MUITableColumnFilterAssert exist() { SoftAssert.jdiAssert(element().isExist() ? "is exist" : "is not exist", Matchers.is("is exist")); return this; } - @JDIAction("Check that '{name}' is not exist") + @JDIAction(value = "Check that '{name}' is not exist", isAssert = true) public MUITableColumnFilterAssert notExist() { SoftAssert.jdiAssert(element().isNotExist() ? "is not exist" : "is exist", Matchers.is("is not exist")); return this; diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/table/MUITableDefaultCellAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/table/MUITableDefaultCellAssert.java index 18b80999bd..76df5c7f3a 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/table/MUITableDefaultCellAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/table/MUITableDefaultCellAssert.java @@ -11,25 +11,25 @@ public class MUITableDefaultCellAssert extends MUITableCellAssert { @Override - @JDIAction("Check that '{name}' text {0}") + @JDIAction(value = "Check that '{name}' text {0}", isAssert = true) public MUITableDefaultCellAssert text(Matcher condition) { SoftAssert.jdiAssert(element().getText(), condition); return this; } - @JDIAction("Check that '{name}' has button '{0}'") + @JDIAction(value = "Check that '{name}' has button '{0}'", isAssert = true) public MUITableDefaultCellAssert button(String label) { SoftAssert.jdiAssert(element().button(label).isExist() ? "is empty" : "is not empty", Matchers.is("is empty")); return this; } - @JDIAction("Check that '{name}' has checkbox element") + @JDIAction(value = "Check that '{name}' has checkbox element", isAssert = true) public MUITableDefaultCellAssert checkbox() { SoftAssert.jdiAssert(element().checkbox().isExist() ? "is empty" : "is not empty", Matchers.is("is empty")); return this; } - @JDIAction("Check that '{name}' has select element") + @JDIAction(value = "Check that '{name}' has select element", isAssert = true) public MUITableDefaultCellAssert select() { SoftAssert.jdiAssert(element().select().isExist() ? "is empty" : "is not empty", Matchers.is("is empty")); return this; diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/table/MUITableFooterAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/table/MUITableFooterAssert.java index cad00677d5..f3c4e9e2db 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/table/MUITableFooterAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/table/MUITableFooterAssert.java @@ -8,37 +8,37 @@ public class MUITableFooterAssert extends UIAssert { - @JDIAction("Check that '{name}' is exist") + @JDIAction(value = "Check that '{name}' is exist", isAssert = true) public MUITableFooterAssert exist() { SoftAssert.jdiAssert(element().isExist() ? "is exist" : "is not exist", Matchers.is("is exist")); return this; } - @JDIAction("Check that '{name}' is not exist") + @JDIAction(value = "Check that '{name}' is not exist", isAssert = true) public MUITableFooterAssert notExist() { SoftAssert.jdiAssert(element().isNotExist() ? "is not exist" : "is exist", Matchers.is("is not exist")); return this; } - @JDIAction("Check that '{name}' shows {0} rows as selected") + @JDIAction(value = "Check that '{name}' shows {0} rows as selected", isAssert = true) public MUITableFooterAssert selectedRows(int amount) { SoftAssert.jdiAssert(element().selectedRows(), Matchers.is(amount)); return this; } - @JDIAction("Check that '{name}' current min row index is {0}") + @JDIAction(value = "Check that '{name}' current min row index is {0}", isAssert = true) public MUITableFooterAssert currentMinRowIndex(int index) { SoftAssert.jdiAssert(element().currentMinRowIndex(), Matchers.is(index)); return this; } - @JDIAction("Check that '{name}' current max row index is {0}") + @JDIAction(value = "Check that '{name}' current max row index is {0}", isAssert = true) public MUITableFooterAssert currentMaxRowIndex(int index) { SoftAssert.jdiAssert(element().currentMaxRowIndex(), Matchers.is(index)); return this; } - @JDIAction("Check that '{name}' current max row amount is {0}") + @JDIAction(value = "Check that '{name}' current max row amount is {0}", isAssert = true) public MUITableFooterAssert maxRowAmount(int amount) { SoftAssert.jdiAssert(element().maxRowAmount(), Matchers.is(amount)); return this; diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/table/MUITableHeaderAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/table/MUITableHeaderAssert.java index 34ed59ea89..1ed08ece47 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/table/MUITableHeaderAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/table/MUITableHeaderAssert.java @@ -8,19 +8,19 @@ public class MUITableHeaderAssert extends UIAssert { - @JDIAction("Check that '{name}' is exist") + @JDIAction(value = "Check that '{name}' is exist", isAssert = true) public MUITableHeaderAssert exist() { SoftAssert.jdiAssert(element().isExist() ? "is exist" : "is not exist", Matchers.is("is exist")); return this; } - @JDIAction("Check that '{name}' is not exist") + @JDIAction(value = "Check that '{name}' is not exist", isAssert = true) public MUITableHeaderAssert notExist() { SoftAssert.jdiAssert(element().isNotExist() ? "is not exist" : "is exist", Matchers.is("is not exist")); return this; } - @JDIAction("Check that '{name}' shows {0} rows as selected") + @JDIAction(value = "Check that '{name}' shows {0} rows as selected", isAssert = true) public MUITableHeaderAssert selectedRows(int amount) { SoftAssert.jdiAssert(element().selectedRows(), Matchers.is(amount)); return this; diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/table/MUITableJoinedCellAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/table/MUITableJoinedCellAssert.java index a986d98c7c..d4fb3dd863 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/table/MUITableJoinedCellAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/table/MUITableJoinedCellAssert.java @@ -1,5 +1,6 @@ package com.epam.jdi.light.material.asserts.displaydata.table; +import com.epam.jdi.light.common.JDIAction; import org.hamcrest.Matcher; import org.hamcrest.Matchers; @@ -9,12 +10,14 @@ public class MUITableJoinedCellAssert extends MUITableCellAssert implements ITextAssert { + @JDIAction(value = "Assert that '{name}' has text matched condition", isAssert = true) @Override public MUITableJoinedCellAssert text(Matcher condition) { SoftAssert.jdiAssert(element().getText(), condition); return this; } + @JDIAction(value = "Assert that '{name}' has text {0}", isAssert = true) @Override public MUITableJoinedCellAssert text(String condition) { return text(Matchers.equalTo(condition)); diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/table/MUITableRowAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/table/MUITableRowAssert.java index 3319d98f80..04861e22fd 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/table/MUITableRowAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/displaydata/table/MUITableRowAssert.java @@ -12,49 +12,49 @@ public class MUITableRowAssert extends MUITableCellContainerAssert { - @JDIAction("Check that '{name}' has cell of type '{1}' in row {0}") + @JDIAction(value = "Check that '{name}' has cell of type '{1}' in row {0}", isAssert = true) public > MUITableRowAssert cell(int columnIndex, Class cellType) { SoftAssert.jdiAssert(element().cell(columnIndex, cellType).isExist() ? "is exist" : "is not exist", Matchers.is("is exist")); return this; } - @JDIAction("Check that '{name}' has cell of type '{1}' with text '{0}'") + @JDIAction(value = "Check that '{name}' has cell of type '{1}' with text '{0}'", isAssert = true) public > MUITableRowAssert cell(String text, Class cellType) { SoftAssert.jdiAssert(element().cell(text, cellType).isExist() ? "is exist" : "is not exist", Matchers.is("is exist")); return this; } - @JDIAction("Check that '{name}' has default type cell in row {0}") + @JDIAction(value = "Check that '{name}' has default type cell in row {0}", isAssert = true) public MUITableRowAssert cell(int columnIndex) { SoftAssert.jdiAssert(element().cell(columnIndex).isExist() ? "is exist" : "is not exist", Matchers.is("is exist")); return this; } - @JDIAction("Check that '{name}' has default type cell with text '{0}'") + @JDIAction(value = "Check that '{name}' has default type cell with text '{0}'", isAssert = true) public MUITableRowAssert cell(String text) { SoftAssert.jdiAssert(element().cell(text).isExist() ? "is exist" : "is not exist", Matchers.is("is exist")); return this; } - @JDIAction("Check that '{name}' has cells of type '{0}' {1}") + @JDIAction(value = "Check that '{name}' has cells of type '{0}' {1}", isAssert = true) public > MUITableRowAssert cells(Class cellType, Matcher>> condition) { SoftAssert.jdiAssert(element().cells(cellType), condition); return this; } - @JDIAction("Check that '{name}' has default type cells {0}") + @JDIAction(value = "Check that '{name}' has default type cells {0}", isAssert = true) public MUITableRowAssert cells(Matcher>> condition) { SoftAssert.jdiAssert(element().cells(), condition); return this; } - @JDIAction("Check that '{name}' row cells text matches {0}") + @JDIAction(value = "Check that '{name}' row cells text matches {0}", isAssert = true) public MUITableRowAssert cellsMatch(List cellsValueExpected) { SoftAssert.jdiAssert(element().cellsText(), Matchers.contains(cellsValueExpected.toArray(new String[0]))); return this; } - @JDIAction("Check that '{name}' row cells text does not match {0}") + @JDIAction(value = "Check that '{name}' row cells text does not match {0}", isAssert = true) public MUITableRowAssert cellsDontMatch(List cellsValueExpected) { SoftAssert.jdiAssert(element().cellsText(), Matchers.not(Matchers.contains(cellsValueExpected.toArray(new String[0])))); diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/feedback/AlertAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/feedback/AlertAssert.java index edc4ff9425..c3c4049b70 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/feedback/AlertAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/feedback/AlertAssert.java @@ -10,49 +10,49 @@ import static com.epam.jdi.light.asserts.core.SoftAssert.jdiAssert; public class AlertAssert extends UIAssert { - @JDIAction("Assert that '{name}' text like {0}") + @JDIAction(value = "Assert that '{name}' text like {0}", isAssert = true) public AlertAssert text(Matcher condition) { jdiAssert(element().text(), condition); return this; } - @JDIAction("Assert that '{name}' text like {0}") + @JDIAction(value = "Assert that '{name}' text like {0}", isAssert = true) public AlertAssert text(String text) { jdiAssert(element().text(), Matchers.is(text)); return this; } - @JDIAction("Assert that '{name}' title like {0}") + @JDIAction(value = "Assert that '{name}' title like {0}", isAssert = true) public AlertAssert title(Matcher condition) { jdiAssert(element().title(), condition); return this; } - @JDIAction("Assert that '{name}' title is {0}") + @JDIAction(value = "Assert that '{name}' title is {0}", isAssert = true) public AlertAssert title(String text) { jdiAssert(element().title(), Matchers.is(text)); return this; } - @JDIAction("Assert that '{name}' has title") + @JDIAction(value = "Assert that '{name}' has title", isAssert = true) public AlertAssert hasTitle() { jdiAssert(element().hasTitle(), Matchers.is(true), "Alert has not title"); return this; } - @JDIAction("Assert that '{name}' has no title") + @JDIAction(value = "Assert that '{name}' has no title", isAssert = true) public AlertAssert hasNoTitle() { jdiAssert(element().hasTitle(), Matchers.is(false), "Alert has title"); return this; } - @JDIAction("Assert that '{name}' severity is {0}") + @JDIAction(value = "Assert that '{name}' severity is {0}", isAssert = true) public AlertAssert severity(Severity value) { jdiAssert(element().severity(), Matchers.is(value)); return this; } - @JDIAction("Assert that '{name}' title is {0}") + @JDIAction(value = "Assert that '{name}' title is {0}", isAssert = true) public AlertAssert notSeverity(Severity value) { jdiAssert(element().severity(), Matchers.not(Matchers.is(value))); return this; diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/feedback/DialogAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/feedback/DialogAssert.java index 7a69572c26..0f943748c0 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/feedback/DialogAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/feedback/DialogAssert.java @@ -3,7 +3,6 @@ import com.epam.jdi.light.asserts.generic.UIAssert; import com.epam.jdi.light.common.JDIAction; import com.epam.jdi.light.material.elements.feedback.Dialog; -import com.jdiai.tools.Timer; import org.hamcrest.Matchers; import static com.epam.jdi.light.asserts.core.SoftAssert.jdiAssert; @@ -13,16 +12,13 @@ */ public class DialogAssert extends UIAssert { - private final Timer timer = new Timer(5000L, 500L); - /** * Checks that dialog has scrollable content. * * @return this {@link DialogAssert} instance */ - @JDIAction("Assert that '{name}' has scrollable content") + @JDIAction(value = "Assert that '{name}' has scrollable content", isAssert = true) public DialogAssert scrollableContent() { - timer.wait(() -> element().isDisplayed()); jdiAssert(element().hasScrollableContent(), Matchers.is(true), "Dialog has no scrollable content"); return this; } @@ -32,9 +28,8 @@ public DialogAssert scrollableContent() { * * @return this {@link DialogAssert} instance */ - @JDIAction("Assert that '{name}' has scrollable body") + @JDIAction(value = "Assert that '{name}' has scrollable body", isAssert = true) public DialogAssert scrollableBody() { - timer.wait(() -> element().isDisplayed()); jdiAssert(element().hasScrollableBody(), Matchers.is(true), "Dialog has no scrollable body"); return this; } @@ -44,10 +39,9 @@ public DialogAssert scrollableBody() { * * @return this {@link DialogAssert} instance */ - @JDIAction("Assert that '{name}' is hidden") + @JDIAction(value = "Assert that '{name}' is hidden", isAssert = true) @Override public DialogAssert hidden() { - timer.wait(() -> element().isNotVisible()); jdiAssert(element().isHidden(), Matchers.is(true), "Dialog is not hidden"); return this; } @@ -57,10 +51,9 @@ public DialogAssert hidden() { * * @return this {@link DialogAssert} instance */ - @JDIAction("Assert that '{name}' is displayed") + @JDIAction(value = "Assert that '{name}' is displayed", isAssert = true) @Override public DialogAssert displayed() { - timer.wait(() -> element().isDisplayed()); jdiAssert(element().isDisplayed(), Matchers.is(true), "Dialog is not displayed"); return this; } diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/feedback/LinearProgressAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/feedback/LinearProgressAssert.java index 891d2a7427..00a885da15 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/feedback/LinearProgressAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/feedback/LinearProgressAssert.java @@ -17,7 +17,7 @@ public class LinearProgressAssert extends ProgressAssertLinear buffer MUI documentation */ - @JDIAction("Assert that '{name}' is linear buffer") + @JDIAction(value = "Assert that '{name}' is linear buffer", isAssert = true) public LinearProgressAssert buffer() { jdiAssert(element().isBuffer(), Matchers.is(true), "Progress is not buffer"); return this; diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/feedback/ProgressAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/feedback/ProgressAssert.java index c6b88cfb47..131065bf63 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/feedback/ProgressAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/feedback/ProgressAssert.java @@ -7,7 +7,6 @@ import org.hamcrest.Matchers; import static com.epam.jdi.light.asserts.core.SoftAssert.jdiAssert; -import static com.jdiai.tools.Timer.waitCondition; /** * Assertions for {@link Progress} @@ -20,10 +19,9 @@ public class ProgressAssert, E extends Progress element().isIndeterminate()); - jdiAssert(isIndeterminate, Matchers.is(true), "Progress is not indeterminate"); + jdiAssert(element().isIndeterminate(), Matchers.is(true), "Progress is not indeterminate"); return (A) this; } @@ -32,10 +30,9 @@ public A indeterminate() { * * @return this {@link ProgressAssert} instance */ - @JDIAction("Assert that '{name}' is determinate") + @JDIAction(value = "Assert that '{name}' is determinate", isAssert = true) public A determinate() { - boolean isDeterminate = waitCondition(() -> element().isDeterminate()); - jdiAssert(isDeterminate, Matchers.is(true), "Progress is not determinate"); + jdiAssert(element().isDeterminate(), Matchers.is(true), "Progress is not determinate"); return (A) this; } @@ -45,7 +42,7 @@ public A determinate() { * @param value expected current value * @return this {@link ProgressAssert} instance */ - @JDIAction("Assert that '{name}' value is {0}") + @JDIAction(value = "Assert that '{name}' value is {0}", isAssert = true) public A value(int value) { return value(Matchers.is(value)); } @@ -56,7 +53,7 @@ public A value(int value) { * @param condition expected condition * @return this {@link ProgressAssert} instance */ - @JDIAction("Assert that '{name}' value {0}") + @JDIAction(value = "Assert that '{name}' value {0}", isAssert = true) public A value(Matcher condition) { jdiAssert(element().getValueNow(), condition); return (A) this; @@ -68,7 +65,7 @@ public A value(Matcher condition) { * @param minValue expected min value * @return this {@link ProgressAssert} instance */ - @JDIAction("Assert that '{name}' min value is {0}") + @JDIAction(value = "Assert that '{name}' min value is {0}", isAssert = true) public A min(int minValue) { return min(Matchers.is(minValue)); } @@ -79,7 +76,7 @@ public A min(int minValue) { * @param condition expected condition * @return this {@link ProgressAssert} instance */ - @JDIAction("Assert that '{name}' min value {0}") + @JDIAction(value = "Assert that '{name}' min value {0}", isAssert = true) public A min(Matcher condition) { jdiAssert(element().minValue(), condition); return (A) this; @@ -91,7 +88,7 @@ public A min(Matcher condition) { * @param maxValue expected max value * @return this {@link ProgressAssert} instance */ - @JDIAction("Assert that '{name}' max value is {0}") + @JDIAction(value = "Assert that '{name}' max value is {0}", isAssert = true) public A max(int maxValue) { return max(Matchers.is(maxValue)); } @@ -102,7 +99,7 @@ public A max(int maxValue) { * @param condition expected condition * @return this {@link ProgressAssert} instance */ - @JDIAction("Assert that '{name}' max value {0}") + @JDIAction(value = "Assert that '{name}' max value {0}", isAssert = true) public A max(Matcher condition) { jdiAssert(element().maxValue(), condition); return (A) this; diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/feedback/SnackbarAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/feedback/SnackbarAssert.java index 96153611a2..0c5a1740c9 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/feedback/SnackbarAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/feedback/SnackbarAssert.java @@ -22,7 +22,7 @@ public class SnackbarAssert extends PositionAssert imp * @return this {@link SnackbarAssert} instance */ @Override - @JDIAction("Assert that '{name}' text {0}") + @JDIAction(value = "Assert that '{name}' text {0}", isAssert = true) public SnackbarAssert text(Matcher condition) { jdiAssert(element().text(), condition); return this; @@ -34,7 +34,7 @@ public SnackbarAssert text(Matcher condition) { * @param type expected message type * @return this {@link SnackbarAssert} instance */ - @JDIAction("Assert that the '{name}' message type is '{0}'") + @JDIAction(value = "Assert that the '{name}' message type is '{0}'", isAssert = true) public SnackbarAssert messageType(MessageType type) { jdiAssert(element().messageType(), Matchers.is(type)); return this; diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/inputs/AdornmentAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/inputs/AdornmentAssert.java index 8678f4f5b8..3f872b3a5e 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/inputs/AdornmentAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/inputs/AdornmentAssert.java @@ -14,7 +14,7 @@ public class AdornmentAssert extends PositionAssert implements ITextAssert { @Override - @JDIAction("Assert that '{name}' adornment text {0}") + @JDIAction(value = "Assert that '{name}' adornment text {0}", isAssert = true) public AdornmentAssert text(Matcher condition) { jdiAssert(element().getText(), condition); return this; diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/inputs/ButtonGroupAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/inputs/ButtonGroupAssert.java index d0cc37fbdc..1fbb57dbcb 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/inputs/ButtonGroupAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/inputs/ButtonGroupAssert.java @@ -21,7 +21,7 @@ public class ButtonGroupAssert extends UISelectAssert> condition) { jdiAssert(element().getAllButtons().stream().map(Button::getText).collect(Collectors.toList()), condition); diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/inputs/CheckboxAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/inputs/CheckboxAssert.java index 527d731e65..39969e5ffb 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/inputs/CheckboxAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/inputs/CheckboxAssert.java @@ -17,7 +17,7 @@ public class CheckboxAssert extends UIAssert { * * @return this {@link CheckboxAssert} instance */ - @JDIAction("Assert that '{name}' is checked") + @JDIAction(value = "Assert that '{name}' is checked", isAssert = true) public CheckboxAssert checked() { jdiAssert(element().isChecked(), Matchers.is(true), "Checkbox is not checked"); return this; @@ -28,7 +28,7 @@ public CheckboxAssert checked() { * * @return this {@link CheckboxAssert} instance */ - @JDIAction("Assert that '{name}' is unchecked") + @JDIAction(value = "Assert that '{name}' is unchecked", isAssert = true) public CheckboxAssert unchecked() { jdiAssert(element().isUnchecked(), Matchers.is(true), "Checkbox is not unchecked"); return this; @@ -39,7 +39,7 @@ public CheckboxAssert unchecked() { * * @return this {@link CheckboxAssert} instance */ - @JDIAction("Assert that '{name}' is indeterminate") + @JDIAction(value = "Assert that '{name}' is indeterminate", isAssert = true) public CheckboxAssert indeterminate() { jdiAssert(element().isIndeterminate(), Matchers.is(true), "Checkbox is not indeterminate"); return this; @@ -51,7 +51,7 @@ public CheckboxAssert indeterminate() { * @param position expected position of the label relative to the checkbox * @return this {@link CheckboxAssert} instance */ - @JDIAction("Assert that '{name}' label has position '{0}'") + @JDIAction(value = "Assert that '{name}' label has position '{0}'", isAssert = true) public CheckboxAssert labelPosition(String position) { jdiAssert(element().labelPosition().toString(), Matchers.is(position)); return this; diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/inputs/DateTimePickerAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/inputs/DateTimePickerAssert.java index 68b8b3106e..fca30c51d7 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/inputs/DateTimePickerAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/inputs/DateTimePickerAssert.java @@ -22,7 +22,7 @@ public class DateTimePickerAssert extends UIAssert condition) { jdiAssert(element().value(), condition); return this; @@ -34,7 +34,7 @@ public DateTimePickerAssert text(Matcher condition) { * @param text expected full-text content of item to be found as {@link String} * @return this {@link DateTimePickerAssert} instance */ - @JDIAction("Assert that '{name}' has title '{0}'") + @JDIAction(value = "Assert that '{name}' has title '{0}'", isAssert = true) public DateTimePickerAssert title(String text) { jdiAssert(element().title(), Matchers.is(text)); return this; diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/inputs/RadioAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/inputs/RadioAssert.java index 4bd0235921..1ba36c43c9 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/inputs/RadioAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/inputs/RadioAssert.java @@ -17,7 +17,7 @@ public class RadioAssert extends UISelectAssert { * @param labelPosition expected position label condition (e.g. "top", "start", topCenter") * @return this {@link RadioAssert} instance */ - @JDIAction("Assert that '{name}' radio button '{0}' label has position '{1}'") + @JDIAction(value = "Assert that '{name}' radio button '{0}' label has position '{1}'", isAssert = true) public RadioAssert position(int index, Position labelPosition) { element().labels().get(index).hasClass(labelPosition.toString()); return this; @@ -30,7 +30,7 @@ public RadioAssert position(int index, Position labelPosition) { * @param labelPosition expected position label condition (e.g. "top", "start", topCenter") * @return this {@link RadioAssert} instance */ - @JDIAction("Assert that '{name}' radio button '{0}' label has position '{1}'") + @JDIAction(value = "Assert that '{name}' radio button '{0}' label has position '{1}'", isAssert = true) public RadioAssert position(String label, Position labelPosition) { int index = element().values().indexOf(label); element().labels().get(index).hasClass(labelPosition.toString()); diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/inputs/SliderAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/inputs/SliderAssert.java index a984a94f45..7b4aafde72 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/inputs/SliderAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/inputs/SliderAssert.java @@ -20,7 +20,7 @@ public class SliderAssert extends UIAssert { * @return this {@link SliderAssert} instance */ @Override - @JDIAction("Assert that '{name}' is disabled") + @JDIAction(value = "Assert that '{name}' is disabled", isAssert = true) public SliderAssert disabled() { jdiAssert(element().isDisabled(), Matchers.is(true), "Slider is not disabled"); return this; @@ -32,7 +32,7 @@ public SliderAssert disabled() { * @param value matcher as {@link Matcher} * @return this {@link SliderAssert} instance */ - @JDIAction("Assert that '{name}' value is {0}") + @JDIAction(value = "Assert that '{name}' value is {0}", isAssert = true) public SliderAssert value(Matcher value) { jdiAssert(element().value(), value); return this; @@ -44,7 +44,7 @@ public SliderAssert value(Matcher value) { * @param orientation expected slider's orientation as {@link Orientation} * @return this {@link SliderAssert} instance */ - @JDIAction("Assert that '{name}' orientation is '{0}'") + @JDIAction(value = "Assert that '{name}' orientation is '{0}'", isAssert = true) public SliderAssert orientation(Orientation orientation) { jdiAssert(element().orientation(), Matchers.is(orientation)); return this; diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/inputs/SliderRangeAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/inputs/SliderRangeAssert.java index 9c77c3989d..6ede00b0b6 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/inputs/SliderRangeAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/inputs/SliderRangeAssert.java @@ -22,7 +22,7 @@ public class SliderRangeAssert extends UIAssert * @param index thumb index. Starting from 1 * @return this {@link SliderRangeAssert} instance */ - @JDIAction("Assert that '{name}' value {0}") + @JDIAction(value = "Assert that '{name}' value {0}", isAssert = true) public SliderRangeAssert value(Matcher value, int index) { jdiAssert(element().value(index), value); return this; @@ -34,7 +34,7 @@ public SliderRangeAssert value(Matcher value, int index) { * @param orientation expected slider's orientation as {@link Orientation} * @return this {@link SliderRangeAssert} instance */ - @JDIAction("Assert that '{name}' orientation is '{0}'") + @JDIAction(value = "Assert that '{name}' orientation is '{0}'", isAssert = true) public SliderRangeAssert orientation(Orientation orientation) { jdiAssert(element().orientation(), Matchers.is(orientation)); return this; @@ -46,7 +46,7 @@ public SliderRangeAssert orientation(Orientation orientation) { * @param type expected slider's orientation as {@link Type} * @return this {@link SliderRangeAssert} instance */ - @JDIAction("Assert that '{name}' type is '{0}'") + @JDIAction(value = "Assert that '{name}' type is '{0}'", isAssert = true) public SliderRangeAssert type(Type type) { jdiAssert(element().type(), Matchers.is(type)); return this; diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/inputs/SwitchAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/inputs/SwitchAssert.java index 651366021d..3d9d6d4529 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/inputs/SwitchAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/inputs/SwitchAssert.java @@ -17,7 +17,7 @@ public class SwitchAssert extends UIAssert { * * @return this {@link SwitchAssert} instance */ - @JDIAction("Assert that '{name}' is checked") + @JDIAction(value = "Assert that '{name}' is checked", isAssert = true) public SwitchAssert checked() { jdiAssert(element().isChecked(), Matchers.is(true), "Switch is not checked"); return this; @@ -28,7 +28,7 @@ public SwitchAssert checked() { * * @return this {@link SwitchAssert} instance */ - @JDIAction("Assert that '{name}' is unchecked") + @JDIAction(value = "Assert that '{name}' is unchecked", isAssert = true) public SwitchAssert unchecked() { jdiAssert(element().isUnchecked(), Matchers.is(true), "Switch is not unchecked"); return this; @@ -39,7 +39,7 @@ public SwitchAssert unchecked() { * * @return this {@link SwitchAssert} instance */ - @JDIAction("Assert that '{name}' has a label") + @JDIAction(value = "Assert that '{name}' has a label", isAssert = true) public SwitchAssert label() { jdiAssert(element().label().isDisplayed(), Matchers.is(true), "Switch label is not displayed"); return this; @@ -51,7 +51,7 @@ public SwitchAssert label() { * @param labelText expected label text * @return this {@link SwitchAssert} instance */ - @JDIAction("Assert that '{name}' label has text '{0}'") + @JDIAction(value = "Assert that '{name}' label has text '{0}'", isAssert = true) public SwitchAssert labelText(String labelText) { jdiAssert(element().labelText(), Matchers.is(labelText)); return this; diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/inputs/TextFieldAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/inputs/TextFieldAssert.java index 58b5f0d6d5..1ad9c105cf 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/inputs/TextFieldAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/inputs/TextFieldAssert.java @@ -15,7 +15,7 @@ public class TextFieldAssert extends UIAssert implements ITextAssert { @Override - @JDIAction("Assert that '{name}' label text {0}") + @JDIAction(value = "Assert that '{name}' label text {0}", isAssert = true) public TextFieldAssert text(Matcher condition) { jdiAssert(element().getText(), condition); return this; @@ -26,7 +26,7 @@ public TextFieldAssert text(Matcher condition) { * * @return this {@link TextFieldAssert} instance */ - @JDIAction("Assert that '{name}' is readonly") + @JDIAction(value = "Assert that '{name}' is readonly", isAssert = true) public TextFieldAssert readonly() { jdiAssert(element().isReadonly(), Matchers.is(true), "TextField is not readonly"); return this; @@ -38,7 +38,7 @@ public TextFieldAssert readonly() { * @param text expected helper text * @return this {@link TextFieldAssert} instance */ - @JDIAction("Assert that '{name}' helper text is '{0}'") + @JDIAction(value = "Assert that '{name}' helper text is '{0}'", isAssert = true) public TextFieldAssert helperText(String text) { return helperText(Matchers.is(text)); } @@ -49,7 +49,7 @@ public TextFieldAssert helperText(String text) { * @param condition expected condition * @return this {@link TextFieldAssert} instance */ - @JDIAction("Assert that '{name}' helper text {0}") + @JDIAction(value = "Assert that '{name}' helper text {0}", isAssert = true) public TextFieldAssert helperText(Matcher condition) { jdiAssert(element().helperText().text(), condition); return this; @@ -60,7 +60,7 @@ public TextFieldAssert helperText(Matcher condition) { * * @return this {@link TextFieldAssert} instance */ - @JDIAction("Assert that '{name}' has helper text") + @JDIAction(value = "Assert that '{name}' has helper text", isAssert = true) public TextFieldAssert hasHelperText() { jdiAssert(element().hasHelperText(), Matchers.is(true), "TextField doesn't have helper text"); return this; @@ -72,7 +72,7 @@ public TextFieldAssert hasHelperText() { * @param text expected placeholder text * @return this {@link TextFieldAssert} instance */ - @JDIAction("Assert that '{name}' placeholder text is '{0}'") + @JDIAction(value = "Assert that '{name}' placeholder text is '{0}'", isAssert = true) public TextFieldAssert placeholderText(String text) { return placeholderText(Matchers.is(text)); } @@ -83,7 +83,7 @@ public TextFieldAssert placeholderText(String text) { * @param condition expected condition * @return this {@link TextFieldAssert} instance */ - @JDIAction("Assert that '{name}' placeholder text {0}") + @JDIAction(value = "Assert that '{name}' placeholder text {0}", isAssert = true) public TextFieldAssert placeholderText(Matcher condition) { jdiAssert(element().placeHolderText(), condition); return this; @@ -94,7 +94,7 @@ public TextFieldAssert placeholderText(Matcher condition) { * * @return this {@link TextFieldAssert} instance */ - @JDIAction("Assert that '{name}' is focused") + @JDIAction(value = "Assert that '{name}' is focused", isAssert = true) public TextFieldAssert focused() { jdiAssert(element().isFocused(), Matchers.is(true), "TextField is not focused"); return this; @@ -106,7 +106,7 @@ public TextFieldAssert focused() { * @param type expected text field type * @return this {@link TextFieldAssert} instance */ - @JDIAction("Assert that '{name}' type is '{0}'") + @JDIAction(value = "Assert that '{name}' type is '{0}'", isAssert = true) public TextFieldAssert type(String type) { return type(Matchers.is(type)); } @@ -117,7 +117,7 @@ public TextFieldAssert type(String type) { * @param condition expected condition * @return this {@link TextFieldAssert} instance */ - @JDIAction("Assert that '{name}' type {0}") + @JDIAction(value = "Assert that '{name}' type {0}", isAssert = true) public TextFieldAssert type(Matcher condition) { jdiAssert(element().type(), condition); return this; @@ -128,7 +128,7 @@ public TextFieldAssert type(Matcher condition) { * * @return this {@link TextFieldAssert} instance */ - @JDIAction("Assert that '{name}' has error notification") + @JDIAction(value = "Assert that '{name}' has error notification", isAssert = true) public TextFieldAssert validationError() { jdiAssert(element().isValidationErrorPresent(), Matchers.is(true), "Validation Error is not displayed for TextField"); diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/inputs/TransferListAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/inputs/TransferListAssert.java index 5b9196e39b..044c6e9258 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/inputs/TransferListAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/inputs/TransferListAssert.java @@ -5,7 +5,6 @@ import com.epam.jdi.light.material.elements.inputs.transferlist.EnhancedTransferList; import com.epam.jdi.light.material.elements.inputs.transferlist.TransferList; -import com.jdiai.tools.Timer; import org.apache.commons.lang3.StringUtils; import org.hamcrest.Matchers; @@ -25,11 +24,9 @@ public class TransferListAssert extends UIAssert element().isChecked(itemText)); - jdiAssert(isChecked, Matchers.is(true), String.format("Element %s in Transferlist is not checked", itemText)); + jdiAssert(element().isChecked(itemText), Matchers.is(true), String.format("Element %s in Transferlist is not checked", itemText)); return this; } @@ -39,11 +36,9 @@ public TransferListAssert checked(String itemText) { * @param itemText text of the item that is expected to be unchecked * @return this {@link TransferListAssert} instance */ - @JDIAction("Assert that '{name}' item '{0}' is unchecked") + @JDIAction(value = "Assert that '{name}' item '{0}' is unchecked", isAssert = true) public TransferListAssert unchecked(String itemText) { - boolean isUnchecked = new Timer(base().getTimeout() * 1000L) - .wait(() -> element().isUnchecked(itemText)); - jdiAssert(isUnchecked, Matchers.is(true), + jdiAssert(element().isUnchecked(itemText), Matchers.is(true), String.format("Element %s in Transferlist is not unchecked", itemText)); return this; } @@ -54,7 +49,7 @@ public TransferListAssert unchecked(String itemText) { * @param items expected text of items that moved to the right list * @return this {@link TransferListAssert} instance */ - @JDIAction("Assert that '{name}' items {0} were moved to the right list") + @JDIAction(value = "Assert that '{name}' items {0} were moved to the right list", isAssert = true) public TransferListAssert itemsMovedRight(String... items) { List rightList = element().updateRightItems(); jdiAssert(rightList.containsAll(Arrays.asList(items)), Matchers.is(true), @@ -69,7 +64,7 @@ public TransferListAssert itemsMovedRight(String... items) { * @param items expected text of items that moved to the left list * @return this {@link TransferListAssert} instance */ - @JDIAction("Assert that '{name}' items {0} were moved to the left list") + @JDIAction(value = "Assert that '{name}' items {0} were moved to the left list", isAssert = true) public TransferListAssert itemsMovedLeft(String... items) { List leftList = element().updateLeftItems(); jdiAssert(leftList.containsAll(Arrays.asList(items)), Matchers.is(true), @@ -83,7 +78,7 @@ public TransferListAssert itemsMovedLeft(String... items) { * * @return this {@link TransferListAssert} instance */ - @JDIAction("Assert that '{name}' 'Move selected right' button is enabled") + @JDIAction(value = "Assert that '{name}' 'Move selected right' button is enabled", isAssert = true) public TransferListAssert isMoveRightButtonEnable() { jdiAssert(element().isMoveRightButtonEnabled() ? "Move right button is enabled" : "Move right button is disabled", Matchers.is("Move right button is enabled")); @@ -95,7 +90,7 @@ public TransferListAssert isMoveRightButtonEnable() { * * @return this {@link TransferListAssert} instance */ - @JDIAction("Assert that '{name}' 'Move selected right' button is disabled") + @JDIAction(value = "Assert that '{name}' 'Move selected right' button is disabled", isAssert = true) public TransferListAssert isMoveRightDisabled() { jdiAssert(element().isMoveRightButtonDisabled(), Matchers.is(true), "Move to right is not disabled"); @@ -107,7 +102,7 @@ public TransferListAssert isMoveRightDisabled() { * * @return this {@link TransferListAssert} instance */ - @JDIAction("Assert that '{name}' 'Move selected left' button is enabled") + @JDIAction(value = "Assert that '{name}' 'Move selected left' button is enabled", isAssert = true) public TransferListAssert isMoveLeftEnabled() { jdiAssert(element().isMoveLeftButtonEnabled(), Matchers.is(true), "Move to left is not enabled"); @@ -119,7 +114,7 @@ public TransferListAssert isMoveLeftEnabled() { * * @return this {@link TransferListAssert} instance */ - @JDIAction("Assert that '{name}' 'Move selected left' button is disabled") + @JDIAction(value = "Assert that '{name}' 'Move selected left' button is disabled", isAssert = true) public TransferListAssert isMoveLeftDisabled() { jdiAssert(element().isMoveLeftButtonDisabled(), Matchers.is(true), "Move to left is not disabled"); diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/layout/ContainerAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/layout/ContainerAssert.java index a0d98cf440..a38fd57d5d 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/layout/ContainerAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/layout/ContainerAssert.java @@ -19,7 +19,7 @@ public class ContainerAssert extends UIAssert implem * * @return this {@link ContainerAssert} instance */ - @JDIAction("Assert that '{name}' is fixed") + @JDIAction(value = "Assert that '{name}' is fixed", isAssert = true) public ContainerAssert fixed() { jdiAssert(element().isFixed(), Matchers.is(true), "Container is not fixed"); return this; @@ -30,7 +30,7 @@ public ContainerAssert fixed() { * * @return this {@link ContainerAssert} instance */ - @JDIAction("Assert that '{name}' is fluid") + @JDIAction(value = "Assert that '{name}' is fluid", isAssert = true) public ContainerAssert fluid() { jdiAssert(element().isFluid(), Matchers.is(true), "Container is not fluid"); return this; @@ -43,14 +43,14 @@ public ContainerAssert fluid() { * * @return this {@link ContainerAssert} instance */ - @JDIAction("Assert that '{name}' max width is {0}") + @JDIAction(value = "Assert that '{name}' max width is {0}", isAssert = true) public ContainerAssert maxWidth(int maxWidthValue) { jdiAssert(element().maxWidth(), Matchers.is(maxWidthValue)); return this; } @Override - @JDIAction("Assert that '{name}' text {0}") + @JDIAction(value = "Assert that '{name}' text {0}", isAssert = true) public ContainerAssert text(Matcher condition) { jdiAssert(element().getText(), condition); return this; diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/layout/GridAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/layout/GridAssert.java index f07d0a5fa4..bc75ad3802 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/layout/GridAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/layout/GridAssert.java @@ -18,7 +18,7 @@ public class GridAssert extends UIAssert { * @param number expected number of items * @return this {@link GridAssert} instance */ - @JDIAction("Assert that '{name}' has {0} items") + @JDIAction(value = "Assert that '{name}' has {0} items", isAssert = true) public GridAssert items(int number) { jdiAssert(element().items().size(), Matchers.is(number)); return this; diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/layout/GridListTileAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/layout/GridListTileAssert.java index 60f290503b..a37e1d79ba 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/layout/GridListTileAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/layout/GridListTileAssert.java @@ -1,6 +1,7 @@ package com.epam.jdi.light.material.asserts.layout; import com.epam.jdi.light.asserts.generic.UIAssert; +import com.epam.jdi.light.common.JDIAction; import com.epam.jdi.light.material.elements.layout.GridListTile; import com.epam.jdi.light.ui.html.asserts.HasImageAssert; import org.hamcrest.Matchers; @@ -10,26 +11,31 @@ public class GridListTileAssert extends UIAssert implements HasImageAssert { + @JDIAction(value = "Assert that '{name}' has alt text {0}", isAssert = true) public GridListTileAssert alternativeImageText(String alt) { jdiAssert(element().image().alt(), Matchers.is(alt)); return this; } + @JDIAction(value = "Assert that '{name}' has bar", isAssert = true) public GridListTileAssert hasBar() { jdiAssert(element().tileBar().isExist(), Matchers.is(true), "Tile has no bar"); return this; } + @JDIAction(value = "Assert that '{name}' has no bar", isAssert = true) public GridListTileAssert hasNoBar() { jdiAssert(element().tileBar().isNotExist(), Matchers.is(true), "Tile has bar"); return this; } - public GridListTileAssert isSubheader() { + @JDIAction(value = "Assert that '{name}' has subheader", isAssert = true) + public GridListTileAssert subheader() { jdiAssert(element().subheader().isExist(), Matchers.is(true), "Tile has no subheader"); return this; } + @JDIAction(value = "Assert that '{name}' has subheader {0}", isAssert = true) public GridListTileAssert subheader(String expSubheader) { jdiAssert(element().subheader().getText(), Matchers.is(expSubheader)); return this; diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/layout/GridListTileBarAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/layout/GridListTileBarAssert.java index 6269037ef9..e864eb75d5 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/layout/GridListTileBarAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/layout/GridListTileBarAssert.java @@ -1,6 +1,7 @@ package com.epam.jdi.light.material.asserts.layout; import com.epam.jdi.light.asserts.generic.UIAssert; +import com.epam.jdi.light.common.JDIAction; import com.epam.jdi.light.material.elements.layout.GridListTileBar; import com.epam.jdi.light.material.elements.utils.enums.Position; import org.hamcrest.Matchers; @@ -9,26 +10,31 @@ public class GridListTileBarAssert extends UIAssert { + @JDIAction(value = "Assert that '{name}' has position {0}", isAssert = true) public GridListTileBarAssert hasPosition(Position position) { jdiAssert(element().position(), Matchers.is(position)); return this; } + @JDIAction(value = "Assert that '{name}' has title {0}", isAssert = true) public GridListTileBarAssert title(String expTitle) { jdiAssert(element().title().getText(), Matchers.is(expTitle)); return this; } + @JDIAction(value = "Assert that '{name}' has subtitle {0}", isAssert = true) public GridListTileBarAssert subtitle(String expTitle) { jdiAssert(element().subtitle().getText(), Matchers.is(expTitle)); return this; } + @JDIAction(value = "Assert that '{name}' has action icon", isAssert = true) public GridListTileBarAssert hasAction() { jdiAssert(element().actionIcon().isExist(), Matchers.is(true), "Action doesn't exist in bar"); return this; } + @JDIAction(value = "Assert that '{name}' has no action icon", isAssert = true) public GridListTileBarAssert hasNoAction() { jdiAssert(element().actionIcon().isNotExist(), Matchers.is(true), "Action exists in bar"); return this; diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/navigation/DrawerAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/navigation/DrawerAssert.java index ad304a3724..7b929e71a0 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/navigation/DrawerAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/navigation/DrawerAssert.java @@ -6,7 +6,6 @@ import org.hamcrest.Matchers; import static com.epam.jdi.light.asserts.core.SoftAssert.jdiAssert; -import static com.jdiai.tools.Timer.waitCondition; /** * Assertions for {@link Drawer}. @@ -14,7 +13,7 @@ public class DrawerAssert extends PositionAssert { @Override - @JDIAction("Assert that '{name}' is displayed") + @JDIAction(value = "Assert that '{name}' is displayed", isAssert = true) public DrawerAssert displayed() { jdiAssert(element().core().isDisplayed(), Matchers.is(true), "Drawer is not displayed"); return this; @@ -26,7 +25,7 @@ public DrawerAssert displayed() { * @param totalNumber expected number of list items * @return this {@link DrawerAssert} instance */ - @JDIAction("Assert that '{name}' has {0} list items") + @JDIAction(value = "Assert that '{name}' has {0} list items", isAssert = true) public DrawerAssert totalSize(int totalNumber) { int sumLen = element().lists().stream() .mapToInt(list -> list.size()) @@ -42,16 +41,16 @@ public DrawerAssert totalSize(int totalNumber) { * @param expectedSize expected number of list items * @return this {@link DrawerAssert} instance */ - @JDIAction("Assert that '{name}' has {1} items in list {0}") + @JDIAction(value = "Assert that '{name}' has {1} items in list {0}", isAssert = true) public DrawerAssert sublistWithSize(int listIndex, int expectedSize) { jdiAssert(element().lists().get(listIndex).size(), Matchers.is(expectedSize)); return this; } @Override - @JDIAction("Assert that '{name}' is hidden") + @JDIAction(value = "Assert that '{name}' is hidden", isAssert = true) public DrawerAssert hidden() { - jdiAssert(waitCondition(() -> element().isHidden()), Matchers.is(true), + jdiAssert(element().isHidden(), Matchers.is(true), "Drawer is not hidden"); return this; } @@ -61,9 +60,9 @@ public DrawerAssert hidden() { * * @return this {@link DrawerAssert} instance */ - @JDIAction("Assert that '{name}' is not exist") + @JDIAction(value = "Assert that '{name}' is not exist", isAssert = true) public DrawerAssert notExist() { - jdiAssert(waitCondition(() -> element().core().isNotExist()), Matchers.is(true), + jdiAssert(element().core().isNotExist(), Matchers.is(true), "Drawer is exists"); return this; } diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/navigation/LinkAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/navigation/LinkAssert.java index 5cfcf7739c..1d8f46af43 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/navigation/LinkAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/navigation/LinkAssert.java @@ -19,7 +19,7 @@ public class LinkAssert extends UIAssert implements ITextAsser * * @return this {@link LinkAssert} instance */ - @JDIAction("Assert that '{name}' is underlined") + @JDIAction(value = "Assert that '{name}' is underlined", isAssert = true) public LinkAssert underlined() { jdiAssert(element().isUnderlined(), Matchers.is(true), "Link is not underlined"); return this; @@ -30,14 +30,14 @@ public LinkAssert underlined() { * * @return this {@link LinkAssert} instance */ - @JDIAction("Assert that '{name}' is not underlined") + @JDIAction(value = "Assert that '{name}' is not underlined", isAssert = true) public LinkAssert notUnderlined() { jdiAssert(element().isNotUnderlined(), Matchers.is(true), "Link is underlined"); return this; } @Override - @JDIAction("Assert that '{name}' text {0}") + @JDIAction(value = "Assert that '{name}' text {0}", isAssert = true) public LinkAssert text(Matcher condition) { jdiAssert(element().text(), condition); return this; @@ -49,19 +49,19 @@ public LinkAssert text(Matcher condition) { * @param style given style * @return this {@link LinkAssert} instance */ - @JDIAction("Assert that '{name}' has '{0}' style") + @JDIAction(value = "Assert that '{name}' has '{0}' style", isAssert = true) public LinkAssert style(TypographyComponentStyle style) { jdiAssert(element().getStyle(), Matchers.is(style)); return this; } - @JDIAction("Assert that '{name}' has icon") + @JDIAction(value = "Assert that '{name}' has icon", isAssert = true) public LinkAssert hasIcon() { jdiAssert(element().hasIcon(), Matchers.is(true), "Link has no Icon"); return this; } - @JDIAction("Assert that '{name}' has no icon") + @JDIAction(value = "Assert that '{name}' has no icon", isAssert = true) public LinkAssert hasNoIcon() { jdiAssert(element().hasIcon(), Matchers.is(false), "Link has Icon"); return this; diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/navigation/MUIStepperAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/navigation/MUIStepperAssert.java index 229fb83363..6531f3c1c3 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/navigation/MUIStepperAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/navigation/MUIStepperAssert.java @@ -3,7 +3,6 @@ import com.epam.jdi.light.asserts.core.SoftAssert; import com.epam.jdi.light.common.JDIAction; import com.epam.jdi.light.material.elements.navigation.steppers.MUIStepper; -import com.jdiai.tools.Timer; import org.hamcrest.Matchers; import java.util.Arrays; @@ -20,7 +19,7 @@ public class MUIStepperAssert extends StepperAssert element().hasStep(step)).collect(Collectors.toList()), @@ -34,7 +33,7 @@ public MUIStepperAssert steps(Integer[] indexes) { * @param labelTexts expected step label texts (headers) * @return this {@link MUIStepperAssert} instance */ - @JDIAction("Assert that '{name}' has '{0}' steps") + @JDIAction(value = "Assert that '{name}' has '{0}' steps", isAssert = true) public MUIStepperAssert steps(String[] labelTexts) { SoftAssert.jdiAssert( Arrays.stream(labelTexts).filter(step -> element().hasStep(step)).collect(Collectors.toList()), @@ -47,7 +46,7 @@ public MUIStepperAssert steps(String[] labelTexts) { * * @return this {@link MUIStepperAssert} instance */ - @JDIAction("Assert that all steps in '{name}' are completed") + @JDIAction(value = "Assert that all steps in '{name}' are completed", isAssert = true) public MUIStepperAssert allStepsCompleted() { SoftAssert.jdiAssert(element().hasAllStepsCompleted(), Matchers.is(true), @@ -60,7 +59,7 @@ public MUIStepperAssert allStepsCompleted() { * * @return this {@link MUIStepperAssert} instance */ - @JDIAction("Assert that all steps in '{name}' are incomplete") + @JDIAction(value = "Assert that all steps in '{name}' are incomplete", isAssert = true) public MUIStepperAssert allStepsIncomplete() { SoftAssert.jdiAssert(element().hasAllStepsIncomplete(), Matchers.is(true), @@ -74,10 +73,9 @@ public MUIStepperAssert allStepsIncomplete() { * @param stepNumber step number in this stepper * @return this {@link MUIStepperAssert} instance */ - @JDIAction("Assert that step '{0}' in '{name}' is completed") + @JDIAction(value = "Assert that step '{0}' in '{name}' is completed", isAssert = true) public MUIStepperAssert stepCompleted(int stepNumber) { - Timer timer = new Timer(base().getTimeout() * 1000L); - SoftAssert.jdiAssert(timer.wait(() -> element().hasStepCompleted(stepNumber - 1)), + SoftAssert.jdiAssert(element().hasStepCompleted(stepNumber - 1), Matchers.is(true), String.format("Step %s in not completed", stepNumber)); return this; } @@ -88,7 +86,7 @@ public MUIStepperAssert stepCompleted(int stepNumber) { * @param stepNumber step number in this stepper * @return this {@link MUIStepperAssert} instance */ - @JDIAction("Assert that step '{0}' in '{name}' is incomplete") + @JDIAction(value = "Assert that step '{0}' in '{name}' is incomplete", isAssert = true) public MUIStepperAssert stepIncomplete(int stepNumber) { SoftAssert.jdiAssert(element().hasStepCompleted(stepNumber - 1), Matchers.is(false), String.format("Step %s in not incomplete", stepNumber)); @@ -100,7 +98,7 @@ public MUIStepperAssert stepIncomplete(int stepNumber) { * * @return this {@link MUIStepperAssert} instance */ - @JDIAction("Assert that '{name}' is vertical") + @JDIAction(value = "Assert that '{name}' is vertical", isAssert = true) public MUIStepperAssert isVertical() { SoftAssert.jdiAssert(element().isVertical(), Matchers.is(true), String.format("Stepper %s in not vertical", this.name)); @@ -112,7 +110,7 @@ public MUIStepperAssert isVertical() { * * @return this {@link MUIStepperAssert} instance */ - @JDIAction("Assert that '{name}' is horizontal") + @JDIAction(value = "Assert that '{name}' is horizontal", isAssert = true) public MUIStepperAssert isHorizontal() { SoftAssert.jdiAssert(element().isVertical(), Matchers.is(false), String.format("Stepper %s in vertical", this.name)); diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/navigation/MenuAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/navigation/MenuAssert.java index fbfe00486d..52b21b9fbc 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/navigation/MenuAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/navigation/MenuAssert.java @@ -21,7 +21,7 @@ public class MenuAssert extends UISelectAssert { * @param expectedItems full text content of items to be found as {@link List} of {@link String} * @return this {@link MenuAssert} instance */ - @JDIAction("Assert that '{name}' has items {0}") + @JDIAction(value = "Assert that '{name}' has items {0}", isAssert = true) public MenuAssert itemsTexts(List expectedItems) { return itemsTexts(Matchers.contains(expectedItems.toArray())); } @@ -32,7 +32,7 @@ public MenuAssert itemsTexts(List expectedItems) { * @param condition expected texts as {@link Matcher} * @return this {@link MenuAssert} instance */ - @JDIAction("Assert that '{name}' has items {0}") + @JDIAction(value = "Assert that '{name}' has items {0}", isAssert = true) public MenuAssert itemsTexts(Matcher> condition) { jdiAssert(element().itemsTexts(), condition); return this; diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/navigation/StepAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/navigation/StepAssert.java index 89b6ef044f..42255b35c5 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/navigation/StepAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/navigation/StepAssert.java @@ -9,14 +9,14 @@ public class StepAssert extends UIAssert { - @JDIAction("Check that '{name}' step is completed") + @JDIAction(value = "Check that '{name}' step is completed", isAssert = true) public StepAssert completed() { jdiAssert(element().isCompleted(), Matchers.is(true), "Step is not completed"); return this; } - @JDIAction("Check that '{name}' step is incomplete") + @JDIAction(value = "Check that '{name}' step is incomplete", isAssert = true) public StepAssert incomplete() { jdiAssert(element().isCompleted(), Matchers.is(false), "Step is completed"); diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/navigation/StepperAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/navigation/StepperAssert.java index bd63e0ee0b..d83116b568 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/navigation/StepperAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/navigation/StepperAssert.java @@ -21,7 +21,7 @@ public class StepperAssert, E extends Stepper> exten * @param index expected current step index * @return this {@link StepperAssert} instance */ - @JDIAction("Assert that '{name}' current index is {0}") + @JDIAction(value = "Assert that '{name}' current index is {0}", isAssert = true) public StepperAssert currentIndex(int index) { return currentIndex(Matchers.is(index)); } @@ -32,7 +32,7 @@ public StepperAssert currentIndex(int index) { * @param condition expected condition * @return this {@link StepperAssert} instance */ - @JDIAction("Assert that '{name}' current value {0}") + @JDIAction(value = "Assert that '{name}' current value {0}", isAssert = true) public StepperAssert currentIndex(Matcher condition) { SoftAssert.jdiAssert(element().currentIndex(), condition); return this; @@ -44,7 +44,7 @@ public StepperAssert currentIndex(Matcher condition) { * @param index expected maximal step index * @return this {@link StepperAssert} instance */ - @JDIAction("Assert that '{name}' max index is {0}") + @JDIAction(value = "Assert that '{name}' max index is {0}", isAssert = true) public StepperAssert maxIndex(int index) { return maxIndex(Matchers.is(index)); } @@ -55,7 +55,7 @@ public StepperAssert maxIndex(int index) { * @param condition expected condition * @return this {@link StepperAssert} instance */ - @JDIAction("Assert that '{name}' max value {0}") + @JDIAction(value = "Assert that '{name}' max value {0}", isAssert = true) public StepperAssert maxIndex(Matcher condition) { SoftAssert.jdiAssert(element().maxIndex(), condition); return this; diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/navigation/TabsAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/navigation/TabsAssert.java index 2f87339bcd..5845c7d507 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/navigation/TabsAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/navigation/TabsAssert.java @@ -18,7 +18,7 @@ public class TabsAssert extends UISelectAssert { * @param index tab's index * @return this {@link TabsAssert} instance */ - @JDIAction("Assert that {0} tab in '{name}' is disabled") + @JDIAction(value = "Assert that {0} tab in '{name}' is disabled", isAssert = true) public TabsAssert disabled(int index) { jdiAssert(element().disabled(index), Matchers.is(true), String.format("Tab %d is not disabled", index)); @@ -31,7 +31,7 @@ public TabsAssert disabled(int index) { * @param index tab's index * @return this {@link TabsAssert} instance */ - @JDIAction("Assert that {0} tab in '{name}' is enabled") + @JDIAction(value = "Assert that {0} tab in '{name}' is enabled", isAssert = true) public TabsAssert enabled(int index) { jdiAssert(element().enabled(index), Matchers.is(true), String.format("Tab %d is not enabled", index)); diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/surfaces/AccordionAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/surfaces/AccordionAssert.java index abdc262c21..6e6041eff4 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/surfaces/AccordionAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/surfaces/AccordionAssert.java @@ -18,7 +18,7 @@ public class AccordionAssert extends UIAssert { * * @return this {@link AccordionAssert} instance */ - @JDIAction("Assert that '{name}' is expanded") + @JDIAction(value = "Assert that '{name}' is expanded", isAssert = true) public AccordionAssert expanded() { jdiAssert(element().isExpanded(), Matchers.is(true), "Accordion is not expanded"); return this; @@ -29,70 +29,70 @@ public AccordionAssert expanded() { * * @return this {@link AccordionAssert} instance */ - @JDIAction("Assert that '{name}' is collapsed") + @JDIAction(value = "Assert that '{name}' is collapsed", isAssert = true) public AccordionAssert collapsed() { jdiAssert(element().isCollapsed(), Matchers.is(true), "Accordion is not collapsed"); return this; } - @JDIAction("Assert that '{name}' has first header") + @JDIAction(value = "Assert that '{name}' has first header", isAssert = true) public AccordionAssert hasFirstHeader() { jdiAssert(element().firstHeader.isExist(), Matchers.is(true), "Accordion has no first header"); return this; } - @JDIAction("Assert that '{name}' has second header") + @JDIAction(value = "Assert that '{name}' has second header", isAssert = true) public AccordionAssert hasSecondHeader() { jdiAssert(element().secondHeader.isExist(), Matchers.is(true), "Accordion has no second header"); return this; } - @JDIAction("Assert that '{name}' has no first header") + @JDIAction(value = "Assert that '{name}' has no first header", isAssert = true) public AccordionAssert hasNoFirstHeader() { jdiAssert(element().firstHeader.isNotExist(), Matchers.is(true), "Accordion has first header"); return this; } - @JDIAction("Assert that '{name}' has no second header") + @JDIAction(value = "Assert that '{name}' has no second header", isAssert = true) public AccordionAssert hasNoSecondHeader() { jdiAssert(element().secondHeader.isNotExist(), Matchers.is(true), "Accordion has second header"); return this; } - @JDIAction("Assert that '{name}' has {0} in details") + @JDIAction(value = "Assert that '{name}' has {0} in details", isAssert = true) public AccordionAssert details(String expText) { jdiAssert(element().details.getText(), Matchers.is(expText)); return this; } - @JDIAction("Assert that '{name}' has {0} in details") + @JDIAction(value = "Assert that '{name}' has {0} in details", isAssert = true) public AccordionAssert details(Matcher expMatcher) { jdiAssert(element().details.getText(), expMatcher); return this; } - @JDIAction("Assert that '{name}' has {0} in first Header") + @JDIAction(value = "Assert that '{name}' has {0} in first Header", isAssert = true) public AccordionAssert firstHeader(String expText) { jdiAssert(element().firstHeader.getText(), Matchers.is(expText)); return this; } - @JDIAction("Assert that '{name}' has {0} in first Header") + @JDIAction(value = "Assert that '{name}' has {0} in first Header", isAssert = true) public AccordionAssert firstHeader(Matcher expMatcher) { jdiAssert(element().firstHeader.getText(), expMatcher); return this; } - @JDIAction("Assert that '{name}' has {0} in second Header") + @JDIAction(value = "Assert that '{name}' has {0} in second Header", isAssert = true) public AccordionAssert secondHeader(String expText) { jdiAssert(element().secondHeader.getText(), Matchers.is(expText)); return this; } - @JDIAction("Assert that '{name}' has {0} in second Header") + @JDIAction(value = "Assert that '{name}' has {0} in second Header", isAssert = true) public AccordionAssert secondHeader(Matcher expMatcher) { jdiAssert(element().secondHeader.getText(), expMatcher); return this; diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/surfaces/CardAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/surfaces/CardAssert.java index 057524ca69..e8b5f82d73 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/surfaces/CardAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/surfaces/CardAssert.java @@ -18,7 +18,7 @@ public class CardAssert extends UIAssert { * @param condition expected condition * @return this {@link CardAssert} instance */ - @JDIAction("Assert that '{name}' title text {0}") + @JDIAction(value = "Assert that '{name}' title text {0}", isAssert = true) public CardAssert title(Matcher condition) { jdiAssert(element().title().getText(), condition); return this; @@ -30,7 +30,7 @@ public CardAssert title(Matcher condition) { * @param condition expected condition * @return this {@link CardAssert} instance */ - @JDIAction("Assert that '{name}' sub header text {0}") + @JDIAction(value = "Assert that '{name}' sub header text {0}", isAssert = true) public CardAssert subHeader(Matcher condition) { jdiAssert(element().subHeader().getText(), condition); return this; diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/surfaces/PaperAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/surfaces/PaperAssert.java index 5cf0545185..f7136a1e8f 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/surfaces/PaperAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/surfaces/PaperAssert.java @@ -17,7 +17,7 @@ public class PaperAssert extends UIAssert { * * @return this {@link PaperAssert} instance */ - @JDIAction("Assert that '{name}' is rounded") + @JDIAction(value = "Assert that '{name}' is rounded", isAssert = true) public PaperAssert rounded() { jdiAssert(element().isRounded(), Matchers.is(true), "Paper is not rounded"); return this; @@ -28,7 +28,7 @@ public PaperAssert rounded() { * * @return this {@link PaperAssert} instance */ - @JDIAction("Assert that '{name}' is not rounded") + @JDIAction(value = "Assert that '{name}' is not rounded", isAssert = true) public PaperAssert notRounded() { jdiAssert(element().isRounded(), Matchers.is(false), "Paper is rounded"); return this; @@ -39,7 +39,7 @@ public PaperAssert notRounded() { * * @return this {@link PaperAssert} instance */ - @JDIAction("Assert that '{name}' is outlined") + @JDIAction(value = "Assert that '{name}' is outlined", isAssert = true) public PaperAssert outlined() { jdiAssert(element().isOutlined(), Matchers.is(true), "Paper is not outlined"); return this; @@ -50,7 +50,7 @@ public PaperAssert outlined() { * * @return this {@link PaperAssert} instance */ - @JDIAction("Assert that '{name}' is not outlined") + @JDIAction(value = "Assert that '{name}' is not outlined", isAssert = true) public PaperAssert notOutlined() { jdiAssert(element().isOutlined(), Matchers.is(false), "Paper is outlined"); return this; @@ -62,7 +62,7 @@ public PaperAssert notOutlined() { * @param expectedElevation expected elevation * @return this {@link PaperAssert} instance */ - @JDIAction("Assert that '{name}' has elevation {0}") + @JDIAction(value = "Assert that '{name}' has elevation {0}", isAssert = true) public PaperAssert elevation(int expectedElevation) { jdiAssert(element().elevation(), Matchers.is(expectedElevation)); return this; diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/utils/ModalAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/utils/ModalAssert.java index 373d10775f..85a23bc8c2 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/utils/ModalAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/utils/ModalAssert.java @@ -15,7 +15,7 @@ public class ModalAssert extends UIAssert implements ITextAssert { @Override - @JDIAction("Assert that {name} text {0}") + @JDIAction(value = "Assert that {name} text {0}", isAssert = true) public ModalAssert text(Matcher condition) { jdiAssert(element().getText(), Matchers.is(condition)); return this; diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/utils/PopoverAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/utils/PopoverAssert.java index 167c53615c..189cfca2c6 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/utils/PopoverAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/utils/PopoverAssert.java @@ -14,7 +14,7 @@ public class PopoverAssert extends UIAssert implements ITextAssert { @Override - @JDIAction("Assert that '{name}' text {0}") + @JDIAction(value = "Assert that '{name}' text {0}", isAssert = true) public PopoverAssert text(Matcher condition) { jdiAssert(element().text(), condition); return this; diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/utils/PopperAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/utils/PopperAssert.java index 09071fb3dd..95bae1578f 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/utils/PopperAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/utils/PopperAssert.java @@ -6,7 +6,6 @@ import org.hamcrest.Matcher; import static com.epam.jdi.light.asserts.core.SoftAssert.jdiAssert; -import static com.jdiai.tools.Timer.waitCondition; /** * Assertions for {@link Popper} @@ -14,16 +13,15 @@ public class PopperAssert extends PositionAssert implements ITextAssert { @Override - @JDIAction("Assert that '{name}' text {0}") + @JDIAction(value = "Assert that '{name}' text {0}", isAssert = true) public PopperAssert text(Matcher condition) { jdiAssert(element().text(), condition); return this; } @Override - @JDIAction("Assert that '{name}' is not visible by user") + @JDIAction(value = "Assert that '{name}' is not visible by user", isAssert = true) public PopperAssert notVisible() { - waitCondition(() -> element().isNotVisible()); super.notVisible(); return this; } diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/utils/PositionAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/utils/PositionAssert.java index d502ceff40..620c996c05 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/utils/PositionAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/utils/PositionAssert.java @@ -10,13 +10,13 @@ public abstract class PositionAssert, E extends HasPosition> extends UIAssert { - @JDIAction("Assert that '{name}' has position '{0}'") + @JDIAction(value = "Assert that '{name}' has position '{0}'", isAssert = true) public A position(String position) { jdiAssert(element().position(), Matchers.is(Position.fromFullString(position))); return (A) this; } - @JDIAction("Assert that '{name}' has position '{0}'") + @JDIAction(value = "Assert that '{name}' has position '{0}'", isAssert = true) public A position(Position position) { jdiAssert(element().position(), Matchers.is(position)); return (A) this; diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/utils/TransitionAssert.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/utils/TransitionAssert.java index 8499297161..a0672132b8 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/utils/TransitionAssert.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/asserts/utils/TransitionAssert.java @@ -6,7 +6,6 @@ import org.hamcrest.Matchers; import static com.epam.jdi.light.asserts.core.SoftAssert.jdiAssert; -import static com.jdiai.tools.Timer.waitCondition; /** * Assertions for {@link Transition} @@ -18,9 +17,9 @@ public class TransitionAssert extends UIAssert { * * @return this {@link TransitionAssert} instance */ - @JDIAction("Assert that '{name}' is entered") + @JDIAction(value = "Assert that '{name}' is entered", isAssert = true) public TransitionAssert entered() { - jdiAssert(waitCondition(() -> element().isEntered()), Matchers.is(true), + jdiAssert(element().isEntered(), Matchers.is(true), "Transition is not entered"); return this; } @@ -30,25 +29,25 @@ public TransitionAssert entered() { * * @return this {@link TransitionAssert} instance */ - @JDIAction("Assert that '{name}' is exited") + @JDIAction(value = "Assert that '{name}' is exited", isAssert = true) public TransitionAssert exited() { - jdiAssert(waitCondition(() -> element().isExited()), Matchers.is(true), + jdiAssert(element().isExited(), Matchers.is(true), "Transition is not exited"); return this; } @Override - @JDIAction("Assert that '{name}' is hidden") + @JDIAction(value = "Assert that '{name}' is hidden", isAssert = true) public TransitionAssert hidden() { - jdiAssert(waitCondition(() -> element().isHidden()), Matchers.is(true), + jdiAssert(element().isHidden(), Matchers.is(true), "Transition is visible"); return this; } @Override - @JDIAction("Assert that '{name}' is displayed") + @JDIAction(value = "Assert that '{name}' is displayed", isAssert = true) public TransitionAssert displayed() { - jdiAssert(waitCondition(() -> element().isDisplayed()), Matchers.is(true), + jdiAssert(element().isDisplayed(), Matchers.is(true), "Transition is hidden"); return this; } diff --git a/jdi-light-vuetify-tests/src/test/java/io/github/epam/testng/TestNGListener.java b/jdi-light-vuetify-tests/src/test/java/io/github/epam/testng/TestNGListener.java index 2192474e4c..6460f02cc1 100644 --- a/jdi-light-vuetify-tests/src/test/java/io/github/epam/testng/TestNGListener.java +++ b/jdi-light-vuetify-tests/src/test/java/io/github/epam/testng/TestNGListener.java @@ -16,7 +16,7 @@ import static java.lang.System.currentTimeMillis; public class TestNGListener implements IInvokedMethodListener { - private Long start = currentTimeMillis(); + private long start = currentTimeMillis(); @Override public void beforeInvocation(IInvokedMethod m, ITestResult tr) { diff --git a/jdi-light-vuetify-tests/src/test/java/io/github/epam/vuetify/tests/complex/ColorPickersTests.java b/jdi-light-vuetify-tests/src/test/java/io/github/epam/vuetify/tests/complex/ColorPickersTests.java index 1f934647bf..b918938b2e 100644 --- a/jdi-light-vuetify-tests/src/test/java/io/github/epam/vuetify/tests/complex/ColorPickersTests.java +++ b/jdi-light-vuetify-tests/src/test/java/io/github/epam/vuetify/tests/complex/ColorPickersTests.java @@ -1,16 +1,11 @@ package io.github.epam.vuetify.tests.complex; -import com.epam.jdi.light.elements.common.UIElement; import io.github.com.dataproviders.ColorPickersDataProviders; import io.github.epam.TestsInit; -import org.openqa.selenium.support.Color; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; -import java.util.ArrayList; - import static com.epam.jdi.light.vuetify.elements.complex.ColorPicker.ALPHA_HEX_LENGTH; -import static com.epam.jdi.light.vuetify.elements.complex.ColorPicker.DIV; import static com.epam.jdi.light.vuetify.elements.complex.ColorPicker.HEX; import static com.epam.jdi.light.vuetify.elements.complex.ColorPicker.HEXA; import static com.epam.jdi.light.vuetify.elements.complex.ColorPicker.HSL; @@ -22,7 +17,6 @@ import static com.epam.jdi.light.vuetify.elements.complex.ColorPicker.RGBA; import static com.jdiai.tools.Timer.waitCondition; import static io.github.com.StaticSite.colorPickersPage; -import static io.github.com.pages.ColorPickersPage.bigSwatchesColorPicker; import static io.github.com.pages.ColorPickersPage.dropdownInput; import static io.github.com.pages.ColorPickersPage.dropdownInputColorPicker; import static io.github.com.pages.ColorPickersPage.elevationColorPicker; @@ -32,7 +26,6 @@ import static io.github.com.pages.ColorPickersPage.hexaModelButton; import static io.github.com.pages.ColorPickersPage.hslaModelButton; import static io.github.com.pages.ColorPickersPage.hsvaModelButton; -import static io.github.com.pages.ColorPickersPage.mediumSwatchesColorPicker; import static io.github.com.pages.ColorPickersPage.modelColorPicker; import static io.github.com.pages.ColorPickersPage.noCanvasColorPicker; import static io.github.com.pages.ColorPickersPage.noInputsColorPicker; @@ -56,10 +49,10 @@ public void fullCanvasColorPickerTest(String colorValue, double initialHueSliderStyle = fullCanvasColorPicker.hueSlider().value(); double initialAlphaSliderStyle = fullCanvasColorPicker.alphaSlider().value(); fullCanvasColorPicker.setColor(colorValue); - fullCanvasColorPicker.has().color(colorValue) + fullCanvasColorPicker.has().dotColor(colorValue) .and().hueSliderValueHaveChanged(initialHueSliderStyle); fullCanvasColorPicker.setColor(transparentColorValue); - fullCanvasColorPicker.has().color(transparentColorValue) + fullCanvasColorPicker.has().dotColor(transparentColorValue) .and().alphaSliderValueHaveChanged(initialAlphaSliderStyle); } @@ -89,7 +82,7 @@ public void noInputColorPickerTest() { .and().canvasDotStyle() .and().hueSliderValue() .and().alphaSliderValue() - .and().color(INITIAL_RGBA_STRING_COLOR); + .and().dotColor(INITIAL_RGBA_STRING_COLOR); } @Test(description = "Test checks different color schemes in color picker") diff --git a/jdi-light-vuetify-tests/src/test/java/io/github/epam/vuetify/tests/complex/ItemGroupsTests.java b/jdi-light-vuetify-tests/src/test/java/io/github/epam/vuetify/tests/complex/ItemGroupsTests.java index fa5ccb96c6..267d263ebc 100644 --- a/jdi-light-vuetify-tests/src/test/java/io/github/epam/vuetify/tests/complex/ItemGroupsTests.java +++ b/jdi-light-vuetify-tests/src/test/java/io/github/epam/vuetify/tests/complex/ItemGroupsTests.java @@ -68,15 +68,10 @@ public void activeClassTests() { } @Test(description="Test checks items feature: 'mandatory', i.e. only one item is always chosen") public void mandatoryItemGroupTest() { - //Check that before selecting any item we already have first element item--active - mandatoryItemGroup.get(1).has().cssClass("v-item--active"); - //Check that if we select already item--active element it stays selected mandatoryItemGroup.select(1); - mandatoryItemGroup.has().selected(1); - //And other items in group stay not selected - mandatoryItemGroup.has().notSelected(2) - .and().notSelected(3); + mandatoryItemGroup.has().selected(1).and().notSelected(2) + .and().notSelected(3); //Check that if we select next item it becomes 'selected' and all other items become 'not selected' mandatoryItemGroup.select(2); @@ -135,13 +130,13 @@ public void selectionItemGroupTest() { selectionItemGroup.is().lightTheme(); } + // TODO: Fix test and logic @Test(description="Test checks item group feature: 'max'(Sets a maximum number of selections that can be made)") public void maxChipsItemGroupTest() { //On our test-site max=3 - long selectedItems; chipsItemGroup.is().displayed(); chipsItemGroup.list().forEach(HasClick::click); - selectedItems = chipsItemGroup.list().stream().filter(el -> el.hasClass("v-item--active")).count(); - Assert.assertEquals(selectedItems, 3); + long selectedItems = chipsItemGroup.list().stream().filter(el -> el.hasClass("v-item--active")).count(); + Assert.assertEquals(selectedItems, 3, ""); } } 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 11fb4ebfa3..a37c7af62b 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 @@ -135,7 +135,7 @@ public static void verticalTabsTest() { waitCondition(() -> verticalTabs.icons().get(finalOpt).isVisible()); verticalTabs.icons().get(finalOpt).is().visible(); waitCondition(() -> verticalTabs.getTabTextContent().contains(USER_PROFILE_TEXT[finalOpt])); - verticalTabs.has().tabTextContentContaining(USER_PROFILE_TEXT[finalOpt]); + verticalTabs.has().tabTextContentContains(USER_PROFILE_TEXT[finalOpt]); verticalTabs.get(opt + 1).has().text(OPTIONS[finalOpt]); } contentTabs.is().notVertical(); @@ -145,7 +145,7 @@ public static void verticalTabsTest() { public static void contentTabsTest() { contentTabs.show(); contentTabs.has().values(equalTo(asList("ITEM 1", "ITEM 2", "ITEM 3"))); - contentTabs.has().tabTextContentContaining("Lorem ipsum dolor sit amet"); + contentTabs.has().tabTextContentContains("Lorem ipsum dolor sit amet"); } @Test(description = "Test checks tab addition and removal for dynamic tabs") diff --git a/jdi-light-vuetify-tests/src/test/java/io/github/epam/vuetify/tests/complex/TextFieldsTests.java b/jdi-light-vuetify-tests/src/test/java/io/github/epam/vuetify/tests/complex/TextFieldsTests.java index b5adce04f6..656d110a1f 100644 --- a/jdi-light-vuetify-tests/src/test/java/io/github/epam/vuetify/tests/complex/TextFieldsTests.java +++ b/jdi-light-vuetify-tests/src/test/java/io/github/epam/vuetify/tests/complex/TextFieldsTests.java @@ -311,6 +311,7 @@ public void iconSlotsTextFieldTest() { tooltip.is().visible(); } + // TODO Check this test, find is not a testable feature here @Test (description = "Test checks text field label and it's text") public void labelTextFieldTest() { labelTextField.has().label(); @@ -343,6 +344,7 @@ public void heightTextFieldTest() { customHeightTextField1.has().height(184); } + // TODO Check assert for progress @Test (description = "Test checks progress bar condition") public void progressTextFieldTest() { for (int i = 1; i < 10; i++) { @@ -379,7 +381,6 @@ public void placeholderTextField() { placeholderTextField1.has().placeholder(); placeholderTextField1.has().placeholder("Filled"); noPlaceholderTextField.has().notPlaceholder(); - } @Test (description = "Test checks reverse feature : reverse (y/n)") diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/AlertAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/AlertAssert.java index 374b329ddd..a6648f2ee2 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/AlertAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/AlertAssert.java @@ -28,103 +28,97 @@ public class AlertAssert extends UIAssert implements ITextAs OutlinedAssert, ElevationAssert { - @JDIAction("Assert that '{name}' text {0}") + @JDIAction(value = "Assert that '{name}' text {0}", isAssert = true) public AlertAssert text(Matcher condition) { jdiAssert(element().getText(), condition); return this; } - @JDIAction("Assert that '{name}' is dismissible") + @JDIAction(value = "Assert that '{name}' is dismissible", isAssert = true) public AlertAssert dismissible() { jdiAssert(element().isDismissible(), Matchers.is(true), "Alert is not dismissible"); return this; } - @JDIAction("Assert that '{name}' is not dismissible") + @JDIAction(value = "Assert that '{name}' is not dismissible", isAssert = true) public AlertAssert notDismissible() { jdiAssert(element().isDismissible(), Matchers.is(false), "Alert is dismissible"); return this; } - @JDIAction("Assert that '{name}' is prominent") + @JDIAction(value = "Assert that '{name}' is prominent", isAssert = true) public AlertAssert prominent() { jdiAssert(element().isProminent(), Matchers.is(true), "Alert is not prominent"); return this; } - @JDIAction("Assert that '{name}' is not prominent") + @JDIAction(value = "Assert that '{name}' is not prominent", isAssert = true) public AlertAssert notProminent() { jdiAssert(element().isProminent(), Matchers.is(false), "Alert is prominent"); return this; } - @JDIAction("Assert that '{name}' has border") + @JDIAction(value = "Assert that '{name}' has border", isAssert = true) public AlertAssert border() { jdiAssert(element().hasBorder(), Matchers.is(true), "Alert has no border"); return this; } - @JDIAction("Assert that '{name}' has no border") + @JDIAction(value = "Assert that '{name}' has no border", isAssert = true) public AlertAssert noBorder() { jdiAssert(element().hasBorder(), Matchers.is(false), "Alert has border"); return this; } - @JDIAction("Assert that '{name}' has {0} border") + @JDIAction(value = "Assert that '{name}' has {0} border", isAssert = true) public AlertAssert border(String boardValue) { - String actualBorderValue = element().borderValue(); - jdiAssert(actualBorderValue, Matchers.is(boardValue), - String.format("Alert has '%s' border, but expected '%s'", actualBorderValue, boardValue)); + jdiAssert(element().borderValue(), Matchers.is(boardValue)); return this; } - @JDIAction("Assert that '{name}' has colored border") + @JDIAction(value = "Assert that '{name}' has colored border", isAssert = true) public AlertAssert coloredBorder() { jdiAssert(element().hasColoredBorder(), Matchers.is(true), "Alert has no colored border"); return this; } - @JDIAction("Assert that '{name}' has no colored border") + @JDIAction(value = "Assert that '{name}' has no colored border", isAssert = true) public AlertAssert noColoredBorder() { jdiAssert(element().hasColoredBorder(), Matchers.is(false), "Alert has colored border"); return this; } - @JDIAction("Assert that '{name}' has border background color '{0}'") + @JDIAction(value = "Assert that '{name}' has border background color '{0}'", isAssert = true) public AlertAssert backgroundBorderColor(String borderBackgroundColor) { if (element().hasColoredBorder()) { - String actualBackgroundBorderColor = element().borderBackGroundColor(); - jdiAssert(actualBackgroundBorderColor, Matchers.is(borderBackgroundColor), - String.format("Actual alert background border color is '%s', but expected '%s'", actualBackgroundBorderColor, borderBackgroundColor)); + jdiAssert(element().borderBackGroundColor(), Matchers.is(borderBackgroundColor)); return this; } else { return coloredBorder(); } } - @JDIAction("Assert that '{name}' has '{0}' type") + @JDIAction(value = "Assert that '{name}' has '{0}' type", isAssert = true) public AlertAssert type(String type) { - String actualType = element().type().toString(); - jdiAssert(actualType, Matchers.is(type), - String.format("Actual alert type is '%s', bur expected '%s'", actualType, type)); + jdiAssert(element().type().toString(), Matchers.is(type)); return this; } - @JDIAction("Assert that '{name}' has '{0}' type") + @JDIAction(value = "Assert that '{name}' has '{0}' type", isAssert = true) public AlertAssert type(AlertType type) { jdiAssert(element().type(), Matchers.is(type)); return this; } - @JDIAction("Assert that '{name}' has close button") + @JDIAction(value = "Assert that '{name}' has close button", isAssert = true) public AlertAssert hasCloseButton() { jdiAssert(element().hasCloseButton(), Matchers.is(true), "Alert has no close button"); return this; } - @JDIAction("Assert that '{name}' has close button") + @JDIAction(value = "Assert that '{name}' has close button", isAssert = true) public AlertAssert hasNoCloseButton() { jdiAssert(element().hasCloseButton(), Matchers.is(false), "Alert has close button"); return this; diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/AspectRatiosAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/AspectRatiosAssert.java index 9b2fac19c8..24540aab8f 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/AspectRatiosAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/AspectRatiosAssert.java @@ -23,7 +23,7 @@ public class AspectRatiosAssert extends UIAssert { - @JDIAction("Assert that '{name}' is expanded") + @JDIAction(value = "Assert that '{name}' is expanded", isAssert = true) public AutocompleteAssert expanded() { jdiAssert(element().isExpanded(), Matchers.is(true), "Autocomplete is not expanded"); return this; } - @JDIAction("Assert that '{name}' is closed") + @JDIAction(value = "Assert that '{name}' is closed", isAssert = true) public AutocompleteAssert closed() { jdiAssert(element().isExpanded(), Matchers.is(false), "Autocomplete is not closed"); return this; } - @JDIAction("Assert that '{name}' is selected") + @JDIAction(value = "Assert that '{name}' is selected", isAssert = true) public AutocompleteAssert selected(String value) { jdiAssert(element().selected().get(0), Matchers.is(value)); return this; } - @JDIAction("Assert that '{name}' is selected") + @JDIAction(value = "Assert that '{name}' is selected", isAssert = true) public AutocompleteAssert options(List values) { jdiAssert(element().options().stream().map(IsText::getText).collect(Collectors.toList()), Matchers.is(values)); return this; } - @JDIAction("Assert that '{name}' is selected") + @JDIAction(value = "Assert that '{name}' is selected", isAssert = true) public AutocompleteAssert selected(List values) { jdiAssert(element().isSelected(values), Matchers.is(true), "Autocomplete doesn't have selected value"); return this; } - @JDIAction("Assert that '{name}' is not selected") + @JDIAction(value = "Assert that '{name}' is not selected", isAssert = true) public AutocompleteAssert notSelected(String value) { jdiAssert(element().isSelected(value), Matchers.is(false), "Autocomplete doesn't have selected value " + value); return this; } - @JDIAction("Assert that '{name}' is not selected") + @JDIAction(value = "Assert that '{name}' is not selected", isAssert = true) public AutocompleteAssert notSelected(List values) { jdiAssert(element().isSelected(values), Matchers.is(false), "Autocomplete doesn't have selected values "); return this; } - @JDIAction("Assert that '{name}' is disabled") + @JDIAction(value = "Assert that '{name}' is disabled", isAssert = true) public AutocompleteAssert disabled() { jdiAssert(element().isDisabled(), Matchers.is(true), "Autocomplete is not disabled"); return this; } - @JDIAction("Assert that '{name}' is expanded") + @JDIAction(value = "Assert that '{name}' is expanded", isAssert = true) public AutocompleteAssert active() { jdiAssert(element().isDisabled(), Matchers.is(false), "Autocomplete is not active"); return this; } - @JDIAction("Assert that '{name}' is expanded") + @JDIAction(value = "Assert that '{name}' is expanded", isAssert = true) public AutocompleteAssert empty() { jdiAssert(element().value().attr("value"), Matchers.is("")); return this; } - @JDIAction("Assert that 'name' has solo style") + // TODO: Create methods in Autocomplete class with all styles below + @JDIAction(value = "Assert that 'name' has solo style", isAssert = true) public AutocompleteAssert solo() { jdiAssert( element().root().getAttribute("class"), @@ -87,7 +88,7 @@ public AutocompleteAssert solo() { return this; } - @JDIAction("Assert that 'name' has filled style") + @JDIAction(value = "Assert that 'name' has filled style", isAssert = true) public AutocompleteAssert filled() { jdiAssert( element().root().attr("class"), @@ -96,7 +97,7 @@ public AutocompleteAssert filled() { return this; } - @JDIAction("Assert that 'name' has solo-inverted style") + @JDIAction(value = "Assert that 'name' has solo-inverted style", isAssert = true) public AutocompleteAssert soloInverted() { jdiAssert( element().root().attr("class"), @@ -105,7 +106,7 @@ public AutocompleteAssert soloInverted() { return this; } - @JDIAction("Assert that 'name' has outlined style") + @JDIAction(value = "Assert that 'name' has outlined style", isAssert = true) public AutocompleteAssert outlined() { jdiAssert( element().root().attr("class"), @@ -114,7 +115,7 @@ public AutocompleteAssert outlined() { return this; } - @JDIAction("Assert that 'name' has dense style") + @JDIAction(value = "Assert that 'name' has dense style", isAssert = true) public AutocompleteAssert dense() { jdiAssert( element().root().attr("class"), @@ -123,7 +124,7 @@ public AutocompleteAssert dense() { return this; } - @JDIAction("Assert that 'name' has shaped style") + @JDIAction(value = "Assert that 'name' has shaped style", isAssert = true) public AutocompleteAssert shaped() { jdiAssert( element().root().attr("class"), @@ -132,7 +133,7 @@ public AutocompleteAssert shaped() { return this; } - @JDIAction("Assert that 'name' has rounded style") + @JDIAction(value = "Assert that 'name' has rounded style", isAssert = true) public AutocompleteAssert rounded() { jdiAssert( element().root().attr("class"), @@ -141,7 +142,7 @@ public AutocompleteAssert rounded() { return this; } - @JDIAction("Assert that 'name' has dark style") + @JDIAction(value = "Assert that 'name' has dark style", isAssert = true) public AutocompleteAssert dark() { jdiAssert( element().root().attr("class"), @@ -150,7 +151,7 @@ public AutocompleteAssert dark() { return this; } - @JDIAction("Assert that 'name' has dark style") + @JDIAction(value = "Assert that 'name' has dark style", isAssert = true) public AutocompleteAssert light() { jdiAssert( element().root().attr("class"), diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/AvatarAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/AvatarAssert.java index 539a1fbb94..0b4fb99f87 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/AvatarAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/AvatarAssert.java @@ -21,23 +21,21 @@ public class AvatarAssert extends UIAssert implements Alig TileAssert { @Override - @JDIAction("Assert that '{name}' text {0}") + @JDIAction(value = "Assert that '{name}' text {0}", isAssert = true) public AvatarAssert text(Matcher condition) { jdiAssert(element().getText(), condition); return this; } - @JDIAction("Assert that '{name}' size is {0} px") + @JDIAction(value = "Assert that '{name}' size is {0} px", isAssert = true) public AvatarAssert size(int size) { - Dimension actualSize = element().core().getSize(); - jdiAssert(actualSize, Matchers.is(new Dimension(size, size)), - String.format("Actual avatar size is '%d', but expected size is '%d')", actualSize.getHeight(), size)); + jdiAssert(element().core().getSize(), Matchers.is(new Dimension(size, size))); return this; } - @JDIAction("Assert that '{name}' has icon") + @JDIAction(value = "Assert that '{name}' has icon", isAssert = true) public AvatarAssert icon() { - jdiAssert(element().hasIcon(), Matchers.is(true), "Element does not have icon"); + jdiAssert(element().hasIcon(), Matchers.is(true), "Avatar does not have icon"); return this; } } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/BadgeAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/BadgeAssert.java index a0ade654ff..e663d5ca7d 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/BadgeAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/BadgeAssert.java @@ -18,100 +18,100 @@ public class BadgeAssert extends UIAssert ITextAssert, ThemeAssert, TileAssert { @Override - @JDIAction("Assert that '{name}' has text '{0}'") + @JDIAction(value = "Assert that '{name}' has text '{0}'", isAssert = true) public BadgeAssert text(Matcher condition) { jdiAssert(element().getText(), condition); return this; } - @JDIAction("Assert that '{name}' badge has icon '{0}'") + @JDIAction(value = "Assert that '{name}' badge has icon '{0}'", isAssert = true) public BadgeAssert icon(String iconName) { jdiAssert(element().icon().hasClass(iconName), Matchers.is(true), String.format("Badge is not '%s' icon", iconName)); return this; } - @JDIAction("Assert that '{name}' is icon") + @JDIAction(value = "Assert that '{name}' is icon", isAssert = true) public BadgeAssert icon() { jdiAssert(element().hasIcon(), Matchers.is(true), "Badge has not icon"); return this; } - @JDIAction("Assert that '{name}' is not icon") + @JDIAction(value = "Assert that '{name}' is not icon", isAssert = true) public BadgeAssert notIcon() { jdiAssert(element().hasIcon(), Matchers.is(false), "Badge has icon"); return this; } - @JDIAction("Assert that '{name}' is dot") + @JDIAction(value = "Assert that '{name}' is dot", isAssert = true) public BadgeAssert dot() { jdiAssert(element().isDot(), Matchers.is(true), "Badge is not dot"); return this; } - @JDIAction("Assert that '{name}' is not dot") + @JDIAction(value = "Assert that '{name}' is not dot", isAssert = true) public BadgeAssert notDot() { jdiAssert(element().isDot(), Matchers.is(false), "Badge is dot"); return this; } - @JDIAction("Assert that '{name}' is bordered") + @JDIAction(value = "Assert that '{name}' is bordered", isAssert = true) public BadgeAssert bordered() { jdiAssert(element().isBordered(), Matchers.is(true), "Badge is not bordered"); return this; } - @JDIAction("Assert that '{name}' is not bordered") + @JDIAction(value = "Assert that '{name}' is not bordered", isAssert = true) public BadgeAssert notBordered() { jdiAssert(element().isBordered(), Matchers.is(false), "Badge is bordered"); return this; } - @JDIAction("Assert that '{name}' is inline") + @JDIAction(value = "Assert that '{name}' is inline", isAssert = true) public BadgeAssert inline() { jdiAssert(element().isInline(), Matchers.is(true), "Badge is not inline"); return this; } - @JDIAction("Assert that '{name}' is not inline") + @JDIAction(value = "Assert that '{name}' is not inline", isAssert = true) public BadgeAssert notInline() { jdiAssert(element().isInline(), Matchers.is(false), "Badge is inline"); return this; } - @JDIAction("Assert that '{name}' is bottom") + @JDIAction(value = "Assert that '{name}' is bottom", isAssert = true) public BadgeAssert onBottom() { jdiAssert(element().isOnBottom(), Matchers.is(true), "Badge is not bottom"); return this; } - @JDIAction("Assert that '{name}' is not bottom") + @JDIAction(value = "Assert that '{name}' is not bottom", isAssert = true) public BadgeAssert notBottom() { jdiAssert(element().isOnBottom(), Matchers.is(false), "Badge is bottom"); return this; } - @JDIAction("Assert that '{name}' is overlapped") + @JDIAction(value = "Assert that '{name}' is overlapped", isAssert = true) public BadgeAssert overlapped() { jdiAssert(element().isOverlapped(), Matchers.is(true), "Badge is not overlapped"); return this; } - @JDIAction("Assert that '{name}' is not overlapped") + @JDIAction(value = "Assert that '{name}' is not overlapped", isAssert = true) public BadgeAssert notOverlapped() { jdiAssert(element().isOverlapped(), Matchers.is(false), "Badge is overlapped"); return this; } - @JDIAction("Assert that '{name}' is avatar") + @JDIAction(value = "Assert that '{name}' has avatar", isAssert = true) public BadgeAssert avatar() { - jdiAssert(element().hasAvatar(), Matchers.is(true), "Badge is not avatar"); + jdiAssert(element().hasAvatar(), Matchers.is(true), "Badge does not have avatar"); return this; } - @JDIAction("Assert that '{name}' has not avatar") + @JDIAction(value = "Assert that '{name}' has not avatar", isAssert = true) public BadgeAssert notAvatar() { - jdiAssert(element().hasAvatar(), Matchers.is(false), "Badge is avatar"); + jdiAssert(element().hasAvatar(), Matchers.is(false), "Badge has avatar"); return this; } } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/BannerAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/BannerAssert.java index e41d09e7e3..d0266de99b 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/BannerAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/BannerAssert.java @@ -23,43 +23,39 @@ public class BannerAssert extends UIAssert implements Roun SingleLineAssert, ITextAssert { @Override - @JDIAction("Assert that '{name}' alert has expected text '{0}'") + @JDIAction(value = "Assert that '{name}' alert has expected text '{0}'", isAssert = true) public BannerAssert text(Matcher text) { - String actualText = element().getText(); - jdiAssert(actualText, text, - String.format("Element's actual text '%s' is not equal to expected '%s'", actualText, text)); + jdiAssert(element().getText(), text); return this; } - @JDIAction("Assert that '{name}' is sticky") + @JDIAction(value = "Assert that '{name}' is sticky", isAssert = true) public BannerAssert sticky() { - jdiAssert(element().isSticky(), Matchers.is(true), "Element is not sticky"); + jdiAssert(element().isSticky(), Matchers.is(true), "Banner is not sticky"); return this; } - @JDIAction("Assert that '{name}' is not sticky") + @JDIAction(value = "Assert that '{name}' is not sticky", isAssert = true) public BannerAssert notSticky() { - jdiAssert(element().isSticky(), Matchers.is(false), "Element is sticky"); + jdiAssert(element().isSticky(), Matchers.is(false), "Banner is sticky"); return this; } - @JDIAction("Assert that '{name}' has icon") + @JDIAction(value = "Assert that '{name}' has icon", isAssert = true) public BannerAssert icon() { - jdiAssert(element().hasIcon(), Matchers.is(true), "Element has not icon"); + jdiAssert(element().hasIcon(), Matchers.is(true), "Banner has not icon"); return this; } - @JDIAction("Assert that '{name}' has not icon") + @JDIAction(value = "Assert that '{name}' has not icon", isAssert = true) public BannerAssert notIcon() { - jdiAssert(element().hasIcon(), Matchers.is(false), "Element has icon"); + jdiAssert(element().hasIcon(), Matchers.is(false), "Banner has icon"); return this; } - @JDIAction("Assert that '{name}' number of buttons is '{0}'") + @JDIAction(value = "Assert that '{name}' number of buttons is '{0}'", isAssert = true) public BannerAssert numberOfButtons(int n) { - int actualNumberOfButtons = element().hasNumberOfButtons(); - jdiAssert(actualNumberOfButtons, Matchers.equalTo(n), String.format("Actual number of element's buttons '%s' " + - "is not equal to expected '%s'", actualNumberOfButtons, n)); + jdiAssert(element().hasNumberOfButtons(), Matchers.equalTo(n)); return this; } } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/BottomNavigationAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/BottomNavigationAssert.java index a1396e367d..18c860ff9f 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/BottomNavigationAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/BottomNavigationAssert.java @@ -13,67 +13,63 @@ public class BottomNavigationAssert extends UISelectAssert implements ColorAssert, ThemeAssert, MeasurementAssert { - @JDIAction("Assert that '{name}' button color is '{0}'") + @JDIAction(value = "Assert that '{name}' button color is '{0}'", isAssert = true) public BottomNavigationAssert buttonColor(int index, String color) { - String actualColor = element().buttonColor(index); - jdiAssert(actualColor, Matchers.is(color), String.format("Element's actual button color '%s' is not equal " + - "to expected '%s'", actualColor, color)); + jdiAssert(element().buttonColor(index), Matchers.is(color)); return this; } - @JDIAction("Assert that '{name}' button color is '{0}'") + @JDIAction(value = "Assert that '{name}' button color is '{0}'", isAssert = true) public BottomNavigationAssert buttonColor(String text, String color) { - String actualColor = element().buttonColor(text); - jdiAssert(actualColor, Matchers.is(color), String.format("Element's actual button color '%s' is not equal " + - "to expected '%s'", actualColor, color)); + jdiAssert(element().buttonColor(text), Matchers.is(color)); return this; } - @JDIAction("Assert that '{name}' is absolute") + @JDIAction(value = "Assert that '{name}' has absolute position", isAssert = true) public BottomNavigationAssert absolute() { - jdiAssert(element().isAbsolute(), Matchers.is(true), "Element is not absolute"); + jdiAssert(element().isAbsolute(), Matchers.is(true), "BottomNavigation is not absolute"); return this; } - @JDIAction("Assert that '{name}' is not absolute") + @JDIAction(value = "Assert that '{name}' does not have absolute position", isAssert = true) public BottomNavigationAssert notAbsolute() { - jdiAssert(element().isAbsolute(), Matchers.is(false), "Element is absolute"); + jdiAssert(element().isAbsolute(), Matchers.is(false), "BottomNavigation is absolute"); return this; } - @JDIAction("Assert that '{name}' is fixed") + @JDIAction(value = "Assert that '{name}' is fixed", isAssert = true) public BottomNavigationAssert fixed() { - jdiAssert(element().isFixed(), Matchers.is(true), "Element is not fixed"); + jdiAssert(element().isFixed(), Matchers.is(true), "BottomNavigation is not fixed"); return this; } - @JDIAction("Assert that '{name}' is not fixed") + @JDIAction(value = "Assert that '{name}' is not fixed", isAssert = true) public BottomNavigationAssert notFixed() { - jdiAssert(element().isFixed(), Matchers.is(false), "Element is fixed"); + jdiAssert(element().isFixed(), Matchers.is(false), "BottomNavigation is fixed"); return this; } - @JDIAction("Assert that '{name}' is grow") + @JDIAction(value = "Assert that '{name}' is grow", isAssert = true) public BottomNavigationAssert grow() { - jdiAssert(element().isGrow(), Matchers.is(true), "Element is not grow"); + jdiAssert(element().isGrow(), Matchers.is(true), "BottomNavigation is not grow"); return this; } - @JDIAction("Assert that '{name}' is not grow") + @JDIAction(value = "Assert that '{name}' is not grow", isAssert = true) public BottomNavigationAssert notGrow() { - jdiAssert(element().isGrow(), Matchers.is(false), "Element is grow"); + jdiAssert(element().isGrow(), Matchers.is(false), "BottomNavigation is grow"); return this; } - @JDIAction("Assert that '{name}' is horizontal") + @JDIAction(value = "Assert that '{name}' is horizontal", isAssert = true) public BottomNavigationAssert horizontal() { - jdiAssert(element().isHorizontal(), Matchers.is(true), "Element is not horizontal"); + jdiAssert(element().isHorizontal(), Matchers.is(true), "BottomNavigation is not horizontal"); return this; } - @JDIAction("Assert that '{name}' is not horizontal") + @JDIAction(value = "Assert that '{name}' is not horizontal", isAssert = true) public BottomNavigationAssert notHorizontal() { - jdiAssert(element().isHorizontal(), Matchers.is(false), "Element is horizontal"); + jdiAssert(element().isHorizontal(), Matchers.is(false), "BottomNavigation is horizontal"); return this; } } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ButtonGroupAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ButtonGroupAssert.java index b44183bcb0..ea32888c3c 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ButtonGroupAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ButtonGroupAssert.java @@ -21,24 +21,22 @@ public class ButtonGroupAssert extends UISelectAssert { @Override - @JDIAction("Assert that {0} item is selected in {name}") + @JDIAction(value = "Assert that {0} button is selected in {name}", isAssert = true) public ButtonGroupAssert selected(int index) { - jdiAssert(element().selected(index) ? "is selected" : "is not selected", - Matchers.is("is selected")); + jdiAssert(element().selected(index), Matchers.is(true), + String.format("Button with number %d is not selected", index)); return this; } - @JDIAction("Assert that '{name}' size {0}") + @JDIAction(value = "Assert that '{name}' size {0}", isAssert = true) public ButtonGroupAssert size(int size) { - int actualSize = element().size(); - jdiAssert(actualSize, Matchers.is(size), String.format("Actual size '%s' is not equal to expected '%s'", - actualSize, size)); + jdiAssert(element().size(), Matchers.is(size)); return this; } - @JDIAction("Assert that '{name}' has icon") + @JDIAction(value = "Assert that '{name}' has icon", isAssert = true) public ButtonGroupAssert icon() { - jdiAssert(element().hasIcon(), Matchers.is(true), "Element does not have icon"); + jdiAssert(element().hasIcon(), Matchers.is(true), "ButtonGoup does not have icon"); return this; } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/CalendarAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/CalendarAssert.java index edbf129c73..446cbd230c 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/CalendarAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/CalendarAssert.java @@ -19,9 +19,9 @@ public class CalendarAssert extends UIAssert * * @return Assert object for chain creation */ - @JDIAction("Assert that {name} is of daily type") + @JDIAction(value = "Assert that {name} is of daily type", isAssert = true) public CalendarAssert daily() { - jdiAssert(element().isDailyType(), Matchers.is(true), "calendar's type is not 'daily'"); + jdiAssert(element().isDailyType(), Matchers.is(true), "Сalendar's type is not 'daily'"); return this; } @@ -30,9 +30,9 @@ public CalendarAssert daily() { * * @return Assert object for chain creation */ - @JDIAction("Assert that {name} is of weekly type") + @JDIAction(value = "Assert that {name} is of weekly type", isAssert = true) public CalendarAssert weekly() { - jdiAssert(element().isWeeklyType(), Matchers.is(true), "calendar's type is not 'weekly'"); + jdiAssert(element().isWeeklyType(), Matchers.is(true), "Сalendar's type is not 'weekly'"); return this; } @@ -41,9 +41,9 @@ public CalendarAssert weekly() { * * @return Assert object for chain creation */ - @JDIAction("Assert that {name} has the today") + @JDIAction(value = "Assert that {name} has the today", isAssert = true) public CalendarAssert today() { - jdiAssert(element().isToday(), Matchers.is(true), "calendar's day is no 'today'"); + jdiAssert(element().isToday(), Matchers.is(true), "Сalendar's day is no 'today'"); return this; } @@ -55,7 +55,7 @@ public CalendarAssert today() { * * @return Assert object for chain creation */ - @JDIAction("Assert that {name} has the category") + @JDIAction(value = "Assert that {name} has the category with index {0} with name {1}", isAssert = true) public CalendarAssert category(int catNum, String catName) { jdiAssert(element().getCategory(catNum), Matchers.is(catName)); return this; @@ -66,9 +66,10 @@ public CalendarAssert category(int catNum, String catName) { * * @param eventNum event index * @param eventName expected part of the name + * * @return Assert object for chain creation */ - @JDIAction("Assert that {name} has the event with num {0} title {1}") + @JDIAction(value = "Assert that {name} has the event with num {0} title {1}", isAssert = true) public CalendarAssert eventTitle(int eventNum, String eventName) { jdiAssert(element().dailyEvent(eventNum).text(), Matchers.is(containsString(eventName))); return this; @@ -81,7 +82,7 @@ public CalendarAssert eventTitle(int eventNum, String eventName) { * @param intText expected interval title * @return Assert object for chain creation */ - @JDIAction("Assert that {name} has the day interval") + @JDIAction(value = "Assert that {name} has the day interval", isAssert = true) public CalendarAssert dayInterval(int intNum, String intText) { jdiAssert(element().getDayInterval(intNum), Matchers.is(intText)); return this; @@ -92,18 +93,18 @@ public CalendarAssert dayInterval(int intNum, String intText) { * * @return Assert object for chain creation */ - @JDIAction("Assert that {name} has categories") + @JDIAction(value = "Assert that {name} has categories", isAssert = true) public CalendarAssert categories() { jdiAssert(element().hasCategories(), Matchers.is(true), "Calendar has no categories"); return this; } /** - * Assert element name has intervals + * Assert element name has day intervals * * @return Assert object for chain creation */ - @JDIAction("Assert that {name} has intervals") + @JDIAction(value = "Assert that {name} has day intervals", isAssert = true) public CalendarAssert intervals() { jdiAssert(element().hasDayIntervals(), Matchers.is(true), "Calendar has no day intervals"); return this; @@ -119,7 +120,7 @@ public CalendarAssert intervals() { * * @return Assert object for chain creation */ - @JDIAction("Assert that the {name} slot has the title") + @JDIAction(value = "Assert that the {name} slot has the title", isAssert = true) public CalendarAssert slotHasTitle(int week, int day, int slot, String title) { jdiAssert(element().slotTitle(week, day, slot), Matchers.is(title)); return this; @@ -130,72 +131,41 @@ public CalendarAssert slotHasTitle(int week, int day, int slot, String title) { * * @return Assert object for chain creation */ - @JDIAction("Assert that {name} has the current time line") + @JDIAction(value = "Assert that {name} has the current time line", isAssert = true) public CalendarAssert currentTimeLine() { jdiAssert(element().hasCurrentTimeLine(), Matchers.is(true), "Calendar has NO current timeline"); return this; } - @JDIAction("Assert that {name} has expected number of daily events") + @JDIAction(value = "Assert that {name} has expected number of daily events", isAssert = true) public CalendarAssert numberOfEventsPerDay(int dayNumber, int expectedNumberOfEvents) { - int actualNumberOfEvents = element().dayEvents(dayNumber).size(); - jdiAssert( - actualNumberOfEvents, - Matchers.equalTo(expectedNumberOfEvents), - String.format( - "Wrong number of daily events. Expected: %d, but was: %d", - expectedNumberOfEvents, actualNumberOfEvents - ) + jdiAssert(element().dayEvents(dayNumber).size(), + Matchers.equalTo(expectedNumberOfEvents) ); return this; } - @JDIAction("Assert that {name} has expected number of daily events") + @JDIAction(value = "Assert that {name} has expected number of daily events", isAssert = true) public CalendarAssert totalNumberOfEvents(int expectedNumberOfEvents) { - int actualNumberOfEvents = element().events().size(); - jdiAssert( - actualNumberOfEvents, - Matchers.equalTo(expectedNumberOfEvents), - String.format( - "Wrong number of events. Expected: %d, but was: %d", - expectedNumberOfEvents, actualNumberOfEvents - ) - ); + jdiAssert(element().events().size(), Matchers.equalTo(expectedNumberOfEvents)); return this; } - @JDIAction("Assert that {name} has expected number of daily events") + @JDIAction(value = "Assert that {name} has expected number of daily events", isAssert = true) public CalendarAssert totalNumberOfEvents(Matcher condition) { - int actualNumberOfEvents = element().events().size(); - jdiAssert(actualNumberOfEvents, condition); + jdiAssert(element().events().size(), condition); return this; } - @JDIAction("Assert that {name} has active date") + @JDIAction(value = "Assert that {name} has active date", isAssert = true) public CalendarAssert activeDay(int expectedDayOfMonth) { - int actualDay = element().activeDay(); - jdiAssert( - actualDay, - Matchers.equalTo(expectedDayOfMonth), - String.format( - "Wrong active day. Expected: %s, but was: %s", - expectedDayOfMonth, actualDay - ) - ); + jdiAssert(element().activeDay(), Matchers.equalTo(expectedDayOfMonth)); return this; } - @JDIAction("Assert that {name} has number of intervals") + @JDIAction(value = "Assert that {name} has number of intervals", isAssert = true) public CalendarAssert numberOfIntervals(int expectedNumberOfIntervals) { - int actualNumberOfIntervals = element().intervalHeaders().size(); - jdiAssert( - actualNumberOfIntervals, - Matchers.equalTo(expectedNumberOfIntervals), - String.format( - "Wrong number of intervals. Expected: %d, but was: %d", - expectedNumberOfIntervals, actualNumberOfIntervals - ) - ); + jdiAssert(element().intervalHeaders().size(), Matchers.equalTo(expectedNumberOfIntervals)); return this; } } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/CardAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/CardAssert.java index 2388cfec1b..29fcfa4cf8 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/CardAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/CardAssert.java @@ -24,11 +24,9 @@ public class CardAssert extends UIAssert implements RoundedAss LoadingAssert, ElevationAssert, MeasurementAssert, ColorAssert, ThemeAssert, FlatAssert { - @JDIAction("Assert that '{name}' title has value '{0}'") + @JDIAction(value = "Assert that '{name}' title has value '{0}'", isAssert = true) public CardAssert title(final Matcher condition) { - String actualTitle = element().title().getText(); - jdiAssert(actualTitle, condition, String.format("Actual element's title '%s' is not equal to expected '%s'", - actualTitle, condition)); + jdiAssert(element().title().getText(), condition); return this; } @@ -36,11 +34,9 @@ public CardAssert title(String text) { return this.title(equalTo(text)); } - @JDIAction("Assert that '{name}' subtitle has value '{0}'") + @JDIAction(value = "Assert that '{name}' subtitle has value '{0}'", isAssert = true) public CardAssert subtitle(final Matcher condition) { - String actualSubtitle = element().subtitle().getText(); - jdiAssert(actualSubtitle, condition, String.format("Actual element's subtitle '%s' is not equal to expected " + - "'%s'", actualSubtitle, condition)); + jdiAssert(element().subtitle().getText(), condition); return this; } @@ -48,63 +44,57 @@ public CardAssert subtitle(String text) { return this.subtitle(equalTo(text)); } - @JDIAction("Assert that '{name}' has loader height {0}") + @JDIAction(value = "Assert that '{name}' has loader height {0}", isAssert = true) public CardAssert loaderHeightPx(int height) { - int actualLoaderHeight = element().getLoaderHeight(); - jdiAssert(actualLoaderHeight, Matchers.equalTo(height), String.format("Actual element's loader height " + - "'%s px' is not equal to expected '%s px'", actualLoaderHeight, height)); + jdiAssert(element().getLoaderHeight(), Matchers.equalTo(height)); return this; } - @JDIAction("Assert that '{name}' is link") + @JDIAction(value = "Assert that '{name}' is link", isAssert = true) public CardAssert link() { - jdiAssert(element().isLink(), Matchers.is(true), "Element is not link"); + jdiAssert(element().isLink(), Matchers.is(true), "Card is not link"); return this; } - @JDIAction("Assert that '{name}' is not link") + @JDIAction(value = "Assert that '{name}' is not link", isAssert = true) public CardAssert notLink() { - jdiAssert(element().isLink(), Matchers.is(false), "Element is link"); + jdiAssert(element().isLink(), Matchers.is(false), "Card is link"); return this; } - @JDIAction("Assert that '{name}' max-width is '{0}'") + @JDIAction(value = "Assert that '{name}' max-width is '{0}'", isAssert = true) public CardAssert maxWidthPx(int maxWidth) { - int actualMaxWidth = element().getMaxWidth(); - jdiAssert(actualMaxWidth, Matchers.is(maxWidth), String.format("Element's actual max-width '%s px' is not " + - "equal to expected '%s px'", actualMaxWidth, maxWidth)); + jdiAssert(element().getMaxWidth(), Matchers.is(maxWidth)); return this; } - @JDIAction("Assert that '{name}' max-height is '{0}'") + @JDIAction(value = "Assert that '{name}' max-height is '{0}'", isAssert = true) public CardAssert maxHeightPx(int maxHeight) { - int actualMaxHeight = element().getMaxWidth(); - jdiAssert(actualMaxHeight, Matchers.is(maxHeight), String.format("Element's actual max-height '%s px' is not " + - "equal to expected '%s px'", actualMaxHeight, maxHeight)); + jdiAssert(element().getMaxWidth(), Matchers.is(maxHeight)); return this; } - @JDIAction("Assert that '{name}' is hover") + @JDIAction(value = "Assert that '{name}' is hover", isAssert = true) public CardAssert hover() { - jdiAssert(element().isHover(), Matchers.is(true), "Element is not hover"); + jdiAssert(element().isHover(), Matchers.is(true), "Card is not hover"); return this; } - @JDIAction("Assert that '{name}' is not hover") + @JDIAction(value = "Assert that '{name}' is not hover", isAssert = true) public CardAssert notHover() { - jdiAssert(element().isHover(), Matchers.is(false), "Element is hover"); + jdiAssert(element().isHover(), Matchers.is(false), "Card is hover"); return this; } - @JDIAction("Assert that '{name}' is raised") + @JDIAction(value = "Assert that '{name}' is raised", isAssert = true) public CardAssert raised() { - jdiAssert(element().isRaised(), Matchers.is(true), "Element is not raised"); + jdiAssert(element().isRaised(), Matchers.is(true), "Card is not raised"); return this; } - @JDIAction("Assert that '{name}' is not raised") + @JDIAction(value = "Assert that '{name}' is not raised", isAssert = true) public CardAssert notRaised() { - jdiAssert(element().isRaised(), Matchers.is(false), "Element is raised"); + jdiAssert(element().isRaised(), Matchers.is(false), "Card is raised"); return this; } } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/CarouselAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/CarouselAssert.java index ec08b0cace..99fa3b19a3 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/CarouselAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/CarouselAssert.java @@ -7,7 +7,6 @@ import com.epam.jdi.light.vuetify.interfaces.asserts.LoadingAssert; import com.epam.jdi.light.vuetify.interfaces.asserts.MeasurementAssert; import com.epam.jdi.light.vuetify.interfaces.asserts.ThemeAssert; -import com.jdiai.tools.Timer; import org.hamcrest.Matchers; import static com.epam.jdi.light.asserts.core.SoftAssert.jdiAssert; @@ -16,60 +15,58 @@ public class CarouselAssert extends UIAssert implement ThemeAssert, LoadingAssert, MeasurementAssert { - @JDIAction("Assert that '{name}' is displayed") + @JDIAction(value = "Assert that '{name}' is displayed", isAssert = true) public CarouselAssert displayed() { - Timer.waitCondition(element()::isDisplayed); - jdiAssert(element().isDisplayed(), Matchers.is(true), "Element is not displayed"); + jdiAssert(element().isDisplayed(), Matchers.is(true), "Carousel is not displayed"); return this; } - @JDIAction("Assert that '{name}' has text '{0}'") + @JDIAction(value = "Assert that '{name}' has text '{0}'", isAssert = true) public CarouselAssert contentText(String text) { jdiAssert(element().getContentText().trim(), Matchers.is(text)); return this; } - @JDIAction("Assert that '{name}' shows arrows on hover") + @JDIAction(value = "Assert that '{name}' shows arrows on hover", isAssert = true) public CarouselAssert showArrowsOnHover() { - jdiAssert(element().showArrowsOnHover(), Matchers.is(true), "Element doesn't show arrows on hover"); + jdiAssert(element().showArrowsOnHover(), Matchers.is(true), "Carousel doesn't show arrows on hover"); return this; } - @JDIAction("Assert that '{name}' doesn't show arrows on hover") + @JDIAction(value = "Assert that '{name}' doesn't show arrows on hover", isAssert = true) public CarouselAssert notShowArrowsOnHover() { - jdiAssert(element().showArrowsOnHover(), Matchers.is(false), "Element shows arrows on hover"); + jdiAssert(element().showArrowsOnHover(), Matchers.is(false), "Carousel shows arrows on hover"); return this; } - @JDIAction("Assert that '{name}' hides delimiters") + @JDIAction(value = "Assert that '{name}' hides delimiters", isAssert = true) public CarouselAssert delimitersHidden() { - jdiAssert(element().hideDelimiters(), Matchers.is(true), "Element doesn't hide delimiters"); + jdiAssert(element().hideDelimiters(), Matchers.is(true), "Carousel doesn't hide delimiters"); return this; } - @JDIAction("Assert that '{name}' hides delimiters") + @JDIAction(value = "Assert that '{name}' hides delimiters", isAssert = true) public CarouselAssert notDelimitersHidden() { - jdiAssert(element().hideDelimiters(), Matchers.is(false), "Element hides delimiters"); + jdiAssert(element().hideDelimiters(), Matchers.is(false), "Carousel hides delimiters"); return this; } - @JDIAction("Assert that '{name}' has vertical delimiters") + @JDIAction(value = "Assert that '{name}' has vertical delimiters", isAssert = true) public CarouselAssert verticalDelimiters() { - jdiAssert(element().hasVerticalDelimiters(), Matchers.is(true), "Element has horizontal delimiters"); + jdiAssert(element().hasVerticalDelimiters(), Matchers.is(true), "Carousel has horizontal delimiters"); return this; } - @JDIAction("Assert that '{name}' has horizontal delimiters") + @JDIAction(value = "Assert that '{name}' has horizontal delimiters", isAssert = true) public CarouselAssert horizontalDelimiters() { - jdiAssert(element().hasVerticalDelimiters(), Matchers.is(false), "Element has vertical delimiters"); + jdiAssert(element().hasVerticalDelimiters(), Matchers.is(false), "Carousel has vertical delimiters"); return this; } - @JDIAction("Assert that '{name}' has loader height {0}") + @JDIAction(value = "Assert that '{name}' has loader height {0}", isAssert = true) public CarouselAssert loaderHeightPx(int height) { int actualLoaderHeight = element().getLoaderHeight(); - jdiAssert(actualLoaderHeight, Matchers.equalTo(height), String.format("Actual element's loader height " + - "'%s px' is not equal to expected '%s px'", actualLoaderHeight, height)); + jdiAssert(element().getLoaderHeight(), Matchers.equalTo(height)); return this; } } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ChipAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ChipAssert.java index e969a02222..890aa24cef 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ChipAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ChipAssert.java @@ -17,142 +17,138 @@ public class ChipAssert extends UIAssert implements ColorAsser OutlinedAssert, ThemeAssert, MeasurementAssert, ITextAssert { @Override - @JDIAction("Assert that '{name}' has text '{0}'") + @JDIAction(value = "Assert that '{name}' has text '{0}'", isAssert = true) public ChipAssert text(Matcher condition) { - String actualText = element().getText(); - jdiAssert(actualText, condition); + jdiAssert(element().getText(), condition); return this; } - @JDIAction("Assert that '{name}' has border color with code '{0}'") + @JDIAction(value = "Assert that '{name}' has border color with code '{0}'", isAssert = true) public ChipAssert borderColor(String color) { - String actualBorderColor = element().borderColor(); - jdiAssert(element().borderColor(), Matchers.equalTo(color), String.format("Actual border color " + - "'%s' is not equal to '%s'", actualBorderColor, color)); + jdiAssert(element().borderColor(), Matchers.equalTo(color)); return this; } - @JDIAction("Assert that '{name}' is draggable") + @JDIAction(value = "Assert that '{name}' is draggable", isAssert = true) public ChipAssert draggable() { - jdiAssert(element().isDraggable(), Matchers.is(true), "Element is not draggable"); + jdiAssert(element().isDraggable(), Matchers.is(true), "Chip is not draggable"); return this; } - @JDIAction("Assert that '{name}' is not draggable") + @JDIAction(value = "Assert that '{name}' is not draggable", isAssert = true) public ChipAssert notDraggable() { - jdiAssert(element().isDraggable(), Matchers.is(false), "Element is draggable"); + jdiAssert(element().isDraggable(), Matchers.is(false), "Chip is draggable"); return this; } - @JDIAction("Assert that '{name}' is selected") + @JDIAction(value = "Assert that '{name}' is selected", isAssert = true) public ChipAssert selected() { - jdiAssert(element().active(), Matchers.is(true), "Element is not selected"); + jdiAssert(element().active(), Matchers.is(true), "Chip is not selected"); return this; } - @JDIAction("Assert that '{name}' is not selected") + @JDIAction(value = "Assert that '{name}' is not selected", isAssert = true) public ChipAssert deselected() { - jdiAssert(element().active(), Matchers.is(false), "Element is selected"); + jdiAssert(element().active(), Matchers.is(false), "Chip is selected"); return this; } - @JDIAction("Assert that '{name}' is a label chip") + @JDIAction(value = "Assert that '{name}' is a label chip", isAssert = true) public ChipAssert label() { - jdiAssert(element().isLabel(), Matchers.is(true), "Element is not label chip"); + jdiAssert(element().isLabel(), Matchers.is(true), "Chip is not label chip"); return this; } - @JDIAction("Assert that '{name}' is not a label chip") + @JDIAction(value = "Assert that '{name}' is not a label chip", isAssert = true) public ChipAssert notLabel() { - jdiAssert(element().isLabel(), Matchers.is(false), "Element is label chip"); + jdiAssert(element().isLabel(), Matchers.is(false), "Chip is label chip"); return this; } - @JDIAction("Assert that ''{name}' filter icon is displayed'") + // TODO Check this + @JDIAction(value = "Assert that ''{name}' filter icon is displayed'", isAssert = true) public ChipAssert filterIconDisplayed() { - jdiAssert(element().isFilterIconDisplayed(), Matchers.is(true), "Element's filter icon is not " + - "displayed"); + jdiAssert(element().isFilterIconDisplayed(), Matchers.is(true), + "Chip's filter icon is not displayed"); return this; } - @JDIAction("Assert that ''{name}' filter icon is not displayed'") + @JDIAction(value = "Assert that ''{name}' filter icon is not displayed'", isAssert = true) public ChipAssert filterIconNotDisplayed() { - jdiAssert(element().isFilterIconDisplayed(), Matchers.is(false), "Element's filter icon is " + - "displayed"); + jdiAssert(element().isFilterIconDisplayed(), Matchers.is(false), + "Chip's filter icon is displayed"); return this; } - @JDIAction("Assert that '{name}' has icon") + @JDIAction(value = "Assert that '{name}' has icon", isAssert = true) public ChipAssert icon() { - jdiAssert(element().hasIcon(), Matchers.is(true), "Element has not icon"); + jdiAssert(element().hasIcon(), Matchers.is(true), "Chip does not have icon"); return this; } - @JDIAction("Assert that '{name}' has image") + @JDIAction(value = "Assert that '{name}' has image", isAssert = true) public ChipAssert image() { - jdiAssert(element().hasImage(), Matchers.is(true), "Element has not image"); + jdiAssert(element().hasImage(), Matchers.is(true), "Chip does not have image"); return this; } - @JDIAction("Assert that '{name}' font size is equal to '{0} px'") + @JDIAction(value = "Assert that '{name}' font size is equal to '{0} px'", isAssert = true) public ChipAssert fontSize(int fontSize) { - int actualFontSize = element().fontSize(); - jdiAssert(actualFontSize, Matchers.equalTo(fontSize), String.format("Actual font size '%s px' is not equal " + - "to expected font size '%s px'", actualFontSize, fontSize)); + jdiAssert(element().fontSize(), Matchers.equalTo(fontSize)); return this; } - @JDIAction("Assert that '{name}' size is x-small") + @JDIAction(value = "Assert that '{name}' size is x-small", isAssert = true) public ChipAssert xSmallSize() { - jdiAssert(element().hasXSmallSize(), Matchers.is(true), "Element's size is not x-small"); + jdiAssert(element().hasXSmallSize(), Matchers.is(true), "Chip's size is not x-small"); return this; } - @JDIAction("Assert that '{name}' size is small") + @JDIAction(value = "Assert that '{name}' size is small", isAssert = true) public ChipAssert smallSize() { - jdiAssert(element().hasSmallSize(), Matchers.is(true), "Element's size is not small"); + jdiAssert(element().hasSmallSize(), Matchers.is(true), "Chip's size is not small"); return this; } - @JDIAction("Assert that '{name}' size is default") + @JDIAction(value = "Assert that '{name}' size is default", isAssert = true) public ChipAssert defaultSize() { - jdiAssert(element().hasDefaultSize(), Matchers.is(true), "Element's size is not default"); + jdiAssert(element().hasDefaultSize(), Matchers.is(true), "Chip's size is not default"); return this; } - @JDIAction("Assert that '{name}' size is large") + @JDIAction(value = "Assert that '{name}' size is large", isAssert = true) public ChipAssert largeSize() { - jdiAssert(element().hasLargeSize(), Matchers.is(true), "Element's size is not large"); + jdiAssert(element().hasLargeSize(), Matchers.is(true), "Chip's size is not large"); return this; } - @JDIAction("Assert that '{name}' size is x-large") + @JDIAction(value = "Assert that '{name}' size is x-large", isAssert = true) public ChipAssert xLargeSize() { - jdiAssert(element().hasXLargeSize(), Matchers.is(true), "Element's size is not x-large"); + jdiAssert(element().hasXLargeSize(), Matchers.is(true), "Chip's size is not x-large"); return this; } - @JDIAction("Assert that '{name}' is removable") + @JDIAction(value = "Assert that '{name}' is removable", isAssert = true) public ChipAssert removable() { - jdiAssert(element().isRemovable(), Matchers.is(true), "Element is not removable"); + jdiAssert(element().isRemovable(), Matchers.is(true), "Chip is not removable"); return this; } - @JDIAction("Assert that '{name}' is not removable") + @JDIAction(value = "Assert that '{name}' is not removable", isAssert = true) public ChipAssert notRemovable() { - jdiAssert(element().isRemovable(), Matchers.is(false), "Element is removable"); + jdiAssert(element().isRemovable(), Matchers.is(false), "Chip is removable"); return this; } - @JDIAction("Assert that '{name}' is pill") + @JDIAction(value = "Assert that '{name}' is pill", isAssert = true) public ChipAssert pill() { - jdiAssert(element().isPill(), Matchers.is(true), "Element is not pill"); + jdiAssert(element().isPill(), Matchers.is(true), "Chip is not pill"); return this; } - @JDIAction("Assert that '{name}' is not pill") + @JDIAction(value = "Assert that '{name}' is not pill", isAssert = true) public ChipAssert notPill() { - jdiAssert(element().isPill(), Matchers.is(false), "Element is pill"); + jdiAssert(element().isPill(), Matchers.is(false), "Chip is pill"); return this; } } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ChipGroupAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ChipGroupAssert.java index 2371d1b4d5..56916eb1d1 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ChipGroupAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ChipGroupAssert.java @@ -9,7 +9,6 @@ import java.util.Collections; import java.util.List; -import java.util.Set; import static com.epam.jdi.light.asserts.core.SoftAssert.jdiAssert; @@ -19,56 +18,51 @@ public class ChipGroupAssert extends UIAssert implements ThemeAssert, ColorAssert { - @JDIAction("Assert that '{name}' has values '{0}'") + @JDIAction(value = "Assert that '{name}' has values '{0}'", isAssert = true) public ChipGroupAssert text(List values) { - Set actualValues = element().getTexts(); - jdiAssert(actualValues.containsAll(values), - Matchers.is(true), String.format("Element actual values '%s' contains not all the expected" + - " values '%s'", actualValues, values)); + jdiAssert(element().getTexts(), Matchers.is(values)); return this; } - @JDIAction("Assert that '{0}' option selected for '{name}'") + @JDIAction(value = "Assert that '{0}' option selected for '{name}'", isAssert = true) public ChipGroupAssert selected(List options) { options.forEach(option -> element().getElement(option).is().selected()); return this; } - @JDIAction("Assert that '{0}' option selected for '{name}'") + @JDIAction(value = "Assert that '{0}' option selected for '{name}'", isAssert = true) public ChipGroupAssert selected(String option) { selected(Collections.singletonList(option)); return this; } - @JDIAction("Assert that '{0}' option deselected for '{name}'") + @JDIAction(value = "Assert that '{0}' option deselected for '{name}'", isAssert = true) public ChipGroupAssert deselected(String option) { deselected(Collections.singletonList(option)); return this; } - @JDIAction("Assert that '{0}' option deselected for '{name}'") + @JDIAction(value = "Assert that '{0}' option deselected for '{name}'", isAssert = true) public ChipGroupAssert deselected(List options) { options.forEach(option -> element().getElement(option).is().deselected()); return this; } - @JDIAction("Assert that '{name}' size {0}") + @JDIAction(value = "Assert that '{name}' size is {0}", isAssert = true) public ChipGroupAssert size(int size) { - int actualSize = element().size(); - jdiAssert(actualSize, Matchers.is(size), String.format("Actual size '%s' is not equal to expected '%s'", - actualSize, size)); + jdiAssert(element().size(), Matchers.is(size)); return this; } - @JDIAction("Assert that '{name}' is column") + @JDIAction(value = "Assert that '{name}' is column", isAssert = true) public ChipGroupAssert column() { - jdiAssert(element().isColumn(), Matchers.is(true), "Element is not column"); + jdiAssert(element().isColumn(), Matchers.is(true), "ChipGroup is not column"); return this; } - @JDIAction("Assert that '{name}' is not column") + @JDIAction(value = "Assert that '{name}' is not column", isAssert = true) public ChipGroupAssert notColumn() { - jdiAssert(element().isColumn(), Matchers.is(false), "Element is column"); + jdiAssert(element().isColumn(), Matchers.is(false), "ChipGroup is column"); return this; } } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ColorPickerAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ColorPickerAssert.java index 87483f6623..e75f286686 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ColorPickerAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ColorPickerAssert.java @@ -13,78 +13,75 @@ public class ColorPickerAssert extends UIAssert implements ElevationAssert, ThemeAssert { - @JDIAction("Assert that '{name}' canvas has style") + @JDIAction(value = "Assert that '{name}' canvas has style", isAssert = true) public ColorPickerAssert canvasStyle() { - jdiAssert(element().getCanvasStyle(), Matchers.is(Matchers.notNullValue()), "Element has not canvas " + - "style"); + jdiAssert(element().getCanvasStyle(), Matchers.is(Matchers.notNullValue()), + "ColorPicker has not canvas style"); return this; } - @JDIAction("Assert that '{name}' canvasDot has style") + @JDIAction(value = "Assert that '{name}' canvasDot has style", isAssert = true) public ColorPickerAssert canvasDotStyle() { - jdiAssert(element().getCanvasDotStyle(), Matchers.is(Matchers.notNullValue()), "Element has not dot " + - "style"); + jdiAssert(element().getCanvasDotStyle(), Matchers.is(Matchers.notNullValue()), + "ColorPicker has not dot style"); return this; } - @JDIAction("Assert that '{name}' input model is '{0}'") + @JDIAction(value = "Assert that '{name}' input model is '{0}'", isAssert = true) public ColorPickerAssert inputModel(String inputModel) { String actualInputModel = element().getInputModel(); - jdiAssert(actualInputModel, Matchers.is(inputModel), String.format("Actual input model '%s' is not equal to " + - "expected '%s'", actualInputModel, inputModel)); + jdiAssert(actualInputModel, Matchers.is(inputModel)); return this; } - @JDIAction("Assert that '{name}' hueSlider has value") + @JDIAction(value = "Assert that '{name}' hueSlider has value", isAssert = true) public ColorPickerAssert hueSliderValue() { - jdiAssert(element().hueSlider().value(), Matchers.is(Matchers.notNullValue()), "Element has not " + - "slider value"); + jdiAssert(element().hueSlider().value(), Matchers.is(Matchers.notNullValue()), + "ColorPicker has not slider value"); return this; } - @JDIAction("Assert that '{name}' alphaSlider has value") + @JDIAction(value = "Assert that '{name}' alphaSlider has value", isAssert = true) public ColorPickerAssert alphaSliderValue() { - jdiAssert(element().alphaSlider().value(), Matchers.is(Matchers.notNullValue()), "Element has not " + - "slider value"); + jdiAssert(element().alphaSlider().value(), Matchers.is(Matchers.notNullValue()), + "ColorPicker has not slider value"); return this; } - @JDIAction("Assert that '{name}' hueSlider value have changed") + //TODO: Check this method + @JDIAction(value = "Assert that '{name}' hueSlider value have changed", isAssert = true) public ColorPickerAssert hueSliderValueHaveChanged(double initialValue) { jdiAssert(element().hueSlider().value(), Matchers.not(initialValue), "Hue slider value wasn't changed"); return this; } - @JDIAction("Assert that '{name}' alphaSlider value have changed") + @JDIAction(value = "Assert that '{name}' alphaSlider value have changed", isAssert = true) public ColorPickerAssert alphaSliderValueHaveChanged(double initialValue) { - jdiAssert(element().alphaSlider().value(), Matchers.not(initialValue), "Alpha slider value wasn't " + - "changed"); + jdiAssert(element().alphaSlider().value(), Matchers.not(initialValue), + "Alpha slider value wasn't changed"); return this; } - @JDIAction("Assert that '{name}' has color '{0}'") - public ColorPickerAssert color(String color) { - Color actualColor = element().getColor(element().colorDot()); - Color expectedColor = Color.fromString(color); - jdiAssert(actualColor, Matchers.is(expectedColor), String.format("Actual element color '%s' is not equal to " + - "expected '%s'", actualColor, expectedColor)); + @JDIAction(value = "Assert that '{name}' dots has color '{0}'", isAssert = true) + public ColorPickerAssert dotColor(String color) { + return dotColor(Color.fromString(color)); + } + + @JDIAction(value = "Assert that '{name}' dots has color '{0}'", isAssert = true) + public ColorPickerAssert dotColor(Color color) { + jdiAssert(element().getColor(element().colorDot()), Matchers.is(color)); return this; } - @JDIAction("Assert that '{name}' hex input field length is '{0}'") + @JDIAction(value = "Assert that '{name}' hex input field length is '{0}'", isAssert = true) public ColorPickerAssert hexInputFieldLength(int length) { - int actualLength = element().inputHEX().getText().length(); - jdiAssert(actualLength, Matchers.is(length), String.format("Actual input field length '%s' is not equal to " + - "expected '%s'", actualLength, length)); + jdiAssert(element().inputHEX().getText().length(), Matchers.is(length)); return this; } - @JDIAction("Assert that '{name}' hex input field color string value is '{0}'") + @JDIAction(value = "Assert that '{name}' hex input field color string value is '{0}'", isAssert = true) public ColorPickerAssert hexInputFieldStringColorValue(String color) { - String actualColor = element().inputHEX().getText(); - jdiAssert(actualColor, Matchers.is(color), String.format("Actual HEX input field color value '%s' is not " + - "equal to expected '%s'", actualColor, color)); + jdiAssert(element().inputHEX().getText(), Matchers.is(color)); return this; } - } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ComboboxAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ComboboxAssert.java index f74944f8c2..f3de3a77ea 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ComboboxAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ComboboxAssert.java @@ -39,191 +39,180 @@ public class ComboboxAssert extends UIAssert implement MeasurementAssert, RoundedAssert, ShapedAssert, HideDetailsAssert { - @JDIAction("Assert that '{name}' is expanded") + @JDIAction(value = "Assert that '{name}' is expanded", isAssert = true) public ComboboxAssert expanded() { - jdiAssert(element().isExpanded(), Matchers.is(true), "Element is closed"); + jdiAssert(element().isExpanded(), Matchers.is(true), "Combobox is closed"); return this; } - @JDIAction("Assert that '{name}' is closed") + @JDIAction(value = "Assert that '{name}' is closed", isAssert = true) public ComboboxAssert closed() { - jdiAssert(element().isExpanded(), Matchers.is(false), "Element is expanded"); + jdiAssert(element().isExpanded(), Matchers.is(false), "Combobox is expanded"); return this; } - @JDIAction("Assert that '{name}' is selected") + @JDIAction(value = "Assert that '{name}' is selected", isAssert = true) public ComboboxAssert selected(String value) { - jdiAssert(element().isSelected(value), Matchers.is(true), String.format("Value '%s' is not selected", - value)); + jdiAssert(element().isSelected(value), Matchers.is(true), String.format("Value '%s' is not selected", value)); return this; } - @JDIAction("Assert that '{name}' is selected") + @JDIAction(value = "Assert that '{name}' is selected", isAssert = true) public ComboboxAssert selected(List values) { jdiAssert(element().isSelected(values), Matchers.is(true), String.format("Values '%s' are not selected", values)); return this; } - @JDIAction("Assert that '{name}' is not selected") + @JDIAction(value = "Assert that '{name}' is not selected", isAssert = true) public ComboboxAssert notSelected(String value) { jdiAssert(element().isSelected(value), Matchers.is(false), String.format("Value '%s' is selected", value)); return this; } - @JDIAction("Assert that '{name}' is not selected") + @JDIAction(value = "Assert that '{name}' is not selected", isAssert = true) public ComboboxAssert notSelected(List values) { jdiAssert(element().isSelected(values), Matchers.is(false), String.format("Values '%s' are selected", values)); return this; } - @JDIAction("Assert that '{name}' label is '{0}'") + @JDIAction(value = "Assert that '{name}' label is '{0}'", isAssert = true) public ComboboxAssert label(String text) { - String actualLabelText = element().label().getText(); - jdiAssert(actualLabelText, Matchers.is(text), String.format("Actual label text '%s' is not equal to expected " + - "'%s'", actualLabelText, text)); + jdiAssert(element().label().getText(), Matchers.is(text)); return this; } - @JDIAction("Assert that '{name}' is error") + @JDIAction(value = "Assert that '{name}' is error", isAssert = true) public ComboboxAssert error() { - jdiAssert(element().isError(), Matchers.is(true), "Element is not error"); + jdiAssert(element().isError(), Matchers.is(true), "Combobox is not error"); return this; } - @JDIAction("Assert that '{name}' is not error") + @JDIAction(value = "Assert that '{name}' is not error", isAssert = true) public ComboboxAssert notError() { - jdiAssert(element().isError(), Matchers.is(false), "Element is error"); + jdiAssert(element().isError(), Matchers.is(false), "Combobox is error"); return this; } - @JDIAction("Assert that '{name}' is success") + @JDIAction(value = "Assert that '{name}' is success", isAssert = true) public ComboboxAssert success() { - jdiAssert(element().isSuccess(), Matchers.is(true), "Element is not success"); + jdiAssert(element().isSuccess(), Matchers.is(true), "Combobox is not success"); return this; } - @JDIAction("Assert that '{name}' is not success") + @JDIAction(value = "Assert that '{name}' is not success", isAssert = true) public ComboboxAssert notSuccess() { - jdiAssert(element().isSuccess(), Matchers.is(false), "Element is success"); + jdiAssert(element().isSuccess(), Matchers.is(false), "Combobox is success"); return this; } - @JDIAction("Assert that '{name}' has chips") + @JDIAction(value = "Assert that '{name}' has chips", isAssert = true) public ComboboxAssert chips() { - jdiAssert(element().hasChips(), Matchers.is(true), "Element has no chips"); + jdiAssert(element().hasChips(), Matchers.is(true), "Combobox has no chips"); return this; } - @JDIAction("Assert that '{name}' has no chips") + @JDIAction(value = "Assert that '{name}' has no chips", isAssert = true) public ComboboxAssert noChips() { - jdiAssert(element().hasChips(), Matchers.is(false), "Element has chips"); + jdiAssert(element().hasChips(), Matchers.is(false), "Combobox has chips"); return this; } - @JDIAction("Assert that '{name}' has small chips") + @JDIAction(value = "Assert that '{name}' has small chips", isAssert = true) public ComboboxAssert smallChips() { - jdiAssert(element().hasSmallChips(), Matchers.is(true), "Element has no small chips"); + jdiAssert(element().hasSmallChips(), Matchers.is(true), "Combobox has no small chips"); return this; } - @JDIAction("Assert that '{name}' has no small chips") + @JDIAction(value = "Assert that '{name}' has no small chips", isAssert = true) public ComboboxAssert noSmallChips() { - jdiAssert(element().hasSmallChips(), Matchers.is(false), "Element has small chips"); + jdiAssert(element().hasSmallChips(), Matchers.is(false), "Combobox has small chips"); return this; } - @JDIAction("Assert that '{name}' has placeholder") + @JDIAction(value = "Assert that '{name}' has placeholder", isAssert = true) public ComboboxAssert placeholder() { - jdiAssert(element().hasPlaceholder(), Matchers.is(true), "Element has no placeholder"); + jdiAssert(element().hasPlaceholder(), Matchers.is(true), "Combobox has no placeholder"); return this; } - @JDIAction("Assert that '{name}' has no placeholder") + @JDIAction(value = "Assert that '{name}' has no placeholder", isAssert = true) public ComboboxAssert noPlaceholder() { - jdiAssert(element().hasPlaceholder(), Matchers.is(false), "Element has placeholder"); + jdiAssert(element().hasPlaceholder(), Matchers.is(false), "Combobox has placeholder"); return this; } - @JDIAction("Assert that '{name}' has placeholder '{0}'") + @JDIAction(value = "Assert that '{name}' has placeholder '{0}'", isAssert = true) public ComboboxAssert placeholder(String placeholder) { - String actualPlaceholder = element().placeholder(); - jdiAssert(actualPlaceholder, Matchers.equalTo(placeholder), String.format("Element's actual placeholder " + - "'%s' is not equal to expected '%s'", actualPlaceholder, placeholder)); + jdiAssert(element().placeholder(), Matchers.equalTo(placeholder)); return this; } - @JDIAction("Assert that '{name}' is autofocus") + @JDIAction(value = "Assert that '{name}' is autofocus", isAssert = true) public ComboboxAssert autofocus() { - jdiAssert(element().isAutofocus(), Matchers.is(true), "Element is not autofocus"); + jdiAssert(element().isAutofocus(), Matchers.is(true), "Combobox is not autofocus"); return this; } - @JDIAction("Assert that '{name}' is not autofocus") + @JDIAction(value = "Assert that '{name}' is not autofocus", isAssert = true) public ComboboxAssert notAutofocus() { - jdiAssert(element().isAutofocus(), Matchers.is(false), "Element is autofocus"); + jdiAssert(element().isAutofocus(), Matchers.is(false), "Combobox is autofocus"); return this; } - @JDIAction("Assert that '{name}' has counter") + @JDIAction(value = "Assert that '{name}' has counter", isAssert = true) public ComboboxAssert counter() { - jdiAssert(element().hasCounter(), Matchers.is(true), "Element has no counter"); + jdiAssert(element().hasCounter(), Matchers.is(true), "Combobox has no counter"); return this; } - @JDIAction("Assert that '{name}' has no counter") + @JDIAction(value = "Assert that '{name}' has no counter", isAssert = true) public ComboboxAssert noCounter() { - jdiAssert(element().hasCounter(), Matchers.is(false), "Element has counter"); + jdiAssert(element().hasCounter(), Matchers.is(false), "Combobox has counter"); return this; } - @JDIAction("Assert that '{name}' has counter value '{0}'") + @JDIAction(value = "Assert that '{name}' has counter value '{0}'", isAssert = true) public ComboboxAssert counterValue(String value) { - String actualCounterValue = element().hasCounterValue(); - jdiAssert(actualCounterValue, Matchers.equalTo(value), String.format("Element's actual counter " + - "value '%s' is not equal to expected '%s'", actualCounterValue, value)); + jdiAssert(element().counterValue(), Matchers.equalTo(value)); return this; } - @JDIAction("Assert that '{name}' has prefix") + @JDIAction(value = "Assert that '{name}' has prefix", isAssert = true) public ComboboxAssert prefix() { - jdiAssert(element().hasPrefix(), Matchers.is(true), "Element has no prefix"); + jdiAssert(element().hasPrefix(), Matchers.is(true), "Combobox has no prefix"); return this; } - @JDIAction("Assert that '{name}' has no prefix") + @JDIAction(value = "Assert that '{name}' has no prefix", isAssert = true) public ComboboxAssert noPrefix() { - jdiAssert(element().hasPrefix(), Matchers.is(false), "Element has prefix"); + jdiAssert(element().hasPrefix(), Matchers.is(false), "Combobox has prefix"); return this; } - @JDIAction("Assert that '{name}' has prefix '{0}'") + @JDIAction(value = "Assert that '{name}' has prefix '{0}'", isAssert = true) public ComboboxAssert prefix(String text) { - String actualPrefixText = element().getPrefixText(); - jdiAssert(actualPrefixText, Matchers.equalTo(text), String.format("Element's actual prefix text '%s' is not " + - "equal to expected '%s'", actualPrefixText, text)); + jdiAssert(element().getPrefixText(), Matchers.equalTo(text)); return this; } - @JDIAction("Assert that '{name}' has suffix") + @JDIAction(value = "Assert that '{name}' has suffix", isAssert = true) public ComboboxAssert suffix() { - jdiAssert(element().hasSuffix(), Matchers.is(true), "Element has no suffix"); + jdiAssert(element().hasSuffix(), Matchers.is(true), "Combobox has no suffix"); return this; } - @JDIAction("Assert that '{name}' has no suffix") + @JDIAction(value = "Assert that '{name}' has no suffix", isAssert = true) public ComboboxAssert noSuffix() { - jdiAssert(element().hasSuffix(), Matchers.is(false), "Element has suffix"); + jdiAssert(element().hasSuffix(), Matchers.is(false), "Combobox has suffix"); return this; } - @JDIAction("Assert that '{name}' has suffix '{0}'") + @JDIAction(value = "Assert that '{name}' has suffix '{0}'", isAssert = true) public ComboboxAssert suffix(String text) { - String actualSuffixText = element().getSuffixText(); - jdiAssert(actualSuffixText, Matchers.equalTo(text), String.format("Element's actual suffix text '%s' is not " + - "equal to expected '%s'", actualSuffixText, text)); + jdiAssert(element().getSuffixText(), Matchers.equalTo(text)); return this; } } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/DatePickerAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/DatePickerAssert.java index 052bee36ea..3529550d18 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/DatePickerAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/DatePickerAssert.java @@ -6,7 +6,6 @@ import com.epam.jdi.light.vuetify.interfaces.asserts.ElevationAssert; import com.epam.jdi.light.vuetify.interfaces.asserts.MeasurementAssert; import com.epam.jdi.light.vuetify.interfaces.asserts.ThemeAssert; -import com.jdiai.tools.Timer; import org.hamcrest.Matchers; import java.time.LocalDate; @@ -44,264 +43,217 @@ String getDayOfMonthSuffix(int n) { return res; } - @JDIAction("Assert that '{name}' date field has value '{0}'") + @JDIAction(value = "Assert that '{name}' date field has value '{0}'", isAssert = true) public DatePickerAssert date(String date) { - Timer.waitCondition(() -> element().getDate().equals(date)); - String actualDate = element().getDate(); - jdiAssert(actualDate, Matchers.is(date), String.format("Element's actual date '%s' is not equal to expected '%s'", - actualDate, date)); + jdiAssert(element().getDate(), Matchers.is(date)); return this; } - @JDIAction("Assert that '{name}' field color is '{0}'") + @JDIAction(value = "Assert that '{name}' field color is '{0}'", isAssert = true) public DatePickerAssert color(String color) { - String actualColor = element().getColor(); - jdiAssert(actualColor, Matchers.is(color), String.format("Element's actual color '%s' is not equal to expected " + - "'%s'", actualColor, color)); + jdiAssert(element().getColor(), Matchers.is(color)); return this; } - @JDIAction("Assert that '{name}' shown day of month is '{0}'") + @JDIAction(value = "Assert that '{name}' shown day of month is '{0}'", isAssert = true) public DatePickerAssert dayOfMonth(String dayOfMonth) { - Timer.waitCondition(() -> element().getDayOfMonth().equals(dayOfMonth)); - String actualDayOfMonth = element().getDayOfMonth(); - jdiAssert(actualDayOfMonth, Matchers.is(dayOfMonth), String.format("Element's actual day of month '%s' is not " + - "equal to expected '%s'", actualDayOfMonth, dayOfMonth)); + jdiAssert(element().getDayOfMonth(), Matchers.is(dayOfMonth)); return this; } - @JDIAction("Assert that '{name}' shown day of month is '{0}' based on locale '{1}'") + @JDIAction(value = "Assert that '{name}' shown day of month is '{0}' based on locale '{1}'", isAssert = true) public DatePickerAssert dayOfMonth(String dayOfMonth, Locale locale) { - Timer.waitCondition(() -> element().getDayOfMonth(locale).equals(dayOfMonth)); - String actualDayOfMonth = element().getDayOfMonth(locale); - jdiAssert(actualDayOfMonth, Matchers.containsString(dayOfMonth), String.format("Actual day of " + - "month '%s' is not equal to expected '%s'", actualDayOfMonth, dayOfMonth)); + jdiAssert(element().getDayOfMonth(locale), Matchers.containsString(dayOfMonth)); return this; } - @JDIAction("Assert that '{name}' shown month is '{0}'") + @JDIAction(value = "Assert that '{name}' shown month is '{0}'", isAssert = true) public DatePickerAssert month(String month) { - Timer.waitCondition(() -> element().getMonth().equals(month)); - String actualMonth = element().getMonth(); - jdiAssert(actualMonth, Matchers.is(month), String.format("Actual month '%s' is not equal to expected '%s'", - actualMonth, month)); + jdiAssert(element().getMonth(), Matchers.is(month)); return this; } - @JDIAction("Assert that '{name}' shown month is '{0}' based on locale '{1}'") + @JDIAction(value = "Assert that '{name}' shown month is '{0}' based on locale '{1}'", isAssert = true) public DatePickerAssert month(String month, Locale locale) { - Timer.waitCondition(() -> element().getMonth(locale).equals(month)); - String actualMonth = element().getMonth(locale); - jdiAssert(actualMonth, Matchers.is(month), String.format("Actual month '%s' is not equal to expected '%s'", - actualMonth, month)); + jdiAssert(element().getMonth(locale), Matchers.is(month)); return this; } - @JDIAction("Assert that '{name}' shown year is '{0}'") + @JDIAction(value = "Assert that '{name}' shown year is '{0}'", isAssert = true) public DatePickerAssert year(String year) { - Timer.waitCondition(() -> element().getYear().equals(year)); - String actualYear = element().getYear(); - jdiAssert(actualYear, Matchers.containsString(year), String.format("Actual year '%s' is not equal to " + - "expected '%s'", actualYear, year)); + jdiAssert(element().getYear(), Matchers.containsString(year)); return this; } - @JDIAction("Assert that '{name}' shown year is '{0}' based on locale '{1}'") + @JDIAction(value = "Assert that '{name}' shown year is '{0}' based on locale '{1}'", isAssert = true) public DatePickerAssert year(String year, Locale locale) { - Timer.waitCondition(() -> element().getYear(locale).equals(year)); - String actualYear = element().getYear(locale); - jdiAssert(actualYear, Matchers.containsString(year), String.format("Actual year '%s' is not equal to " + - "expected '%s'", actualYear, year)); + jdiAssert(element().getYear(locale), Matchers.containsString(year)); return this; } - @JDIAction("Assert that '{name}' list of disabled dates is not empty") + @JDIAction(value = "Assert that '{name}' list of disabled dates is not empty", isAssert = true) public DatePickerAssert disabledDatesNonEmptyList() { - jdiAssert(element().getDisabledDates().size(), Matchers.greaterThanOrEqualTo(1), "Element " + - "doesn't have disabled dates"); + jdiAssert(element().getDisabledDates().size(), Matchers.greaterThanOrEqualTo(1), + "DatePicker doesn't have disabled dates"); return this; } - @JDIAction("Assert that '{name}' list of enabled dates is not empty") + @JDIAction(value = "Assert that '{name}' list of enabled dates is not empty", isAssert = true) public DatePickerAssert enabledDatesNonEmptyList() { - jdiAssert(element().getEnabledDates().size(), Matchers.greaterThanOrEqualTo(1), "Element " + - "doesn't have enabled dates"); + jdiAssert(element().getEnabledDates().size(), Matchers.greaterThanOrEqualTo(1), + "DatePicker doesn't have enabled dates"); return this; } - @JDIAction("Assert that '{name}' enabled dates are clickable") + @JDIAction(value = "Assert that '{name}' enabled dates are clickable", isAssert = true) public DatePickerAssert clickableEnabledDates() { element().getEnabledDatesElements().stream().forEach(elem -> { elem.hover(); - Timer.waitCondition(() -> elem.isClickable()); - jdiAssert(elem.isClickable(), Matchers.is(true), "Element is not clickable"); + jdiAssert(elem.isClickable(), Matchers.is(true), "DatePicker is not clickable"); } ); return this; } - @JDIAction("Assert that '{name}' disabled dates are non-clickable") + @JDIAction(value = "Assert that '{name}' disabled dates are non-clickable", isAssert = true) public DatePickerAssert nonClickableDisabledDates() { element().getDisabledDatesElements().stream().forEach(elem -> - jdiAssert(elem.isClickable(), Matchers.is(false), "Element is clickable") + jdiAssert(elem.isClickable(), Matchers.is(false), "DatePicker's disabled dates is clickable") ); return this; } - @JDIAction("Assert that '{name}' next month icon class is '{0}'") + @JDIAction(value = "Assert that '{name}' next month icon class is '{0}'", isAssert = true) public DatePickerAssert nextMonthIconClass(String nextMonthIconClass) { - String actualNextMonthIconClass = element().getNextMonthIconClass(); - jdiAssert(actualNextMonthIconClass, Matchers.containsString(nextMonthIconClass), String.format("Actual next " + - "month icon class '%s' is not equal to expected '%s'", actualNextMonthIconClass, nextMonthIconClass)); + jdiAssert(element().getNextMonthIconClass(), Matchers.containsString(nextMonthIconClass)); return this; } - @JDIAction("Assert that '{name}' previous month icon class is '{0}'") + @JDIAction(value = "Assert that '{name}' previous month icon class is '{0}'", isAssert = true) public DatePickerAssert previousMonthIconClass(String previousMonthIconClass) { - String actualPreviousMonthIconClass = element().getPreviousMonthIconClass(); - jdiAssert(actualPreviousMonthIconClass, Matchers.containsString(previousMonthIconClass), String.format( - "Actual element's previous month icon class '%s' is not equal to expected '%s'", - actualPreviousMonthIconClass, previousMonthIconClass)); + jdiAssert(element().getPreviousMonthIconClass(), Matchers.containsString(previousMonthIconClass)); return this; } - @JDIAction("Assert that '{name}' additional year icon exists") + @JDIAction(value = "Assert that '{name}' additional year icon exists", isAssert = true) public DatePickerAssert additionalYearIcon() { - jdiAssert(element().getAdditionalYearIcon().isExist(), Matchers.is(true), "Element hasn't " + - "additional year icon"); + jdiAssert(element().getAdditionalYearIcon().isExist(), Matchers.is(true), + "DatePicker hasn't additional year icon"); return this; } - @JDIAction("Assert that '{name}' chosen dates are '{0}'") + @JDIAction(value = "Assert that '{name}' chosen dates are '{0}'", isAssert = true) public DatePickerAssert properSetOfActiveDays(Set days) { - Timer.waitCondition(() -> element().getAllActiveDaysOfMonth().equals(days)); - List actualActiveDaysOfMonth = element().getAllActiveDaysOfMonth(); - jdiAssert(actualActiveDaysOfMonth, Matchers.containsInAnyOrder(days.toArray()), String.format( - "Actual element's days of month '%s' don't contain all of the expected days '%s'", - actualActiveDaysOfMonth, days)); + jdiAssert(element().getAllActiveDaysOfMonth(), Matchers.containsInAnyOrder(days.toArray())); return this; } - @JDIAction("Assert that '{name}' all chosen dates are shown in menu list") + @JDIAction(value = "Assert that '{name}' all chosen dates are shown in menu list", isAssert = true) public DatePickerAssert properShownMultipleDates() { List activeFormattedDates = element().getAllActiveDaysOfMonth().stream().map(elem -> LocalDate.of(Integer.parseInt(element().getYear()), Month.valueOf(element().getMonth(Locale.ENGLISH).toUpperCase(Locale.ROOT)).getValue(), Integer.parseInt(elem)).toString()).collect(Collectors.toList()); - Object[] shownDates = element().getShownMultipleDates().toArray(); - jdiAssert(activeFormattedDates, Matchers.containsInAnyOrder(shownDates), - String.format("Element's actual active dates '%s' don't contain all of the shown dates '%s'", - activeFormattedDates, shownDates)); + jdiAssert(activeFormattedDates, Matchers.containsInAnyOrder(element().getShownMultipleDates().toArray())); return this; } - @JDIAction("Assert that '{name}' all dates in range '{0} - {1}' are active") + @JDIAction(value = "Assert that '{name}' all dates in range '{0} - {1}' are active", isAssert = true) public DatePickerAssert activeDatesInRange(int startDay, int finalDay) { List expectedNumbersInRange = new ArrayList<>(); for (int i = startDay; i < finalDay + 1; i++) { expectedNumbersInRange.add(Integer.toString(i)); } - List activeDays = element().getAllActiveDaysOfMonth(); - jdiAssert(activeDays, Matchers.is(expectedNumbersInRange), String.format("Actual element's " + - "active days '%s' don't contain all of the expected '%s'", activeDays, expectedNumbersInRange)); + jdiAssert(element().getAllActiveDaysOfMonth(), Matchers.is(expectedNumbersInRange)); return this; } - @JDIAction("Assert that '{name}' list of event color circles is not empty") + @JDIAction(value = "Assert that '{name}' list of event color circles is not empty", isAssert = true) public DatePickerAssert eventColorCirclesNonEmptyList() { - jdiAssert(element().getEventCirclesColor().size(), Matchers.greaterThanOrEqualTo(1), "Element " + - "hasn't event color circles"); + jdiAssert(element().getEventCirclesColor().size(), Matchers.greaterThanOrEqualTo(1), + "DatePicker does not have event color circles"); return this; } - @JDIAction("Assert that '{name}' has following colors of event circles '{0}'") + @JDIAction(value = "Assert that '{name}' has following colors of event circles '{0}'", isAssert = true) public DatePickerAssert properColorsOfEventCircles(String... colors) { - List actualEventCirclesColor = element().getEventCirclesColor(); - jdiAssert(actualEventCirclesColor, Matchers.hasItems(colors), String.format("Actual event circles " + - "colors '%s' don't contain all of the expected colors '%s'", actualEventCirclesColor, colors)); + jdiAssert(element().getEventCirclesColor(), Matchers.hasItems(colors)); return this; } - @JDIAction("Assert that '{name}' result date field has date '{0}'") + @JDIAction(value = "Assert that '{name}' result date field has date '{0}'", isAssert = true) public DatePickerAssert resultDate(String resultDate) { - Timer.waitCondition(() -> element().getResultDate().equals(resultDate)); - String actualResultDate = element().getResultDate(); - jdiAssert(actualResultDate, Matchers.is(resultDate), String.format("Actual result date '%s' is not equal to " + - "expected '%s'", actualResultDate, resultDate)); + jdiAssert(element().getResultDate(), Matchers.is(resultDate)); return this; } - @JDIAction("Assert that '{name}' change year button is visible") + @JDIAction(value = "Assert that '{name}' change year button is visible", isAssert = true) public DatePickerAssert visibleChangeYearButton() { - Timer.waitCondition(() -> element().getChangeYearButton().isVisible()); - jdiAssert(element().getChangeYearButton().isVisible(), Matchers.is(true), "Element hasn't " + - "visible change year button"); + jdiAssert(element().getChangeYearButton().isVisible(), Matchers.is(true), + "DatePicker's does not have visible change year button"); return this; } - @JDIAction("Assert that '{name}' main date field does not exist") + @JDIAction(value = "Assert that '{name}' main date field does not exist", isAssert = true) public DatePickerAssert mainDateFieldIsNotExist() { - jdiAssert(element().getMainField().isNotExist(), Matchers.is(true), "Element's main date " + - "field exists"); + jdiAssert(element().getMainField().isNotExist(), Matchers.is(true), + "DatePicker's main date field exists"); return this; } - @JDIAction("Assert that '{name}' main date field exists") + @JDIAction(value = "Assert that '{name}' main date field exists", isAssert = true) public DatePickerAssert mainDateField() { - Timer.waitCondition(() -> element().getMainField().isExist()); - jdiAssert(element().getMainField().isExist(), Matchers.is(true), "Element's main date field " + - "exists"); + jdiAssert(element().getMainField().isExist(), Matchers.is(true), + "DatePicker's main date field exists"); return this; } - @JDIAction("Assert that '{name}' formatted date field has date '{0}'") + @JDIAction(value = "Assert that '{name}' formatted date field has date '{0}'", isAssert = true) public DatePickerAssert formattedDate(String formattedDate) { - Timer.waitCondition(() -> element().getFormattedDate().equals(formattedDate)); - String actualFormattedDate = element().getFormattedDate(); - jdiAssert(actualFormattedDate, Matchers.is(formattedDate), String.format("Element's actual formatted date " + - "'%s' is not equal to expected '%s'", actualFormattedDate, formattedDate)); + jdiAssert(element().getFormattedDate(), Matchers.is(formattedDate)); return this; } - @JDIAction("Assert that '{name}' date field has readonly attribute") + @JDIAction(value = "Assert that '{name}' date field has readonly attribute", isAssert = true) public DatePickerAssert dateFieldReadonlyAttribute() { - jdiAssert(element().getDateFieldReadonlyAttribute(), Matchers.is("true"), "Element's date " + - "field hasn't readonly attribute"); + jdiAssert(element().getDateFieldReadonlyAttribute(), Matchers.is("true"), + "DatePicker's date field hasn't readonly attribute"); return this; } - @JDIAction("Assert that '{name}' result date '{0}' is formatted according to external libraries") + @JDIAction(value = "Assert that '{name}' result date '{0}' is formatted according to external libraries", isAssert = true) public DatePickerAssert properExternalLibFormattingDate(LocalDate date) { DateTimeFormatter formatterJS = DateTimeFormatter. ofPattern("cccc, MMMM d'" + getDayOfMonthSuffix(date.getDayOfMonth()) + "' yyyy") .withLocale(Locale.ENGLISH); - jdiAssert(element().getResultDate(), Matchers.is(date.format(formatterJS)), "Element's result date " + - "isn't formatted according to external libraries"); + jdiAssert(element().getResultDate(), Matchers.is(date.format(formatterJS))); return this; } - @JDIAction("Assert that '{name}' result date is empty") + @JDIAction(value = "Assert that '{name}' result date is empty", isAssert = true) public DatePickerAssert emptyResultDate() { - jdiAssert(element().getResultDate(), Matchers.is(""), "Element's result date is not empty"); + jdiAssert(element().getResultDate(), Matchers.is(""), + "DatePicker's result date is not empty"); return this; } - @JDIAction("Assert that '{name}' has portrait orientation") + // TODO Check this logic + @JDIAction(value = "Assert that '{name}' has portrait orientation", isAssert = true) public DatePickerAssert portraitOrientation() { jdiAssert(element().getColorFieldWidth(), Matchers.greaterThan(element().getColorFieldHeight()), - "Element has not portrait orientation"); + "DatePicker is not in portrait orientation"); return this; } - @JDIAction("Assert that '{name}' has landscape orientation") + @JDIAction(value = "Assert that '{name}' has landscape orientation", isAssert = true) public DatePickerAssert landscapeOrientation() { jdiAssert(element().getColorFieldWidth(), Matchers.lessThan(element().getColorFieldHeight()), "Element has not landscape orientation"); return this; } - @JDIAction("Assert that expandable '{name}' is expanded") + @JDIAction(value = "Assert that expandable '{name}' is expanded", isAssert = true) public DatePickerAssert expanded() { jdiAssert(element().getExpandedElement().attr("class"), Matchers.containsString("primary--text"), "Element is not expanded"); diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/DatePickerMonthAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/DatePickerMonthAssert.java index 475ab24550..a3a1ddbbef 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/DatePickerMonthAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/DatePickerMonthAssert.java @@ -7,7 +7,6 @@ import com.epam.jdi.light.vuetify.interfaces.asserts.ElevationAssert; import com.epam.jdi.light.vuetify.interfaces.asserts.MeasurementAssert; import com.epam.jdi.light.vuetify.interfaces.asserts.ThemeAssert; -import com.jdiai.tools.Timer; import org.hamcrest.Matchers; import java.util.Set; @@ -17,112 +16,110 @@ public class DatePickerMonthAssert extends UIAssert implements MeasurementAssert, ColorAssert, ThemeAssert, ElevationAssert { - @JDIAction("Assert that '{name}' next year icon class is correct") + @JDIAction(value = "Assert that '{name}' next year icon class is correct", isAssert = true) public DatePickerMonthAssert nextYearIconClass(String iconClass) { jdiAssert(element().getNextYearIconClass(), Matchers.containsString(iconClass)); return this; } - @JDIAction("Assert that '{name}' previous year icon class is correct") + @JDIAction(value = "Assert that '{name}' previous year icon class is correct", isAssert = true) public DatePickerMonthAssert previousYearIconClass(String iconClass) { jdiAssert(element().getPreviousYearIconClass(), Matchers.containsString(iconClass)); return this; } - @JDIAction("Assert that '{name}' has additional year icon") + @JDIAction(value = "Assert that '{name}' has additional year icon", isAssert = true) public DatePickerMonthAssert additionalYearIcon() { - jdiAssert(element().getAdditionalYearIcon().isExist(), Matchers.is(true), "Element hasn't " + - "additional year icon"); + jdiAssert(element().getAdditionalYearIcon().isExist(), Matchers.is(true), + "DatePickerMonth does not have additional year icon"); return this; } - @JDIAction("Assert that '{name}' additional year icon class is correct") + @JDIAction(value = "Assert that '{name}' additional year icon class is correct", isAssert = true) public DatePickerMonthAssert additionalYearIconClass(String iconClass) { jdiAssert(element().getAdditionalYearIconClass(), Matchers.containsString(iconClass)); return this; } - @JDIAction("Assert that '{name}' shown year is '{0}'") + @JDIAction(value = "Assert that '{name}' shown year is '{0}'", isAssert = true) public DatePickerMonthAssert year(int year) { jdiAssert(element().getYear(), Matchers.is(year)); return this; } - @JDIAction("Assert that '{name}' shown month is '{0}'") + @JDIAction(value = "Assert that '{name}' shown month is '{0}'", isAssert = true) public DatePickerMonthAssert month(String month) { jdiAssert(element().getMonth(), Matchers.is(month)); return this; } - @JDIAction("Assert that '{name}' list of enabled months is not empty") + @JDIAction(value = "Assert that '{name}' list of enabled months is not empty", isAssert = true) public DatePickerMonthAssert enabledMonthsNonEmptyList() { - jdiAssert(element().getEnabledMonths().size(), Matchers.greaterThanOrEqualTo(1), "Enabled " + - "months is an empty list"); + jdiAssert(element().getEnabledMonths().size(), Matchers.greaterThanOrEqualTo(1), + "There is no enabled months found"); return this; } - @JDIAction("Assert that '{name}' list of disabled months is not empty") + @JDIAction(value = "Assert that '{name}' list of disabled months is not empty", isAssert = true) public DatePickerMonthAssert disabledMonthsNonEmptyList() { - jdiAssert(element().getDisabledMonths().size(), Matchers.greaterThanOrEqualTo(1), "Disabled " + - "months is an empty list"); + jdiAssert(element().getDisabledMonths().size(), Matchers.greaterThanOrEqualTo(1), + "There is no disabled months found"); return this; } - @JDIAction("Assert that '{name}' enabled months are clickable") + @JDIAction(value = "Assert that '{name}' enabled months are clickable", isAssert = true) public DatePickerMonthAssert clickableEnabledMonths() { element().getEnabledMonthElements().forEach(elem -> { elem.hover(); - Timer.waitCondition(() -> elem.isClickable()); - jdiAssert(elem.isClickable(), Matchers.is(true), "Element is not clickable"); + jdiAssert(elem.isClickable(), Matchers.is(true), "Month is not clickable"); } ); return this; } - @JDIAction("Assert that '{name}' disabled months are non-clickable") + @JDIAction(value = "Assert that '{name}' disabled months are non-clickable", isAssert = true) public DatePickerMonthAssert nonClickableDisabledMonths() { element().getDisabledMonthElements().forEach(elem -> - jdiAssert(elem.isClickable(), Matchers.is(false), "Element is clickable") + jdiAssert(elem.isClickable(), Matchers.is(false), "Month is clickable") ); return this; } - @JDIAction("Assert that all chosen months are correctly chosen") + @JDIAction(value = "Assert that all chosen months are correctly chosen", isAssert = true) public DatePickerMonthAssert properSetOfActiveMonths(Set months) { jdiAssert(element().getAllActiveMonths(), Matchers.containsInAnyOrder(months.toArray())); return this; } - @JDIAction("Assert that result date field has {0} date") + @JDIAction(value = "Assert that result date field has {0} date", isAssert = true) public DatePickerMonthAssert resultDate(String resultDate) { jdiAssert(element().getResultDate(), Matchers.is(resultDate)); return this; } - @JDIAction("Assert that '{name}' hasn't month field") + @JDIAction(value = "Assert that '{name}' hasn't month field", isAssert = true) public DatePickerMonthAssert notMonthField() { - jdiAssert(element().getMonthField().isNotExist(), Matchers.is(true), "Element has month field"); + jdiAssert(element().getMonthField().isNotExist(), Matchers.is(true), "DatePickerMonth has month field"); return this; } - @JDIAction("Assert that '{name}' has month field") + @JDIAction(value = "Assert that '{name}' has month field", isAssert = true) public DatePickerMonthAssert monthField() { - Timer.waitCondition(() -> element().getMonthField().isExist()); - jdiAssert(element().getMonthField().isExist(), Matchers.is(true), "Element has not month field"); + jdiAssert(element().getMonthField().isExist(), Matchers.is(true), "DatePickerMonth has not month field"); return this; } - @JDIAction("Assert that '{name}' has portrait orientation") + @JDIAction(value = "Assert that '{name}' has portrait orientation", isAssert = true) public DatePickerMonthAssert portraitOrientation() { jdiAssert(element().getColorFieldWidth(), Matchers.greaterThan(element().getColorFieldHeight()), - "Element has not portrait orientation"); + "DatePickerMonth has not portrait orientation"); return this; } - @JDIAction("Assert that '{name}' has landscape orientation") + @JDIAction(value = "Assert that '{name}' has landscape orientation", isAssert = true) public DatePickerMonthAssert landscapeOrientation() { jdiAssert(element().getColorFieldWidth(), Matchers.lessThan(element().getColorFieldHeight()), - "Element has not landscape orientation"); + "DatePickerMonth has not landscape orientation"); return this; } } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/DialogAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/DialogAssert.java index 0b5a3ce469..c227c43861 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/DialogAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/DialogAssert.java @@ -8,7 +8,6 @@ import org.hamcrest.Matchers; import static com.epam.jdi.light.asserts.core.SoftAssert.jdiAssert; -import static com.jdiai.tools.Timer.waitCondition; public class DialogAssert extends UIAssert implements ThemeAssert { @@ -17,92 +16,87 @@ public DialogAssert and() { return super.and(); } - @JDIAction("Assert that '{name}' is opened") + @JDIAction(value = "Assert that '{name}' is opened", isAssert = true) public DialogAssert opened() { - waitCondition(() -> element().isOpened()); - jdiAssert(element().isOpened(), Matchers.is(true), "Element is closed"); + jdiAssert(element().isOpened(), Matchers.is(true), "Dialog is closed"); return this; } - @JDIAction("Assert that '{name}' is closed") + @JDIAction(value = "Assert that '{name}' is closed", isAssert = true) public DialogAssert closed() { - jdiAssert(element().isOpened(), Matchers.is(false), "Element is opened"); + jdiAssert(element().isOpened(), Matchers.is(false), "Dialog is opened"); return this; } - @JDIAction("Assert that '{name}' is active") + @JDIAction(value = "Assert that '{name}' is active", isAssert = true) public DialogAssert active() { - jdiAssert(element().isActive(), Matchers.is(true), "Element is not active"); + jdiAssert(element().isActive(), Matchers.is(true), "Dialog is not active"); return this; } - @JDIAction("Assert that '{name}' is not active") + @JDIAction(value = "Assert that '{name}' is not active", isAssert = true) public DialogAssert notActive() { - jdiAssert(element().isActive(), Matchers.is(false), "Element is active"); + jdiAssert(element().isActive(), Matchers.is(false), "Dialog is active"); return this; } - @JDIAction("Assert that '{name}' is fullscreen") + @JDIAction(value = "Assert that '{name}' is fullscreen", isAssert = true) public DialogAssert fullscreen() { - jdiAssert(element().isFullscreen(), Matchers.is(true), "Element is not fullscreen"); + jdiAssert(element().isFullscreen(), Matchers.is(true), "Dialog is not fullscreen"); return this; } - @JDIAction("Assert that '{name}' is not fullscreen") + @JDIAction(value = "Assert that '{name}' is not fullscreen", isAssert = true) public DialogAssert notFullscreen() { - jdiAssert(element().isFullscreen(), Matchers.is(false), "Element is fullscreen"); + jdiAssert(element().isFullscreen(), Matchers.is(false), "Dialog is fullscreen"); return this; } - @JDIAction("Assert that '{name}' is persistent") + @JDIAction(value = "Assert that '{name}' is persistent", isAssert = true) public DialogAssert persistent() { - jdiAssert(element().isPersistent(), Matchers.is(true), "Element is not persistent"); + jdiAssert(element().isPersistent(), Matchers.is(true), "Dialog is not persistent"); return this; } - @JDIAction("Assert that '{name}' is not persistent") + @JDIAction(value = "Assert that '{name}' is not persistent", isAssert = true) public DialogAssert notPersistent() { - jdiAssert(element().isPersistent(), Matchers.is(false), "Element is persistent"); + jdiAssert(element().isPersistent(), Matchers.is(false), "Dialog is persistent"); return this; } - @JDIAction("Assert that '{name}' is scrollable") + @JDIAction(value = "Assert that '{name}' is scrollable", isAssert = true) public DialogAssert scrollable() { - jdiAssert(element().isScrollable(), Matchers.is(true), "Element is not scrollable"); + jdiAssert(element().isScrollable(), Matchers.is(true), "Dialog is not scrollable"); return this; } - @JDIAction("Assert that '{name}' is not scrollable") + @JDIAction(value = "Assert that '{name}' is not scrollable", isAssert = true) public DialogAssert notScrollable() { - jdiAssert(element().isScrollable(), Matchers.is(false), "Element is scrollable"); + jdiAssert(element().isScrollable(), Matchers.is(false), "Dialog is scrollable"); return this; } - @JDIAction("Assert that '{name}' has visible '{0}' in dialog content") + @JDIAction(value = "Assert that '{name}' has visible '{0}' in dialog content", isAssert = true) public DialogAssert visibleContent(UIElement element) { - jdiAssert(element().hasVisibleContent(element), Matchers.is(true), "Element has no visible content"); + jdiAssert(element().hasVisibleContent(element), Matchers.is(true), "Dialog has no visible content"); return this; } - @JDIAction("Assert that '{name}' has not visible '{0}' in dialog content") + @JDIAction(value = "Assert that '{name}' has not visible '{0}' in dialog content", isAssert = true) public DialogAssert notVisibleContent(UIElement element) { - jdiAssert(element().hasVisibleContent(element), Matchers.is(false), "Element has visible content"); + jdiAssert(element().hasVisibleContent(element), Matchers.is(false), "Dialog has visible content"); return this; } - @JDIAction("Assert that '{name}' has width '{0}'") + @JDIAction(value = "Assert that '{name}' has width '{0}'", isAssert = true) public DialogAssert maxWidthPx(int width) { - int actualWidth = element().maxWidthPx(); - jdiAssert(actualWidth, Matchers.equalTo(width), String.format("Element's actual max-width '%s px' is not " + - "equal to expected '%s px'", actualWidth, width)); + jdiAssert(element().maxWidthPx(), Matchers.equalTo(width)); return this; } - @JDIAction("Assert that '{name}' has margin '{0} px'") + @JDIAction(value = "Assert that '{name}' has margin '{0} px'", isAssert = true) public DialogAssert marginPx(int margin) { - int actualMargin = element().marginPx(); - jdiAssert(actualMargin, Matchers.equalTo(margin), String.format("Element's actual margin '%s px' is not " + - "equal to expected '%s px'", actualMargin, margin)); + jdiAssert(element().marginPx(), Matchers.equalTo(margin)); return this; } } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/DividerAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/DividerAssert.java index a4beec8a5d..1f57f8890e 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/DividerAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/DividerAssert.java @@ -12,15 +12,15 @@ public class DividerAssert extends UIAssert implements OrientationAssert, ThemeAssert { - @JDIAction("Assert that '{name}' is inset") + @JDIAction(value = "Assert that '{name}' is inset", isAssert = true) public DividerAssert inset() { - jdiAssert(element().isInset(), Matchers.is(true), "Element is not inset"); + jdiAssert(element().isInset(), Matchers.is(true), "Divider is not inset"); return this; } - @JDIAction("Assert that '{name}' is not inset") + @JDIAction(value = "Assert that '{name}' is not inset", isAssert = true) public DividerAssert notInset() { - jdiAssert(element().isInset(), Matchers.is(false), "Element is inset"); + jdiAssert(element().isInset(), Matchers.is(false), "Divider is inset"); return this; } } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/FileInputAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/FileInputAssert.java index 26dd4107cd..665af115c4 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/FileInputAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/FileInputAssert.java @@ -39,109 +39,91 @@ public class FileInputAssert extends UIAssert ThemeAssert, SoloAssert, FullWidthAssert, HideDetailsAssert { - @JDIAction("Assert that '{name}' is enabled") + @JDIAction(value = "Assert that '{name}' is enabled", isAssert = true) public FileInputAssert enabled() { - jdiAssert(element().isDisabled(), Matchers.is(false), "Element is disabled"); + jdiAssert(element().isDisabled(), Matchers.is(false), "FileInput is disabled"); return this; } - @JDIAction("Assert that '{name}' is disabled") + @JDIAction(value = "Assert that '{name}' is disabled", isAssert = true) public FileInputAssert disabled() { - jdiAssert(element().isDisabled(), Matchers.is(true), "Element is enabled"); + jdiAssert(element().isDisabled(), Matchers.is(true), "FileInput is enabled"); return this; } - @JDIAction("Assert that '{name}' accept {0}") + @JDIAction(value = "Assert that '{name}' accept {0}", isAssert = true) public FileInputAssert accept(Matcher condition) { - String elementAccepts = element().accept(); - jdiAssert(elementAccepts, condition, String.format("Element accepts '%s'. It doesn't accept '%s'", - elementAccepts, condition)); + jdiAssert(element().accept(), condition); return this; } - @JDIAction("Assert that '{name}' has file {0}") + @JDIAction(value = "Assert that '{name}' has file {0}", isAssert = true) public FileInputAssert file(Matcher condition) { - String elementsActualConditions = element().getText(); - jdiAssert(elementsActualConditions, condition, String.format("Element's actual files '%s' don't contain " + - "expected '%s'", elementsActualConditions, condition)); + jdiAssert(element().getText(), condition); return this; } - @JDIAction("Assert that '{name}' has file {0}") + @JDIAction(value = "Assert that '{name}' has file {0}", isAssert = true) public FileInputAssert file(String file) { return file(Matchers.is(file)); } - @JDIAction("Assert that '{name}' has files {0}") + @JDIAction(value = "Assert that '{name}' has files {0}", isAssert = true) public FileInputAssert files(Matcher> condition) { - List actualFiles = element().getFiles(); - jdiAssert(element().getFiles(), condition, String.format("Element's actual files '%s' don't contain " + - "expected '%s'", actualFiles, condition)); + jdiAssert(element().getFiles(), condition); return this; } - @JDIAction("Assert that '{name}' has files {0}") + @JDIAction(value = "Assert that '{name}' has files {0}", isAssert = true) public FileInputAssert files(List files) { return files(Matchers.is(files)); } - @JDIAction("Assert that '{name}' has label") + @JDIAction(value = "Assert that '{name}' has label", isAssert = true) public FileInputAssert hasLabel() { - jdiAssert(element().hasLabel(), Matchers.is(true), "There is no label for element"); + jdiAssert(element().hasLabel(), Matchers.is(true), "There is no label for FileInput"); return this; } - @JDIAction("Assert that '{name}' has label color '{0}'") + @JDIAction(value = "Assert that '{name}' has label color '{0}'", isAssert = true) public FileInputAssert labelColor(String color) { - String actualLabelColor = element().labelColor(); - jdiAssert(actualLabelColor, Matchers.equalTo(color), String.format("Actual label color '%s' " + - "is not equal to '%s'", actualLabelColor, color)); + jdiAssert(element().labelColor(), Matchers.equalTo(color)); return this; } - @JDIAction("Assert that '{name}' has suffix text '{0}'") + @JDIAction(value = "Assert that '{name}' has suffix text '{0}'", isAssert = true) public FileInputAssert suffixText(String suffixText) { - String actualSuffixText = element().suffix().getText(); - jdiAssert(actualSuffixText, Matchers.equalTo(suffixText), String.format("Actual suffix text '%s' is not equal" + - " to expected suffix text '%s'", actualSuffixText, suffixText)); + jdiAssert(element().suffix().getText(), Matchers.equalTo(suffixText)); return this; } - @JDIAction("Assert that '{name}' has prefix text '{0}'") + @JDIAction(value = "Assert that '{name}' has prefix text '{0}'", isAssert = true) public FileInputAssert prefixText(String prefixText) { - String actualPrefixText = element().prefix().getText(); - jdiAssert(actualPrefixText, Matchers.equalTo(prefixText), String.format("Actual prefix text '%s' is not equal" + - " to expected prefix text '%s'", actualPrefixText, prefixText)); + jdiAssert(element().prefix().getText(), Matchers.equalTo(prefixText)); return this; } - @JDIAction("Assert that '{name}' has autofocus") + @JDIAction(value = "Assert that '{name}' has autofocus", isAssert = true) public FileInputAssert autofocus() { - jdiAssert(element().isAutofocus(), Matchers.is(true), "Element has not autofocus"); + jdiAssert(element().isAutofocus(), Matchers.is(true), "FileInput has not autofocus"); return this; } - @JDIAction("Assert that '{name}' has loader height {0}") + @JDIAction(value = "Assert that '{name}' has loader height {0}", isAssert = true) public FileInputAssert loaderHeightPx(int height) { - int actualLoaderHeight = element().getLoaderHeight(); - jdiAssert(actualLoaderHeight, Matchers.equalTo(height), String.format("Actual element's loader height " + - "'%s px' is not equal to expected '%s px'", actualLoaderHeight, height)); + jdiAssert(element().getLoaderHeight(), Matchers.equalTo(height)); return this; } - @JDIAction("Assert that '{name}' has placeholder '{0}'") + @JDIAction(value = "Assert that '{name}' has placeholder '{0}'", isAssert = true) public FileInputAssert placeholder(String placeholder) { - String actualPlaceholder = element().placeholder(); - jdiAssert(actualPlaceholder, Matchers.equalTo(placeholder), String.format("Element's actual" + - " placeholder '%s' is not equal to expected '%s'", actualPlaceholder, placeholder)); + jdiAssert(element().placeholder(), Matchers.equalTo(placeholder)); return this; } - @JDIAction("Assert that '{name}' has truncated file name") + @JDIAction(value = "Assert that '{name}' has truncated file name", isAssert = true) public FileInputAssert truncatedFileName() { - String fileInputText = element().getText(); - jdiAssert(fileInputText.contains("…"), Matchers.is(true), String.format( - "File input text '%s' is not truncated", fileInputText)); + jdiAssert(element().getText(), Matchers.containsString("…")); return this; } } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/FooterAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/FooterAssert.java index e36961ee6e..cd0acee716 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/FooterAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/FooterAssert.java @@ -24,47 +24,45 @@ public class FooterAssert extends UIAssert implements ITex RoundedAssert, ShapedAssert, TileAssert, ContainerAssert { @Override - @JDIAction("Assert that '{name}' has text '{0}'") + @JDIAction(value = "Assert that '{name}' has text '{0}'", isAssert = true) public FooterAssert text(Matcher condition) { - String actualText = element().getText(); - jdiAssert(actualText, condition, String.format("Actual element's text '%s' is not equal to expected '%s'", - actualText, condition)); + jdiAssert(element().getText(), condition); return this; } - @JDIAction("Assert that '{name}' is padless") + @JDIAction(value = "Assert that '{name}' is padless", isAssert = true) public FooterAssert padless() { - jdiAssert(element().isPadless(), Matchers.is(true), "Element is not padless"); + jdiAssert(element().isPadless(), Matchers.is(true), "Footer is not padless"); return this; } - @JDIAction("Assert that '{name}' is not padless") + @JDIAction(value = "Assert that '{name}' is not padless", isAssert = true) public FooterAssert notPadless() { - jdiAssert(element().isPadless(), Matchers.is(false), "Element is padless"); + jdiAssert(element().isPadless(), Matchers.is(false), "Footer is padless"); return this; } - @JDIAction("Assert that '{name}' is absolute") + @JDIAction(value = "Assert that '{name}' is absolute", isAssert = true) public FooterAssert absolute() { - jdiAssert(element().isAbsolute(), Matchers.is(true), "Element is not absolute"); + jdiAssert(element().isAbsolute(), Matchers.is(true), "Footer is not absolute"); return this; } - @JDIAction("Assert that '{name}' is not absolute") + @JDIAction(value = "Assert that '{name}' is not absolute", isAssert = true) public FooterAssert notAbsolute() { - jdiAssert(element().isAbsolute(), Matchers.is(false), "Element is absolute"); + jdiAssert(element().isAbsolute(), Matchers.is(false), "Footer is absolute"); return this; } - @JDIAction("Assert that '{name}' is fixed") + @JDIAction(value = "Assert that '{name}' is fixed", isAssert = true) public FooterAssert fixed() { - jdiAssert(element().isFixed(), Matchers.is(true), "Element is not fixed"); + jdiAssert(element().isFixed(), Matchers.is(true), "Footer is not fixed"); return this; } - @JDIAction("Assert that '{name}' is not fixed") + @JDIAction(value = "Assert that '{name}' is not fixed", isAssert = true) public FooterAssert notFixed() { - jdiAssert(element().isFixed(), Matchers.is(false), "Element is fixed"); + jdiAssert(element().isFixed(), Matchers.is(false), "Footer is fixed"); return this; } } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/GridAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/GridAssert.java index e1991dcdd6..8a59bd179d 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/GridAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/GridAssert.java @@ -3,195 +3,178 @@ import com.epam.jdi.light.asserts.generic.UIAssert; import com.epam.jdi.light.common.JDIAction; import com.epam.jdi.light.vuetify.elements.complex.Grid; -import com.jdiai.tools.Timer; import org.hamcrest.Matchers; import static com.epam.jdi.light.asserts.core.SoftAssert.jdiAssert; public class GridAssert extends UIAssert { - @JDIAction("Assert that '{name}' is displayed") + @JDIAction(value = "Assert that '{name}' is displayed", isAssert = true) public GridAssert displayed() { - Timer.waitCondition(element()::isDisplayed); - jdiAssert(element().isDisplayed(), Matchers.is(true), "Element is not displayed"); + jdiAssert(element().isDisplayed(), Matchers.is(true), "Grid is not displayed"); return this; } - @JDIAction("Assert that '{name}' has text '{0}' in in column '{1}'") + @JDIAction(value = "Assert that '{name}' has text '{0}' in in column '{1}'", isAssert = true) public GridAssert cellText(String text, int rowIndex, int columnIndex) { - String actualCellText = element().getCellByIndex(rowIndex, columnIndex).text(); - jdiAssert(actualCellText, Matchers.is(text), String.format("Actual element's cell text '%s' is not equal to " + - "expected '%s'", actualCellText, text)); + jdiAssert(element().getCellByIndex(rowIndex, columnIndex).text(), Matchers.is(text)); return this; } - @JDIAction("Assert that '{name}' row '{0}' has vertical alignment '{1}'") + // TODO Check method + @JDIAction(value = "Assert that '{name}' row '{0}' has vertical alignment '{1}'", isAssert = true) public GridAssert rowVerticalAlignment(int rowIndex, String alignment) { - String actualAlignment = element().getRowVerticalAlignment(rowIndex); String expectedAlignment = String.format("align-%s", alignment); - jdiAssert(actualAlignment, Matchers.is(expectedAlignment), String.format("Actual element's alignment '%s' " + - "is not equal to expected '%s'", actualAlignment, expectedAlignment)); + jdiAssert(element().getRowVerticalAlignment(rowIndex), Matchers.is(expectedAlignment)); return this; } - @JDIAction("Assert that '{name}' row '{0}' has horizontal alignment '{1}'") + @JDIAction(value = "Assert that '{name}' row '{0}' has horizontal alignment '{1}'", isAssert = true) public GridAssert rowHorizontalAlignment(int rowIndex, String alignment) { - String actualAlignment = element().getRowHorizontalAlignment(rowIndex); String expectedAlignment = String.format("justify-%s", alignment); - jdiAssert(actualAlignment, Matchers.is(expectedAlignment), String.format("Actual element's alignment '%s' " + - "is not equal to expected '%s'", actualAlignment, expectedAlignment)); + jdiAssert(element().getRowHorizontalAlignment(rowIndex), Matchers.is(expectedAlignment)); return this; } - @JDIAction("Assert that '{name}' cell at row '{0}' column '{1}' has vertical alignment '{2}'") + @JDIAction(value = "Assert that '{name}' cell at row '{0}' column '{1}' has vertical alignment '{2}'", isAssert = true) public GridAssert cellVerticalAlignment(int rowIndex, int columnIndex, String alignment) { - String actualAlignment = element().getCellVerticalAlignment(rowIndex, columnIndex); String expectedAlignment = String.format("align-self-%s", alignment); - jdiAssert(actualAlignment, Matchers.is(expectedAlignment), String.format("Actual element's alignment '%s' is " + - "not equal to expected '%s'", actualAlignment, expectedAlignment)); + jdiAssert(element().getCellVerticalAlignment(rowIndex, columnIndex), Matchers.is(expectedAlignment)); return this; } - @JDIAction("Assert that '{name}' cell at row '{0}' column '{1}' has order '{2}'") + @JDIAction(value = "Assert that '{name}' cell at row '{0}' column '{1}' has order '{2}'", isAssert = true) public GridAssert cellOrder(int rowIndex, int columnIndex, String order) { - String actualOrder = element().getCellOrder(rowIndex, columnIndex); String expectedOrder = String.format("order-%s", order); - jdiAssert(actualOrder, Matchers.is(expectedOrder), String.format("Actual element's order '%s' is not equal " + - "to expected '%s'", actualOrder, expectedOrder)); + jdiAssert(element().getCellOrder(rowIndex, columnIndex), Matchers.is(expectedOrder)); return this; } - @JDIAction("Assert that '{name}' cell at row '{0}' column '{1}' has order '{2}'") + @JDIAction(value = "Assert that '{name}' cell at row '{0}' column '{1}' has order '{2}'", isAssert = true) public GridAssert cellOrder(int rowIndex, int columnIndex, int order) { - String actualOrder = element().getCellOrder(rowIndex, columnIndex); String expectedOrder = String.format("order-%s", order); - jdiAssert(actualOrder, Matchers.is(expectedOrder), String.format("Actual element's order '%s' is not equal " + - "to expected '%s'", actualOrder, expectedOrder)); + jdiAssert(element().getCellOrder(rowIndex, columnIndex), Matchers.is(expectedOrder)); return this; } - @JDIAction("Assert that '{name}' cell at row '{0}' column '{1}' has offset") + @JDIAction(value = "Assert that '{name}' cell at row '{0}' column '{1}' has offset", isAssert = true) public GridAssert cellOffset(int rowIndex, int columnIndex) { - jdiAssert(element().hasCellOffset(rowIndex, columnIndex), Matchers.is(true), "Element's cell " + - "has no offset"); + jdiAssert(element().hasCellOffset(rowIndex, columnIndex), Matchers.is(true), + "Grid's cell has no offset"); return this; } - @JDIAction("Assert that '{name}' cell at row '{0}' column '{1}' has no offset") + @JDIAction(value = "Assert that '{name}' cell at row '{0}' column '{1}' has no offset", isAssert = true) public GridAssert noCellOffset(int rowIndex, int columnIndex) { - jdiAssert(element().hasCellOffset(rowIndex, columnIndex), Matchers.is(false), "Element's cell " + - "has an offset"); + jdiAssert(element().hasCellOffset(rowIndex, columnIndex), Matchers.is(false), + "Grid's cell has an offset"); return this; } - @JDIAction("Assert that '{name}' cells in row '{0}' have equal width") + @JDIAction(value = "Assert that '{name}' cells in row '{0}' have equal width", isAssert = true) public GridAssert cellWithEqualWidthsInRow(int rowIndex) { - jdiAssert(element().hasCellsWithEqualWidthInRow(rowIndex), Matchers.is(true), "Element's cells " + - "in row have different width"); + jdiAssert(element().hasCellsWithEqualWidthInRow(rowIndex), Matchers.is(true), + "Grid's cells in row have different width"); return this; } - @JDIAction("Assert that '{name}' cells in row '{0}' have different width") + @JDIAction(value = "Assert that '{name}' cells in row '{0}' have different width", isAssert = true) public GridAssert cellWithDifferentWidthsInRow(int rowIndex) { - jdiAssert(element().hasCellsWithEqualWidthInRow(rowIndex), Matchers.is(false), "Element's cells " + - "in row have equal width"); + jdiAssert(element().hasCellsWithEqualWidthInRow(rowIndex), Matchers.is(false), + "Grid's cells in row have equal width"); return this; } - @JDIAction("Assert that '{name}' cell at row '{0}' column '{1}' has width '{2}' - integer from 1 to 12") + @JDIAction(value = "Assert that '{name}' cell at row '{0}' column '{1}' has width '{2}' - integer from 1 to 12", isAssert = true) public GridAssert cellWithCustomWidth(int rowIndex, int columnIndex, int widthParameter) { jdiAssert(element().hasCellWithCustomWidth(rowIndex, columnIndex), - Matchers.containsString(String.format("col-%s", widthParameter)), String.format("Element's column " + - "width parameter is not '%s'", widthParameter)); + Matchers.containsString(String.format("col-%s", widthParameter))); return this; } - @JDIAction("Assert that '{name}' cell at row '{0}' column '{1}' has margin") + @JDIAction(value = "Assert that '{name}' cell at row '{0}' column '{1}' has margin", isAssert = true) public GridAssert cellWithMargin(int rowIndex, int columnIndex) { - jdiAssert(element().hasMargin(rowIndex, columnIndex), Matchers.is(true), String.format("Element's cell " + - "at row '%s' column '%s' has no margin", rowIndex, columnIndex)); + jdiAssert(element().hasMargin(rowIndex, columnIndex), Matchers.is(true), + String.format("Grid's cell at row '%s' column '%s' has no margin", rowIndex, columnIndex)); return this; } - @JDIAction("Assert that '{name}' cell at row '{0}' column '{1}' has no margin") + @JDIAction(value = "Assert that '{name}' cell at row '{0}' column '{1}' has no margin", isAssert = true) public GridAssert cellWithoutMargin(int rowIndex, int columnIndex) { - jdiAssert(element().hasMargin(rowIndex, columnIndex), Matchers.is(false), String.format("Element's cell " + - "at row '%s' column '%s' has margin", rowIndex, columnIndex)); + jdiAssert(element().hasMargin(rowIndex, columnIndex), Matchers.is(false), + String.format("Grid's cell at row '%s' column '%s' has margin", rowIndex, columnIndex)); return this; } - @JDIAction("Assert that '{name}' cell in row '{0}' column '{1}' has background color '{2}'") + @JDIAction(value = "Assert that '{name}' cell in row '{0}' column '{1}' has background color '{2}'", isAssert = true) public GridAssert cellBackgroundColor(int rowIndex, int columnIndex, String color) { String actualCellBackgroundColor = element().getCellBackgroundColor(rowIndex, columnIndex); - jdiAssert(actualCellBackgroundColor, Matchers.is(color), String.format("Actual element's cell background " + - "color '%s' is not equal to expected '%s'", actualCellBackgroundColor, color)); + jdiAssert(element().getCellBackgroundColor(rowIndex, columnIndex), Matchers.is(color)); return this; } - @JDIAction("Assert that '{name}' cell in row '{0}' column '{1}' has font color '{2}'") + @JDIAction(value = "Assert that '{name}' cell in row '{0}' column '{1}' has font color '{2}'", isAssert = true) public GridAssert cellFontColor(int rowIndex, int columnIndex, String color) { - String actualCellFontColor = element().getCellFontColor(rowIndex, columnIndex); - jdiAssert(actualCellFontColor, Matchers.is(color), String.format("Actual element's cell font color '%s' is " + - "not equal to expected '%s'", actualCellFontColor, color)); + jdiAssert(element().getCellFontColor(rowIndex, columnIndex), Matchers.is(color)); return this; } - @JDIAction("Assert that '{name}' row '{0}' has spacers") + @JDIAction(value = "Assert that '{name}' row '{0}' has spacers", isAssert = true) public GridAssert rowWithSpacers(int rowIndex) { - jdiAssert(element().hasRowWithSpacers(rowIndex), Matchers.is(true), "Element has no spacers"); + jdiAssert(element().hasRowWithSpacers(rowIndex), Matchers.is(true), "Grid has no spacers"); return this; } - @JDIAction("Assert that '{name}' row '{0}' has no spacers") + @JDIAction(value = "Assert that '{name}' row '{0}' has no spacers", isAssert = true) public GridAssert rowWithoutSpacers(int rowIndex) { - jdiAssert(element().hasRowWithSpacers(rowIndex), Matchers.is(false), "Element has spacers"); + jdiAssert(element().hasRowWithSpacers(rowIndex), Matchers.is(false), "Grid has spacers"); return this; } - @JDIAction("Assert that '{name}' cell at row '{0}' column '{1}' is auto-width") + @JDIAction(value = "Assert that '{name}' cell at row '{0}' column '{1}' is auto-width", isAssert = true) public GridAssert cellWithAutoWidth(int rowIndex, int columnIndex) { - jdiAssert(element().hasCellWithAutoWidth(rowIndex, columnIndex), Matchers.is(true), String.format( - "Element's cell at row '%s' column '%s' is not auto-width", rowIndex, columnIndex)); + jdiAssert(element().hasCellWithAutoWidth(rowIndex, columnIndex), Matchers.is(true), + String.format("Grid's cell at row '%s' column '%s' is not auto-width", rowIndex, columnIndex)); return this; } - @JDIAction("Assert that '{name}' is fluid") + @JDIAction(value = "Assert that '{name}' is fluid", isAssert = true) public GridAssert fluid() { - jdiAssert(element().isFluid(), Matchers.is(true), "Element is not fluid"); + jdiAssert(element().isFluid(), Matchers.is(true), "Grid is not fluid"); return this; } - @JDIAction("Assert that '{name}' is not fluid") + @JDIAction(value = "Assert that '{name}' is not fluid", isAssert = true) public GridAssert notFluid() { - jdiAssert(element().isFluid(), Matchers.is(false), "Element is fluid"); + jdiAssert(element().isFluid(), Matchers.is(false), "Grid is fluid"); return this; } - @JDIAction("Assert that '{name}' row '{0}' is no-gutters") + @JDIAction(value = "Assert that '{name}' row '{0}' is no-gutters", isAssert = true) public GridAssert noGuttersRow(int rowIndex) { - jdiAssert(element().hasNoGuttersRow(rowIndex), Matchers.is(true), String.format("Element's row '%s' is " + - "not no-gutters", rowIndex)); + jdiAssert(element().hasNoGuttersRow(rowIndex), Matchers.is(true), + String.format("Grid's row '%s' is not no-gutters", rowIndex)); return this; } - @JDIAction("Assert that '{name}' row '{0}' is not no-gutters") + @JDIAction(value = "Assert that '{name}' row '{0}' is not no-gutters", isAssert = true) public GridAssert notNoGuttersRow(int rowIndex) { - jdiAssert(element().hasNoGuttersRow(rowIndex), Matchers.is(false), String.format("Element's row '%s' is " + - "no-gutters", rowIndex)); + jdiAssert(element().hasNoGuttersRow(rowIndex), Matchers.is(false), + String.format("Grid's row '%s' is no-gutters", rowIndex)); return this; } - @JDIAction("Assert that '{name}' row is dense") + @JDIAction(value = "Assert that '{name}' row is dense", isAssert = true) public GridAssert dense(int rowIndex) { - jdiAssert(element().isDense(rowIndex), Matchers.is(true), String.format("Element's row '%s' is not dense", - rowIndex)); + jdiAssert(element().isDense(rowIndex), Matchers.is(true), + String.format("Grid's row '%s' is not dense", rowIndex)); return this; } - @JDIAction("Assert that '{name}' row is not dense") + @JDIAction(value = "Assert that '{name}' row is not dense", isAssert = true) public GridAssert notDense(int rowIndex) { - jdiAssert(element().isDense(rowIndex), Matchers.is(false), String.format("Element's row '%s' is dense", - rowIndex)); + jdiAssert(element().isDense(rowIndex), Matchers.is(false), + String.format("Grid's row '%s' is dense", rowIndex)); return this; } } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/IconAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/IconAssert.java index 56527121af..c6e0740906 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/IconAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/IconAssert.java @@ -8,7 +8,6 @@ import com.epam.jdi.light.vuetify.interfaces.asserts.CursorAssert; import com.epam.jdi.light.vuetify.interfaces.asserts.MeasurementAssert; import com.epam.jdi.light.vuetify.interfaces.asserts.ThemeAssert; -import com.jdiai.tools.Timer; import org.hamcrest.Matchers; import static com.epam.jdi.light.asserts.core.SoftAssert.jdiAssert; @@ -18,33 +17,32 @@ public class IconAssert extends UIAssert implements AlignmentAssert, ThemeAssert, MeasurementAssert, ColorAssert { - @JDIAction("Assert that '{name}' is clickable") + @JDIAction(value = "Assert that '{name}' is clickable", isAssert = true) public IconAssert clickable() { - Timer.waitCondition(element()::isDisplayed); jdiAssert(element().core().isClickable(), Matchers.is(true), "Icon is not clickable"); return this; } - @JDIAction("Assert that '{name}' has expected type") + @JDIAction(value = "Assert that '{name}' has expected type", isAssert = true) public IconAssert type(String iconType) { jdiAssert(element().type(), Matchers.is(iconType)); return this; } - @JDIAction("Assert that '{name}' has alert after clicking on it") + @JDIAction(value = "Assert that '{name}' has alert after clicking on it", isAssert = true) public IconAssert alertOnIconClick(String text) { jdiAssert(element().hasAlertOnIconClick(), Matchers.is(text)); return this; } - @JDIAction("Assert that '{name}' has no label") + @JDIAction(value = "Assert that '{name}' has no label", isAssert = true) public IconAssert hasNoLabel() { jdiAssert(element().hasLabel(), Matchers.is(false), "There a label for element"); return this; } - @JDIAction("Assert that '{name}' has a name") + @JDIAction(value = "Assert that '{name}' has a name", isAssert = true) public IconAssert iconName(String iconName) { jdiAssert(element().getMdiIconName(), Matchers.is(iconName)); return this; diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ImageAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ImageAssert.java index 217f536fb1..26b65a59ff 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ImageAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ImageAssert.java @@ -5,7 +5,6 @@ import com.epam.jdi.light.vuetify.elements.common.Image; import com.epam.jdi.light.vuetify.interfaces.asserts.MeasurementAssert; import com.epam.jdi.light.vuetify.interfaces.asserts.ThemeAssert; -import com.jdiai.tools.Timer; import org.hamcrest.Matchers; import static com.epam.jdi.light.asserts.core.SoftAssert.jdiAssert; @@ -13,61 +12,56 @@ public class ImageAssert extends UIAssert implements MeasurementAssert, ThemeAssert { - @JDIAction("Assert that '{name}' has {0} alternate image text") + @JDIAction(value = "Assert that '{name}' has {0} alternate image text", isAssert = true) public ImageAssert altText(String expectedText) { - String actualText = element().alternateText(); - jdiAssert(actualText, Matchers.equalTo(expectedText), - String.format("Actual alternate image text is '%s', but expected '%s'", actualText, expectedText)); + jdiAssert(element().alternateText(), Matchers.equalTo(expectedText)); return this; } - @JDIAction("Assert that '{name}' is contain") + // TODO check the methods + @JDIAction(value = "Assert that '{name}' is contain", isAssert = true) public ImageAssert contain() { jdiAssert(element().isContain(), Matchers.is(true), "Image is not contain"); return this; } - @JDIAction("Assert that '{name}' is not contain") + @JDIAction(value = "Assert that '{name}' is not contain", isAssert = true) public ImageAssert notContain() { jdiAssert(element().isContain(), Matchers.is(false), "Image is contain"); return this; } - @JDIAction("Assert that '{name}' is displayed") + @JDIAction(value = "Assert that '{name}' is displayed", isAssert = true) public ImageAssert displayed() { - Timer.waitCondition(element()::isDisplayed); jdiAssert(element().isDisplayed(), Matchers.is(true), "Image is not displayed"); return this; } - @JDIAction("Assert that '{name}' has expected {0} source path") + @JDIAction(value = "Assert that '{name}' has expected {0} source path", isAssert = true) public ImageAssert sourcePath(String expectedSourcePath) { - Timer.waitCondition(() -> !element().getSourcePath().equals("")); - String actualSourcePath = element().getSourcePath(); - jdiAssert(actualSourcePath, Matchers.containsString(expectedSourcePath), - String.format("Image has '%s' source path, but expected '%s'", actualSourcePath, expectedSourcePath)); + jdiAssert(element().getSourcePath(), Matchers.containsString(expectedSourcePath)); return this; } - @JDIAction("Assert that '{name}' has gradient") + @JDIAction(value = "Assert that '{name}' has gradient", isAssert = true) public ImageAssert gradient() { jdiAssert(element().hasGradient(), Matchers.is(true), "Image doesn't have gradient"); return this; } - @JDIAction("Assert that '{name}' has not gradient") + @JDIAction(value = "Assert that '{name}' has not gradient", isAssert = true) public ImageAssert noGradient() { jdiAssert(element().hasGradient(), Matchers.is(false), "Image has gradient"); return this; } - @JDIAction("Assert that '{name}' has placeholder") + @JDIAction(value = "Assert that '{name}' has placeholder", isAssert = true) public ImageAssert placeholder() { jdiAssert(element().hasPlaceholder(), Matchers.is(true), "Image has not placeholder"); return this; } - @JDIAction("Assert that '{name}' has not placeholder") + @JDIAction(value = "Assert that '{name}' has not placeholder", isAssert = true) public ImageAssert noPlaceholder() { jdiAssert(element().hasPlaceholder(), Matchers.is(false), "Image has placeholder"); return this; diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/InputAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/InputAssert.java index 68c8458b61..9ebd05cf44 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/InputAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/InputAssert.java @@ -20,26 +20,27 @@ public class InputAssert extends UIAssert LoadingAssert, ColorAssert, ThemeAssert, MeasurementAssert, DenseAssert, HideDetailsAssert { @Override - @JDIAction("Assert that '{name}' is disabled") + @JDIAction(value = "Assert that '{name}' is disabled", isAssert = true) public InputAssert disabled() { - jdiAssert(element().isDisabled(), Matchers.is(true), "Element is enabled"); + jdiAssert(element().isDisabled(), Matchers.is(true), "Input is enabled"); return this; } @Override - @JDIAction("Assert that '{name}' is enabled") + @JDIAction(value = "Assert that '{name}' is enabled", isAssert = true) public InputAssert enabled() { - jdiAssert(element().isDisabled(), Matchers.is(false), "Element is disabled"); + jdiAssert(element().isDisabled(), Matchers.is(false), "Input is disabled"); return this; } - @JDIAction("Assert that '{name}' has text in slot") + // TODO check this method + @JDIAction(value = "Assert that '{name}' has text in slot", isAssert = true) public InputAssert textInSlot() { - jdiAssert(element().hasTextInSlot(), Matchers.is(true), "Element hasn't text in slot"); + jdiAssert(element().hasTextInSlot(), Matchers.is(true), "Input hasn't text in slot"); return this; } - @JDIAction("Assert that '{name}' has text in slot '{0}'") + @JDIAction(value = "Assert that '{name}' has text in slot '{0}'", isAssert = true) public InputAssert textInSlot(String text) { String actualTextInSlot = element().getTextInSlot(); jdiAssert(actualTextInSlot, Matchers.equalTo(text), String.format("Actual text in slot '%s' is not equal to " + @@ -47,131 +48,111 @@ public InputAssert textInSlot(String text) { return this; } - @JDIAction("Assert that '{name}' has text field") + @JDIAction(value = "Assert that '{name}' has text field", isAssert = true) public InputAssert textField() { - jdiAssert(element().hasTextField(), Matchers.is(true), "Element hasn't text field"); + jdiAssert(element().hasTextField(), Matchers.is(true), "Input hasn't text field"); return this; } - @JDIAction("Assert that '{name}' has text field") + @JDIAction(value = "Assert that '{name}' has text field", isAssert = true) public InputAssert notTextField() { - jdiAssert(element().hasTextField(), Matchers.is(false), "Element text field"); + jdiAssert(element().hasTextField(), Matchers.is(false), "Input text field"); return this; } - @JDIAction("Assert that '{name}' has typed text in input field") + @JDIAction(value = "Assert that '{name}' has typed text in input field", isAssert = true) public InputAssert typedText() { - jdiAssert(element().hasTypedText(), Matchers.is(true), "Element hasn't typed text"); + jdiAssert(element().hasTypedText(), Matchers.is(true), "Input hasn't typed text"); return this; } - @JDIAction("Assert that '{name}' has typed text '{0}' in input field") + @JDIAction(value = "Assert that '{name}' has typed text '{0}' in input field", isAssert = true) public InputAssert typedText(String text) { - String actualTypedText = element().getTypedText(); - jdiAssert(actualTypedText, Matchers.equalTo(text), String.format("Actual typed text '%s' is not equal to " + - "expected '%s'", actualTypedText, text)); + jdiAssert(element().getTypedText(), Matchers.equalTo(text)); return this; } - @JDIAction("Assert that '{name}' has not typed text in input field") + @JDIAction(value = "Assert that '{name}' has not typed text in input field", isAssert = true) public InputAssert notTypedText() { - jdiAssert(element().hasTypedText(), Matchers.is(true), "Element has typed text"); + jdiAssert(element().hasTypedText(), Matchers.is(false), "Input has typed text"); return this; } - @JDIAction("Assert that '{name}' has empty input field") + @JDIAction(value = "Assert that '{name}' has empty input field", isAssert = true) public InputAssert empty() { - String actualTypedText = element().getTypedText(); - String errorMsg = String.format("Element should not have text, but was '%s'", actualTypedText); - jdiAssert(actualTypedText, Matchers.emptyString(), errorMsg); + jdiAssert(element().getTypedText(), Matchers.emptyString()); return this; } - @JDIAction("Assert that '{name}' has label") + @JDIAction(value = "Assert that '{name}' has label", isAssert = true) public InputAssert label() { - jdiAssert(element().hasLabel(), Matchers.is(true), "Element has no label"); + jdiAssert(element().hasLabel(), Matchers.is(true), "Input has no label"); return this; } - @JDIAction("Assert that '{name}' has no label") + @JDIAction(value = "Assert that '{name}' has no label", isAssert = true) public InputAssert noLabel() { - jdiAssert(element().hasLabel(), Matchers.is(false), "Element has label"); + jdiAssert(element().hasLabel(), Matchers.is(false), "Input has label"); return this; } - @JDIAction("Assert that '{name}' has label '{0}'") + @JDIAction(value = "Assert that '{name}' has label '{0}'", isAssert = true) public InputAssert label(String text) { - String actualLabelText = element().getLabel(); - jdiAssert(actualLabelText, Matchers.equalTo(text), String.format("Actual label text '%s' is not equal to " + - "expected '%s'", actualLabelText, text)); + jdiAssert(element().getLabel(), Matchers.equalTo(text)); return this; } - @JDIAction("Assert that '{name}' is focused") + @JDIAction(value = "Assert that '{name}' is focused", isAssert = true) public InputAssert focused() { - jdiAssert(element().isFocused(), Matchers.is(true), "Element is not focused"); + jdiAssert(element().isFocused(), Matchers.is(true), "Input is not focused"); return this; } - @JDIAction("Assert that '{name}' is not focused") + @JDIAction(value = "Assert that '{name}' is not focused", isAssert = true) public InputAssert notFocused() { - jdiAssert(element().isFocused(), Matchers.is(false), "Element is focused"); + jdiAssert(element().isFocused(), Matchers.is(false), "Input is focused"); return this; } - @JDIAction("Assert that '{name}' has prepend outer icon") + @JDIAction(value = "Assert that '{name}' has prepend outer icon", isAssert = true) public InputAssert prependOuterIcon() { - jdiAssert(element().hasPrependOuterIcon(), Matchers.is(true), "Element hasn't prepend outer icon"); + jdiAssert(element().hasPrependOuterIcon(), Matchers.is(true), "Input hasn't prepend outer icon"); return this; } - @JDIAction("Assert that '{name}' has prepend inner icon") + @JDIAction(value = "Assert that '{name}' has prepend inner icon", isAssert = true) public InputAssert prependInnerIcon() { - jdiAssert(element().hasPrependInnerIcon(), Matchers.is(true), "Element hasn't prepend inner icon"); + jdiAssert(element().hasPrependInnerIcon(), Matchers.is(true), "Input hasn't prepend inner icon"); return this; } - @JDIAction("Assert that '{name}' has append outer icon") + @JDIAction(value = "Assert that '{name}' has append outer icon", isAssert = true) public InputAssert appendOuterIcon() { - jdiAssert(element().hasAppendOuterIcon(), Matchers.is(true), "Element hasn't append outer icon"); + jdiAssert(element().hasAppendOuterIcon(), Matchers.is(true), "Input hasn't append outer icon"); return this; } - @JDIAction("Assert that '{name}' has append inner icon") + @JDIAction(value = "Assert that '{name}' has append inner icon", isAssert = true) public InputAssert appendInnerIcon() { - jdiAssert(element().hasAppendInnerIcon(), Matchers.is(true), "Element hasn't append inner icon"); + jdiAssert(element().hasAppendInnerIcon(), Matchers.is(true), "Input hasn't append inner icon"); return this; } - @JDIAction("Assert that '{name}' has switch") + @JDIAction(value = "Assert that '{name}' has switch", isAssert = true) public InputAssert switchInput() { - jdiAssert(element().hasSwitch(), Matchers.is(true), "Element hasn't switch"); + jdiAssert(element().hasSwitch(), Matchers.is(true), "Input hasn't switch"); return this; } - @JDIAction("Assert that '{name}' switch is checked") + @JDIAction(value = "Assert that '{name}' switch is checked", isAssert = true) public InputAssert checkedSwitch() { - jdiAssert(element().switchIsChecked(), Matchers.is(true), "Element's switch is unchecked"); + jdiAssert(element().switchIsChecked(), Matchers.is(true), "Input's switch is unchecked"); return this; } - @JDIAction("Assert that '{name}' switch is unchecked") + @JDIAction(value = "Assert that '{name}' switch is unchecked", isAssert = true) public InputAssert uncheckedSwitch() { - jdiAssert(element().switchIsChecked(), Matchers.is(false), "Element's switch is checked"); - return this; - } - - @JDIAction("Assert that '{name}' has class attribute '{0}'") - public InputAssert className(String className) { - jdiAssert(element().hasClass(className), Matchers.is(true), String.format("Element hasn't class " + - "attribute '%s'", className)); - return this; - } - - @JDIAction("Assert that '{name}' has not class attribute '{0}'") - public InputAssert notClassName(String className) { - jdiAssert(element().hasAttribute(className), Matchers.is(false), String.format("Element has class " + - "attribute '%s'", className)); + jdiAssert(element().switchIsChecked(), Matchers.is(false), "Input's switch is checked"); return this; } } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ItemGroupAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ItemGroupAssert.java index 5549cdae09..44abb53781 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ItemGroupAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ItemGroupAssert.java @@ -12,17 +12,15 @@ public class ItemGroupAssert extends UISelectAssert implements ThemeAssert { @Override - @JDIAction("Assert that {0} item is selected in {name}") + @JDIAction(value = "Assert that {0} item is selected in {name}", isAssert = true) public ItemGroupAssert selected(int index) { - jdiAssert(element().selected(index) ? "is selected" : "is not selected", - Matchers.is("is selected")); + jdiAssert(element().selected(index), Matchers.is(true), String.format("Item with index %d is not selected", index)); return this; } - @JDIAction("Assert that {0} item is not selected in {name}") + @JDIAction(value = "Assert that {0} item is not selected in {name}", isAssert = true) public ItemGroupAssert notSelected(int index) { - jdiAssert(element().notSelected(index) ? "is not selected" : "is selected", - Matchers.is("is not selected")); + jdiAssert(element().notSelected(index), Matchers.is(true), String.format("Item with index %d is selected", index)); return this; } } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ListItemAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ListItemAssert.java index f095e64efd..3c78f9a4d2 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ListItemAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ListItemAssert.java @@ -15,25 +15,23 @@ public class ListItemAssert extends UIAssert implements ITextAssert { @Override - @JDIAction("Assert that '{name}' is displayed") + @JDIAction(value = "Assert that '{name}' is displayed", isAssert = true) public ListItemAssert displayed() { - jdiAssert(element().isDisplayed(), Matchers.is(true), "Element is not displayed"); + jdiAssert(element().isDisplayed(), Matchers.is(true), "ListItem is not displayed"); return this; } @Override - @JDIAction("Assert that '{name}' is hidden") + @JDIAction(value = "Assert that '{name}' is hidden", isAssert = true) public ListItemAssert hidden() { - jdiAssert(element().isHidden(), Matchers.is(true), "Element is not hidden"); + jdiAssert(element().isHidden(), Matchers.is(true), "ListItem is not hidden"); return this; } @Override - @JDIAction("Assert that '{name}' text {0}") + @JDIAction(value = "Assert that '{name}' text {0}", isAssert = true) public ListItemAssert text(Matcher condition) { - String actualText = element().text(); - jdiAssert(actualText, condition, String.format("Element's actual text '%s' is not equal to expected '%s'", - actualText, condition)); + jdiAssert(element().text(), condition); return this; } @@ -42,9 +40,9 @@ public ListItemAssert text(Matcher condition) { * * @return this {@link ListItemAssert} instance */ - @JDIAction("Assert that '{name}' is active") + @JDIAction(value = "Assert that '{name}' is active", isAssert = true) public ListItemAssert active() { - jdiAssert(element().isActive(), Matchers.is(true), "Element is not active"); + jdiAssert(element().isActive(), Matchers.is(true), "ListItem is not active"); return this; } @@ -53,9 +51,9 @@ public ListItemAssert active() { * * @return this {@link ListItemAssert} instance */ - @JDIAction("Assert that '{name}' is not active") + @JDIAction(value = "Assert that '{name}' is not active", isAssert = true) public ListItemAssert notActive() { - jdiAssert(element().isActive(), Matchers.is(false), "Element is active"); + jdiAssert(element().isActive(), Matchers.is(false), "ListItem is active"); return this; } @@ -64,9 +62,9 @@ public ListItemAssert notActive() { * * @return this {@link ListItemAssert} instance */ - @JDIAction("Assert that '{name}' is clickable") + @JDIAction(value = "Assert that '{name}' is clickable", isAssert = true) public ListItemAssert clickable() { - jdiAssert(element().core().isClickable(), Matchers.is(true), "Element is not clickable"); + jdiAssert(element().core().isClickable(), Matchers.is(true), "ListItem is not clickable"); return this; } @@ -75,9 +73,9 @@ public ListItemAssert clickable() { * * @return this {@link ListItemAssert} instance */ - @JDIAction("Assert that '{name}' is clickable") + @JDIAction(value = "Assert that '{name}' is clickable", isAssert = true) public ListItemAssert notClickable() { - jdiAssert(element().core().isClickable(), Matchers.is(false), "Element is clickable"); + jdiAssert(element().core().isClickable(), Matchers.is(false), "ListItem is clickable"); return this; } @@ -86,9 +84,9 @@ public ListItemAssert notClickable() { * * @return this {@link ListItemAssert} instance */ - @JDIAction("Assert that '{name}' is expanded") + @JDIAction(value = "Assert that '{name}' is expanded", isAssert = true) public ListItemAssert expanded() { - jdiAssert(element().isExpanded(), Matchers.is(true), "Element is collapsed"); + jdiAssert(element().isExpanded(), Matchers.is(true), "ListItem is collapsed"); return this; } @@ -97,30 +95,30 @@ public ListItemAssert expanded() { * * @return this {@link ListItemAssert} instance */ - @JDIAction("Assert that '{name}' is collapsed") + @JDIAction(value = "Assert that '{name}' is collapsed", isAssert = true) public ListItemAssert collapsed() { - jdiAssert(element().isExpanded(), Matchers.is(false), "Element is expanded"); + jdiAssert(element().isExpanded(), Matchers.is(false), "ListItem is expanded"); return this; } - @JDIAction("Assert that '{name}' title is {0}") + @JDIAction(value = "Assert that '{name}' title is {0}", isAssert = true) public ListItemAssert title(String expTitle) { jdiAssert(element().title().text(), Matchers.is(expTitle)); return this; } - @JDIAction("Assert that '{name}' title matches {0}") + @JDIAction(value = "Assert that '{name}' title matches {0}", isAssert = true) public ListItemAssert title(Matcher condition) { jdiAssert(element().title().text(), condition); return this; } - @JDIAction("Assert that '{name}' subtitle matches {0}") + @JDIAction(value = "Assert that '{name}' subtitle matches {0}", isAssert = true) public ListItemAssert subtitle(Matcher condition) { jdiAssert(element().subtitle().text(), condition); return this; } - @JDIAction("Assert that '{name}' subtitle is {0}") + @JDIAction(value = "Assert that '{name}' subtitle is {0}", isAssert = true) public ListItemAssert subtitle(String expSubtitle) { jdiAssert(element().subtitle().text(), Matchers.is(expSubtitle)); return this; diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ListItemGroupsAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ListItemGroupsAssert.java index ce063e7cd0..1a72cc0583 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ListItemGroupsAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ListItemGroupsAssert.java @@ -15,83 +15,81 @@ public class ListItemGroupsAssert extends UIAssert, ColorAssert, ThemeAssert { - @JDIAction("Assert that '{name}' is active") + @JDIAction(value = "Assert that '{name}' is active", isAssert = true) public ListItemGroupsAssert active() { - jdiAssert(element().isActive(), Matchers.is(true), "Element is not active"); + jdiAssert(element().isActive(), Matchers.is(true), "ListItemGroup is not active"); return this; } - @JDIAction("Assert that '{name}' is not active") + @JDIAction(value = "Assert that '{name}' is not active", isAssert = true) public ListItemGroupsAssert notActive() { - jdiAssert(element().isActive(), Matchers.is(false), "Element is active"); + jdiAssert(element().isActive(), Matchers.is(false), "ListItemGroup is active"); return this; } - @JDIAction("Assert that '{name}' has title") + @JDIAction(value = "Assert that '{name}' has title", isAssert = true) public ListItemGroupsAssert title() { - jdiAssert(element().hasTitle(), Matchers.is(true), "Element has no title"); + jdiAssert(element().hasTitle(), Matchers.is(true), "ListItemGroup has no title"); return this; } - @JDIAction("Assert that '{name}' has no title") + @JDIAction(value = "Assert that '{name}' has no title", isAssert = true) public ListItemGroupsAssert noTitle() { - jdiAssert(element().hasTitle(), Matchers.is(false), "Element has title"); + jdiAssert(element().hasTitle(), Matchers.is(false), "ListItemGroup has title"); return this; } - @JDIAction("Assert that '{name}' has border") + @JDIAction(value = "Assert that '{name}' has border", isAssert = true) public ListItemGroupsAssert border() { - jdiAssert(element().hasBorder(), Matchers.is(true), "Element has no border"); + jdiAssert(element().hasBorder(), Matchers.is(true), "ListItemGroup has no border"); return this; } - @JDIAction("Assert that '{name}' has not border") + @JDIAction(value = "Assert that '{name}' has not border", isAssert = true) public ListItemGroupsAssert noBorder() { - jdiAssert(element().hasBorder(), Matchers.is(false), "Element has border"); + jdiAssert(element().hasBorder(), Matchers.is(false), "ListItemGroup has border"); return this; } - @JDIAction("Assert that '{name}' has icon") + @JDIAction(value = "Assert that '{name}' has icon", isAssert = true) public ListItemGroupsAssert icon() { - jdiAssert(element().hasIcon(), Matchers.is(true), "Element has no icon"); + jdiAssert(element().hasIcon(), Matchers.is(true), "ListItemGroup does not have icon"); return this; } - @JDIAction("Assert that '{name}' has no icon") + @JDIAction(value = "Assert that '{name}' has no icon", isAssert = true) public ListItemGroupsAssert noIcon() { - jdiAssert(element().hasIcon(), Matchers.is(false), "Element has icon"); + jdiAssert(element().hasIcon(), Matchers.is(false), "ListItemGroup has icon"); return this; } - @JDIAction("Assert that '{name}' contains text '{0}'") + @JDIAction(value = "Assert that '{name}' contains text '{0}'", isAssert = true) public ListItemGroupsAssert containsText(String text) { - String actualText = element().getText(); - jdiAssert(actualText, Matchers.containsString(text), String.format("Element's actual text '%s' doesn't " + - "contain expected '%s'", actualText, text)); + jdiAssert(element().getText(), Matchers.containsString(text)); return this; } - @JDIAction("Assert that '{name}' is a sub-group") + @JDIAction(value = "Assert that '{name}' is a sub-group", isAssert = true) public ListItemGroupsAssert subGroup() { - jdiAssert(element().isSubgroup(), Matchers.is(true), "Element is not a sub-group"); + jdiAssert(element().isSubgroup(), Matchers.is(true), "ListItemGroup is not a sub-group"); return this; } - @JDIAction("Assert that '{name}' is not a sub-group") + @JDIAction(value = "Assert that '{name}' is not a sub-group", isAssert = true) public ListItemGroupsAssert notSubGroup() { - jdiAssert(element().isSubgroup(), Matchers.is(false), "Element is sub-group"); + jdiAssert(element().isSubgroup(), Matchers.is(false), "ListItemGroup is sub-group"); return this; } - @JDIAction("Assert that '{name}' is no-action") + @JDIAction(value = "Assert that '{name}' is no-action", isAssert = true) public ListItemGroupsAssert noAction() { - jdiAssert(element().isNoAction(), Matchers.is(true), "Element is not no-action"); + jdiAssert(element().isNoAction(), Matchers.is(true), "ListItemGroup is not no-action"); return this; } - @JDIAction("Assert that '{name}' is not no-action") + @JDIAction(value = "Assert that '{name}' is not no-action", isAssert = true) public ListItemGroupsAssert notNoAction() { - jdiAssert(element().isNoAction(), Matchers.is(false), "Element is no-action"); + jdiAssert(element().isNoAction(), Matchers.is(false), "ListItemGroup is no-action"); return this; } } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/MenuAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/MenuAssert.java index 45d3fd5685..3d24a62a18 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/MenuAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/MenuAssert.java @@ -4,7 +4,6 @@ import com.epam.jdi.light.common.JDIAction; import com.epam.jdi.light.vuetify.elements.complex.Menu; import com.epam.jdi.light.vuetify.interfaces.asserts.ThemeAssert; -import com.jdiai.tools.Timer; import org.hamcrest.Matchers; import java.util.List; @@ -13,44 +12,43 @@ public class MenuAssert extends UIAssert implements ThemeAssert { - @JDIAction("Assert that '{name}' is displayed") + @JDIAction(value = "Assert that '{name}' is displayed", isAssert = true) public MenuAssert displayed() { - Timer.waitCondition(element()::isDisplayed); jdiAssert(element().isDisplayed(), Matchers.is(true), "Menu is not displayed"); return this; } - @JDIAction("Assert that '{name}' has expected top position") + @JDIAction(value = "Assert that '{name}' has expected top position", isAssert = true) public MenuAssert positionTop(int top) { jdiAssert(element().topPosition(), Matchers.equalTo(top)); return this; } - @JDIAction("Assert that '{name}' has expected left position") + @JDIAction(value = "Assert that '{name}' has expected left position", isAssert = true) public MenuAssert positionLeft(int left) { jdiAssert(element().leftPosition(), Matchers.equalTo(left)); return this; } - @JDIAction("Assert that '{name}' has expected number of options") + @JDIAction(value = "Assert that '{name}' has expected number of options", isAssert = true) public MenuAssert countOfOptions(int numberOfOptions) { jdiAssert(element().countOfOptions(), Matchers.is(numberOfOptions)); return this; } - @JDIAction("Assert that '{name}' has expected options titles") + @JDIAction(value = "Assert that '{name}' has expected options titles", isAssert = true) public MenuAssert optionsTitles(List optionsTitles) { jdiAssert(element().optionsTitles(), Matchers.is(optionsTitles)); return this; } - @JDIAction("Assert that '{name}' has removed radius") + @JDIAction(value = "Assert that '{name}' has removed radius", isAssert = true) public MenuAssert removedRadius() { jdiAssert(element().hasRemovedRadius(), Matchers.is(true), "Menu doesn't have rounded-0"); return this; } - @JDIAction("Assert that '{name}' has large radius") + @JDIAction(value = "Assert that '{name}' has large radius", isAssert = true) public MenuAssert largeRadius() { jdiAssert(element().hasLargeRadius(), Matchers.is(true), "Menu doesn't have large rounded"); return this; diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/NavigationDrawerAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/NavigationDrawerAssert.java index a533d7510c..a4680fbca5 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/NavigationDrawerAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/NavigationDrawerAssert.java @@ -4,7 +4,6 @@ import com.epam.jdi.light.common.JDIAction; import com.epam.jdi.light.vuetify.elements.complex.NavigationDrawer; import com.epam.jdi.light.vuetify.interfaces.asserts.ThemeAssert; -import com.jdiai.tools.Timer; import org.hamcrest.Matcher; import org.hamcrest.Matchers; @@ -15,141 +14,137 @@ public class NavigationDrawerAssert extends UIAssert implements ThemeAssert { - @JDIAction("Assert that '{name}' has expected number of items") + @JDIAction(value = "Assert that '{name}' has expected number of items", isAssert = true) public NavigationDrawerAssert itemSize(int value) { jdiAssert(element().size(), Matchers.is(value)); return this; } - @JDIAction("Assert that '{name}' is collapsed") + @JDIAction(value = "Assert that '{name}' is collapsed", isAssert = true) public NavigationDrawerAssert collapsed() { - Timer.waitCondition(element()::isCollapsed); jdiAssert(element().isCollapsed(), Matchers.is(true), "NavigationDrawer is not collapsed"); return this; } - @JDIAction("Assert that '{name}' is expanded") + @JDIAction(value = "Assert that '{name}' is expanded", isAssert = true) public NavigationDrawerAssert expanded() { - Timer.waitCondition(element()::isExpanded); jdiAssert(element().isExpanded(), Matchers.is(true), "NavigationDrawer is not expanded"); return this; } - @JDIAction("Assert that '{name}' is opened") + @JDIAction(value = "Assert that '{name}' is opened", isAssert = true) public NavigationDrawerAssert opened() { - Timer.waitCondition(element()::isOpened); jdiAssert(element().isOpened(), Matchers.is(true), "NavigationDrawer is not opened"); return this; } - @JDIAction("Assert that '{name}' is closed") + @JDIAction(value = "Assert that '{name}' is closed", isAssert = true) public NavigationDrawerAssert closed() { - Timer.waitCondition(element()::isClosed); jdiAssert(element().isClosed(), Matchers.is(true), "NavigationDrawer is not closed"); return this; } - @JDIAction("Assert that '{name}' is located on the right side") + @JDIAction(value = "Assert that '{name}' is located on the right side", isAssert = true) public NavigationDrawerAssert right() { jdiAssert(element().isRight(), Matchers.is(true), "NavigationDrawer is not on right side"); return this; } - @JDIAction("Assert that '{name}' has expected background color") + @JDIAction(value = "Assert that '{name}' has expected background color", isAssert = true) public NavigationDrawerAssert backgroundColor(String color) { jdiAssert(element().backgroundColor(), Matchers.is(color)); return this; } - @JDIAction("Check '{name}' text of items") + @JDIAction(value = "Check '{name}' text of items", isAssert = true) public NavigationDrawerAssert text(List values) { text(Matchers.is(values)); text(Matchers.hasSize(values.size())); return this; } - @JDIAction("Check '{name}' text of items using specific condition") + @JDIAction(value = "Check '{name}' text of items using specific condition", isAssert = true) public NavigationDrawerAssert text(Matcher> condition) { jdiAssert(element().itemsText(), condition); return this; } - @JDIAction("Assert that '{name}' is absolute") + @JDIAction(value = "Assert that '{name}' is absolute", isAssert = true) public NavigationDrawerAssert absolute() { jdiAssert(element().isAbsolute(), Matchers.is(true), "NavigationDrawer is not absolute"); return this; } - @JDIAction("Assert that '{name}' is bottom") + @JDIAction(value = "Assert that '{name}' is bottom", isAssert = true) public NavigationDrawerAssert bottom() { jdiAssert(element().isBottom(), Matchers.is(true), "NavigationDrawer is not in bottom"); return this; } - @JDIAction("Assert that '{name}' is clipped") + @JDIAction(value = "Assert that '{name}' is clipped", isAssert = true) public NavigationDrawerAssert clipped() { jdiAssert(element().isClipped(), Matchers.is(true), "NavigationDrawer is not clipped"); return this; } - @JDIAction("Assert that theme of '{name}' is floating") + @JDIAction(value = "Assert that theme of '{name}' is floating", isAssert = true) public NavigationDrawerAssert floating() { jdiAssert(element().isFloating(), Matchers.is(true), "NavigationDrawer is not floating"); return this; } - @JDIAction("Assert that '{name}' height is '{0}'") + @JDIAction(value = "Assert that '{name}' height is '{0}'", isAssert = true) public NavigationDrawerAssert height(int height) { jdiAssert(element().height(), Matchers.is(height)); return this; } - @JDIAction("Assert that '{name}' width is '{0}'") + @JDIAction(value = "Assert that '{name}' width is '{0}'", isAssert = true) public NavigationDrawerAssert width(int width) { jdiAssert(element().width(), Matchers.is(width)); return this; } - @JDIAction("Assert that theme of '{name}' is temporary") + @JDIAction(value = "Assert that theme of '{name}' is temporary", isAssert = true) public NavigationDrawerAssert temporary() { jdiAssert(element().isTemporary(), Matchers.is(true), "NavigationDrawer is not temporary"); return this; } - @JDIAction("Assert that theme of '{name}' is permanent") + @JDIAction(value = "Assert that theme of '{name}' is permanent", isAssert = true) public NavigationDrawerAssert permanent() { jdiAssert(element().isTemporary(), Matchers.is(false), "NavigationDrawer is temporary"); return this; } - @JDIAction("Assert that theme of '{name}' is mini-variant") + @JDIAction(value = "Assert that theme of '{name}' is mini-variant", isAssert = true) public NavigationDrawerAssert miniVariant() { jdiAssert(element().isMiniVariant(), Matchers.is(true), "NavigationDrawer is not mini-variant"); return this; } - @JDIAction("Assert that '{name}' has overlay") + @JDIAction(value = "Assert that '{name}' has overlay", isAssert = true) public NavigationDrawerAssert overlay() { jdiAssert(element().overlay().isExist(), Matchers.is(true), "Navigation drawer has no overlay"); return this; } - @JDIAction("Assert that '{name}' has no overlay") + @JDIAction(value = "Assert that '{name}' has no overlay", isAssert = true) public NavigationDrawerAssert noOverlay() { jdiAssert(element().overlay().isExist(), Matchers.is(false), "Navigation drawer has overlay"); return this; } - @JDIAction("Assert that theme of '{name}' is expanded on hover") + @JDIAction(value = "Assert that theme of '{name}' is expanded on hover", isAssert = true) public NavigationDrawerAssert expandedOnHover() { jdiAssert(element().isExpandedOnHover(), Matchers.is(true), "NavigationDrawer is not expanded on hover"); diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/OtpInputAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/OtpInputAssert.java index d3be0dbed0..7c001830f6 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/OtpInputAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/OtpInputAssert.java @@ -15,31 +15,27 @@ public class OtpInputAssert extends UIAssert implements ThemeAssert, ReadOnlyAssert, ITextAssert { - @JDIAction("Check that '{name}' has {0} length") + @JDIAction(value = "Check that '{name}' has {0} length", isAssert = true) public OtpInputAssert length(int expectedLength) { - int actualLength = element().length(); - jdiAssert(actualLength, Matchers.is(expectedLength), - String.format("OTP input has '%d' length, but expected '%d'", actualLength, expectedLength)); + jdiAssert(element().length(), Matchers.is(expectedLength)); return this; } - @JDIAction("Check that '{name}' is plain") + @JDIAction(value = "Check that '{name}' is plain", isAssert = true) public OtpInputAssert plain() { jdiAssert(element().isPlain(), Matchers.is(true), "OTP input is not plain"); return this; } - @JDIAction("Check that '{name}' is not plain") + @JDIAction(value = "Check that '{name}' is not plain", isAssert = true) public OtpInputAssert notPlain() { jdiAssert(element().isPlain(), Matchers.is(false), "OTP input is plain"); return this; } - @JDIAction("Check that '{name}' has {0} type") + @JDIAction(value = "Check that '{name}' has {0} type", isAssert = true) public OtpInputAssert type(String expectedType) { - String actualType = element().type(); - jdiAssert(actualType, Matchers.is(expectedType), - String.format("OTP input has '%s' type, but expected '%s'", actualType, expectedType)); + jdiAssert(element().type(), Matchers.is(expectedType)); return this; } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/OverflowButtonAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/OverflowButtonAssert.java index d0bf9eddf5..3b41e695ba 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/OverflowButtonAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/OverflowButtonAssert.java @@ -29,125 +29,119 @@ public class OverflowButtonAssert extends UIAssert, SingleLineAssert, FullWidthAssert { - @JDIAction("Assert that '{name}' is expanded") + @JDIAction(value = "Assert that '{name}' is expanded", isAssert = true) public OverflowButtonAssert expanded() { - jdiAssert(element().isExpanded(), Matchers.is(true), "Element is not expanded"); + jdiAssert(element().isExpanded(), Matchers.is(true), "OverflowButton is not expanded"); return this; } - @JDIAction("Assert that '{name}' is closed") + @JDIAction(value = "Assert that '{name}' is closed", isAssert = true) public OverflowButtonAssert closed() { - jdiAssert(element().isClosed(), Matchers.is(true), "Element is expanded"); + jdiAssert(element().isClosed(), Matchers.is(true), "OverflowButton is not closed"); return this; } - @JDIAction("Assert that '{name}' selected value is '{0}'") + @JDIAction(value = "Assert that '{name}' selected value is '{0}'", isAssert = true) public OverflowButtonAssert selected(String value) { - String actualSelectedValue = element().selected(); - jdiAssert(actualSelectedValue, Matchers.is(value), String.format("Actual selected value '%s' is not equal to " + - "expected '%s'", actualSelectedValue, value)); + jdiAssert(element().selected(), Matchers.is(value)); return this; } - @JDIAction("Assert that '{name}' placeholder has text '{0}'") + @JDIAction(value = "Assert that '{name}' placeholder has text '{0}'", isAssert = true) public OverflowButtonAssert placeholder(String text) { - String actualPlaceholderText = element().placeholder(); - jdiAssert(actualPlaceholderText, Matchers.is(text), String.format("Element's actual placeholder text '%s' " + - "is not equal to expected '%s'", actualPlaceholderText, text)); + jdiAssert(element().placeholder(), Matchers.is(text)); return this; } - @JDIAction("Assert that '{name}' has counter") + @JDIAction(value = "Assert that '{name}' has counter", isAssert = true) public OverflowButtonAssert counter() { - jdiAssert(element().hasCounter(), Matchers.is(true), "Element has not counter"); + jdiAssert(element().hasCounter(), Matchers.is(true), "OverflowButton has not counter"); return this; } - @JDIAction("Assert that '{name}' has not counter") + @JDIAction(value = "Assert that '{name}' has not counter", isAssert = true) public OverflowButtonAssert notCounter() { - jdiAssert(element().hasCounter(), Matchers.is(false), "Element has counter"); + jdiAssert(element().hasCounter(), Matchers.is(false), "OverflowButton has counter"); return this; } - @JDIAction("Assert that '{name}' counter is '{0}'") + @JDIAction(value = "Assert that '{name}' counter is '{0}'", isAssert = true) public OverflowButtonAssert counter(int value) { - int actualCounterValue = element().counterValue(); - jdiAssert(actualCounterValue, Matchers.equalTo(value), String.format("Actual counter value '%s' is not equal " + - "to expected '%s'", actualCounterValue, value)); + jdiAssert(element().counterValue(), Matchers.equalTo(value)); return this; } - @JDIAction("Assert that '{name}' is editable") + @JDIAction(value = "Assert that '{name}' is editable", isAssert = true) public OverflowButtonAssert editable() { - jdiAssert(element().isEditable(), Matchers.is(true), "Element is not editable"); + jdiAssert(element().isEditable(), Matchers.is(true), "OverflowButton is not editable"); return this; } - @JDIAction("Assert that '{name}' is not editable") + @JDIAction(value = "Assert that '{name}' is not editable", isAssert = true) public OverflowButtonAssert notEditable() { - jdiAssert(element().isEditable(), Matchers.is(false), "Element is editable"); + jdiAssert(element().isEditable(), Matchers.is(false), "OverflowButton is editable"); return this; } @Override - @JDIAction("Assert that '{name}' is enabled") + @JDIAction(value = "Assert that '{name}' is enabled", isAssert = true) public OverflowButtonAssert enabled() { - jdiAssert(element().isEnabled(), Matchers.is(true), "Element is disabled"); + jdiAssert(element().isEnabled(), Matchers.is(true), "OverflowButton is disabled"); return this; } @Override - @JDIAction("Assert that '{name}' is disabled") + @JDIAction(value = "Assert that '{name}' is disabled", isAssert = true) public OverflowButtonAssert disabled() { - jdiAssert(element().isDisabled(), Matchers.is(true), "Element is enabled"); + jdiAssert(element().isDisabled(), Matchers.is(true), "OverflowButton is enabled"); return this; } - @JDIAction("Assert that '{name}' has loader") + @JDIAction(value = "Assert that '{name}' has loader", isAssert = true) public OverflowButtonAssert hasLoader() { jdiAssert(element().loader().isExist(), Matchers.equalTo(true), "Loader is not exists"); return this; } - @JDIAction("Assert that '{name}' has no loader") + @JDIAction(value = "Assert that '{name}' has no loader", isAssert = true) public OverflowButtonAssert hasNoLoader() { jdiAssert(element().loader().isNotExist(), Matchers.equalTo(true), "Loader is exists"); return this; } - @JDIAction("Assert that '{name}' is segmented") + @JDIAction(value = "Assert that '{name}' is segmented", isAssert = true) public OverflowButtonAssert segmented() { - jdiAssert(element().isSegmented(), Matchers.is(true), "Element is not segmented"); + jdiAssert(element().isSegmented(), Matchers.is(true), "OverflowButton is not segmented"); return this; } - @JDIAction("Assert that '{name}' is not segmented") + @JDIAction(value = "Assert that '{name}' is not segmented", isAssert = true) public OverflowButtonAssert notSegmented() { - jdiAssert(element().isSegmented(), Matchers.is(false), "Element is segmented"); + jdiAssert(element().isSegmented(), Matchers.is(false), "OverflowButton is segmented"); return this; } - @JDIAction("Assert that '{name}' has chips") + @JDIAction(value = "Assert that '{name}' has chips", isAssert = true) public OverflowButtonAssert chips() { - jdiAssert(element().hasChips(), Matchers.is(true), "Element has no chips"); + jdiAssert(element().hasChips(), Matchers.is(true), "OverflowButton has no chips"); return this; } - @JDIAction("Assert that '{name}' has no chips") + @JDIAction(value = "Assert that '{name}' has no chips", isAssert = true) public OverflowButtonAssert noChips() { - jdiAssert(element().hasChips(), Matchers.is(false), "Element has chips"); + jdiAssert(element().hasChips(), Matchers.is(false), "OverflowButton has chips"); return this; } - @JDIAction("Assert that '{name}' has small chips") + @JDIAction(value = "Assert that '{name}' has small chips", isAssert = true) public OverflowButtonAssert smallChips() { - jdiAssert(element().hasSmallChips(), Matchers.is(true), "Element has no small chips"); + jdiAssert(element().hasSmallChips(), Matchers.is(true), "OverflowButton has no small chips"); return this; } - @JDIAction("Assert that '{name}' has no small chips") + @JDIAction(value = "Assert that '{name}' has no small chips", isAssert = true) public OverflowButtonAssert noSmallChips() { - jdiAssert(element().hasSmallChips(), Matchers.is(false), "Element has small chips"); + jdiAssert(element().hasSmallChips(), Matchers.is(false), "OverflowButton has small chips"); return this; } } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/OverlayAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/OverlayAssert.java index 2dfe2e0e19..0408024b76 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/OverlayAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/OverlayAssert.java @@ -12,31 +12,27 @@ public class OverlayAssert extends UIAssert implements ColorAssert, ThemeAssert { - @JDIAction("Assert that '{name}' position is absolute") + @JDIAction(value = "Assert that '{name}' position is absolute", isAssert = true) public OverlayAssert absolutePosition() { jdiAssert(element().isAbsolute(), Matchers.is(true), "Overlay position is not absolute"); return this; } - @JDIAction("Assert that '{name}' position is not absolute") + @JDIAction(value = "Assert that '{name}' position is not absolute", isAssert = true) public OverlayAssert notAbsolutePosition() { jdiAssert(element().isAbsolute(), Matchers.is(false), "Overlay position is absolute"); return this; } - @JDIAction("Check that '{name}' opacity is {0}") + @JDIAction(value = "Check that '{name}' opacity is {0}", isAssert = true) public OverlayAssert opacity(double expectedOpacity) { - double actualOpacity = element().opacity(); - jdiAssert(actualOpacity, Matchers.is(expectedOpacity), - String.format("Actual overlay opacity is '%f', but expected '%f'", actualOpacity, expectedOpacity)); + jdiAssert(element().opacity(), Matchers.is(expectedOpacity)); return this; } - @JDIAction("Check that '{name}' z-index is {0}") + @JDIAction(value = "Check that '{name}' z-index is {0}", isAssert = true) public OverlayAssert zIndex(int expectedZIndex) { - int actualZIndex = element().zIndex(); - jdiAssert(actualZIndex, Matchers.is(expectedZIndex), - String.format("Actual overlay z-index is '%d', but expected '%d'", actualZIndex, expectedZIndex)); + jdiAssert(element().zIndex(), Matchers.is(expectedZIndex)); return this; } } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/PaginationAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/PaginationAssert.java index eb30a1a346..ea36ca043a 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/PaginationAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/PaginationAssert.java @@ -11,72 +11,76 @@ public class PaginationAssert extends UISelectAssert implements ThemeAssert { + + // TODO Check the constants private static final String DEFAULT_CURRENT_PAGE_ARIA_LABEL = "Current Page"; private static final String DEFAULT_PREVIOUS_ARIA_LABEL = "Previous page"; private static final String DEFAULT_NEXT_ARIA_LABEL = "Next page"; private static final String DEFAULT_PAGE_ARIA_LABEL = "Goto Page"; private static final String ITEM_CLASS_SELECTED = "v-pagination__item--active"; - @JDIAction("Assert that '{name}' at the start") + @JDIAction(value = "Assert that '{name}' at the start", isAssert = true) public PaginationAssert atStart() { jdiAssert(element().isStart(), Matchers.is(true), "Pagination is not at start"); return this; } - @JDIAction("Assert that '{name}' at the end") + @JDIAction(value = "Assert that '{name}' at the end", isAssert = true) public PaginationAssert atEnd() { jdiAssert(element().isEnd(), Matchers.is(true), "Pagination is not at end"); return this; } - @JDIAction("Assert that '{name}' is circle") + // TODO Check method + @JDIAction(value = "Assert that '{name}' is circle", isAssert = true) public PaginationAssert circle() { jdiAssert(element().isCircle(), Matchers.is(true), "Pagination is not circle"); return this; } - @JDIAction("Assert that '{name}' is not circle") + @JDIAction(value = "Assert that '{name}' is not circle", isAssert = true) public PaginationAssert notCircle() { jdiAssert(element().isCircle(), Matchers.is(false), "Pagination is circle"); return this; } - @JDIAction("Assert that '{name}' aria-label has value '{0}'") + @JDIAction(value = "Assert that '{name}' aria-label has value '{0}'", isAssert = true) public PaginationAssert currentPageAriaLabel() { jdiAssert(element().activeButton().ariaLabel(), Matchers.containsString(DEFAULT_CURRENT_PAGE_ARIA_LABEL)); return this; } - @JDIAction("Assert that '{name}' previous-aria-label has value '{0}'") + @JDIAction(value = "Assert that '{name}' previous-aria-label has value '{0}'", isAssert = true) public PaginationAssert previousAriaLabel() { jdiAssert(element().leftNavigation().ariaLabel(), Matchers.containsString(DEFAULT_PREVIOUS_ARIA_LABEL)); return this; } - @JDIAction("Assert that '{name}' next-aria-label has value '{0}'") + @JDIAction(value = "Assert that '{name}' next-aria-label has value '{0}'", isAssert = true) public PaginationAssert nextAriaLabel() { jdiAssert(element().rightNavigation().ariaLabel(), Matchers.containsString(DEFAULT_NEXT_ARIA_LABEL)); return this; } - @JDIAction("Assert that '{name}' next icon has value '{0}'") + @JDIAction(value = "Assert that '{name}' next icon has value '{0}'", isAssert = true) public PaginationAssert nextIcon(String icon) { jdiAssert(element().nextIcon().hasClass(icon), Matchers.is(true), "Paginator next icon is not " + icon); return this; } - @JDIAction("Assert that '{name}' next icon has value '{0}'") + @JDIAction(value = "Assert that '{name}' next icon has value '{0}'", isAssert = true) public PaginationAssert previousIcon(String icon) { jdiAssert(element().previousIcon().hasClass(icon), Matchers.is(true), "Paginator previous icon is not " + icon); return this; } - @JDIAction("Assert that '{name}' page-aria-label has value '{0}'") + // TODO remove area-label + @JDIAction(value = "Assert that '{name}' page-aria-label has value '{0}'", isAssert = true) public PaginationAssert pageAriaLabel() { element().list().foreach(button -> { if (!button.hasClass(ITEM_CLASS_SELECTED)) { @@ -87,7 +91,7 @@ public PaginationAssert pageAriaLabel() { return this; } - @JDIAction("Assert that '{name}' total visible has value '{0}'") + @JDIAction(value = "Assert that '{name}' total visible has value '{0}'", isAssert = true) public PaginationAssert totalVisible(Integer totalVisible) { jdiAssert(element().totalVisible(), Matchers.is(totalVisible)); return this; diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ParallaxAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ParallaxAssert.java index b726750bed..4ebabf1e89 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ParallaxAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ParallaxAssert.java @@ -10,22 +10,21 @@ public class ParallaxAssert extends UIAssert implements HasImageAssert { - @JDIAction("Assert that '{name}' container height is '{0} px'") + @JDIAction(value = "Assert that '{name}' container height is '{0} px'", isAssert = true) public ParallaxAssert height(int height) { - int actualHeight = element().height(); - jdiAssert(actualHeight, Matchers.equalTo(height)); + jdiAssert(element().height(), Matchers.equalTo(height)); return this; } - @JDIAction("Assert that '{name}' has elements in content section") + @JDIAction(value = "Assert that '{name}' has elements in content section", isAssert = true) public ParallaxAssert content() { - jdiAssert(element().hasContent(), Matchers.is(true), "Element has no content"); + jdiAssert(element().hasContent(), Matchers.is(true), "Parallax has no content"); return this; } - @JDIAction("Assert that '{name}' has no elements in content section") + @JDIAction(value = "Assert that '{name}' has no elements in content section", isAssert = true) public ParallaxAssert noContent() { - jdiAssert(element().hasContent(), Matchers.is(false), "Element has content"); + jdiAssert(element().hasContent(), Matchers.is(false), "Parallax has content"); return this; } } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ProgressCircularAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ProgressCircularAssert.java index 7dfcaf3746..b3605158ec 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ProgressCircularAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ProgressCircularAssert.java @@ -8,60 +8,60 @@ import static com.epam.jdi.light.asserts.core.SoftAssert.jdiAssert; public class ProgressCircularAssert extends UIAssert { - @JDIAction("Assert that '{name}' has expected height") + @JDIAction(value = "Assert that '{name}' has expected height", isAssert = true) public ProgressCircularAssert height(int height) { jdiAssert(element().height(), Matchers.is(height)); return this; } - @JDIAction("Assert that '{name}' has expected width") + @JDIAction(value = "Assert that '{name}' has expected width", isAssert = true) public ProgressCircularAssert width(int width) { jdiAssert(element().width(), Matchers.is(width)); return this; } - @JDIAction("Assert that '{name}' has expected color") + @JDIAction(value = "Assert that '{name}' has expected color", isAssert = true) public ProgressCircularAssert color(String color) { jdiAssert(element().color(), Matchers.is(color)); return this; } - @JDIAction("Assert that '{name}' is spinning") + @JDIAction(value = "Assert that '{name}' is spinning", isAssert = true) public ProgressCircularAssert spinning() { jdiAssert(element().isSpinning(), Matchers.is(true), "ProgressCircular is not spinning"); return this; } - @JDIAction("Assert that '{name}' is not spinning") + @JDIAction(value = "Assert that '{name}' is not spinning", isAssert = true) public ProgressCircularAssert notSpinning() { jdiAssert(element().isSpinning(), Matchers.is(false), "ProgressCircular is spinning"); return this; } - @JDIAction("Assert that '{name}' has not label") + @JDIAction(value = "Assert that '{name}' has not label", isAssert = true) public ProgressCircularAssert hasNoLabel() { jdiAssert(element().hasLabel(), Matchers.is(false), "There a label for element"); return this; } - @JDIAction("Assert that '{name}' has line thickness") + @JDIAction(value = "Assert that '{name}' has line thickness", isAssert = true) public ProgressCircularAssert thickness(int thickness) { jdiAssert(element().getThickness(), Matchers.equalTo(thickness)); return this; } - @JDIAction("Assert that '{name}' has text") + @JDIAction(value = "Assert that '{name}' has text", isAssert = true) public ProgressCircularAssert text(String text) { jdiAssert(element().getText(), Matchers.equalTo(text)); return this; } - @JDIAction("Assert that '{name}' has value") + @JDIAction(value = "Assert that '{name}' has value", isAssert = true) public ProgressCircularAssert value(int value) { jdiAssert(element().getValue(), Matchers.equalTo(value)); return this; } - @JDIAction("Assert that '{name}' has rotate") + @JDIAction(value = "Assert that '{name}' has rotate {0}", isAssert = true) public ProgressCircularAssert rotation(int startAngle) { jdiAssert(element().getRotate(), Matchers.equalTo(startAngle)); return this; diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ProgressLinearAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ProgressLinearAssert.java index 8058d36752..1747d392fd 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ProgressLinearAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/ProgressLinearAssert.java @@ -9,7 +9,6 @@ import com.epam.jdi.light.vuetify.interfaces.asserts.ReverseAssert; import com.epam.jdi.light.vuetify.interfaces.asserts.RoundedAssert; import com.epam.jdi.light.vuetify.interfaces.asserts.ThemeAssert; -import com.jdiai.tools.Timer; import org.hamcrest.Matchers; import static com.epam.jdi.light.asserts.core.SoftAssert.jdiAssert; @@ -19,84 +18,85 @@ public class ProgressLinearAssert extends UIAssert, MeasurementAssert, ThemeAssert, LoadingAssert { - @JDIAction("Assert that '{name}' is displayed") + @JDIAction(value = "Assert that '{name}' is displayed", isAssert = true) public ProgressLinearAssert displayed() { - Timer.waitCondition(element()::isDisplayed); - jdiAssert(element().isDisplayed(), Matchers.is(true), "Element is not displayed"); + jdiAssert(element().isDisplayed(), Matchers.is(true), "ProgressLinear is not displayed"); return this; } - @JDIAction("Assert that '{name}' is indeterminate") + @JDIAction(value = "Assert that '{name}' is indeterminate", isAssert = true) public ProgressLinearAssert indeterminate() { - jdiAssert(element().isIndeterminate(), Matchers.is(true), "Element is determinate"); + jdiAssert(element().isIndeterminate(), Matchers.is(true), "ProgressLinear is determinate"); return this; } - @JDIAction("Assert that '{name}' is determinate") + @JDIAction(value = "Assert that '{name}' is determinate", isAssert = true) public ProgressLinearAssert determinate() { - jdiAssert(element().isDeterminate(), Matchers.is(true), "Element is indeterminate"); + jdiAssert(element().isDeterminate(), Matchers.is(true), "ProgressLinear is indeterminate"); return this; } - @JDIAction("Assert that '{name}' is reactive") + @JDIAction(value = "Assert that '{name}' is reactive", isAssert = true) public ProgressLinearAssert reactive() { - jdiAssert(element().isReactive(), Matchers.is(true), "Element is not reactive"); + jdiAssert(element().isReactive(), Matchers.is(true), "ProgressLinear is not reactive"); return this; } - @JDIAction("Assert that '{name}' is not reactive") + @JDIAction(value = "Assert that '{name}' is not reactive", isAssert = true) public ProgressLinearAssert notReactive() { - jdiAssert(element().isReactive(), Matchers.is(false), "Element is reactive"); + jdiAssert(element().isReactive(), Matchers.is(false), "ProgressLinear is reactive"); return this; } - @JDIAction("Assert that '{name}' is striped") + @JDIAction(value = "Assert that '{name}' is striped", isAssert = true) public ProgressLinearAssert striped() { - jdiAssert(element().isStriped(), Matchers.is(true), "Element is not striped"); + jdiAssert(element().isStriped(), Matchers.is(true), "ProgressLinear is not striped"); return this; } - @JDIAction("Assert that '{name}' is not striped") + @JDIAction(value = "Assert that '{name}' is not striped", isAssert = true) public ProgressLinearAssert notStriped() { - jdiAssert(element().isStriped(), Matchers.is(false), "Element is striped"); + jdiAssert(element().isStriped(), Matchers.is(false), "ProgressLinear is striped"); return this; } - @JDIAction("Assert that '{name}' has expected bar color") + @JDIAction(value = "Assert that '{name}' has bar color is {0}", isAssert = true) public ProgressLinearAssert barColor(String barColor) { - String actualBarColor = element().hasBarColor(); - jdiAssert(actualBarColor, Matchers.is(barColor), String.format("Actual bar color '%s' is not equal to " + - "expected '%s'", actualBarColor, barColor)); + jdiAssert(element().hasBarColor(), Matchers.is(barColor)); return this; } - @JDIAction("Assert that '{name}' has expected value '{0}'") - public ProgressLinearAssert value(Double value) { - Timer.waitCondition(() -> Math.abs((element().getValue()) - value) < 0.5); - double actualValue = element().getValue(); - jdiAssert(actualValue, Matchers.closeTo(value, 0.5), String.format("Actual value '%s' is not close to " + - "expected '%s'", actualValue, value)); + @JDIAction(value = "Assert that '{name}' has expected value '{0}'", isAssert = true) + public ProgressLinearAssert value(double value) { + return value(value, 0.5); + } + + @JDIAction(value = "Assert that '{name}' has expected value '{0}'", isAssert = true) + public ProgressLinearAssert valueMax(double value) { + return valueMax(value, 0.5); + } + + @JDIAction(value = "Assert that '{name}' has expected value '{0}'", isAssert = true) + public ProgressLinearAssert value(double value, double error) { + jdiAssert(element().getValue(), Matchers.closeTo(value, error)); return this; } - @JDIAction("Assert that '{name}' has expected value '{0}'") - public ProgressLinearAssert valueMax(Double value) { - Timer.waitCondition(() -> Math.abs((element().getMaxValue()) - value) < 0.5); - double actualValue = element().getMaxValue(); - jdiAssert(actualValue, Matchers.closeTo(value, 0.5), String.format("Actual max value '%s' is not close to " + - "expected '%s'", actualValue, value)); + @JDIAction(value = "Assert that '{name}' has expected value '{0}'", isAssert = true) + public ProgressLinearAssert valueMax(double value, double error) { + jdiAssert(element().getMaxValue(), Matchers.closeTo(value, error)); return this; } - @JDIAction("Assert that '{name}' has stream") + @JDIAction(value = "Assert that '{name}' has stream", isAssert = true) public ProgressLinearAssert stream() { - jdiAssert(element().hasStream(), Matchers.is(true), "Element has no stream"); + jdiAssert(element().hasStream(), Matchers.is(true), "ProgressLinear has no stream"); return this; } - @JDIAction("Assert that '{name}' has no stream") + @JDIAction(value = "Assert that '{name}' has no stream", isAssert = true) public ProgressLinearAssert noStream() { - jdiAssert(element().hasStream(), Matchers.is(false), "Element has stream"); + jdiAssert(element().hasStream(), Matchers.is(false), "ProgressLinear has stream"); return this; } } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/RangeSliderAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/RangeSliderAssert.java index 8dc404c495..d2ce1a1cbf 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/RangeSliderAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/RangeSliderAssert.java @@ -24,41 +24,37 @@ public class RangeSliderAssert extends UIAssert DenseAssert, ColorAssert, MeasurementAssert, HideDetailsAssert, LoadingAssert { - @JDIAction("Assert that value {name} is {0}, {1}") + @JDIAction(value = "Assert that value {name} is {0}, {1}", isAssert = true) public RangeSliderAssert value(double valueLeft, double valueRight) { jdiAssert(element().value(), Matchers.is(Arrays.asList(valueLeft, valueRight))); return this; } - @JDIAction("Assert that left value {name} is {0}") + @JDIAction(value = "Assert that left value {name} is {0}", isAssert = true) public RangeSliderAssert leftValue(double valueLeft) { jdiAssert(element().leftValue(), Matchers.is(valueLeft)); return this; } - @JDIAction("Assert that right value {name} is {0}") + @JDIAction(value = "Assert that right value {name} is {0}", isAssert = true) public RangeSliderAssert rightValue(double valueRight) { jdiAssert(element().rightValue(), Matchers.is(valueRight)); return this; } - @JDIAction("Assert that min value {name} is {0}") + @JDIAction(value = "Assert that min value {name} is {0}", isAssert = true) public RangeSliderAssert minValue(double value) { - double actualValue = element().minValue(); - jdiAssert(actualValue, Matchers.is(value), String.format("Element's actual min value '%s' is not equal to " + - "expected '%s'", actualValue, value)); + jdiAssert(element().minValue(), Matchers.is(value)); return this; } - @JDIAction("Assert that max value {name} is {0}") + @JDIAction(value = "Assert that max value {name} is {0}", isAssert = true) public RangeSliderAssert maxValue(double value) { - double actualValue = element().maxValue(); - jdiAssert(actualValue, Matchers.is(value), String.format("Element's actual max value '%s' is not equal to " + - "expected '%s'", actualValue, value)); + jdiAssert(element().maxValue(), Matchers.is(value)); return this; } - @JDIAction("Assert that thumb label value {name} is {0}, {1}") + @JDIAction(value = "Assert that thumb label value {name} is {0}, {1}", isAssert = true) public RangeSliderAssert thumbLabelValue(String leftValue, String rightValue) { assertSoft(); jdiAssert(element().thumbLabelValue().get(0), Matchers.containsString(leftValue)); @@ -66,138 +62,125 @@ public RangeSliderAssert thumbLabelValue(String leftValue, String rightValue) { return this; } - @JDIAction("Assert that thumb label {name} is displayed") + @JDIAction(value = "Assert that thumb label {name} is displayed", isAssert = true) public RangeSliderAssert thumbLabelDisplayed() { jdiAssert(element().isThumbLabelDisplayed(), Matchers.is(true), "RangeSlider's thumb label is not displayed"); return this; } - @JDIAction("Assert that thumb label {name} is not displayed") + @JDIAction(value = "Assert that thumb label {name} is not displayed", isAssert = true) public RangeSliderAssert thumbLabelNotDisplayed() { jdiAssert(element().isThumbLabelDisplayed(), Matchers.is(false), "RangeSlider's thumb label is displayed"); return this; } - @JDIAction("Assert that '{name}' has no thumb label") + @JDIAction(value = "Assert that '{name}' has no thumb label", isAssert = true) public RangeSliderAssert noThumbLabels() { - jdiAssert(element().hasThumbLabels(), Matchers.is(false), "Element has thumb label"); + jdiAssert(element().hasThumbLabels(), Matchers.is(false), "RangeSlider has thumb label"); return this; } - @JDIAction("Assert that {name} has ticks") + @JDIAction(value = "Assert that {name} has ticks", isAssert = true) public RangeSliderAssert ticks() { - jdiAssert(element().ticks().isExist(), Matchers.is(true), "Element has no ticks"); + jdiAssert(element().ticks().isExist(), Matchers.is(true), "RangeSlider has no ticks"); return this; } - @JDIAction("Assert that '{name}' has no ticks") + @JDIAction(value = "Assert that '{name}' has no ticks", isAssert = true) public RangeSliderAssert noTicks() { - jdiAssert(element().ticks().isExist(), Matchers.is(false), "Element has ticks"); + jdiAssert(element().ticks().isExist(), Matchers.is(false), "RangeSlider has ticks"); return this; } - @JDIAction("Assert that {name} ticks is always show") + @JDIAction(value = "Assert that {name} ticks is always show", isAssert = true) public RangeSliderAssert ticksAlwaysShow() { - jdiAssert(element().isTicksAlwaysShow(), Matchers.is(true), "Element's tick is not always shown"); + jdiAssert(element().isTicksAlwaysShow(), Matchers.is(true), "RangeSlider's tick is not always shown"); return this; } - @JDIAction("Assert that {name} tick size is {0}") + @JDIAction(value = "Assert that {name} tick size is {0}", isAssert = true) public RangeSliderAssert ticksSize(int size) { - Integer actualSize = element().ticksSize(); - jdiAssert(element().ticksSize(), Matchers.equalTo(size), String.format("Element's actual size '%s' is not equal to " + - "expected '%s'", actualSize, size)); + jdiAssert(element().ticksSize(), Matchers.equalTo(size)); return this; } - @JDIAction("Assert that {name} {0} tick label is {1}") + @JDIAction(value = "Assert that {name} {0} tick label is {1}", isAssert = true) public RangeSliderAssert tickLabel(int index, String label) { - String actualTickLabel = element().tickLabel(index); - jdiAssert(actualTickLabel, Matchers.is(label), String.format("Element's actual tick label '%s' is not equal " + - "to expected '%s'", actualTickLabel, label)); + jdiAssert(element().tickLabel(index), Matchers.is(label)); return this; } - @JDIAction("Assert that '{name}' has label") + @JDIAction(value = "Assert that '{name}' has label", isAssert = true) public RangeSliderAssert label() { - jdiAssert(element().hasLabel(), Matchers.is(true), "Element has no label"); + jdiAssert(element().hasLabel(), Matchers.is(true), "RangeSlider has no label"); return this; } - @JDIAction("Assert that '{name}' label is '{0}'") + @JDIAction(value = "Assert that '{name}' label is '{0}'", isAssert = true) public RangeSliderAssert label(String text) { - String actualLabelText = element().label().getText(); - jdiAssert(actualLabelText, Matchers.is(text), String.format("Actual label text '%s' is not equal to expected " + - "'%s'", actualLabelText, text)); + jdiAssert(element().label().getText(), Matchers.is(text)); return this; } - @JDIAction("Assert that '{name}' has not label") + @JDIAction(value = "Assert that '{name}' has not label", isAssert = true) public RangeSliderAssert noLabel() { - jdiAssert(element().hasLabel(), Matchers.is(false), "Element has label"); + jdiAssert(element().hasLabel(), Matchers.is(false), "RangeSlider has label"); return this; } - @JDIAction("Assert that '{name}' has Inverse label") + @JDIAction(value = "Assert that '{name}' has Inverse label", isAssert = true) public RangeSliderAssert inverseLabel() { - jdiAssert(element().hasInverseLabel(), Matchers.is(true), "Element does not have inverse label"); + jdiAssert(element().hasInverseLabel(), Matchers.is(true), "RangeSlider does not have inverse label"); return this; } - @JDIAction("Assert that '{name}' track fill color is '{0}'") + @JDIAction(value = "Assert that '{name}' track fill color is '{0}'", isAssert = true) public RangeSliderAssert trackFillColor(String color) { - String actualColor = element().trackFillColor(); - jdiAssert(actualColor, Matchers.equalTo(color), String.format("Element's actual track fill color '%s' is not " + - "equal to expected '%s'", actualColor, color)); + jdiAssert(element().trackFillColor(), Matchers.equalTo(color)); return this; } - @JDIAction("Assert that '{name}' track background color is '{0}'") + @JDIAction(value = "Assert that '{name}' track background color is '{0}'", isAssert = true) public RangeSliderAssert trackColor(String color) { - String actualColor = element().trackBackgroundColor(); - jdiAssert(actualColor, Matchers.equalTo(color), String.format("Element's actual track background color '%s' is not " + - "equal expected '%s'", actualColor, color)); + jdiAssert(element().trackBackgroundColor(), Matchers.equalTo(color)); return this; } - @JDIAction("Assert that '{name}' thumb color is '{0}'") + @JDIAction(value = "Assert that '{name}' thumb color is '{0}'", isAssert = true) public RangeSliderAssert thumbColor(String color) { - String actualColor = element().thumbColor(); - jdiAssert(actualColor, Matchers.equalTo(color), String.format("Element's actual thumb color '%s' is not " + - "equal to expected '%s'", actualColor, color)); + jdiAssert(element().thumbColor(), Matchers.equalTo(color)); return this; } - @JDIAction("Assert that '{name}' left thumb size is '{0}'") + @JDIAction(value = "Assert that '{name}' left thumb size is '{0}'", isAssert = true) public RangeSliderAssert thumbSize(int size) { - int actualSize = element().thumbSize(); - jdiAssert(actualSize, Matchers.equalTo(size), String.format("Element's actual thumb size '%s' is not equal to expected '%s'", actualSize, size)); + jdiAssert(element().thumbSize(), Matchers.equalTo(size)); return this; } - @JDIAction("Assert that '{name}' is error") + @JDIAction(value = "Assert that '{name}' is error", isAssert = true) public RangeSliderAssert error() { - jdiAssert(element().isError(), Matchers.is(true), "Element is not error"); + jdiAssert(element().isError(), Matchers.is(true), "RangeSlider is not error"); return this; } - @JDIAction("Assert that '{name}' is not error") + @JDIAction(value = "Assert that '{name}' is not error", isAssert = true) public RangeSliderAssert notError() { - jdiAssert(element().isError(), Matchers.is(false), "Element is error"); + jdiAssert(element().isError(), Matchers.is(false), "RangeSlider is error"); return this; } - @JDIAction("Assert that '{name}' is success") + @JDIAction(value = "Assert that '{name}' is success", isAssert = true) public RangeSliderAssert success() { - jdiAssert(element().isSuccess(), Matchers.is(true), "Element is not success"); + jdiAssert(element().isSuccess(), Matchers.is(true), "RangeSlider is not success"); return this; } - @JDIAction("Assert that '{name}' is not success") + @JDIAction(value = "Assert that '{name}' is not success", isAssert = true) public RangeSliderAssert notSuccess() { - jdiAssert(element().isSuccess(), Matchers.is(false), "Element is success"); + jdiAssert(element().isSuccess(), Matchers.is(false), "RangeSlider is success"); return this; } } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/RatingAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/RatingAssert.java index 0d9f16bb70..781977f3df 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/RatingAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/RatingAssert.java @@ -13,51 +13,41 @@ public class RatingAssert extends UIAssert implements ReadOnlyAssert, ColorAssert, DenseAssert, ThemeAssert { - @JDIAction("Assert that '{name}' value is '{0}'") + @JDIAction(value = "Assert that '{name}' value is '{0}'", isAssert = true) public RatingAssert value(double rating) { - double actualRating = element().getValue(); - jdiAssert(actualRating, Matchers.is(rating), String.format("Element's actual rating '%s' is not equal to " + - "expected '%s'", actualRating, rating)); + jdiAssert(element().getValue(), Matchers.is(rating)); return this; } - @JDIAction("Assert that '{name}' value is '{0}'") + @JDIAction(value = "Assert that '{name}' value is '{0}'", isAssert = true) public RatingAssert value(int rating) { double actualRating = element().getValue(); - jdiAssert(actualRating, Matchers.is((double) rating), String.format("Element's actual rating '%s' is not equal to " + - "expected '%s'", actualRating, rating)); + jdiAssert(element().getValue(), Matchers.is((double) rating)); return this; } - @JDIAction("Assert that '{name}' main color is {0}") + @JDIAction(value = "Assert that '{name}' main color is {0}", isAssert = true) public RatingAssert color(String color) { - String actualColor = element().color(); - jdiAssert(actualColor, Matchers.equalTo(color), String.format("Element's actual color '%s' is not equal to " + - "expected '%s'", actualColor, color)); + jdiAssert(element().color(), Matchers.equalTo(color)); return this; } - @JDIAction("Assert that '{name}' main color of button index '{0}' is '{1}'") + @JDIAction(value = "Assert that '{name}' main color of button index '{0}' is '{1}'", isAssert = true) public RatingAssert color(int index, String color) { - String actualColor = element().color(index); - jdiAssert(actualColor, Matchers.equalTo(color), String.format("Element's actual color '%s' is not equal to " + - "expected '%s'", actualColor, color)); + jdiAssert(element().color(index), Matchers.equalTo(color)); return this; } - @JDIAction("Assert that '{name}' size is '{0}'") + @JDIAction(value = "Assert that '{name}' size is '{0}'", isAssert = true) public RatingAssert size(int size) { - int actualSize = element().size(); - jdiAssert(actualSize, Matchers.is(size), String.format("Elements actual size '%s' is not equal to expected " + - "'%s'", actualSize, size)); + jdiAssert(element().size(), Matchers.is(size)); return this; } - @JDIAction("Assert that '{name}' length is '{0}'") + @JDIAction(value = "Assert that '{name}' length is '{0}'", isAssert = true) public RatingAssert length(int length) { int actualLength = element().length(); - jdiAssert(actualLength, Matchers.is(length), String.format("Element's actual length '%s' is not equal to " + - "expected '%s'", actualLength, length)); + jdiAssert(element().length(), Matchers.is(length)); return this; } } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/SheetAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/SheetAssert.java index 80ab980235..e6eee2b668 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/SheetAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/SheetAssert.java @@ -23,13 +23,14 @@ public class SheetAssert extends UIAssert implements ITextAs ElevationAssert, ColorAssert, MeasurementAssert, RoundedAssert { - @JDIAction("Assert that '{name}' border radius is {0}") + @JDIAction(value = "Assert that '{name}' border radius is {0}", isAssert = true) public SheetAssert borderRadius(int value) { jdiAssert(element().borderRadius(), Matchers.is(value)); return this; } @Override + @JDIAction(value = "Assert that sheet's '{name}' text matches", isAssert = true) public SheetAssert text(Matcher condition) { jdiAssert(element().getText(), condition); return this; diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/SkeletonLoaderAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/SkeletonLoaderAssert.java index 1dba7079ff..d594200cc0 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/SkeletonLoaderAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/SkeletonLoaderAssert.java @@ -17,15 +17,15 @@ public class SkeletonLoaderAssert extends UIAssert, TileAssert, CursorAssert { - @JDIAction("Assert that '{name}' is boilerplate") + @JDIAction(value = "Assert that '{name}' is boilerplate", isAssert = true) public SkeletonLoaderAssert boilerplate() { - jdiAssert(element().isBoilerplate(), Matchers.is(true), "Element is not boilerplate"); + jdiAssert(element().isBoilerplate(), Matchers.is(true), "SkeletonLoader is not boilerplate"); return this; } - @JDIAction("Assert that '{name}' is not boilerplate") + @JDIAction(value = "Assert that '{name}' is not boilerplate", isAssert = true) public SkeletonLoaderAssert notBoilerplate() { - jdiAssert(element().isBoilerplate(), Matchers.is(false), "Element is boilerplate"); + jdiAssert(element().isBoilerplate(), Matchers.is(false), "SkeletonLoader is boilerplate"); return this; } } 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 fa3e370643..6d4ec0bff5 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 @@ -11,51 +11,52 @@ public class SlideGroupAssert extends UIAssert implements ThemeAssert { - @JDIAction("Assert that '{name}' is displayed") + @JDIAction(value = "Assert that '{name}' is displayed", isAssert = true) public SlideGroupAssert displayed() { jdiAssert(element().isDisplayed(), Matchers.is(true), "SlideGroup is not displayed"); return this; } - @JDIAction("Assert that '{name}' slide on index {0} is selected") + @JDIAction(value = "Assert that '{name}' slide on index {0} is selected", isAssert = true) public SlideGroupAssert slideSelected(int index) { jdiAssert(element().slideIsSelected(index), Matchers.is(true), String.format("Slide with %d is not selected", index)); return this; } - @JDIAction("Assert that '{name}' slide on index {0} is not selected") + @JDIAction(value = "Assert that '{name}' slide on index {0} is not selected", isAssert = true) public SlideGroupAssert slideNotSelected(int index) { jdiAssert(element().slideIsSelected(index), Matchers.is(false), String.format("Slide with %d is selected", index)); return this; } - @JDIAction("Assert that '{name}' icon is visible") + // TODO check this method + @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("Assert that '{name}' icon is visible") + @JDIAction(value = "Assert that '{name}' icon is visible", isAssert = true) public SlideGroupAssert previousButtonActive() { jdiAssert(element().isPreviousButtonDisabled(), Matchers.is(false), "Previous Button is disabled"); return this; } - @JDIAction("Assert that '{name}' icon is visible") + @JDIAction(value = "Assert that '{name}' icon is visible", isAssert = true) public SlideGroupAssert previousButtonDisabled() { jdiAssert(element().isPreviousButtonDisabled(), Matchers.is(true), "Previous Button is active"); return this; } - @JDIAction("Assert that '{name}' icon is visible") + @JDIAction(value = "Assert that '{name}' icon is visible", isAssert = true) public SlideGroupAssert nextButtonActive() { jdiAssert(element().isNextButtonActive(), Matchers.is(true), "Next Button is disabled"); return this; } - @JDIAction("Assert that '{name}' icon is visible") + @JDIAction(value = "Assert that '{name}' icon is visible", isAssert = true) public SlideGroupAssert nextButtonDisabled() { jdiAssert(element().isNextButtonDisabled(), Matchers.is(true), "Next Button is active"); return this; diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/SliderAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/SliderAssert.java index 782b981ed4..aa7cb3f058 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/SliderAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/SliderAssert.java @@ -20,151 +20,131 @@ public class SliderAssert extends UIAssert implements Orie ReadOnlyAssert, MessagesAssert, ThemeAssert, DenseAssert, ColorAssert, MeasurementAssert, HideDetailsAssert, LoadingAssert { - @JDIAction("Assert that value {name} is {0}") + @JDIAction(value = "Assert that value {name} is {0}", isAssert = true) public SliderAssert value(double value) { - double actualValue = element().value(); - jdiAssert(actualValue, Matchers.is(value), String.format("Element's actual value '%s' is not equal to " + - "expected '%s'", actualValue, value)); + jdiAssert(element().value(), Matchers.is(value)); return this; } - @JDIAction("Assert that min value {name} is {0}") + @JDIAction(value = "Assert that min value {name} is {0}", isAssert = true) public SliderAssert minValue(double value) { - double actualValue = element().minValue(); - jdiAssert(actualValue, Matchers.is(value), String.format("Element's actual min value '%s' is not equal to " + - "expected '%s'", actualValue, value)); + jdiAssert(element().minValue(), Matchers.is(value)); return this; } - @JDIAction("Assert that min value {name} is {0}") + @JDIAction(value = "Assert that max value {name} is {0}", isAssert = true) public SliderAssert maxValue(double value) { - double actualValue = element().maxValue(); - jdiAssert(actualValue, Matchers.is(value), String.format("Element's actual min value '%s' is not equal to " + - "expected '%s'", actualValue, value)); + jdiAssert(element().maxValue(), Matchers.is(value)); return this; } - @JDIAction("Assert that '{name}' has thumb label") + @JDIAction(value = "Assert that '{name}' has thumb label", isAssert = true) public SliderAssert thumbLabel() { - jdiAssert(element().hasThumbLabel(), Matchers.is(true), "Element's has no thumb label"); + jdiAssert(element().hasThumbLabel(), Matchers.is(true), "Slider's has no thumb label"); return this; } - @JDIAction("Assert that '{name}' has no thumb label") + @JDIAction(value = "Assert that '{name}' has no thumb label", isAssert = true) public SliderAssert noThumbLabel() { - jdiAssert(element().hasThumbLabel(), Matchers.is(false), "Element's has thumb label"); + jdiAssert(element().hasThumbLabel(), Matchers.is(false), "Slider's has thumb label"); return this; } - @JDIAction("Assert that {name} has ticks") + @JDIAction(value = "Assert that {name} has ticks", isAssert = true) public SliderAssert ticks() { - jdiAssert(element().ticks().isExist(), Matchers.is(true), "Element has no ticks"); + jdiAssert(element().ticks().isExist(), Matchers.is(true), "Slider has no ticks"); return this; } - @JDIAction("Assert that '{name}' has no ticks") + @JDIAction(value = "Assert that '{name}' has no ticks", isAssert = true) public SliderAssert noTicks() { - jdiAssert(element().ticks().isExist(), Matchers.is(false), "Element has ticks"); + jdiAssert(element().ticks().isExist(), Matchers.is(false), "Slider has ticks"); return this; } - @JDIAction("Assert that tick {name} is always show") + @JDIAction(value = "Assert that tick {name} is always show", isAssert = true) public SliderAssert tickAlwaysShow() { - jdiAssert(element().isAlwaysShow(), Matchers.is(true), "Element's tick is not always shown"); + jdiAssert(element().isAlwaysShow(), Matchers.is(true), "Slider's tick is not always shown"); return this; } - @JDIAction("Assert that tick {name} size is {0}") + @JDIAction(value = "Assert that tick {name} size is {0}", isAssert = true) public SliderAssert ticksSize(int size) { - Integer actualSize = element().ticksSize(); - jdiAssert(element().ticksSize(), Matchers.equalTo(size), String.format("Element's actual size '%s' is not equal to " + - "expected '%s'", actualSize, size)); + jdiAssert(element().ticksSize(), Matchers.equalTo(size)); return this; } - @JDIAction("Assert that tick {name} label is {0}") + @JDIAction(value = "Assert that tick {name} label is {0}", isAssert = true) public SliderAssert tickLabel(int index, String label) { - String actualTickLabel = element().tickLabel(index); - jdiAssert(actualTickLabel, Matchers.is(label), String.format("Element's actual tick label '%s' is not equal " + - "to expected '%s'", actualTickLabel, label)); + jdiAssert(element().tickLabel(index), Matchers.is(label)); return this; } - @JDIAction("Assert that '{name}' has label") + @JDIAction(value = "Assert that '{name}' has label", isAssert = true) public SliderAssert label() { - jdiAssert(element().hasLabel(), Matchers.is(true), "Element has no label"); + jdiAssert(element().hasLabel(), Matchers.is(true), "Slider has no label"); return this; } - @JDIAction("Assert that '{name}' label is '{0}'") + @JDIAction(value = "Assert that '{name}' label is '{0}'", isAssert = true) public SliderAssert label(String text) { - String actualLabelText = element().label().getText(); - jdiAssert(actualLabelText, Matchers.is(text), String.format("Actual label text '%s' is not equal to expected " + - "'%s'", actualLabelText, text)); + jdiAssert(element().label().getText(), Matchers.is(text)); return this; } - @JDIAction("Assert that '{name}' has not label") + @JDIAction(value = "Assert that '{name}' has not label", isAssert = true) public SliderAssert noLabel() { - jdiAssert(element().hasLabel(), Matchers.is(false), "Element has label"); + jdiAssert(element().hasLabel(), Matchers.is(false), "Slider has label"); return this; } - @JDIAction("Assert that '{name}' has Inverse label") + @JDIAction(value = "Assert that '{name}' has Inverse label", isAssert = true) public SliderAssert inverseLabel() { - jdiAssert(element().hasInverseLabel(), Matchers.is(true), "Element has inverse label"); + jdiAssert(element().hasInverseLabel(), Matchers.is(true), "Slider has inverse label"); return this; } - @JDIAction("Assert that '{name}' track fill color is '{0}'") + @JDIAction(value = "Assert that '{name}' track fill color is '{0}'", isAssert = true) public SliderAssert trackFillColor(String color) { - String actualColor = element().trackFillColor(); - jdiAssert(actualColor, Matchers.equalTo(color), String.format("Element's actual track color '%s' is not " + - "equal to expected '%s'", actualColor, color)); + jdiAssert(element().trackFillColor(), Matchers.equalTo(color)); return this; } - @JDIAction("Assert that '{name}' track color is '{0}'") + @JDIAction(value = "Assert that '{name}' track color is '{0}'", isAssert = true) public SliderAssert trackColor(String color) { - String actualColor = element().trackBackgroundColor(); - jdiAssert(actualColor, Matchers.equalTo(color), String.format("Element's actual background track color '%s' " + - "is not equal to expected '%s'", actualColor, color)); + jdiAssert(element().trackBackgroundColor(), Matchers.equalTo(color)); return this; } - @JDIAction("Assert that '{name}' thumb color is '{0}'") + @JDIAction(value = "Assert that '{name}' thumb color is '{0}'", isAssert = true) public SliderAssert thumbColor(String color) { - String actualColor = element().thumbColor(); - jdiAssert(actualColor, Matchers.equalTo(color), String.format("Element's actual thumb color '%s' is not equal to " + - "expected '%s'", actualColor, color)); + jdiAssert(element().thumbColor(), Matchers.equalTo(color)); return this; } - @JDIAction("Assert that '{name}' thumb color is '{0}'") + @JDIAction(value = "Assert that '{name}' thumb color is '{0}'", isAssert = true) public SliderAssert thumbSize(int size) { - int actualSize = element().thumbSize(); - jdiAssert(actualSize, Matchers.equalTo(size), String.format("Element's actual thumb size '%s' is not equal " + - "to expected '%s'", actualSize, size)); + jdiAssert(element().thumbSize(), Matchers.equalTo(size)); return this; } - @JDIAction("Assert that '{name}' is error") + @JDIAction(value = "Assert that '{name}' is error", isAssert = true) public SliderAssert error() { - jdiAssert(element().isError(), Matchers.is(true), "Element is not error"); + jdiAssert(element().isError(), Matchers.is(true), "Slider is not error"); return this; } - @JDIAction("Assert that '{name}' is not error") + @JDIAction(value = "Assert that '{name}' is not error", isAssert = true) public SliderAssert notError() { - jdiAssert(element().isError(), Matchers.is(false), "Element is error"); + jdiAssert(element().isError(), Matchers.is(false), "Slider is error"); return this; } - @JDIAction("Assert that '{name}' is success") + @JDIAction(value = "Assert that '{name}' is success", isAssert = true) public SliderAssert success() { - jdiAssert(element().isSuccess(), Matchers.is(true), "Element is not success"); + jdiAssert(element().isSuccess(), Matchers.is(true), "Slider is not success"); return this; } - @JDIAction("Assert that '{name}' is not success") + @JDIAction(value = "Assert that '{name}' is not success", isAssert = true) public SliderAssert notSuccess() { - jdiAssert(element().isSuccess(), Matchers.is(false), "Element is success"); + jdiAssert(element().isSuccess(), Matchers.is(false), "Slider is success"); return this; } } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/SnackbarAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/SnackbarAssert.java index d203267db4..19df70e2a1 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/SnackbarAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/SnackbarAssert.java @@ -31,43 +31,43 @@ public SnackbarAssert and() { return super.and(); } - @JDIAction("Assert that {name} is visible") + @JDIAction(value = "Assert that {name} is visible", isAssert = true) public SnackbarAssert visible() { jdiAssert(element().isOpen(), Matchers.is(true), "Snackbar is not opened"); return this; } - @JDIAction("Assert that {name} is closed") + @JDIAction(value = "Assert that {name} is closed", isAssert = true) public SnackbarAssert closed() { jdiAssert(element().isClosed(), Matchers.is(true), "Snackbar is not closed"); return this; } - @JDIAction("Assert that {name} has text") + @JDIAction(value = "Assert that {name} has text", isAssert = true) public SnackbarAssert text(String text) { jdiAssert(element().text(), Matchers.is(text)); return this; } - @JDIAction("Assert that {name} is centered") + @JDIAction(value = "Assert that {name} is centered", isAssert = true) public SnackbarAssert centered() { jdiAssert(element().isCentered(), Matchers.is(true), "Snackbar is not centered"); return this; } - @JDIAction("Assert that {name} is top") + @JDIAction(value = "Assert that {name} is top", isAssert = true) public SnackbarAssert top() { jdiAssert(element().isTop(), Matchers.is(true), "Snackbar is not top"); return this; } - @JDIAction("Assert that {name} is bottom") + @JDIAction(value = "Assert that {name} is bottom", isAssert = true) public SnackbarAssert bottom() { jdiAssert(element().isBottom(), Matchers.is(true), "Snackbar is not bottom"); return this; } - @JDIAction("Assert that {name} is multi-line") + @JDIAction(value = "Assert that {name} is multi-line", isAssert = true) public SnackbarAssert multiLine() { jdiAssert(element().isMultiLine(), Matchers.is(true), "Snackbar is not multiline"); return this; diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/SparklineAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/SparklineAssert.java index 45268e583c..a39f4ef573 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/SparklineAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/SparklineAssert.java @@ -14,7 +14,8 @@ public class SparklineAssert extends UIAssert implements MeasurementAssert, FilledAssert { - @JDIAction("Assert that all '{name}' data point labels have a '{0}' prefix") + // TODO Check functionality + @JDIAction(value = "Assert that all '{name}' data point labels have a '{0}' prefix", isAssert = true) public SparklineAssert labelsPrefixedWith(String prefix) { List labels = element().getLabelTexts(); for (String label: labels) { @@ -23,7 +24,7 @@ public SparklineAssert labelsPrefixedWith(String prefix) { return this; } - @JDIAction("Assert that all '{name}' data point labels have a '{0}' postfix") + @JDIAction(value = "Assert that all '{name}' data point labels have a '{0}' postfix", isAssert = true) public SparklineAssert labelsPostfixedWith(String postfix) { List labels = element().getLabelTexts(); for (String label: labels) { @@ -32,90 +33,84 @@ public SparklineAssert labelsPostfixedWith(String postfix) { return this; } - @JDIAction("Assert that '{name}' linear gradient map corresponds to the provided map {0}") + @JDIAction(value = "Assert that '{name}' linear gradient map corresponds to the provided map {0}", isAssert = true) public SparklineAssert linearGradientMap(Map gradientColorMap) { Map actualLinearGradientMap = element().getLinearGradientMap(); jdiAssert(actualLinearGradientMap, Matchers.equalTo(gradientColorMap)); return this; } - @JDIAction("Assert that '{name}' SVG path shape is equal to the provided path shape") + @JDIAction(value = "Assert that '{name}' SVG path shape is equal to the provided path shape", isAssert = true) public SparklineAssert pathShapeEqualTo(String pathShape) { String actualPathShape = element().getPathShape(); jdiAssert(actualPathShape, Matchers.equalTo(pathShape)); return this; } - @JDIAction("Assert that '{name}' SVG path shape is not equal to the provided path shape") + @JDIAction(value = "Assert that '{name}' SVG path shape is not equal to the provided path shape", isAssert = true) public SparklineAssert pathShapeNotEqualTo(String pathShape) { String actualPathShape = element().getPathShape(); jdiAssert(actualPathShape, Matchers.not(pathShape)); return this; } - @JDIAction("Assert that '{name}' has type bar") + @JDIAction(value = "Assert that '{name}' has type bar", isAssert = true) public SparklineAssert bar() { jdiAssert(element().isBar(), Matchers.is(true), "Element's type is not bar"); return this; } - @JDIAction("Assert that '{name}' has type bar") + @JDIAction(value = "Assert that '{name}' has trend line", isAssert = true) public SparklineAssert trendline() { jdiAssert(element().isTrendline(), Matchers.is(true), "Element's type is not trendline"); return this; } - @JDIAction("Assert that '{name}' labels has font size '{0}'") + @JDIAction(value = "Assert that '{name}' labels has font size '{0}'", isAssert = true) public SparklineAssert labelFontSize(int labelFontSize) { - int actualLabelFontSize = element().labelFontSize(); - jdiAssert(actualLabelFontSize, Matchers.equalTo(labelFontSize)); + jdiAssert(element().labelFontSize(), Matchers.equalTo(labelFontSize)); return this; } - @JDIAction("Assert that '{name}' has visible labels") + @JDIAction(value = "Assert that '{name}' has visible labels", isAssert = true) public SparklineAssert labels() { jdiAssert(element().hasLabels(), Matchers.is(true), "Element has no visible labels"); return this; } - @JDIAction("Assert that '{name}' has not visible labels") + @JDIAction(value = "Assert that '{name}' has not visible labels", isAssert = true) public SparklineAssert noLabels() { jdiAssert(element().hasLabels(), Matchers.is(false), "Element has visible labels"); return this; } - @JDIAction("Assert that '{name}' has visible labels") + @JDIAction(value = "Assert that '{name}' has visible labels", isAssert = true) public SparklineAssert labelTexts(List labelTexts) { - List actualLabelTexts = element().getLabelTexts(); - jdiAssert(actualLabelTexts, Matchers.equalTo(labelTexts)); + jdiAssert(element().getLabelTexts(), Matchers.equalTo(labelTexts)); return this; } - @JDIAction("Assert that '{name}' has line width '{0}'") + @JDIAction(value = "Assert that '{name}' has line width '{0}'", isAssert = true) public SparklineAssert lineWidth(int lineWidth) { - int actualLineWidth = element().lineWidth(); - jdiAssert(actualLineWidth, Matchers.equalTo(lineWidth)); + jdiAssert(element().lineWidth(), Matchers.equalTo(lineWidth)); return this; } - @JDIAction("Assert that '{name}' has bars width '{0}'") + @JDIAction(value = "Assert that '{name}' has bars width '{0}'", isAssert = true) public SparklineAssert barsWidth(List barWidth) { - List actualBarWidth = element().getBarsWidths(); - jdiAssert(actualBarWidth.toArray(), Matchers.arrayContaining(barWidth.toArray())); + jdiAssert(element().getBarsWidths(), Matchers.is(barWidth)); return this; } - @JDIAction("Assert that '{name}' has bar width '{0}'") + @JDIAction(value = "Assert that '{name}' has bar width '{0}'", isAssert = true) public SparklineAssert barWidth(int barWidth) { - int actualBarWidth = element().getBarWidth(); - jdiAssert(actualBarWidth, Matchers.equalTo(barWidth)); + jdiAssert(element().getBarWidth(), Matchers.equalTo(barWidth)); return this; } - @JDIAction("Assert that '{name}' has bars height '{0}'") + @JDIAction(value = "Assert that '{name}' has bars height '{0}'", isAssert = true) public SparklineAssert barsHeight(List barHeight) { - List actualBarHeight = element().getBarsHeights(); - jdiAssert(actualBarHeight.toArray(), Matchers.arrayContaining(barHeight.toArray())); + jdiAssert(element().getBarsHeights(), Matchers.is(barHeight)); return this; } } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/SubheaderAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/SubheaderAssert.java index 6f931f964d..839cd0144d 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/SubheaderAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/SubheaderAssert.java @@ -11,20 +11,20 @@ public class SubheaderAssert extends UIAssert implements ThemeAssert { - @JDIAction("Assert that '{name}' text is '{0}'") + @JDIAction(value = "Assert that '{name}' text is '{0}'", isAssert = true) public SubheaderAssert text(String text) { jdiAssert(element().getText(), Matchers.is(text)); return this; } - @JDIAction("Assert that '{name}' is displayed") + @JDIAction(value = "Assert that '{name}' is displayed", isAssert = true) public SubheaderAssert displayed() { jdiAssert(element().isDisplayed(), Matchers.is(true), "Subheader is not displayed"); return this; } - @JDIAction("Assert that '{name}' is inset") + @JDIAction(value = "Assert that '{name}' is inset", isAssert = true) public SubheaderAssert inset() { jdiAssert(element().isInset(), Matchers.is(true), "Subheader is not inset"); return this; diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/SwitchAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/SwitchAssert.java index c2df2c2b94..25f1e91700 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/SwitchAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/SwitchAssert.java @@ -9,6 +9,7 @@ import org.hamcrest.Matchers; import java.util.List; +import java.util.stream.Collectors; import static com.epam.jdi.light.asserts.core.SoftAssert.jdiAssert; @@ -16,233 +17,216 @@ public class SwitchAssert extends UIAssert implements ThemeAssert, HideDetailsAssert, ColorAssert { - @JDIAction("Assert that '{name}' is checked") + @JDIAction(value = "Assert that '{name}' is checked", isAssert = true) public SwitchAssert checked() { - jdiAssert(element().isChecked() ? "is checked" - : "isn't checked", Matchers.is("is checked")); + jdiAssert(element().isChecked(), Matchers.is(true), "Switch is unchecked"); return this; } - @JDIAction("Assert that '{name}' is unchecked") + @JDIAction(value = "Assert that '{name}' is unchecked", isAssert = true) public SwitchAssert unchecked() { - jdiAssert(element().isNotChecked() ? "is unchecked" - : "isn't unchecked", Matchers.is("is unchecked")); + jdiAssert(element().isNotChecked(), Matchers.is(true), "Switch is checked"); return this; } - @JDIAction("Assert that '{name}' has label") + @JDIAction(value = "Assert that '{name}' has label", isAssert = true) public SwitchAssert label() { - jdiAssert(element().hasLabel(), Matchers.is(true), "There is no label for element"); + jdiAssert(element().hasLabel(), Matchers.is(true), "There is no label for switch"); return this; } - @JDIAction("Assert that '{name}' has not label") + @JDIAction(value = "Assert that '{name}' has not label", isAssert = true) public SwitchAssert notLabel() { - jdiAssert(element().hasLabel(), Matchers.is(false), "There a label for element"); + jdiAssert(element().hasLabel(), Matchers.is(false), "There a label for switch"); return this; } - @JDIAction("Assert that '{name}' has value {0}") + @JDIAction(value = "Assert that '{name}' has value {0}", isAssert = true) public SwitchAssert value(String value) { - String actualValue = element().value(); - jdiAssert(actualValue, Matchers.equalTo(value), "Actual value " + actualValue + "is not equal to " + value); + jdiAssert(element().value(), Matchers.equalTo(value)); return this; } - @JDIAction("Assert that '{name}' has color '{0}'") + @JDIAction(value = "Assert that '{name}' has color '{0}'", isAssert = true) public SwitchAssert color(String color) { - String actualColor = element().color(); - jdiAssert(actualColor, Matchers.equalTo(color), actualColor + " is not equal to " + color); + jdiAssert(element().color(), Matchers.equalTo(color)); return this; } - @JDIAction("Assert that '{name}' has background color {0}") + @JDIAction(value = "Assert that '{name}' has background color {0}", isAssert = true) public SwitchAssert backgroundColor(String backgroundColor) { - String actualBackgroundColor = element().backgroundColor(); - jdiAssert(actualBackgroundColor, Matchers.equalTo(backgroundColor), - actualBackgroundColor + " is not equal to " + backgroundColor); + jdiAssert(element().backgroundColor(), Matchers.equalTo(backgroundColor)); return this; } - @JDIAction("Assert that '{name}' has slot's background color {0}") + @JDIAction(value = "Assert that '{name}' has slot's background color {0}", isAssert = true) public SwitchAssert slotsBackgroundColor(String backgroundColor) { - String actualBackgroundColor = element().slotsBackgroundColor(); - jdiAssert(actualBackgroundColor, Matchers.equalTo(backgroundColor), - actualBackgroundColor + " is not equal to " + backgroundColor); + jdiAssert(element().slotsBackgroundColor(), Matchers.equalTo(backgroundColor)); return this; } - @JDIAction("Assert that '{name}' is dense") + @JDIAction(value = "Assert that '{name}' is dense", isAssert = true) public SwitchAssert dense() { - jdiAssert(element().isDense(), Matchers.is(true), "Element is not dense"); + jdiAssert(element().isDense(), Matchers.is(true), "Switch is not dense"); return this; } - @JDIAction("Assert that '{name}' is not dense") + @JDIAction(value = "Assert that '{name}' is not dense", isAssert = true) public SwitchAssert notDense() { - jdiAssert(element().isDense(), Matchers.is(false), "Element is dense"); + jdiAssert(element().isDense(), Matchers.is(false), "Switch is dense"); return this; } - @JDIAction("Assert that '{name}' has message") + @JDIAction(value = "Assert that '{name}' has message", isAssert = true) public SwitchAssert message() { - jdiAssert(element().hasMessages(), Matchers.is(true), "Element has not message"); + jdiAssert(element().hasMessages(), Matchers.is(true), "Switch has not message"); return this; } - @JDIAction("Assert that '{name}' has messages {0}") + @JDIAction(value = "Assert that '{name}' has messages {0}", isAssert = true) public SwitchAssert messages(List messages) { - List actualMessages = element().getMessages(); - jdiAssert(actualMessages, Matchers.equalTo(messages), String.format("Actual element's messages %s is " - + "not equal to expected messages %s", actualMessages, messages)); + jdiAssert(element().getMessages(), Matchers.is(messages)); return this; } - @JDIAction("Assert that '{name}' has error message {0}") + @JDIAction(value = "Assert that '{name}' has error message {0}", isAssert = true) public SwitchAssert message(String message) { - jdiAssert(element().getMessages().contains(message), Matchers.is(true), String.format("Actual element's" - + " messages %s doesn't contain expected message %s", element().getMessages(), message)); + jdiAssert(element().getMessages(), Matchers.contains(message)); return this; } - @JDIAction("Assert that '{name}' has not message") + @JDIAction(value = "Assert that '{name}' has not message", isAssert = true) public SwitchAssert notMessage() { - jdiAssert(element().hasMessages(), Matchers.is(false), String.format("Element has following messages: %s", element().getMessages())); + jdiAssert(element().hasMessages(), Matchers.is(false), + "Switch has no messages"); return this; } - @JDIAction("Assert that '{name}' has error message") + @JDIAction(value = "Assert that '{name}' has error message", isAssert = true) public SwitchAssert errorMessage() { - jdiAssert(element().hasErrorMessage(), Matchers.is(true), "Element has not error messages"); + jdiAssert(element().hasErrorMessage(), Matchers.is(true), "Switch has not error messages"); return this; } - @JDIAction("Assert that number of {name}'s error messages is {0}") + @JDIAction(value = "Assert that number of {name}'s error messages is {0}", isAssert = true) public SwitchAssert numberOfErrorMessages(Integer n) { - Integer actualNumberOfErrorMessages = element().getNumberErrorMessages(); - jdiAssert(actualNumberOfErrorMessages, Matchers.equalTo(n), String.format("Actual number of error messages %s " - + "is not equal to %s", actualNumberOfErrorMessages, n)); + jdiAssert(element().getNumberErrorMessages(), Matchers.equalTo(n)); return this; } - @JDIAction("Assert that '{name}' has error messages {0}") + @JDIAction(value = "Assert that '{name}' has error messages {0}", isAssert = true) public SwitchAssert errorMessages(List errorMessages) { - List actualErrorMessages = element().getErrorMessages(); - jdiAssert(actualErrorMessages, Matchers.equalTo(errorMessages), String.format("Actual element's messages %s " - + "is not equal to expected messages %s", actualErrorMessages, errorMessages)); + jdiAssert(element().getErrorMessages(), Matchers.equalTo(errorMessages)); return this; } - @JDIAction("Assert that '{name}' has error messages {0}") + @JDIAction(value = "Assert that '{name}' has error messages {0}", isAssert = true) public SwitchAssert errorMessage(String errorMessage) { - jdiAssert(element().getErrorMessages().contains(errorMessage), Matchers.is(true), String.format("Actual element's error" - + " messages %s doesn't contain expected message %s", element().getErrorMessages(), errorMessage)); + jdiAssert(element().getErrorMessages(), Matchers.hasItem(errorMessage)); return this; } - @JDIAction("Assert that '{name}' has not error message") + @JDIAction(value = "Assert that '{name}' has not error message", isAssert = true) public SwitchAssert notErrorMessage() { jdiAssert(element().hasErrorMessage(), Matchers.is(false), - String.format("Element has following error messages: %s", element().getErrorMessages())); + "Switch has following no error messages"); return this; } - @JDIAction("Assert that '{name}' has success message") + @JDIAction(value = "Assert that '{name}' has success message", isAssert = true) public SwitchAssert successMessage() { - jdiAssert(element().hasSuccessMessage(), Matchers.is(true), "Element has not success messages"); + jdiAssert(element().hasSuccessMessage(), Matchers.is(true), "Switch has not success messages"); return this; } - @JDIAction("Assert that '{name}' has success message {0}") + @JDIAction(value = "Assert that '{name}' has success message {0}", isAssert = true) public SwitchAssert successMessage(String successMessage) { - jdiAssert(element().getSuccessMessages().contains(successMessage), Matchers.is(true), String.format("Actual element's success" - + " messages %s doesn't contain expected message %s", element().getSuccessMessages(), successMessage)); + jdiAssert(element().getSuccessMessages(), Matchers.contains(successMessage)); return this; } - @JDIAction("Assert that '{name}' has success messages {0}") + @JDIAction(value = "Assert that '{name}' has success messages {0}", isAssert = true) public SwitchAssert successMessages(List successMessages) { - jdiAssert(element().getSuccessMessages(), Matchers.equalTo(successMessages), String.format("Actual element's success" - + " messages %s is not equal to expected messages %s", element().getSuccessMessages(), successMessages)); + jdiAssert(element().getSuccessMessages(), Matchers.is(successMessages)); return this; } - @JDIAction("Assert that '{name}' has not success message") + @JDIAction(value = "Assert that '{name}' has not success message", isAssert = true) public SwitchAssert notSuccessMessage() { jdiAssert(element().hasSuccessMessage(), Matchers.is(false), - String.format("Element has following success messages: %s", element().getSuccessMessages())); + String.format("Switch has following success messages: %s", element().getSuccessMessages().stream().collect(Collectors.joining("; ")))); return this; } - @JDIAction("Assert that '{name}' is flat") + @JDIAction(value = "Assert that '{name}' is flat", isAssert = true) public SwitchAssert flat() { - jdiAssert(element().isFlat(), Matchers.is(true), "Element is not flat"); + jdiAssert(element().isFlat(), Matchers.is(true), "Switch is not flat"); return this; } - @JDIAction("Assert that '{name}' is not flat") + @JDIAction(value = "Assert that '{name}' is not flat", isAssert = true) public SwitchAssert notFlat() { - jdiAssert(element().isFlat(), Matchers.is(false), "Element is flat"); + jdiAssert(element().isFlat(), Matchers.is(false), "Switch is flat"); return this; } - @JDIAction("Assert that '{name}' is inset") + @JDIAction(value = "Assert that '{name}' is inset", isAssert = true) public SwitchAssert inset() { - jdiAssert(element().isInset(), Matchers.is(true), "Element is not inset"); + jdiAssert(element().isInset(), Matchers.is(true), "Switch is not inset"); return this; } - @JDIAction("Assert that '{name}' is not inset") + @JDIAction(value = "Assert that '{name}' is not inset", isAssert = true) public SwitchAssert notInset() { - jdiAssert(element().isInset(), Matchers.is(false), "Element is inset"); + jdiAssert(element().isInset(), Matchers.is(false), "Switch is inset"); return this; } - @JDIAction("Assert that '{name}' has icon-append") + @JDIAction(value = "Assert that '{name}' has icon-append", isAssert = true) public SwitchAssert iconAppend() { - jdiAssert(element().hasIconAppend(), Matchers.is(true), "Element has not icon-append"); + jdiAssert(element().hasIconAppend(), Matchers.is(true), "Switch has not icon-append"); return this; } - @JDIAction("Assert that '{name}' has not icon-append") + @JDIAction(value = "Assert that '{name}' has not icon-append", isAssert = true) public SwitchAssert notIconAppend() { - jdiAssert(element().hasIconAppend(), Matchers.is(false), "Element has icon-append"); + jdiAssert(element().hasIconAppend(), Matchers.is(false), "Switch has icon-append"); return this; } - @JDIAction("Assert that '{name}' has icon-prepend") + @JDIAction(value = "Assert that '{name}' has icon-prepend", isAssert = true) public SwitchAssert iconPrepend() { - jdiAssert(element().hasIconPrepend(), Matchers.is(true), "Element has not icon-prepend"); + jdiAssert(element().hasIconPrepend(), Matchers.is(true), "Switch has not icon-prepend"); return this; } - @JDIAction("Assert that '{name}' has not icon-prepend") + @JDIAction(value = "Assert that '{name}' has not icon-prepend", isAssert = true) public SwitchAssert notIconPrepend() { - jdiAssert(element().hasIconPrepend(), Matchers.is(false), "Element has icon-prepend"); + jdiAssert(element().hasIconPrepend(), Matchers.is(false), "Switch has icon-prepend"); return this; } - @JDIAction("Assert that '{name}' is read-only") + @JDIAction(value = "Assert that '{name}' is read-only", isAssert = true) public SwitchAssert readonly() { - jdiAssert(element().isReadonly(), Matchers.is(true), "Element is not read-only"); + jdiAssert(element().isReadonly(), Matchers.is(true), "Switch is not read-only"); return this; } - @JDIAction("Assert that '{name}' is read-only") + @JDIAction(value = "Assert that '{name}' is read-only", isAssert = true) public SwitchAssert notReadonly() { - jdiAssert(element().isReadonly(), Matchers.is(false), "Element is read-only"); + jdiAssert(element().isReadonly(), Matchers.is(false), "Switch is read-only"); return this; } - @JDIAction("Assert that '{name}' has ripple") + @JDIAction(value = "Assert that '{name}' has ripple", isAssert = true) public SwitchAssert ripple() { - jdiAssert(element().hasRipple(), Matchers.is(true), "Element has not ripple"); + jdiAssert(element().hasRipple(), Matchers.is(true), "Switch has not ripple"); return this; } - @JDIAction("Assert that '{name}' has not ripple") + @JDIAction(value = "Assert that '{name}' has not ripple", isAssert = true) public SwitchAssert notRipple() { - jdiAssert(element().hasRipple(), Matchers.is(false), "Element has ripple"); + jdiAssert(element().hasRipple(), Matchers.is(false), "Switch has ripple"); return this; } } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/TextAreaAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/TextAreaAssert.java index 3518729b95..836d6fd66e 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/TextAreaAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/TextAreaAssert.java @@ -40,196 +40,189 @@ public class TextAreaAssert extends UIAssert implement SoloAssert, FullWidthAssert, HideDetailsAssert { @Override - @JDIAction("Assert that '{name}' has text '{0}'") + @JDIAction(value = "Assert that '{name}' has text with condition", isAssert = true) public TextAreaAssert text(Matcher condition) { - String actualText = element().getText(); - jdiAssert(actualText, condition, String.format("Actual element's text '%s' is not equal to expected " + - "'%s'", actualText, condition)); + jdiAssert(element().getText(), condition); return this; } - @JDIAction("Assert that '{name}' has text '{0}'") + @JDIAction(value = "Assert that '{name}' has text '{0}'", isAssert = true) public TextAreaAssert text(String text) { text(Matchers.equalTo(text)); return this; } - @JDIAction("Assert that '{name}' is auto grow") + @JDIAction(value = "Assert that '{name}' is auto grow", isAssert = true) public TextAreaAssert autoGrow() { - jdiAssert(element().isAutogrow(), Matchers.is(true), "Element is not auto grow"); + jdiAssert(element().isAutogrow(), Matchers.is(true), "TextArea is not auto grow"); return this; } - @JDIAction("Assert that '{name}' is not auto grow") + @JDIAction(value = "Assert that '{name}' is not auto grow", isAssert = true) public TextAreaAssert notAutoGrow() { - jdiAssert(element().isAutogrow(), Matchers.is(false), "Element is auto grow"); + jdiAssert(element().isAutogrow(), Matchers.is(false), "TextArea is auto grow"); return this; } - @JDIAction("Assert that '{name}' is not resizable") + @JDIAction(value = "Assert that '{name}' is not resizable", isAssert = true) public TextAreaAssert notResizable() { - jdiAssert(element().isNotResizable(), Matchers.is(true), "Element is resizable"); + jdiAssert(element().isNotResizable(), Matchers.is(true), "TextArea is resizable"); return this; } - @JDIAction("Assert that '{name}' is resizable") + @JDIAction(value = "Assert that '{name}' is resizable", isAssert = true) public TextAreaAssert resizable() { - jdiAssert(element().isNotResizable(), Matchers.is(false), "Element is not resizable"); + jdiAssert(element().isNotResizable(), Matchers.is(false), "TextArea is not resizable"); return this; } - @JDIAction("Assert that '{name}' rows count is {0}") + @JDIAction(value = "Assert that '{name}' rows count is {0}", isAssert = true) public TextAreaAssert rowsCount(int rowsCount) { - int actualRowCount = element().rows(); - jdiAssert(actualRowCount, Matchers.is(rowsCount)); + jdiAssert(element().rows(), Matchers.is(rowsCount)); return this; } - @JDIAction("Assert that '{name}' has lines {0}") + @JDIAction(value = "Assert that '{name}' has lines with condition", isAssert = true) private TextAreaAssert lines(Matcher> condition) { - List actualLines = element().getLines(); - jdiAssert(actualLines, condition); + jdiAssert(element().getLines(), condition); return this; } - @JDIAction("Assert that '{name}' has lines {0}") + @JDIAction(value = "Assert that '{name}' has lines {0}", isAssert = true) public TextAreaAssert lines(String... lines) { return lines(containsInAnyOrder(lines)); } - @JDIAction("Assert that '{name}' has label") + @JDIAction(value = "Assert that '{name}' has label", isAssert = true) public TextAreaAssert label() { - jdiAssert(element().hasLabel(), Matchers.is(true), "Element doesn't have label"); + jdiAssert(element().hasLabel(), Matchers.is(true), "TextArea doesn't have label"); return this; } - @JDIAction("Assert that '{name}' has suffix") + @JDIAction(value = "Assert that '{name}' has suffix", isAssert = true) public TextAreaAssert suffix() { - jdiAssert(element().hasSuffix(), Matchers.is(true), "Element doesn't have suffix"); + jdiAssert(element().hasSuffix(), Matchers.is(true), "TextArea doesn't have suffix"); return this; } - @JDIAction("Assert that '{name}' has not suffix") + @JDIAction(value = "Assert that '{name}' has not suffix", isAssert = true) public TextAreaAssert notSuffix() { - jdiAssert(element().hasSuffix(), Matchers.is(false), "Element has suffix"); + jdiAssert(element().hasSuffix(), Matchers.is(false), "TextArea has suffix"); return this; } - @JDIAction("Assert that '{name}' has prefix") + @JDIAction(value = "Assert that '{name}' has prefix", isAssert = true) public TextAreaAssert prefix() { - jdiAssert(element().hasPrefix(), Matchers.is(true), "Element doesn't have prefix"); + jdiAssert(element().hasPrefix(), Matchers.is(true), "TextArea doesn't have prefix"); return this; } - @JDIAction("Assert that '{name}' has not prefix") + @JDIAction(value = "Assert that '{name}' has not prefix", isAssert = true) public TextAreaAssert notPrefix() { - jdiAssert(element().hasPrefix(), Matchers.is(false), "Element has prefix"); + jdiAssert(element().hasPrefix(), Matchers.is(false), "TextArea has prefix"); return this; } - @JDIAction("Assert that '{name}' has icon") + @JDIAction(value = "Assert that '{name}' has icon", isAssert = true) public TextAreaAssert icon() { - jdiAssert(element().hasIcon(), Matchers.is(true), "Element doesn't have icon"); + jdiAssert(element().hasIcon(), Matchers.is(true), "TextArea doesn't have icon"); return this; } - @JDIAction("Assert that '{name}' has not icon") + @JDIAction(value = "Assert that '{name}' has not icon", isAssert = true) public TextAreaAssert notIcon() { - jdiAssert(element().hasIcon(), Matchers.is(false), "Element has icon"); + jdiAssert(element().hasIcon(), Matchers.is(false), "TextArea has icon"); return this; } - @JDIAction("Assert that '{name}' has prepend outer icon") + @JDIAction(value = "Assert that '{name}' has prepend outer icon", isAssert = true) public TextAreaAssert prependOuterIcon() { - jdiAssert(element().hasPrependOuterIcon(), Matchers.is(true), "Element doesn't have prepend " + - "outer icon"); + jdiAssert(element().hasPrependOuterIcon(), Matchers.is(true), + "TextArea doesn't have prepend outer icon"); return this; } - @JDIAction("Assert that '{name}' has prepend inner icon") + @JDIAction(value = "Assert that '{name}' has prepend inner icon", isAssert = true) public TextAreaAssert prependInnerIcon() { - jdiAssert(element().hasPrependInnerIcon(), Matchers.is(true), "Element doesn't have prepend " + - "inner icon"); + jdiAssert(element().hasPrependInnerIcon(), Matchers.is(true), + "TextArea doesn't have prepend inner icon"); return this; } - @JDIAction("Assert that '{name}' has append outer icon") + @JDIAction(value = "Assert that '{name}' has append outer icon", isAssert = true) public TextAreaAssert appendOuterIcon() { - jdiAssert(element().hasAppendOuterIcon(), Matchers.is(true), "Element doesn't have append " + - "outer icon"); + jdiAssert(element().hasAppendOuterIcon(), Matchers.is(true), + "TextArea doesn't have append outer icon"); return this; } - @JDIAction("Assert that '{name}' has append inner icon") + @JDIAction(value = "Assert that '{name}' has append inner icon", isAssert = true) public TextAreaAssert appendInnerIcon() { - jdiAssert(element().hasAppendInnerIcon(), Matchers.is(true), "Element doesn't have append " + - "inner icon"); + jdiAssert(element().hasAppendInnerIcon(), Matchers.is(true), + "TextArea doesn't have append inner icon"); return this; } - @JDIAction("Assert that '{name}' has placeholder") + @JDIAction(value = "Assert that '{name}' has placeholder", isAssert = true) public TextAreaAssert placeholder() { - jdiAssert(element().hasPlaceholder(), Matchers.is(true), "Element doesn't have placeholder"); + jdiAssert(element().hasPlaceholder(), Matchers.is(true), "TextArea doesn't have placeholder"); return this; } - @JDIAction("Assert that '{name}' has not placeholder") + @JDIAction(value = "Assert that '{name}' has not placeholder", isAssert = true) public TextAreaAssert notPlaceholder() { - jdiAssert(element().hasPlaceholder(), Matchers.is(false), "Element has placeholder"); + jdiAssert(element().hasPlaceholder(), Matchers.is(false), "TextArea has placeholder"); return this; } - @JDIAction("Assert that '{name}' has placeholder text '{0}'") + @JDIAction(value = "Assert that '{name}' has placeholder text '{0}'", isAssert = true) public TextAreaAssert placeholderText(String text) { - String actualPlaceholderText = element().placeholder(); - jdiAssert(actualPlaceholderText, Matchers.equalTo(text)); + jdiAssert(element().placeholder(), Matchers.equalTo(text)); return this; } - @JDIAction("Assert that '{name}' has counter value '{0}'") + @JDIAction(value = "Assert that '{name}' has counter value '{0}'", isAssert = true) public TextAreaAssert counterValue(int n) { jdiAssert(element().counterValue(), Matchers.equalTo(n)); return this; } - @JDIAction("Assert that '{name}' is autofocused") + @JDIAction(value = "Assert that '{name}' is autofocused", isAssert = true) public TextAreaAssert autofocus() { - jdiAssert(element().isAutofocus(), Matchers.is(true), "Element is not autofocus"); + jdiAssert(element().isAutofocus(), Matchers.is(true), "TextArea is not autofocus"); return this; } - @JDIAction("Assert that '{name}' is not autofocus") + @JDIAction(value = "Assert that '{name}' is not autofocus", isAssert = true) public TextAreaAssert notAutofocus() { - jdiAssert(element().isAutofocus(), Matchers.is(false), "Element is autofocus"); + jdiAssert(element().isAutofocus(), Matchers.is(false), "TextArea is autofocus"); return this; } - @JDIAction("Assert that '{name}' is reversed") + @JDIAction(value = "Assert that '{name}' is reversed", isAssert = true) public TextAreaAssert reversed() { - jdiAssert(element().isReversed(), Matchers.is(true), "Element is not reversed"); + jdiAssert(element().isReversed(), Matchers.is(true), "TextArea is not reversed"); return this; } - @JDIAction("Assert that '{name}' is not reversed") + @JDIAction(value = "Assert that '{name}' is not reversed", isAssert = true) public TextAreaAssert notReversed() { - jdiAssert(element().isReversed(), Matchers.is(false), "Element is reversed"); + jdiAssert(element().isReversed(), Matchers.is(false), "TextArea is reversed"); return this; } - @JDIAction("Assert that '{name}' has loader height {0}") + @JDIAction(value = "Assert that '{name}' has loader height {0}", isAssert = true) public TextAreaAssert loaderHeightPx(int height) { - int actualLoaderHeight = element().getLoaderHeight(); - jdiAssert(actualLoaderHeight, Matchers.equalTo(height), String.format("Actual element's loader height " + - "'%s px' is not equal to expected '%s px'", actualLoaderHeight, height)); + jdiAssert(element().getLoaderHeight(), Matchers.equalTo(height)); return this; } - @JDIAction("Assert that '{name}' hint message is '{0}'") + @JDIAction(value = "Assert that '{name}' hint message is '{0}'", isAssert = true) public TextAreaAssert hint(String msg) { return this.hint(Matchers.equalTo(msg)); } - @JDIAction("Assert that '{name}' hint message is '{0}'") + @JDIAction(value = "Assert that '{name}' hint message matches condition", isAssert = true) public TextAreaAssert hint(Matcher condition) { jdiAssert(element().hint().text(), condition); return this; diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/TextAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/TextAssert.java index 5c171c2a43..f10d9a49a4 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/TextAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/TextAssert.java @@ -11,22 +11,24 @@ public class TextAssert extends UIAssert implements ITextAssert { - @JDIAction("Assert that '{name}' text {0}") + @JDIAction(value = "Assert that '{name}' text matches the condition", isAssert = true) public TextAssert text(Matcher condition) { jdiAssert(element().getText(), condition); return this; } + + @JDIAction(value = "Assert that '{name}' text {0}", isAssert = true) public TextAssert text(String text) { return text(Matchers.is(text)); } - @JDIAction("Assert that '{name}' color is '{0}'") + @JDIAction(value = "Assert that '{name}' color is '{0}'", isAssert = true) public TextAssert color(String color) { jdiAssert(element().color(), Matchers.is(color)); return this; } - @JDIAction("Assert that '{name}' has color '{0}'") + @JDIAction(value = "Assert that '{name}' has color '{0}'", isAssert = true) public TextAssert backgroundColor(String color) { jdiAssert(element().backgroundColor(), Matchers.is(color)); return this; diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/TextFieldAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/TextFieldAssert.java index 94a2c9a8b6..e17c7875ea 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/TextFieldAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/TextFieldAssert.java @@ -45,60 +45,55 @@ public class TextFieldAssert extends UIAssert HideDetailsAssert { @Override - @JDIAction("Assert that '{name}' text '{0}'") + @JDIAction(value = "Assert that '{name}' text '{0}'", isAssert = true) public TextFieldAssert text(Matcher condition) { - String actualText = element().getText(); - jdiAssert(actualText, condition, String.format("Actual text '%s' is not equal to expected '%s'", actualText, - condition)); + jdiAssert(element().getText(), condition); return this; } - @JDIAction("Assert that '{name}' is focused") + @JDIAction(value = "Assert that '{name}' is focused", isAssert = true) public TextFieldAssert focused() { - jdiAssert(element().isFocused(), Matchers.is(true), "Element is not focused"); + jdiAssert(element().isFocused(), Matchers.is(true), "TextField is not focused"); return this; } - @JDIAction("Assert that '{name}' is not focused") + @JDIAction(value = "Assert that '{name}' is not focused", isAssert = true) public TextFieldAssert notFocused() { - jdiAssert(element().isFocused(), Matchers.is(false), "Element is focused"); + jdiAssert(element().isFocused(), Matchers.is(false), "TextField is focused"); return this; } - @JDIAction("Assert that '{name}' text type is '{0}'") + @JDIAction(value = "Assert that '{name}' text type is '{0}'", isAssert = true) public TextFieldAssert textType(String textType) { String actualTextType = element().getTextType(); - jdiAssert(actualTextType, Matchers.equalTo(textType), String.format("Actual text type '%s' is not equal to " + - "expected '%s'", actualTextType, textType)); + jdiAssert(element().getTextType(), Matchers.equalTo(textType)); return this; } - @JDIAction("Assert that '{name}' has placeholder") + @JDIAction(value = "Assert that '{name}' has placeholder", isAssert = true) public TextFieldAssert placeholder() { - jdiAssert(element().hasPlaceholder(), Matchers.is(true), "Element has not placeholder"); + jdiAssert(element().hasPlaceholder(), Matchers.is(true), "TextField has not placeholder"); return this; } - @JDIAction("Assert that '{name}' has not placeholder") + @JDIAction(value = "Assert that '{name}' has not placeholder", isAssert = true) public TextFieldAssert notPlaceholder() { - jdiAssert(element().hasPlaceholder(), Matchers.is(false), "Element has placeholder"); + jdiAssert(element().hasPlaceholder(), Matchers.is(false), "TextField has placeholder"); return this; } - @JDIAction("Assert that '{name}' placeholder is '{0}'") + @JDIAction(value = "Assert that '{name}' placeholder is '{0}'", isAssert = true) public TextFieldAssert placeholder(String placeholder) { - String actualPlaceholder; if (element().hasPlaceholder()) { - actualPlaceholder = element().labelText(); + jdiAssert(element().placeholder(), Matchers.equalTo(placeholder)); } else { - actualPlaceholder = ""; + return placeholder(); } - jdiAssert(actualPlaceholder, Matchers.equalTo(placeholder), String.format("Actual placeholder '%s' is not " + - "equal to expected '%s'", actualPlaceholder, placeholder)); return this; } - @JDIAction("Assert that '{name}' current counter is '{0}' and max counter is '{1}'") + // TODO Fix this function + @JDIAction(value = "Assert that '{name}' current counter is '{0}' and max counter is '{1}'", isAssert = true) public TextFieldAssert counter(int currentCounter, int maxCounter) { String[] counter = element().counter().text().replaceAll("\\s", "").split("/"); jdiAssert(Integer.parseInt(counter[0]), Matchers.equalTo(currentCounter), String.format("Actual current counter " + @@ -108,63 +103,61 @@ public TextFieldAssert counter(int currentCounter, int maxCounter) { return this; } - @JDIAction("Assert that '{name}' has label") + @JDIAction(value = "Assert that '{name}' has label {0}", isAssert = true) public TextFieldAssert labelText(String label) { jdiAssert(element().labelText(), Matchers.is(label)); return this; } - @JDIAction("Assert that '{name}' has label") + @JDIAction(value = "Assert that '{name}' has label", isAssert = true) public TextFieldAssert label() { - jdiAssert(element().hasLabel(), Matchers.is(true), "There is no label for element"); + jdiAssert(element().hasLabel(), Matchers.is(true), "There is no label for TextField"); return this; } - @JDIAction("Assert that '{name}' has append outer icon") + @JDIAction(value = "Assert that '{name}' has append outer icon", isAssert = true) public TextFieldAssert appendOuterIcon() { - jdiAssert(element().hasAppendOuterIcon(), Matchers.is(true), "Element doesn't have append " + - "outer icon"); + jdiAssert(element().hasAppendOuterIcon(), Matchers.is(true), + "TextField doesn't have append outer icon"); return this; } - @JDIAction("Assert that '{name}' has append inner icon") + @JDIAction(value = "Assert that '{name}' has append inner icon", isAssert = true) public TextFieldAssert appendInnerIcon() { - jdiAssert(element().hasAppendInnerIcon(), Matchers.is(true), "Element doesn't have append " + - "inner icon"); + jdiAssert(element().hasAppendInnerIcon(), Matchers.is(true), + "TextField doesn't have append inner icon"); return this; } - @JDIAction("Assert that '{name}' has prepend outer icon") + @JDIAction(value = "Assert that '{name}' has prepend outer icon", isAssert = true) public TextFieldAssert prependOuterIcon() { - jdiAssert(element().hasPrependOuterIcon(), Matchers.is(true), "Element doesn't have prepend " + - "outer icon"); + jdiAssert(element().hasPrependOuterIcon(), Matchers.is(true), + "TextField doesn't have prepend outer icon"); return this; } - @JDIAction("Assert that '{name}' has prepend inner icon") + @JDIAction(value = "Assert that '{name}' has prepend inner icon", isAssert = true) public TextFieldAssert prependInnerIcon() { - jdiAssert(element().hasPrependInnerIcon(), Matchers.is(true), "Element doesn't have prepend " + - "inner icon"); + jdiAssert(element().hasPrependInnerIcon(), Matchers.is(true), + "TextField doesn't have prepend inner icon"); return this; } - @JDIAction("Assert that '{name}' is autofocus") + @JDIAction(value = "Assert that '{name}' is autofocus", isAssert = true) public TextFieldAssert autofocus() { - jdiAssert(element().isAutofocus(), Matchers.is(true), "Element is not autofocus"); + jdiAssert(element().isAutofocus(), Matchers.is(true), "TextField is not autofocus"); return this; } - @JDIAction("Assert that '{name}' is not autofocus") + @JDIAction(value = "Assert that '{name}' is not autofocus", isAssert = true) public TextFieldAssert notAutofocus() { - jdiAssert(element().isAutofocus(), Matchers.is(false), "Element is autofocus"); + jdiAssert(element().isAutofocus(), Matchers.is(false), "TextField is autofocus"); return this; } - @JDIAction("Assert that '{name}' has loader height {0}") + @JDIAction(value = "Assert that '{name}' has loader height {0}", isAssert = true) public TextFieldAssert loaderHeightPx(int height) { - int actualLoaderHeight = element().getLoaderHeight(); - jdiAssert(actualLoaderHeight, Matchers.equalTo(height), String.format("Actual element's loader height " + - "'%s px' is not equal to expected '%s px'", actualLoaderHeight, height)); + jdiAssert(element().getLoaderHeight(), Matchers.equalTo(height)); return this; } } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/TimePickerAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/TimePickerAssert.java index 3990b88491..a1d7246163 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/TimePickerAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/TimePickerAssert.java @@ -8,115 +8,106 @@ import com.epam.jdi.light.vuetify.interfaces.asserts.MeasurementAssert; import com.epam.jdi.light.vuetify.interfaces.asserts.ReadOnlyAssert; import com.epam.jdi.light.vuetify.interfaces.asserts.ThemeAssert; -import java.util.Arrays; import org.hamcrest.Matchers; import java.time.LocalTime; -import java.util.List; import static com.epam.jdi.light.asserts.core.SoftAssert.jdiAssert; -import static java.lang.String.format; + public class TimePickerAssert extends UIAssert implements ColorAssert, ThemeAssert, ElevationAssert, ReadOnlyAssert, MeasurementAssert { - @JDIAction("Assert that '{name}' time in title is '{0}'") + @JDIAction(value = "Assert that '{name}' time in title is '{0}'", isAssert = true) public TimePickerAssert title(final String titleTimeText) { jdiAssert(element().titleText(), Matchers.is(titleTimeText)); return this; } - @JDIAction("Assert that '{name}' time in title is '{0}'") + @JDIAction(value = "Assert that '{name}' time in title is '{0}'", isAssert = true) public TimePickerAssert time(final LocalTime localTime) { jdiAssert(element().titleTime(), Matchers.is(localTime)); return this; } - @JDIAction("Assert that '{name}' in title are '{0}'") + @JDIAction(value = "Assert that '{name}' hours in title are '{0}'", isAssert = true) public TimePickerAssert hours(int hours) { jdiAssert(element().titleHours(), Matchers.is(hours)); return this; } - @JDIAction("Assert that '{name}' in title are '{0}'") + @JDIAction(value = "Assert that '{name}' minutes in title are '{0}'", isAssert = true) public TimePickerAssert minutes(int minutes) { jdiAssert(element().titleMinutes(), Matchers.is(minutes)); return this; } - @JDIAction("Assert that '{name}' in title are '{0}'") + @JDIAction(value = "Assert that '{name}' seconds in title are '{0}'", isAssert = true) public TimePickerAssert seconds(int seconds) { jdiAssert(element().titleSeconds(), Matchers.is(seconds)); return this; } - @JDIAction("Assert that '{name}' has '{0}' disabled numbers") + @JDIAction(value = "Assert that '{name}' has '{0}' disabled numbers", isAssert = true) public TimePickerAssert disabledNumbers(Integer... expectedDisabledNumbers) { - List actualDisabledNumbers = element().disabledClockNumbers(); - String errorMsg = format("Expecting '%s' numbers to be disabled. But disabled numbers were '%s'", - Arrays.asList(expectedDisabledNumbers), actualDisabledNumbers); - jdiAssert(actualDisabledNumbers, Matchers.containsInAnyOrder(expectedDisabledNumbers), errorMsg); + jdiAssert(element().disabledClockNumbers(), Matchers.containsInAnyOrder(expectedDisabledNumbers)); return this; } - @JDIAction("Assert that '{name}' has '{0}' enabled numbers") + @JDIAction(value = "Assert that '{name}' has '{0}' enabled numbers", isAssert = true) public TimePickerAssert enabledNumbers(Integer... expectedEnabledNumbers) { - List actualEnabledNumbers = element().enabledClockNumbers(); - String errorMsg = format("Expecting '%s' numbers to be enabled. But enabled numbers were '%s'", - Arrays.asList(expectedEnabledNumbers), actualEnabledNumbers); - jdiAssert(actualEnabledNumbers, Matchers.contains(expectedEnabledNumbers), errorMsg); + jdiAssert(element().enabledClockNumbers(), Matchers.contains(expectedEnabledNumbers)); return this; } - @JDIAction("Assert that '{name}' has '{0}' selected number") + @JDIAction(value = "Assert that '{name}' has '{0}' selected number", isAssert = true) public TimePickerAssert selectedNumber(int expectedSelectedNumber) { jdiAssert(element().selectedNumber(), Matchers.is(expectedSelectedNumber)); return this; } - @JDIAction("Assert that '{name}' is 12h") + // TODO Fix required. Not only h can be used + @JDIAction(value = "Assert that '{name}' is 12h", isAssert = true) public TimePickerAssert format12() { jdiAssert(element().is12h() ? "12h" : "24h", Matchers.is("12h")); return this; } - @JDIAction("Assert that '{name}' is 24h") + @JDIAction(value = "Assert that '{name}' is 24h", isAssert = true) public TimePickerAssert format24() { jdiAssert(element().is12h() ? "12h" : "24h", Matchers.is("24h")); return this; } @Override - @JDIAction("Assert that '{name}' background color is {0}") + @JDIAction(value = "Assert that '{name}' background color is {0}", isAssert = true) public TimePickerAssert backgroundColor(String color) { - String actualBackgroundColor = element().titleBackgroundColor(); - String errorMsg = format("Expecting '%s' title background color, but was '%s'", color, actualBackgroundColor); - jdiAssert(actualBackgroundColor, Matchers.is(color), errorMsg); + jdiAssert(element().titleBackgroundColor(), Matchers.is(color)); return this; } @Override - @JDIAction("Assert that '{name}' is disabled") + @JDIAction(value = "Assert that '{name}' is disabled", isAssert = true) public TimePickerAssert disabled() { - jdiAssert(element().isDisabled() ? "disabled" : "enabled", Matchers.is("disabled")); + jdiAssert(element().isDisabled(), Matchers.is(true), "TimePicker is enabled"); return this; } @Override - @JDIAction("Assert that '{name}' is enabled") + @JDIAction(value = "Assert that '{name}' is enabled", isAssert = true) public TimePickerAssert enabled() { - jdiAssert(element().isDisabled() ? "disabled" : "enabled", Matchers.is("enabled")); + jdiAssert(element().isDisabled(), Matchers.is(false), "TimePicker is disabled"); return this; } - @JDIAction("Assert that '{name}' title field has AM period") + @JDIAction(value = "Assert that '{name}' title field has AM period", isAssert = true) public TimePickerAssert amPeriod() { return period("AM"); } - @JDIAction("Assert that '{name}' title field has PM period") + @JDIAction(value = "Assert that '{name}' title field has PM period", isAssert = true) public TimePickerAssert pmPeriod() { return period("PM"); } @@ -126,15 +117,15 @@ private TimePickerAssert period(final String amPmPeriod) { return this; } - @JDIAction("Assert that '{name}' is landscape") + @JDIAction(value = "Assert that '{name}' is landscape", isAssert = true) public TimePickerAssert landscape() { - jdiAssert(element().isLandscape() ? "landscape" : "not landscape", Matchers.is("landscape")); + jdiAssert(element().isLandscape(), Matchers.is(true), "TimePicker is not landscape"); return this; } - @JDIAction("Assert that '{name}' is not landscape") + @JDIAction(value = "Assert that '{name}' is not landscape", isAssert = true) public TimePickerAssert notLandscape() { - jdiAssert(element().isLandscape() ? "landscape" : "not landscape", Matchers.is("not landscape")); + jdiAssert(element().isLandscape(), Matchers.is(false), "TimePicker is landscape"); return this; } } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/TooltipAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/TooltipAssert.java index a0b3200a6a..6f2e9fe33e 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/TooltipAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/TooltipAssert.java @@ -3,34 +3,31 @@ import com.epam.jdi.light.asserts.generic.UIAssert; import com.epam.jdi.light.common.JDIAction; import com.epam.jdi.light.vuetify.elements.common.Tooltip; -import com.jdiai.tools.Timer; import org.hamcrest.Matchers; import static com.epam.jdi.light.asserts.core.SoftAssert.jdiAssert; public class TooltipAssert extends UIAssert { - @JDIAction("Assert that '{name}' is displayed'") + @JDIAction(value = "Assert that '{name}' is displayed'", isAssert = true) public TooltipAssert displayed() { - Timer.waitCondition(element()::isDisplayed); jdiAssert(element().isDisplayed(), Matchers.is(true), "Tooltip is not displayed"); return this; } - @JDIAction("Assert that '{name}' is hidden'") + @JDIAction(value = "Assert that '{name}' is hidden'", isAssert = true) public TooltipAssert hidden() { - Timer.waitCondition(() -> !element().isDisplayed()); jdiAssert(element().isDisplayed(), Matchers.is(false), "Tooltip is displayed"); return this; } - @JDIAction("Assert that '{name}' has '{0}' text") + @JDIAction(value = "Assert that '{name}' has '{0}' text", isAssert = true) public TooltipAssert text(String text) { jdiAssert(element().text(), Matchers.is(text)); return this; } - @JDIAction("Assert that '{name}' color is '{0}'") + @JDIAction(value = "Assert that '{name}' color is '{0}'", isAssert = true) public TooltipAssert color(String color) { jdiAssert(element().color(), Matchers.is(color)); return this; diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/TreeViewAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/TreeViewAssert.java index 86be8f40c6..e2059c8936 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/TreeViewAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/TreeViewAssert.java @@ -13,15 +13,15 @@ public class TreeViewAssert extends UISelectAssert imp DenseAssert { - @JDIAction("Assert that '{name}' is hoverable") + @JDIAction(value = "Assert that '{name}' is hoverable", isAssert = true) public TreeViewAssert hoverable() { - jdiAssert(element().isHoverable(), Matchers.is(true), "Element is not hoverable"); + jdiAssert(element().isHoverable(), Matchers.is(true), "TreeView is not hoverable"); return this; } - @JDIAction("Assert that '{name}' is not hoverable") + @JDIAction(value = "Assert that '{name}' is not hoverable", isAssert = true) public TreeViewAssert notHoverable() { - jdiAssert(element().isHoverable(), Matchers.is(false), "Element is hoverable"); + jdiAssert(element().isHoverable(), Matchers.is(false), "TreeView is hoverable"); return this; } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/TreeViewNodeAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/TreeViewNodeAssert.java index e8a725b91e..88478cbfd2 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/TreeViewNodeAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/TreeViewNodeAssert.java @@ -11,7 +11,6 @@ import org.hamcrest.Matchers; import java.util.List; import static com.epam.jdi.light.asserts.core.SoftAssert.jdiAssert; -import static com.jdiai.tools.Timer.waitCondition; import static java.util.Arrays.asList; import static org.hamcrest.Matchers.equalTo; @@ -19,113 +18,114 @@ public class TreeViewNodeAssert extends UISelectAssert, ShapedAssert, LoadingAssert, ColorAssert { - @JDIAction("Assert that '{name}' is expanded") + @JDIAction(value = "Assert that '{name}' is expanded", isAssert = true) public TreeViewNodeAssert expanded() { - jdiAssert(waitCondition(element()::isExpanded), Matchers.is(true), "Element is collapsed"); + jdiAssert(element().isExpanded(), Matchers.is(true), "TreeViewNode is collapsed"); return this; } - @JDIAction("Assert that '{name}' is collapsed") + @JDIAction(value = "Assert that '{name}' is collapsed", isAssert = true) public TreeViewNodeAssert collapsed() { - jdiAssert(waitCondition(element()::isExpanded), Matchers.is(false), "Element is expanded"); + jdiAssert(element().isExpanded(), Matchers.is(false), "TreeViewNode is expanded"); return this; } - @JDIAction("Assert that '{name}' has label") + @JDIAction(value = "Assert that '{name}' has label", isAssert = true) public TreeViewNodeAssert hasLabel() { - jdiAssert(element().hasLabel(), Matchers.is(true), "Element has no label"); + jdiAssert(element().hasLabel(), Matchers.is(true), "TreeViewNode has no label"); return this; } - @JDIAction("Assert that '{name}' is a leaf") + @JDIAction(value = "Assert that '{name}' is a leaf", isAssert = true) public TreeViewNodeAssert leaf() { - jdiAssert(element().isLeaf(), Matchers.is(true), "Element is not a leaf"); + jdiAssert(element().isLeaf(), Matchers.is(true), "TreeViewNode is not a leaf"); return this; } - @JDIAction("Assert that '{name}' is not a leaf") + @JDIAction(value = "Assert that '{name}' is not a leaf", isAssert = true) public TreeViewNodeAssert notLeaf() { - jdiAssert(element().isLeaf(), Matchers.is(false), "Element is a leaf"); + jdiAssert(element().isLeaf(), Matchers.is(false), "TreeViewNode is a leaf"); return this; } - @JDIAction("Assert that '{name}' is active") + @JDIAction(value = "Assert that '{name}' is active", isAssert = true) public TreeViewNodeAssert active() { - jdiAssert(element().isActive(), Matchers.is(true), "Element is not active"); + jdiAssert(element().isActive(), Matchers.is(true), "TreeViewNode is not active"); return this; } - @JDIAction("Assert that '{name}' is not active") + @JDIAction(value = "Assert that '{name}' is not active", isAssert = true) public TreeViewNodeAssert notActive() { - jdiAssert(element().isActive(), Matchers.is(false), "Element is active"); + jdiAssert(element().isActive(), Matchers.is(false), "TreeViewNode is active"); return this; } - @JDIAction("Assert that '{name}' is selected") + @JDIAction(value = "Assert that '{name}' is selected", isAssert = true) public TreeViewNodeAssert selected() { - jdiAssert(element().isSelected(), Matchers.is(true), "Element is not selected"); + jdiAssert(element().isSelected(), Matchers.is(true), "TreeViewNode is not selected"); return this; } - @JDIAction("Assert that '{name}' is not selected") + @JDIAction(value = "Assert that '{name}' is not selected", isAssert = true) public TreeViewNodeAssert notSelected() { - jdiAssert(element().isSelected(), Matchers.is(false), "Element is selected"); + jdiAssert(element().isSelected(), Matchers.is(false), "TreeViewNode is selected"); return this; } - @JDIAction("Assert that '{name}' has checkbox") + // TODO Check this methods + @JDIAction(value = "Assert that '{name}' has checkbox", isAssert = true) public TreeViewNodeAssert checkbox() { - jdiAssert(element().checkbox().isExist(), Matchers.is(true), "Element has no checkbox"); + jdiAssert(element().checkbox().isExist(), Matchers.is(true), "TreeViewNode has no checkbox"); return this; } - @JDIAction("Assert that '{name}' has no checkbox") + @JDIAction(value = "Assert that '{name}' has no checkbox", isAssert = true) public TreeViewNodeAssert noCheckbox() { - jdiAssert(element().checkbox().isExist(), Matchers.is(false), "Element has checkbox"); + jdiAssert(element().checkbox().isExist(), Matchers.is(false), "TreeViewNode has checkbox"); return this; } - @JDIAction("Assert that '{name}' is fully marked") + @JDIAction(value = "Assert that '{name}' is fully marked", isAssert = true) public TreeViewNodeAssert fullyMarked() { - jdiAssert(element().isFullyMarked(), Matchers.is(true), "Element is not fully marked"); + jdiAssert(element().isFullyMarked(), Matchers.is(true), "TreeViewNode is not fully marked"); return this; } - @JDIAction("Assert that '{name}' is partly marked") + @JDIAction(value = "Assert that '{name}' is partly marked", isAssert = true) public TreeViewNodeAssert isPartlyMarked() { - jdiAssert(element().isPartlyMarked(), Matchers.is(true), "Element is not partly marked"); + jdiAssert(element().isPartlyMarked(), Matchers.is(true), "TreeViewNode is not partly marked"); return this; } - @JDIAction("Assert that '{name}' is not marked") + @JDIAction(value = "Assert that '{name}' is not marked", isAssert = true) public TreeViewNodeAssert notMarked() { - jdiAssert(element().isNotMarked(), Matchers.is(true), "Element is marked"); + jdiAssert(element().isNotMarked(), Matchers.is(true), "TreeViewNode is marked"); return this; } - @JDIAction("Assert that '{0}' values checked in '{name}'") + @JDIAction(value = "Assert that '{name}' checked are matched condition", isAssert = true) public TreeViewNodeAssert checked(Matcher> values) { jdiAssert(element().checked(), values); return this; } - @JDIAction("Assert that only '{0}' values are checked in '{name}'") + @JDIAction(value = "Assert that only '{0}' values are checked in '{name}'", isAssert = true) public TreeViewNodeAssert checked(String... values) { return checked(equalTo(asList(values))); } - @JDIAction("Assert that only '{0}' values are checked in '{name}'") + @JDIAction(value = "Assert that only '{0}' values are checked in '{name}'", isAssert = true) public TreeViewNodeAssert checked(List values) { return checked(equalTo(values)); } - @JDIAction("Assert that color of '{name}' is equal to '{0}'") + @JDIAction(value = "Assert that color of '{name}' is equal to '{0}'", isAssert = true) public TreeViewNodeAssert color(String color) { jdiAssert(element().color(), equalTo(color)); return this; } - @JDIAction("Assert that checkbox color of '{name}' is equal to '{0}'") + @JDIAction(value = "Assert that checkbox color of '{name}' is equal to '{0}'", isAssert = true) public TreeViewNodeAssert checkboxColor(String color) { jdiAssert(element().checkboxColor(), equalTo(color)); return this; diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/VirtualScrollerAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/VirtualScrollerAssert.java index aaedd62dfb..26cb9e3f61 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/VirtualScrollerAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/VirtualScrollerAssert.java @@ -6,46 +6,33 @@ import com.epam.jdi.light.common.JDIAction; import com.epam.jdi.light.vuetify.elements.complex.VirtualScroller; import com.epam.jdi.light.vuetify.interfaces.asserts.MeasurementAssert; -import com.jdiai.tools.Timer; import org.hamcrest.Matchers; -import java.util.Arrays; -import java.util.List; - public class VirtualScrollerAssert extends UIAssert implements MeasurementAssert { - @JDIAction("Assert that number of rendered items of '{name}' are {0}") + @JDIAction(value = "Assert that number of rendered items of '{name}' are {0}", isAssert = true) public VirtualScrollerAssert itemsCount(int expectedCount) { - Timer.waitCondition(() -> !element().items().isEmpty()); - int actualCount = element().items().size(); - jdiAssert(actualCount, Matchers.is(expectedCount), - String.format("Number of actual rendered items is '%d', but expected '%d'", actualCount, expectedCount)); + jdiAssert(element().items().size(), Matchers.is(expectedCount)); return this; } - @JDIAction("Assert that '{name}' items are exist") + // TODO CHeck this function + @JDIAction(value = "Assert that '{name}' items are exist", isAssert = true) public VirtualScrollerAssert items() { - Timer.waitCondition(()-> !element().items().isEmpty()); jdiAssert(element().items(), Matchers.notNullValue()); return this; } - @JDIAction("Assert that '{name}' items has text {0}") + @JDIAction(value = "Assert that '{name}' items contains texts {0}", isAssert = true) public VirtualScrollerAssert text(String... expectedText) { - Timer.waitCondition(()-> !element().items().isEmpty()); - List actualItemsText = element().itemsText(); - jdiAssert(actualItemsText.containsAll(Arrays.asList(expectedText)), Matchers.is(true), - String.format("Virtual scroller has '%s' items, but expected '%s'", - String.join(", ", actualItemsText), String.join(", ", expectedText))); + jdiAssert(element().itemsText(), Matchers.hasItems(expectedText)); return this; } - @JDIAction("Assert that '{name}' has {0} items height") + @JDIAction(value = "Assert that '{name}' has {0} items height", isAssert = true) public VirtualScrollerAssert itemsHeight(int expectedItemsHeight) { - int actualItemsHeight = element().itemHeight(); - jdiAssert(actualItemsHeight, Matchers.is(expectedItemsHeight), - String.format("Actual item height is '%d', but expected '%d'", actualItemsHeight, expectedItemsHeight)); + jdiAssert(element().itemHeight(), Matchers.is(expectedItemsHeight)); return this; } } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/VueCheckboxAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/VueCheckboxAssert.java index 7b44911a93..3ea05c634c 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/VueCheckboxAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/VueCheckboxAssert.java @@ -8,7 +8,6 @@ import com.epam.jdi.light.vuetify.interfaces.asserts.MessagesAssert; import com.epam.jdi.light.vuetify.interfaces.asserts.ReadOnlyAssert; import com.epam.jdi.light.vuetify.interfaces.asserts.ThemeAssert; -import com.jdiai.tools.Timer; import org.hamcrest.Matchers; import static com.epam.jdi.light.asserts.core.SoftAssert.jdiAssert; @@ -18,107 +17,93 @@ public class VueCheckboxAssert extends UIAssert ColorAssert, DenseAssert, MessagesAssert, ReadOnlyAssert { - @JDIAction("Assert that '{name}' is enabled") + @JDIAction(value = "Assert that '{name}' is enabled", isAssert = true) public VueCheckboxAssert enabled() { - jdiAssert(element().isDisabled(), Matchers.is(false), "Element is disabled"); + jdiAssert(element().isDisabled(), Matchers.is(false), "Checkbox is disabled"); return this; } - @JDIAction("Assert that '{name}' is disabled") + @JDIAction(value = "Assert that '{name}' is disabled", isAssert = true) public VueCheckboxAssert disabled() { - jdiAssert(element().isDisabled(), Matchers.is(true), "Element is enabled"); + jdiAssert(element().isDisabled(), Matchers.is(true), "Checkbox is enabled"); return this; } - @JDIAction("Assert that '{name}' is checked") + @JDIAction(value = "Assert that '{name}' is checked", isAssert = true) public VueCheckboxAssert checked() { - jdiAssert(element().isChecked(), Matchers.is(true), "Element is unchecked"); + jdiAssert(element().isChecked(), Matchers.is(true), "Checkbox is unchecked"); return this; } - @JDIAction("Assert that '{name}' is not checked") + @JDIAction(value = "Assert that '{name}' is not checked", isAssert = true) public VueCheckboxAssert unchecked() { - jdiAssert(element().isChecked(), Matchers.is(false), "Element is checked"); + jdiAssert(element().isChecked(), Matchers.is(false), "Checkbox is checked"); return this; } - @JDIAction("Assert that '{name}' has '{0}' label") + @JDIAction(value = "Assert that '{name}' has '{0}' label", isAssert = true) public VueCheckboxAssert label(String text) { - new Timer(base().getTimeout() * 1000L) - .wait(() -> element().isDisplayed()); - String actualLabelText = element().labelText(); - jdiAssert(actualLabelText, equalToIgnoringCase(text), String.format("Element's actual label text '%s' is " + - "not equal to expected '%s'", actualLabelText, text)); + jdiAssert(element().labelText(), equalToIgnoringCase(text)); return this; } - @JDIAction("Assert that '{name}' label contains '{text}'") + @JDIAction(value = "Assert that '{name}' label contains '{text}'", isAssert = true) public VueCheckboxAssert labelContains(String text) { - String actualLabelText = element().labelText(); - jdiAssert(actualLabelText, Matchers.containsString(text), String.format("Element's actual label text '%s' " + - "doesn't contain expected text '%s'", actualLabelText, text)); + jdiAssert(element().labelText(), Matchers.containsString(text)); return this; } - @JDIAction("Assert that '{name}' is indeterminate") + @JDIAction(value = "Assert that '{name}' is indeterminate", isAssert = true) public VueCheckboxAssert indeterminate() { - jdiAssert(element().isIndeterminate(), Matchers.is(true), "Element is not indeterminate"); + jdiAssert(element().isIndeterminate(), Matchers.is(true), "Checkbox is not indeterminate"); return this; } - @JDIAction("Assert that '{name}' is not indeterminate") + @JDIAction(value = "Assert that '{name}' is not indeterminate", isAssert = true) public VueCheckboxAssert notIndeterminate() { - jdiAssert(element().isIndeterminate(), Matchers.is(false), "Element is indeterminate"); + jdiAssert(element().isIndeterminate(), Matchers.is(false), "Checkbox is indeterminate"); return this; } - @JDIAction("Assert that '{name}' has '{0}' class") - public VueCheckboxAssert className(String className) { - jdiAssert(element().hasClass(className), Matchers.is(true), String.format("Element hasn't class '%s'", className)); - return this; - } - - @JDIAction("Assert that '{name}' has not label") + @JDIAction(value = "Assert that '{name}' has not label", isAssert = true) public VueCheckboxAssert noLabel() { - jdiAssert(element().hasLabel(), Matchers.is(false), "Element has label"); + jdiAssert(element().hasLabel(), Matchers.is(false), "Checkbox has label"); return this; } - @JDIAction("Assert that '{name}' has label") + @JDIAction(value = "Assert that '{name}' has label", isAssert = true) public VueCheckboxAssert label() { - jdiAssert(element().hasLabel(), Matchers.is(true), "Element has no label"); + jdiAssert(element().hasLabel(), Matchers.is(true), "Checkbox has no label"); return this; } - @JDIAction("Assert that '{name}' is success") + @JDIAction(value = "Assert that '{name}' is success", isAssert = true) public VueCheckboxAssert success() { - jdiAssert(element().isSuccess(), Matchers.is(true), "Element is not success"); + jdiAssert(element().isSuccess(), Matchers.is(true), "Checkbox is not success"); return this; } - @JDIAction("Assert that '{name}' is not success") + @JDIAction(value = "Assert that '{name}' is not success", isAssert = true) public VueCheckboxAssert notSuccess() { - jdiAssert(element().isSuccess(), Matchers.is(false), "Element is success"); + jdiAssert(element().isSuccess(), Matchers.is(false), "Checkbox is success"); return this; } - @JDIAction("Assert that '{name}' is error") + @JDIAction(value = "Assert that '{name}' is error", isAssert = true) public VueCheckboxAssert error() { - jdiAssert(element().isError(), Matchers.is(true), "Element is not error"); + jdiAssert(element().isError(), Matchers.is(true), "Checkbox is not in errorstate "); return this; } - @JDIAction("Assert that '{name}' is not error") + @JDIAction(value = "Assert that '{name}' is not error", isAssert = true) public VueCheckboxAssert notError() { - jdiAssert(element().isError(), Matchers.is(false), "Element is error"); + jdiAssert(element().isError(), Matchers.is(false), "Checkbox is in error state"); return this; } - @JDIAction("Assert that '{name}' has label color '{0}'") + @JDIAction(value = "Assert that '{name}' has label color '{0}'", isAssert = true) public VueCheckboxAssert labelColor(String color) { - String actualLabelColor = element().labelColor(); - jdiAssert(actualLabelColor, Matchers.equalTo(color), String.format("Element's actual label color '%s' " + - "is not equal to expected '%s'", actualLabelColor, color)); + jdiAssert(element().labelColor(), Matchers.equalTo(color)); return this; } } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/VuetifyButtonAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/VuetifyButtonAssert.java index 18579c1807..0c921e4257 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/VuetifyButtonAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/VuetifyButtonAssert.java @@ -25,21 +25,21 @@ public VuetifyButton element() { return (VuetifyButton) super.element(); } - @JDIAction("Assert that '{name}' is loading") + @JDIAction(value = "Assert that '{name}' is loading", isAssert = true) public VuetifyButtonAssert loading() { jdiAssert(element().isLoading(), Matchers.is(true), "Button doesn't have loader"); return this; } - @JDIAction("Assert that '{name}' is clickable") + @JDIAction(value = "Assert that '{name}' is clickable", isAssert = true) public VuetifyButtonAssert clickable() { jdiAssert(element().core().isClickable(), Matchers.is(true), "Button is not clickable"); return this; } - @JDIAction("Assert that '{name}' has icon") + @JDIAction(value = "Assert that '{name}' has icon", isAssert = true) public VuetifyButtonAssert icon() { - jdiAssert(element().hasIcon(), Matchers.is(true), "Element does not have icon"); + jdiAssert(element().hasIcon(), Matchers.is(true), "Button does not have icon"); return this; } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/VuetifyListAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/VuetifyListAssert.java index c4bb4f44c0..924f53269f 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/VuetifyListAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/VuetifyListAssert.java @@ -27,25 +27,23 @@ public class VuetifyListAssert extends UIAssert * @param size expected size * @return this {@link ListItemAssert} instance */ - @JDIAction("Assert that '{name}' size is '{0}'") + @JDIAction(value = "Assert that '{name}' size is '{0}'", isAssert = true) public VuetifyListAssert size(int size) { - int actualSize = element().size(); - jdiAssert(actualSize, Matchers.is(size), String.format("Actual element's sixe '%s' is not equal to expected " + - "'%s'", actualSize, size)); + jdiAssert(element().size(), Matchers.is(size)); return this; } @Override - @JDIAction("Assert that '{name}' is disabled") + @JDIAction(value = "Assert that '{name}' is disabled", isAssert = true) public VuetifyListAssert disabled() { - jdiAssert(element().isDisabled(), Matchers.is(true), "Element is enabled"); + jdiAssert(element().isDisabled(), Matchers.is(true), "List is enabled"); return this; } @Override - @JDIAction("Assert that '{name}' is enabled") + @JDIAction(value = "Assert that '{name}' is enabled", isAssert = true) public VuetifyListAssert enabled() { - jdiAssert(element().isDisabled(), Matchers.is(false), "Element is disabled"); + jdiAssert(element().isDisabled(), Matchers.is(false), "List is disabled"); return this; } @@ -55,7 +53,7 @@ public VuetifyListAssert enabled() { * @param groupSize expected group size * @return this {@link ListItemAssert} instance */ - @JDIAction("Assert that '{name}' groups count is {0}") + @JDIAction(value = "Assert that '{name}' groups count is {0}", isAssert = true) public VuetifyListAssert groupSize(int groupSize) { jdiAssert(element().groups().size(), Matchers.is(groupSize)); return this; @@ -67,7 +65,7 @@ public VuetifyListAssert groupSize(int groupSize) { * @param divSize expected dividers count * @return this {@link ListItemAssert} instance */ - @JDIAction("Assert that '{name}' dividers count is {0}") + @JDIAction(value = "Assert that '{name}' dividers count is {0}", isAssert = true) public VuetifyListAssert dividersSize(int divSize) { jdiAssert(element().dividers().size(), Matchers.is(divSize)); return this; diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/VuetifyListGroupAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/VuetifyListGroupAssert.java index 6d2167429a..a8399ec609 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/VuetifyListGroupAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/VuetifyListGroupAssert.java @@ -14,9 +14,9 @@ public class VuetifyListGroupAssert extends UIAssert, ThemeAssert { @Override - @JDIAction("Assert that '{name}' tab '{0}' is selected") + @JDIAction(value = "Assert that '{name}' tab '{0}' is selected", isAssert = true) public VuetifyTabsAssert selected(int index) { - jdiAssert(element().isSelected(index), Matchers.is(true), "Element is not selected"); + jdiAssert(element().isSelected(index), Matchers.is(true), "Tab is not selected"); return this; } - @JDIAction("Assert that '{name}' tab '{0}' is not selected") + @JDIAction(value = "Assert that '{name}' tab '{0}' is not selected", isAssert = true) public VuetifyTabsAssert notSelected(int index) { - jdiAssert(element().isSelected(index), Matchers.is(false), "Element is selected"); + jdiAssert(element().isSelected(index), Matchers.is(false), "Tab is selected"); return this; } - @JDIAction("Assert that '{name}' has size '{0}'") + @JDIAction(value = "Assert that '{name}' has size '{0}'", isAssert = true) public VuetifyTabsAssert size(int size) { - int actualSize = element().size(); - jdiAssert(actualSize, Matchers.is(size), String.format("Element's actual size '%s' is not equal to expected " + - "'%s'", actualSize, size)); + jdiAssert(element().size(), Matchers.is(size)); return this; } - @JDIAction("Assert that '{name}' is fixed") + @JDIAction(value = "Assert that '{name}' is fixed", isAssert = true) public VuetifyTabsAssert fixed() { - jdiAssert(element().isFixed(), Matchers.is(true), "Element is not fixed"); + jdiAssert(element().isFixed(), Matchers.is(true), "Tab is not fixed"); return this; } - @JDIAction("Assert that '{name}' is grow") + @JDIAction(value = "Assert that '{name}' is grow", isAssert = true) public VuetifyTabsAssert grow() { - jdiAssert(element().isGrow(), Matchers.is(true), "Element is not grow"); + jdiAssert(element().isGrow(), Matchers.is(true), "Tab is not grow"); return this; } - @JDIAction("Assert that '{name}' is not grow") + @JDIAction(value = "Assert that '{name}' is not grow", isAssert = true) public VuetifyTabsAssert notGrow() { - jdiAssert(element().isGrow(), Matchers.is(false), "Element is grow"); + jdiAssert(element().isGrow(), Matchers.is(false), "Tab is grow"); return this; } - @JDIAction("Assert that '{name}' is right") + @JDIAction(value = "Assert that '{name}' is right", isAssert = true) public VuetifyTabsAssert right() { - jdiAssert(element().isRight(), Matchers.is(true), "Element is not right"); + jdiAssert(element().isRight(), Matchers.is(true), "Tab is not right"); return this; } - @JDIAction("Assert that '{name}' is not right") + @JDIAction(value = "Assert that '{name}' is not right", isAssert = true) public VuetifyTabsAssert notRight() { - jdiAssert(element().isRight(), Matchers.is(false), "Element is right"); + jdiAssert(element().isRight(), Matchers.is(false), "Tab is right"); return this; } - @JDIAction("Assert that '{name}' is vertical") + @JDIAction(value = "Assert that '{name}' is vertical", isAssert = true) public VuetifyTabsAssert vertical() { - jdiAssert(element().isVertical(), Matchers.is(true), "Element is not vertical"); + jdiAssert(element().isVertical(), Matchers.is(true), "Tab is not vertical"); return this; } - @JDIAction("Assert that '{name}' is not vertical") + @JDIAction(value = "Assert that '{name}' is not vertical", isAssert = true) public VuetifyTabsAssert notVertical() { - jdiAssert(element().isVertical(), Matchers.is(false), "Element is vertical"); + jdiAssert(element().isVertical(), Matchers.is(false), "Tab is vertical"); return this; } - @JDIAction("Assert that '{name}' tab with index '{0}' exists") + @JDIAction(value = "Assert that '{name}' tab with index '{0}' exists", isAssert = true) public VuetifyTabsAssert tabExist(int index) { - jdiAssert(element().get(index).isExist(), Matchers.is(true), String.format("Tab with index '%s' doesn't " + - "exist", index)); + jdiAssert(element().get(index).isExist(), Matchers.is(true), + String.format("Tab with index '%d' doesn't exist", index)); return this; } - @JDIAction("Assert that '{name}' tab with index '{0}' doesn't exist") + @JDIAction(value = "Assert that '{name}' tab with index '{0}' doesn't exist", isAssert = true) public VuetifyTabsAssert tabNotExist(int index) { - jdiAssert(element().get(index).isNotExist(), Matchers.is(true), String.format("Tab with index '%s' " + - "doesn't exist", index)); + jdiAssert(element().get(index).isNotExist(), Matchers.is(true), + String.format("Tab with index '%d' doesn't exist", index)); return this; } - @JDIAction("Assert that '{name}' tab text content is '{0}'") + @JDIAction(value = "Assert that '{name}' tab text content matched condition", isAssert = true) public VuetifyTabsAssert tabTextContent(Matcher condition) { - String actualTabTextContent = element().getTabTextContent(); - jdiAssert(actualTabTextContent, condition, String.format("Element's actual tab text content '%s' is not " + - "equal to expected '%s'", actualTabTextContent, condition)); + jdiAssert(element().getTabTextContent(), condition); return this; } - @JDIAction("Assert that '{name}' tab text content is '{0}'") + @JDIAction(value = "Assert that '{name}' tab text content is '{0}'", isAssert = true) public VuetifyTabsAssert tabTextContent(String text) { tabTextContent(Matchers.is(text)); return this; } - @JDIAction("Assert that '{name}' tab text content contains '{0}'") - public VuetifyTabsAssert tabTextContentContaining(String text) { + @JDIAction(value = "Assert that '{name}' tab text content contains '{0}'", isAssert = true) + public VuetifyTabsAssert tabTextContentContains(String text) { tabTextContent(Matchers.containsString(text)); return this; } - @JDIAction("Assert that '{name}' is align with title") + // TODO Check this function + @JDIAction(value = "Assert that '{name}' is align with title", isAssert = true) public VuetifyTabsAssert alignWithTitle() { - jdiAssert(element().isAlignWithTitle(), Matchers.is(true), "Element is not align with title"); + jdiAssert(element().isAlignWithTitle(), Matchers.is(true), "Tab is not align with title"); return this; } - @JDIAction("Assert that '{name}' is not align with title") + @JDIAction(value = "Assert that '{name}' is not align with title", isAssert = true) public VuetifyTabsAssert notAlignWithTitle() { - jdiAssert(element().isAlignWithTitle(), Matchers.is(false), "Element is align with title"); + jdiAssert(element().isAlignWithTitle(), Matchers.is(false), "Tab is align with title"); return this; } - @JDIAction("Assert that '{name}' has tab slider size '{0}'") + @JDIAction(value = "Assert that '{name}' has tab slider size '{0}'", isAssert = true) public VuetifyTabsAssert tabSliderSizePx(int n) { - int actualTabSliderSize = element().tabsSliderSize(); - jdiAssert(actualTabSliderSize, Matchers.equalTo(n), String.format("Element's actual tab slider size '%s' is " + - "not equal to expected '%s'", actualTabSliderSize, n)); + jdiAssert(element().tabsSliderSize(), Matchers.equalTo(n)); return this; } - @JDIAction("Assert that '{name}' has tab slider color '{0}'") + @JDIAction(value = "Assert that '{name}' has tab slider color '{0}'", isAssert = true) public VuetifyTabsAssert tabSliderColor(String color) { - String actualTabSliderColor = element().tabsSliderColor(); - jdiAssert(actualTabSliderColor, Matchers.equalTo(color), String.format("Element's actual tab slider color " + - "'%s' is not equal to expected '%s'", actualTabSliderColor, color)); + jdiAssert(element().tabsSliderColor(), Matchers.equalTo(color)); return this; } - @JDIAction("Assert that '{name}' tab '{0}' is disabled") + @JDIAction(value = "Assert that '{name}' tab '{0}' is disabled", isAssert = true) public VuetifyTabsAssert tabDisabled(int index) { - jdiAssert(element().isTabDisabled(index), Matchers.is(true), String.format("Element's tab '%s' is enabled", - index)); + jdiAssert(element().isTabDisabled(index), Matchers.is(true), + String.format("Tab's tab with index '%d' is enabled", index)); return this; } - @JDIAction("Assert that '{name}' tab '{0}' is enabled") + @JDIAction(value = "Assert that '{name}' tab '{0}' is enabled", isAssert = true) public VuetifyTabsAssert tabEnabled(int index) { - jdiAssert(element().isTabDisabled(index), Matchers.is(false), String.format("Element's tab '%s' is " + - "disabled", index)); + jdiAssert(element().isTabDisabled(index), Matchers.is(false), + String.format("Tab's tab with index '%d' is disabled", index)); return this; } - @JDIAction("Assert that '{name}' tab '{0}' has href") + @JDIAction(value = "Assert that '{name}' tab '{0}' has href", isAssert = true) public VuetifyTabsAssert tabHref(int index) { - jdiAssert(element().tabHasHref(index), Matchers.is(true), String.format("Element's tab '%s' has no href", - index)); + jdiAssert(element().tabHasHref(index), Matchers.is(true), + String.format("Tab's tab with index '%d' has no href", index)); return this; } - @JDIAction("Assert that '{name}' tab '{0}' has no href") + @JDIAction(value = "Assert that '{name}' tab '{0}' has no href", isAssert = true) public VuetifyTabsAssert noTabHref(int index) { - jdiAssert(element().tabHasHref(index), Matchers.is(false), String.format("Element's tab '%s' has href", - index)); + jdiAssert(element().tabHasHref(index), Matchers.is(false), + String.format("Tab's tab with index '%d' has href", index)); return this; } - @JDIAction("Assert that '{name}' has tab slider color '{0}'") + @JDIAction(value = "Assert that '{name}' has tab {0} has href '{1}'", isAssert = true) public VuetifyTabsAssert tabHref(int index, String href) { - String actualTabHref = element().getTabHref(index); - jdiAssert(actualTabHref, Matchers.equalTo(href), String.format("Element's actual tab '%s' href '%s' is not " + - "equal to expected '%s'", index, actualTabHref, href)); + jdiAssert(element().getTabHref(index), Matchers.equalTo(href)); return this; } - @JDIAction("Assert that '{name}' shows arrows") + @JDIAction(value = "Assert that '{name}' shows arrows", isAssert = true) public VuetifyTabsAssert showArrows() { - jdiAssert(element().showsArrows(), Matchers.is(true), "Element's tab '%s' has no href"); + jdiAssert(element().showsArrows(), Matchers.is(true), + "Tabs doesn't show arrows"); return this; } - @JDIAction("Assert that '{name}' doesn't show arrows") + @JDIAction(value = "Assert that '{name}' doesn't show arrows", isAssert = true) public VuetifyTabsAssert notShowArrows() { - jdiAssert(element().showsArrows(), Matchers.is(false), "Element shows arrows"); + jdiAssert(element().showsArrows(), Matchers.is(false), "Tab shows arrows"); return this; } } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/WindowsAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/WindowsAssert.java index ebd78ed554..86bd24042d 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/WindowsAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/WindowsAssert.java @@ -9,50 +9,43 @@ import static com.epam.jdi.light.asserts.core.SoftAssert.jdiAssert; public class WindowsAssert extends UIAssert implements ThemeAssert { - @JDIAction("Assert that '{name}' shows arrows on hover") + @JDIAction(value = "Assert that '{name}' shows arrows on hover", isAssert = true) public WindowsAssert showArrowsOnHover() { - jdiAssert(element().showArrowsOnHover(), Matchers.is(true), "Element doesn't show arrows on hover"); + jdiAssert(element().showArrowsOnHover(), Matchers.is(true), "Window doesn't show arrows on hover"); return this; } - @JDIAction("Assert that '{name}' doesn't show arrows on hover") + @JDIAction(value = "Assert that '{name}' doesn't show arrows on hover", isAssert = true) public WindowsAssert notShowArrowsOnHover() { - jdiAssert(element().showArrowsOnHover(), Matchers.is(false), "Element shows arrows on hover"); + jdiAssert(element().showArrowsOnHover(), Matchers.is(false), "Window shows arrows on hover"); return this; } - @JDIAction("Assert that '{name}' has no next actions button") - public WindowsAssert noNextActionsButton() { - jdiAssert(element().nextButton().isNotExist(), Matchers.is(false), "Element's next actions " + - "button exists"); - return this; - } - - @JDIAction("Assert that '{name}' has previous button") + @JDIAction(value = "Assert that '{name}' has previous button", isAssert = true) public WindowsAssert previousButton() { - jdiAssert(element().previousButton().isExist(), Matchers.is(true), "Element's previous " + - "button doesn't exist"); + jdiAssert(element().previousButton().isExist(), Matchers.is(true), + "Window's previous button doesn't exist"); return this; } - @JDIAction("Assert that '{name}' has no previous button") + @JDIAction(value = "Assert that '{name}' has no previous button", isAssert = true) public WindowsAssert noPreviousButton() { - jdiAssert(element().previousButton().isExist(), Matchers.is(false), "Element's previous " + - "button exists"); + jdiAssert(element().previousButton().isExist(), Matchers.is(false), + "Window's previous button exists"); return this; } - @JDIAction("Assert that '{name}' has next button") + @JDIAction(value = "Assert that '{name}' has next button", isAssert = true) public WindowsAssert nextButton() { - jdiAssert(element().nextButton().isExist(), Matchers.is(true), "Element's next " + - "button doesn't exist"); + jdiAssert(element().nextButton().isExist(), Matchers.is(true), + "Window's next button doesn't exist"); return this; } - @JDIAction("Assert that '{name}' has no next button") + @JDIAction(value = "Assert that '{name}' has no next button", isAssert = true) public WindowsAssert noNextButton() { - jdiAssert(element().nextButton().isExist(), Matchers.is(false), "Element's next " + - "button exists"); + jdiAssert(element().nextButton().isExist(), Matchers.is(false), + "Window's next button exists"); return this; } } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/bars/AppBarAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/bars/AppBarAssert.java index 3b8b024a9c..d9ee9608b1 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/bars/AppBarAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/bars/AppBarAssert.java @@ -7,113 +7,112 @@ import static com.epam.jdi.light.asserts.core.SoftAssert.jdiAssert; public class AppBarAssert extends BasicBarAssert { - @JDIAction("Assert that '{name}' is collapsible") + @JDIAction(value = "Assert that '{name}' is collapsible", isAssert = true) public AppBarAssert collapsible() { - jdiAssert(element().isCollapsible(), Matchers.is(true), "Element is not collapsible"); + jdiAssert(element().isCollapsible(), Matchers.is(true), "AppBar is not collapsible"); return this; } - @JDIAction("Assert that '{name}' is not collapsible") + @JDIAction(value = "Assert that '{name}' is not collapsible", isAssert = true) public AppBarAssert notCollapsible() { - jdiAssert(element().isCollapsible(), Matchers.is(false), "Element is collapsible"); + jdiAssert(element().isCollapsible(), Matchers.is(false), "AppBar is collapsible"); return this; } - @JDIAction("Assert that '{name}' has image fading on scroll") + @JDIAction(value = "Assert that '{name}' has image fading on scroll", isAssert = true) public AppBarAssert imageFadingOnScroll() { - jdiAssert(element().hasImageFadingOnScroll(), Matchers.is(true), "Element has no image fading " + + jdiAssert(element().hasImageFadingOnScroll(), Matchers.is(true), "AppBar has no image fading " + "on scroll"); return this; } - @JDIAction("Assert that '{name}' is on top position") + @JDIAction(value = "Assert that '{name}' is on top position", isAssert = true) public AppBarAssert onTopPosition() { - jdiAssert(element().isOnTopPosition(), Matchers.is(true), "Element is not scrolled on top"); + jdiAssert(element().isOnTopPosition(), Matchers.is(true), "AppBar is not on top position"); return this; } - @JDIAction("Assert that '{name}' is on bottom position") + @JDIAction(value = "Assert that '{name}' is on bottom position", isAssert = true) public AppBarAssert onBottomPosition() { - jdiAssert(element().isOnBottomPosition(), Matchers.is(true), "Element is not scrolled till bottom"); + jdiAssert(element().isOnBottomPosition(), Matchers.is(true), "AppBar is not on bottom position"); return this; } - @JDIAction("Assert that '{name}' has no image fading on scroll") + @JDIAction(value = "Assert that '{name}' has no image fading on scroll", isAssert = true) public AppBarAssert noImageFadingOnScroll() { - jdiAssert(element().hasImageFadingOnScroll(), Matchers.is(false), "Element has image fading on " + - "scroll"); + jdiAssert(element().hasImageFadingOnScroll(), Matchers.is(false), "AppBar has image fading on scroll"); return this; } - @JDIAction("Assert that '{name}' is prominent") + @JDIAction(value = "Assert that '{name}' is prominent", isAssert = true) public AppBarAssert prominent() { - jdiAssert(element().isProminent(), Matchers.is(true), "Element is not prominent"); + jdiAssert(element().isProminent(), Matchers.is(true), "AppBar is not prominent"); return this; } - @JDIAction("Assert that '{name}' is not prominent") + @JDIAction(value = "Assert that '{name}' is not prominent", isAssert = true) public AppBarAssert notProminent() { - jdiAssert(element().isProminent(), Matchers.is(false), "Element is prominent"); + jdiAssert(element().isProminent(), Matchers.is(false), "AppBar is prominent"); return this; } - @JDIAction("Assert that '{name}' is elevate on scroll") + @JDIAction(value = "Assert that '{name}' is elevate on scroll", isAssert = true) public AppBarAssert elevateOnScroll() { - jdiAssert(element().isElevateOnScroll(), Matchers.is(true), "Element is not elevate on scroll"); + jdiAssert(element().isElevateOnScroll(), Matchers.is(true), "AppBar is not elevate on scroll"); return this; } - @JDIAction("Assert that '{name}' is not elevate on scroll") + @JDIAction(value = "Assert that '{name}' is not elevate on scroll", isAssert = true) public AppBarAssert notElevateOnScroll() { - jdiAssert(element().isElevateOnScroll(), Matchers.is(false), "Element is elevate on scroll"); + jdiAssert(element().isElevateOnScroll(), Matchers.is(false), "AppBar is elevate on scroll"); return this; } - @JDIAction("Assert that '{name}' is scrolled") + @JDIAction(value = "Assert that '{name}' is scrolled", isAssert = true) public AppBarAssert scrolled() { - jdiAssert(element().isScrolled(), Matchers.is(true), "Element is not scrolled"); + jdiAssert(element().isScrolled(), Matchers.is(true), "AppBar is not scrolled"); return this; } - @JDIAction("Assert that '{name}' is not scrolled") + @JDIAction(value = "Assert that '{name}' is not scrolled", isAssert = true) public AppBarAssert notScrolled() { - jdiAssert(element().isScrolled(), Matchers.is(false), "Element is scrolled"); + jdiAssert(element().isScrolled(), Matchers.is(false), "AppBar is scrolled"); return this; } - @JDIAction("Assert that '{name}' has background image") + @JDIAction(value = "Assert that '{name}' has background image", isAssert = true) public AppBarAssert backgroundImage() { - jdiAssert(element().hasBackgroundImage(), Matchers.is(true), "Element has no background image"); + jdiAssert(element().hasBackgroundImage(), Matchers.is(true), "AppBar has no background image"); return this; } - @JDIAction("Assert that '{name}' has no background image") + @JDIAction(value = "Assert that '{name}' has no background image", isAssert = true) public AppBarAssert noBackgroundImage() { - jdiAssert(element().hasBackgroundImage(), Matchers.is(false), "Element has background image"); + jdiAssert(element().hasBackgroundImage(), Matchers.is(false), "AppBar has background image"); return this; } - @JDIAction("Assert that '{name}' shrinks on scroll") + @JDIAction(value = "Assert that '{name}' shrinks on scroll", isAssert = true) public AppBarAssert shrinkOnScroll() { - jdiAssert(element().isShrinkOnScroll(), Matchers.is(true), "Element doesn't shrink on scroll"); + jdiAssert(element().isShrinkOnScroll(), Matchers.is(true), "AppBar doesn't shrink on scroll"); return this; } - @JDIAction("Assert that '{name}' doesn't shrink on scroll") + @JDIAction(value = "Assert that '{name}' doesn't shrink on scroll", isAssert = true) public AppBarAssert notShrinkOnScroll() { - jdiAssert(element().isShrinkOnScroll(), Matchers.is(false), "Element shrinks on scroll"); + jdiAssert(element().isShrinkOnScroll(), Matchers.is(false), "AppBar shrinks on scroll"); return this; } - @JDIAction("Assert that '{name}' bar is short") + @JDIAction(value = "Assert that '{name}' bar is short", isAssert = true) public AppBarAssert isShort() { - jdiAssert(element().isBarShort(), Matchers.is(true), "Current bar expected to be short!"); + jdiAssert(element().isBarShort(), Matchers.is(true), "AppBar expected is not short"); return this; } - @JDIAction("Assert that '{name}' bar has usual size") + @JDIAction(value = "Assert that '{name}' bar has usual size", isAssert = true) public AppBarAssert isUsualSize() { - jdiAssert(element().isBarUsualSize(), Matchers.is(true), "Current bar expected to be usual size!"); + jdiAssert(element().isBarUsualSize(), Matchers.is(true), "AppBar expected doesn't have usual size"); return this; } } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/bars/BasicBarAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/bars/BasicBarAssert.java index 9b946eee59..5deedfed4b 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/bars/BasicBarAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/bars/BasicBarAssert.java @@ -11,7 +11,6 @@ import com.epam.jdi.light.vuetify.interfaces.asserts.RoundedAssert; import com.epam.jdi.light.vuetify.interfaces.asserts.ShapedAssert; import com.epam.jdi.light.vuetify.interfaces.asserts.ThemeAssert; -import com.jdiai.tools.Timer; import org.hamcrest.Matchers; import static com.epam.jdi.light.asserts.core.SoftAssert.jdiAssert; @@ -20,68 +19,66 @@ public class BasicBarAssert, T extends BasicBar, FlatAssert, DenseAssert, ShapedAssert, OutlinedAssert, ElevationAssert, ThemeAssert, RoundedAssert { - @JDIAction("Assert that '{name}' is displayed") + @JDIAction(value = "Assert that '{name}' is displayed", isAssert = true) public A displayed() { - Timer.waitCondition(element()::isDisplayed); - element().show(); jdiAssert(element().isDisplayed(), Matchers.is(true), "Bar is not displayed"); return (A) this; } - @JDIAction("Assert that '{name}' has expected text") + @JDIAction(value = "Assert that '{name}' has expected text", isAssert = true) public A text(String text) { jdiAssert(element().getText(), Matchers.containsString(text)); return (A) this; } - @JDIAction("Assert that '{name}' is collapsed") + @JDIAction(value = "Assert that '{name}' is collapsed", isAssert = true) public A collapsed() { - jdiAssert(element().isCollapsed() ? "is collapsed" : "is expanded", - Matchers.is("is collapsed")); + jdiAssert(element().isCollapsed(), + Matchers.is(true), "Bar is not collapsed"); return (A) this; } - @JDIAction("Assert that '{name}' is expanded") + @JDIAction(value = "Assert that '{name}' is expanded", isAssert = true) public A expanded() { - jdiAssert(element().isExpanded() ? "is expanded" : "is collapsed", - Matchers.is("is expanded")); + jdiAssert(element().isExpanded(), + Matchers.is(true), "Bar is not expanded"); return (A) this; } - @JDIAction("Assert that '{name}' is extended") + @JDIAction(value = "Assert that '{name}' is extended", isAssert = true) public A extended() { - jdiAssert(element().isExtended(), Matchers.is(true), "Toolbar is not extended"); + jdiAssert(element().isExtended(), Matchers.is(true), "Bar is not extended"); return (A) this; } - @JDIAction("Assert that '{name}' is not extended") + @JDIAction(value = "Assert that '{name}' is not extended", isAssert = true) public A notExtended() { - jdiAssert(element().isExtended(), Matchers.is(false), "Toolbar is extended"); + jdiAssert(element().isExtended(), Matchers.is(false), "Bar is extended"); return (A) this; } - @JDIAction("Assert that '{name}' is floating") + @JDIAction(value = "Assert that '{name}' is floating", isAssert = true) public A floating() { - jdiAssert(element().isFloating(), Matchers.is(true), "Toolbar is not floating"); + jdiAssert(element().isFloating(), Matchers.is(true), "Bar is not floating"); return (A) this; } - @JDIAction("Assert that '{name}' is not floating") + @JDIAction(value = "Assert that '{name}' is not floating", isAssert = true) public A notFloating() { - jdiAssert(element().isFloating(), Matchers.is(false), "Toolbar is floating"); + jdiAssert(element().isFloating(), Matchers.is(false), "Bar is floating"); return (A) this; } - @JDIAction("Assert that '{name}' is prominent") + @JDIAction(value = "Assert that '{name}' is prominent", isAssert = true) public A prominent() { - jdiAssert(element().isProminent(), Matchers.is(true), "Toolbar is not prominent"); + jdiAssert(element().isProminent(), Matchers.is(true), "Bar is not prominent"); return (A) this; } - @JDIAction("Assert that '{name}' is not prominent") + @JDIAction(value = "Assert that '{name}' is not prominent", isAssert = true) public A notProminent() { - jdiAssert(element().isProminent(), Matchers.is(false), "Toolbar is prominent"); + jdiAssert(element().isProminent(), Matchers.is(false), "Bar is prominent"); return (A) this; } } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/bars/SystemBarAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/bars/SystemBarAssert.java index 3faf16bdcf..4da52b9189 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/bars/SystemBarAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/bars/SystemBarAssert.java @@ -10,27 +10,27 @@ public class SystemBarAssert extends BasicBarAssert implements MeasurementAssert { - @JDIAction("Assert that '{name}' is lights out") + @JDIAction(value = "Assert that '{name}' is lights out", isAssert = true) public SystemBarAssert lightsOut() { - jdiAssert(element().isLightsOut(), Matchers.is(true), "Element is not lights out"); + jdiAssert(element().isLightsOut(), Matchers.is(true), "SystemBar is not lights out"); return this; } - @JDIAction("Assert that '{name}' is not lights out") + @JDIAction(value = "Assert that '{name}' is not lights out", isAssert = true) public SystemBarAssert notLightsOut() { - jdiAssert(element().isLightsOut(), Matchers.is(false), "Element is lights out"); + jdiAssert(element().isLightsOut(), Matchers.is(false), "SystemBar is lights out"); return this; } - @JDIAction("Assert that '{name}' is window") + @JDIAction(value = "Assert that '{name}' is window", isAssert = true) public SystemBarAssert window() { - jdiAssert(element().isWindow(), Matchers.is(true), "Element is not window"); + jdiAssert(element().isWindow(), Matchers.is(true), "SystemBar is not window"); return this; } - @JDIAction("Assert that '{name}' is not window") + @JDIAction(value = "Assert that '{name}' is not window", isAssert = true) public SystemBarAssert notWindow() { - jdiAssert(element().isWindow(), Matchers.is(false), "Element is window"); + jdiAssert(element().isWindow(), Matchers.is(false), "SystemBar is window"); return this; } } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/bars/ToolBarAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/bars/ToolBarAssert.java index d0b90cb46f..ba8cc72b8e 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/bars/ToolBarAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/bars/ToolBarAssert.java @@ -7,15 +7,15 @@ import static com.epam.jdi.light.asserts.core.SoftAssert.jdiAssert; public class ToolBarAssert extends BasicBarAssert { - @JDIAction("Assert that '{name}' has background image") + @JDIAction(value = "Assert that '{name}' has background image", isAssert = true) public ToolBarAssert backgroundImage() { - jdiAssert(element().hasBackgroundImage(), Matchers.is(true), "Element has not background image"); + jdiAssert(element().hasBackgroundImage(), Matchers.is(true), "ToolBar has not background image"); return this; } - @JDIAction("Assert that '{name}' has not background image") + @JDIAction(value = "Assert that '{name}' has not background image", isAssert = true) public ToolBarAssert notBackgroundImage() { - jdiAssert(element().hasBackgroundImage(), Matchers.is(false), "Element has background image"); + jdiAssert(element().hasBackgroundImage(), Matchers.is(false), "ToolBar has background image"); return this; } } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/breadcrumbs/BreadcrumbAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/breadcrumbs/BreadcrumbAssert.java index e232b34476..83f31c6551 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/breadcrumbs/BreadcrumbAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/breadcrumbs/BreadcrumbAssert.java @@ -8,13 +8,11 @@ import static com.epam.jdi.light.asserts.core.SoftAssert.jdiAssert; -public class BreadcrumbAssert extends UIAssert implements ITextAssert { +public class BreadcrumbAssert extends UIAssert implements ITextAssert { @Override - @JDIAction("Assert that '{name}' has text '{0}'") - public BreadcrumbAssert text(Matcher condition) { - String actualText = element().getText(); - jdiAssert(actualText, condition, String.format("Element's actual text '%s' is not equal to expected '%s'", - actualText, condition)); + @JDIAction(value = "Assert that '{name}' has text '{0}'", isAssert = true) + public BreadcrumbAssert text(Matcher condition) { + jdiAssert(element().getText(), condition); return this; } } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/breadcrumbs/BreadcrumbsAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/breadcrumbs/BreadcrumbsAssert.java index 97c8b46074..46650b1e46 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/breadcrumbs/BreadcrumbsAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/breadcrumbs/BreadcrumbsAssert.java @@ -10,33 +10,33 @@ public class BreadcrumbsAssert extends UIAssert implements ThemeAssert { - @JDIAction("Assert that '{0}' dividers satisfy a predicate '{1}'") + @JDIAction(value = "Assert that '{0}' dividers satisfy a predicate '{1}'", isAssert = true) public BreadcrumbsAssert dividerType(String symbol) { element().dividers().forEach(e -> jdiAssert(e.text().equals(symbol), Matchers.is(true), String.format( "Actual divider type '%s' is not equal to expected '%s'", e.text(), symbol))); return this; } - @JDIAction("Assert that '{0}' dividers satisfy a predicate '{1}'") + @JDIAction(value = "Assert that '{0}' dividers satisfy a predicate '{1}'", isAssert = true) public BreadcrumbsAssert iconDivider(String iconClass) { element().dividers().forEach(e -> jdiAssert(e.find("i").hasClass(iconClass), Matchers.is(true), String.format( "Actual divider type '%s' is not equal to expected '%s'", e.text(), iconClass))); return this; } - @JDIAction("Assert that '{name}' is large") + @JDIAction(value = "Assert that '{name}' is large", isAssert = true) public BreadcrumbsAssert large() { - jdiAssert(element().isLarge(), Matchers.is(true), "Element is not large"); + jdiAssert(element().isLarge(), Matchers.is(true), "Breadcrumps is not large"); return this; } - @JDIAction("Assert that '{name}' is not large") + @JDIAction(value = "Assert that '{name}' is not large", isAssert = true) public BreadcrumbsAssert notLarge() { - jdiAssert(element().isLarge(), Matchers.is(false), "Element is large"); + jdiAssert(element().isLarge(), Matchers.is(false), "Breadcrumps is large"); return this; } - @JDIAction("Assert that '{name}' size is {0}") + @JDIAction(value = "Assert that '{name}' size is {0}", isAssert = true) public BreadcrumbsAssert size(int size) { jdiAssert(element().list().size(), Matchers.is(size)); return this; diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/panels/ExpansionPanelAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/panels/ExpansionPanelAssert.java index aa11d0988b..5826194b1e 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/panels/ExpansionPanelAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/panels/ExpansionPanelAssert.java @@ -11,44 +11,42 @@ public class ExpansionPanelAssert extends UIAssert implements ColorAssert { - @JDIAction("Assert that '{name}' is expanded") + @JDIAction(value = "Assert that '{name}' is expanded", isAssert = true) public ExpansionPanelAssert expanded() { - jdiAssert(element().isExpanded(), Matchers.is(true), "Element is closed"); + jdiAssert(element().isExpanded(), Matchers.is(true), "ExpansionPanel is closed"); return this; } - @JDIAction("Assert that '{name}' is closed") + @JDIAction(value = "Assert that '{name}' is closed", isAssert = true) public ExpansionPanelAssert closed() { - jdiAssert(element().isExpanded(), Matchers.is(false), "Element is expanded"); + jdiAssert(element().isExpanded(), Matchers.is(false), "ExpansionPanel is expanded"); return this; } - @JDIAction("Assert that '{name}' has content font color '{0}'") + @JDIAction(value = "Assert that '{name}' has content font color '{0}'", isAssert = true) public ExpansionPanelAssert contentColor(String color) { String actualContentColor = element().contentColor(); - jdiAssert(actualContentColor, Matchers.equalTo(color), String.format("Actual element's content font color " + - "'%s' is not equal to expected '%s'", actualContentColor, color)); + jdiAssert(element().contentColor(), Matchers.equalTo(color)); return this; } - @JDIAction("Assert that '{name}' has content background color '{0}'") + @JDIAction(value = "Assert that '{name}' has content background color '{0}'", isAssert = true) public ExpansionPanelAssert contentBackgroundColor(String color) { String contentBackgroundColor = element().contentBackgroundColor(); - jdiAssert(contentBackgroundColor, Matchers.equalTo(color), String.format("Actual element's content " + - "background color '%s' is not equal to expected '%s'", contentBackgroundColor, color)); + jdiAssert(element().contentBackgroundColor(), Matchers.equalTo(color)); return this; } - @JDIAction("Assert that '{name}' has icon disable rotate") + @JDIAction(value = "Assert that '{name}' has icon disable rotate", isAssert = true) public ExpansionPanelAssert iconDisableRotate() { - jdiAssert(element().hasIconDisableRotate(), Matchers.is(true), "Element's icon rotation is not " + + jdiAssert(element().hasIconDisableRotate(), Matchers.is(true), "ExpansionPanel's icon rotation is not " + "disabled"); return this; } - @JDIAction("Assert that '{name}' icon rotation is not disabled") + @JDIAction(value = "Assert that '{name}' icon rotation is not disabled", isAssert = true) public ExpansionPanelAssert notIconDisableRotate() { - jdiAssert(element().hasIconDisableRotate(), Matchers.is(false), "Element's icon rotation is " + + jdiAssert(element().hasIconDisableRotate(), Matchers.is(false), "ExpansionPanel's icon rotation is " + "disabled"); return this; } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/panels/ExpansionPanelsAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/panels/ExpansionPanelsAssert.java index 7a8f9c2b93..86366ab281 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/panels/ExpansionPanelsAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/panels/ExpansionPanelsAssert.java @@ -13,51 +13,51 @@ public class ExpansionPanelsAssert extends UISelectAssert implements ThemeAssert, FlatAssert, TileAssert { - @JDIAction("Assert that '{name}' is accordion") + @JDIAction(value = "Assert that '{name}' is accordion", isAssert = true) public ExpansionPanelsAssert accordion() { - jdiAssert(element().isAccordion(), Matchers.is(true), "Element is not accordion"); + jdiAssert(element().isAccordion(), Matchers.is(true), "ExpansionPanel is not accordion"); return this; } - @JDIAction("Assert that '{name}' is not accordion") + @JDIAction(value = "Assert that '{name}' is not accordion", isAssert = true) public ExpansionPanelsAssert notAccordion() { - jdiAssert(element().isAccordion(), Matchers.is(false), "Element is accordion"); + jdiAssert(element().isAccordion(), Matchers.is(false), "ExpansionPanel is accordion"); return this; } - @JDIAction("Assert that '{name}' is focusable") + @JDIAction(value = "Assert that '{name}' is focusable", isAssert = true) public ExpansionPanelsAssert focusable() { - jdiAssert(element().isFocusable(), Matchers.is(true), "Element is not focusable"); + jdiAssert(element().isFocusable(), Matchers.is(true), "ExpansionPanel is not focusable"); return this; } - @JDIAction("Assert that '{name}' is not focusable") + @JDIAction(value = "Assert that '{name}' is not focusable", isAssert = true) public ExpansionPanelsAssert notFocusable() { - jdiAssert(element().isFocusable(), Matchers.is(false), "Element is focusable"); + jdiAssert(element().isFocusable(), Matchers.is(false), "ExpansionPanel is focusable"); return this; } - @JDIAction("Assert that '{name}' is inset") + @JDIAction(value = "Assert that '{name}' is inset", isAssert = true) public ExpansionPanelsAssert inset() { - jdiAssert(element().isInset(), Matchers.is(true), "Element is not inset"); + jdiAssert(element().isInset(), Matchers.is(true), "ExpansionPanel is not inset"); return this; } - @JDIAction("Assert that '{name}' is not inset") + @JDIAction(value = "Assert that '{name}' is not inset", isAssert = true) public ExpansionPanelsAssert notInset() { - jdiAssert(element().isInset(), Matchers.is(false), "Element is inset"); + jdiAssert(element().isInset(), Matchers.is(false), "ExpansionPanel is inset"); return this; } - @JDIAction("Assert that '{name}' is popout") + @JDIAction(value = "Assert that '{name}' is popout", isAssert = true) public ExpansionPanelsAssert popout() { - jdiAssert(element().isPopout(), Matchers.is(true), "Element is not popout"); + jdiAssert(element().isPopout(), Matchers.is(true), "ExpansionPanel is not popout"); return this; } - @JDIAction("Assert that '{name}' is not popout") + @JDIAction(value = "Assert that '{name}' is not popout", isAssert = true) public ExpansionPanelsAssert notPopout() { - jdiAssert(element().isPopout(), Matchers.is(false), "Element is popout"); + jdiAssert(element().isPopout(), Matchers.is(false), "ExpansionPanel is popout"); return this; } } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/radiobuttons/RadioButtonAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/radiobuttons/RadioButtonAssert.java index 045102b0ae..9f814f36a2 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/radiobuttons/RadioButtonAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/radiobuttons/RadioButtonAssert.java @@ -12,45 +12,45 @@ public class RadioButtonAssert extends UIAssert implements ColorAssert, ThemeAssert { @Override - @JDIAction("Assert that '{name}' is disabled") + @JDIAction(value = "Assert that '{name}' is disabled", isAssert = true) public RadioButtonAssert disabled() { - jdiAssert(element().isDisabled(), Matchers.is(true), "Element is enabled"); + jdiAssert(element().isDisabled(), Matchers.is(true), "RadioButton is enabled"); return this; } @Override - @JDIAction("Assert that '{name}' is disabled") + @JDIAction(value = "Assert that '{name}' is disabled", isAssert = true) public RadioButtonAssert enabled() { - jdiAssert(element().isDisabled(), Matchers.is(false), "Element is disabled"); + jdiAssert(element().isDisabled(), Matchers.is(false), "RadioButton is disabled"); return this; } - @JDIAction("Assert that '{name}' label has color '{0}'") + @JDIAction(value = "Assert that '{name}' label has color '{0}'", isAssert = true) public RadioButtonAssert labelColor(String color) { String actualColor = element().labelColor(); jdiAssert(actualColor, Matchers.is(color)); return this; } - @JDIAction("Assert that '{name}' is success") + @JDIAction(value = "Assert that '{name}' is success", isAssert = true) public RadioButtonAssert success() { jdiAssert(element().isSuccess(), Matchers.is(true), "Element is not success"); return this; } - @JDIAction("Assert that '{name}' is not success") + @JDIAction(value = "Assert that '{name}' is not success", isAssert = true) public RadioButtonAssert notSuccess() { jdiAssert(element().isSuccess(), Matchers.is(false), "Element is success"); return this; } - @JDIAction("Assert that '{name}' is error") + @JDIAction(value = "Assert that '{name}' is error", isAssert = true) public RadioButtonAssert error() { jdiAssert(element().isError(), Matchers.is(true), "Element is not error"); return this; } - @JDIAction("Assert that '{name}' is not error") + @JDIAction(value = "Assert that '{name}' is not error", isAssert = true) public RadioButtonAssert notError() { jdiAssert(element().isError(), Matchers.is(false), "Element is error"); return this; diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/radiobuttons/RadioButtonsAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/radiobuttons/RadioButtonsAssert.java index 44700c7848..7aba68a86f 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/radiobuttons/RadioButtonsAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/radiobuttons/RadioButtonsAssert.java @@ -18,11 +18,9 @@ public class RadioButtonsAssert extends UISelectAssert, ReadOnlyAssert, DenseAssert, MessagesAssert { - @JDIAction("Assert that '{name}' label has color '{0}'") + @JDIAction(value = "Assert that '{name}' label has color '{0}'", isAssert = true) public RadioButtonsAssert labelColor(String color) { - String actualColor = element().labelColor(); - jdiAssert(actualColor, Matchers.is(color), - String.format("Actual label color of element is '%s', but expected '%s'", actualColor, color)); + jdiAssert(element().labelColor(), Matchers.is(color)); return this; } } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/steppers/StepAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/steppers/StepAssert.java index 6c14500367..4f964b102a 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/steppers/StepAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/steppers/StepAssert.java @@ -10,63 +10,55 @@ public class StepAssert extends UIAssert implements ColorAssert { - @JDIAction("Assert that '{name}' is active") + @JDIAction(value = "Assert that '{name}' is active", isAssert = true) public StepAssert active() { jdiAssert(element().isActive(), Matchers.is(true), "Step is not active"); return this; } - @JDIAction("Assert that '{name}' is not active") + @JDIAction(value = "Assert that '{name}' is not active", isAssert = true) public StepAssert notActive() { jdiAssert(element().isActive(), Matchers.is(false), "Step is active"); return this; } - @JDIAction("Assert that '{name}' is complete") + @JDIAction(value = "Assert that '{name}' is complete", isAssert = true) public StepAssert complete() { jdiAssert(element().isComplete(), Matchers.is(true), "Step is not complete"); return this; } - @JDIAction("Assert that '{name}' is not complete") + @JDIAction(value = "Assert that '{name}' is not complete", isAssert = true) public StepAssert notComplete() { jdiAssert(element().isComplete(), Matchers.is(false), "Step is complete"); return this; } - @JDIAction("Assert that '{name}' is editable") + @JDIAction(value = "Assert that '{name}' is editable", isAssert = true) public StepAssert editable() { jdiAssert(element().isEditable(), Matchers.is(true), "Step is not editable"); return this; } - @JDIAction("Assert that '{name}' is not editable") + @JDIAction(value = "Assert that '{name}' is not editable", isAssert = true) public StepAssert notEditable() { jdiAssert(element().isEditable(), Matchers.is(false), "Step is editable"); return this; } - @JDIAction("Assert that '{name}' text is {0}") + @JDIAction(value = "Assert that '{name}' text is {0}", isAssert = true) public StepAssert text(String currentText) { jdiAssert(element().getName(), Matchers.is(currentText)); return this; } - // TODO: Check this method - @JDIAction("Assert that '{name}' contains {0}") - public StepAssert contains(String locator) { - jdiAssert(element().core().getAttribute("class").contains(locator), - Matchers.is(true), "Step doesn't contain element with locator " + locator); - return this; - } - - @JDIAction("Assert that '{name}' step has error") + @JDIAction(value = "Assert that '{name}' step has error", isAssert = true) public StepAssert error() { jdiAssert(element().hasError(), Matchers.is(true), "Step has no error"); return this; } - @JDIAction("Assert that '{name}' step has error") + @JDIAction(value = "Assert that '{name}' step has error", isAssert = true) public StepAssert noError() { jdiAssert(element().hasError(), Matchers.is(false), "Step has an error"); return this; diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/steppers/StepperAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/steppers/StepperAssert.java index a642ccaa41..7a3f028add 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/steppers/StepperAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/steppers/StepperAssert.java @@ -23,27 +23,27 @@ public class StepperAssert extends UIAssert implements RoundedAssert, ShapedAssert, TileAssert { - @JDIAction("Assert that '{name}' is non-linear") + @JDIAction(value = "Assert that '{name}' is non-linear", isAssert = true) public StepperAssert nonLinear() { - jdiAssert(element().isNonLinear(), Matchers.is(true), "Element is linear"); + jdiAssert(element().isNonLinear(), Matchers.is(true), "Stepper is linear"); return this; } - @JDIAction("Assert that '{name}' is linear") + @JDIAction(value = "Assert that '{name}' is linear", isAssert = true) public StepperAssert linear() { - jdiAssert(element().isNonLinear(), Matchers.is(false), "Element is non-linear"); + jdiAssert(element().isNonLinear(), Matchers.is(false), "Stepper is non-linear"); return this; } - @JDIAction("Assert that '{name}' has alt label") + @JDIAction(value = "Assert that '{name}' has alt label", isAssert = true) public StepperAssert altLabel() { - jdiAssert(element().hasAltLabel(), Matchers.is(true), "Element has not alt label"); + jdiAssert(element().hasAltLabel(), Matchers.is(true), "Stepper has not alt label"); return this; } - @JDIAction("Assert that '{name}' has not alt label") + @JDIAction(value = "Assert that '{name}' has not alt label", isAssert = true) public StepperAssert notAltLabel() { - jdiAssert(element().hasAltLabel(), Matchers.is(false), "Element has alt label"); + jdiAssert(element().hasAltLabel(), Matchers.is(false), "Stepper has alt label"); return this; } } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/tables/DataIteratorAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/tables/DataIteratorAssert.java index f67201a645..6eba808fae 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/tables/DataIteratorAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/tables/DataIteratorAssert.java @@ -10,19 +10,19 @@ public class DataIteratorAssert extends UIAssert { - @JDIAction("Assert that '{name}' has required number of columns per page") + @JDIAction(value = "Assert that '{name}' has required number of columns per page", isAssert = true) public DataIteratorAssert numberOfElements(int n) { jdiAssert(element().elements().size(), Matchers.is(n)); return this; } - @JDIAction("Assert that '{name}' has text '{0}' inside") + @JDIAction(value = "Assert that '{name}' has text '{0}' inside", isAssert = true) public DataIteratorAssert text(String value) { this.text(Matchers.is(value)); return this; } - @JDIAction("Assert that '{name}' has text '{0}' inside") + @JDIAction(value = "Assert that '{name}' has text '{0}' inside", isAssert = true) public DataIteratorAssert text(Matcher validation) { jdiAssert(element().content().text(), validation); return this; diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/tables/DataTableAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/tables/DataTableAssert.java index 571553fd07..4c8456a36e 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/tables/DataTableAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/tables/DataTableAssert.java @@ -31,19 +31,19 @@ public DataTableAssert waitFor() { return this.is(); } - @JDIAction("Assert that {name} element has required name") + @JDIAction(value = "Assert that {name} element has required name", isAssert = true) public DataTableAssert elementName(int elNum, String elName) { jdiAssert(element().getColumn(1).get(elNum).getText(), Matchers.is(elName)); return this; } - @JDIAction("Assert that {name} has required value") + @JDIAction(value = "Assert that {name} has required value", isAssert = true) public DataTableAssert elementValue(int colNum, int elNum, String elName) { jdiAssert(element().webCell(colNum, elNum).text(), Matchers.is(elName)); return this; } - @JDIAction("Assert that {name} columns are sorted by {0}") + @JDIAction(value = "Assert that {name} columns are sorted by {0}", isAssert = true) public DataTableAssert sortedBy(String column) { jdiAssert( element().isSortedBy(column), @@ -53,68 +53,68 @@ public DataTableAssert sortedBy(String column) { return this; } - @JDIAction("Assert that {name} aren't sorted by column {0}") + @JDIAction(value = "Assert that {name} aren't sorted by column {0}", isAssert = true) public DataTableAssert notSortedBy(String value) { jdiAssert(element().isSortedBy(value), Matchers.is(false), "Table is sorted by column " + value); return this; } - @JDIAction("Assert that {name} element is selected") + @JDIAction(value = "Assert that {name} element is selected", isAssert = true) public DataTableAssert cellSelected(int colNum, int elNum) { jdiAssert(element().isSelected(colNum, elNum), Matchers.is(true), String.format("Rows %d is not selected", elNum)); return this; } - @JDIAction("Assert that {name} element isn't selected") + @JDIAction(value = "Assert that {name} element isn't selected", isAssert = true) public DataTableAssert cellNotSelected(int colNum, int elNum) { jdiAssert(element().isSelected(colNum, elNum), Matchers.is(false), String.format("Rows %d is selected", elNum)); return this; } - @JDIAction("Assert that {name} column header is {0}") + @JDIAction(value = "Assert that {name} column header is {0}", isAssert = true) public DataTableAssert header(int colNum, String value) { jdiAssert(element().headerUI().get(colNum).text(), Matchers.is(value)); return this; } - @JDIAction("Assert that {name} element is expanded") + @JDIAction(value = "Assert that {name} element is expanded", isAssert = true) public DataTableAssert rowExpanded(int elNum) { jdiAssert(element().isRowExpanded(elNum), Matchers.is(true), String.format("Rows %d is not expanded", elNum)); return this; } - @JDIAction("Assert that {name} element is collapsed") + @JDIAction(value = "Assert that {name} element is collapsed", isAssert = true) public DataTableAssert rowCollapsed(int elNum) { jdiAssert(element().isRowExpanded(elNum), Matchers.is(false), String.format("Rows %d is expanded", elNum)); return this; } - @JDIAction("Assert that {name} group is collapsed") + @JDIAction(value = "Assert that {name} group is collapsed", isAssert = true) public DataTableAssert groupCollapsed(String groupName) { jdiAssert(element().isGroupExpanded(groupName), Matchers.is(false), String.format("Group %s doesn't collapsed", groupName)); return this; } - @JDIAction("Assert that {name} group is expanded") + @JDIAction(value = "Assert that {name} group is expanded", isAssert = true) public DataTableAssert groupExpanded(String groupName) { jdiAssert(element().isGroupExpanded(groupName), Matchers.is(true), String.format("Group %s doesn't expanded", groupName)); return this; } - @JDIAction("Assert that {name} has group") + @JDIAction(value = "Assert that {name} has group", isAssert = true) public DataTableAssert group(String groupName) { jdiAssert(element().hasGroup(groupName), Matchers.is(true), String.format("Group %s doesn't exist", groupName)); return this; } - @JDIAction("Assert that {name} has number of rows per page input field") + @JDIAction(value = "Assert that {name} has number of rows per page input field", isAssert = true) public DataTableAssert numberOfRowsPerPageInput(boolean enabled) { jdiAssert( element().getNumberOfRowsPerPageInput().hasClass("v-icon--disabled"), @@ -124,7 +124,7 @@ public DataTableAssert numberOfRowsPerPageInput(boolean enabled) { return this; } - @JDIAction("Assert that {name} has first page button") + @JDIAction(value = "Assert that {name} has first page button", isAssert = true) public DataTableAssert firstPageButton(boolean enabled) { jdiAssert( element().firstPageButton().isEnabled(), @@ -134,7 +134,7 @@ public DataTableAssert firstPageButton(boolean enabled) { return this; } - @JDIAction("Assert that {name} has previous page button") + @JDIAction(value = "Assert that {name} has previous page button", isAssert = true) public DataTableAssert previousPageButton(boolean enabled) { jdiAssert( element().previousPageButton().isEnabled(), @@ -144,7 +144,7 @@ public DataTableAssert previousPageButton(boolean enabled) { return this; } - @JDIAction("Assert that {name} has next page button") + @JDIAction(value = "Assert that {name} has next page button", isAssert = true) public DataTableAssert nextPageButton(boolean enabled) { jdiAssert( element().nextPageButton().isEnabled(), @@ -154,7 +154,7 @@ public DataTableAssert nextPageButton(boolean enabled) { return this; } - @JDIAction("Assert that {name} has last page button") + @JDIAction(value = "Assert that {name} has last page button", isAssert = true) public DataTableAssert lastPageButton(boolean enabled) { jdiAssert( element().lastPageButton().isEnabled(), @@ -164,7 +164,7 @@ public DataTableAssert lastPageButton(boolean enabled) { return this; } - @JDIAction("Assert {name} current page") + @JDIAction(value = "Assert {name} current page", isAssert = true) public DataTableAssert currentPage(int expectedCurrentPage) { int actualCurrentPage = element().currentPage(); jdiAssert( @@ -174,7 +174,7 @@ public DataTableAssert currentPage(int expectedCurrentPage) { return this; } - @JDIAction("Assert that {name} has footer") + @JDIAction(value = "Assert that {name} has footer", isAssert = true) public DataTableAssert footer(boolean isDisplayed) { jdiAssert( element().footer().isDisplayed(), @@ -184,7 +184,7 @@ public DataTableAssert footer(boolean isDisplayed) { return this; } - @JDIAction("Assert that {name} has header") + @JDIAction(value = "Assert that {name} has header", isAssert = true) public DataTableAssert header(boolean isDisplayed) { jdiAssert( element().header().size(), @@ -194,7 +194,7 @@ public DataTableAssert header(boolean isDisplayed) { return this; } - @JDIAction("Assert that {name} row has values") + @JDIAction(value = "Assert that {name} row has values", isAssert = true) public DataTableAssert rowWithValues(int rowNumber, String... values) { jdiAssert( element().getRowValues(rowNumber), @@ -203,7 +203,7 @@ public DataTableAssert rowWithValues(int rowNumber, String... values) { return this; } - @JDIAction("Assert that {name} sort is enabled for column") + @JDIAction(value = "Assert that {name} sort is enabled for column", isAssert = true) public DataTableAssert sortEnabled(String column, boolean isEnabled) { jdiAssert( element().isSortEnabled(column), @@ -213,7 +213,7 @@ public DataTableAssert sortEnabled(String column, boolean isEnabled) { return this; } - @JDIAction("Assert that {name} sort is required for the table") + @JDIAction(value = "Assert that {name} sort is required for the table", isAssert = true) public DataTableAssert sortRequired(boolean isRequired) { jdiAssert( element().isSortRequired(), @@ -223,20 +223,19 @@ public DataTableAssert sortRequired(boolean isRequired) { return this; } - @JDIAction("Assert that {name} is loading") + @JDIAction(value = "Assert that {name} is loading", isAssert = true) public DataTableAssert loading() { jdiAssert(element().isLoading(), Matchers.is(true), "Table is not loading"); return this; } - @JDIAction("Assert that {name} group has size") + @JDIAction(value = "Assert that {name} group has size", isAssert = true) public DataTableAssert groupSize(String groupName, int expectedSize) { - int actualSize = element().groupedData().getOrDefault(groupName, new ArrayList<>()).size(); - jdiAssert(actualSize, Matchers.is(expectedSize)); + jdiAssert(element().groupedData().getOrDefault(groupName, new ArrayList<>()).size(), Matchers.is(expectedSize)); return this; } - @JDIAction("Assert that {name} has fixed header") + @JDIAction(value = "Assert that {name} has fixed header", isAssert = true) public DataTableAssert fixedHeader(boolean isFixedHeader) { jdiAssert( element().isFixedHeader(), @@ -246,14 +245,14 @@ public DataTableAssert fixedHeader(boolean isFixedHeader) { return this; } - @JDIAction("Assert that '{name}' do not have '{1}' row") + @JDIAction(value = "Assert that '{name}' do not have '{1}' row", isAssert = true) public DataTableAssert noRowInColumn(int columnNum, String rowValue) { jdiAssert(element().getColumn(columnNum).get(rowValue).isExist(), Matchers.is(false), String.format("There is a '%s' in %d column", rowValue, columnNum)); return this; } - @JDIAction("Assert that '{name}' do not have '{1}' row") + @JDIAction(value = "Assert that '{name}' have '{1}' row", isAssert = true) public DataTableAssert rowInColumn(int columnNum, String rowValue) { jdiAssert(element().getColumn(columnNum).get(rowValue).isExist(), Matchers.is(true), String.format("There is no '%s' in %d column", rowValue, columnNum)); diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/tables/SimpleTableAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/tables/SimpleTableAssert.java index 5b00e96aaf..2ba1cbf628 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/tables/SimpleTableAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/tables/SimpleTableAssert.java @@ -16,31 +16,31 @@ public A and() { return (A) this; } - @JDIAction("Assert that {name} has fixed header") + @JDIAction(value = "Assert that {name} has fixed header", isAssert = true) public A fixedHeader() { jdiAssert(element().hasFixedHeader(), Matchers.is(true), "Table's header is not fixed"); return (A) this; } - @JDIAction("Assert that {name} has fixed height") + @JDIAction(value = "Assert that {name} has fixed height", isAssert = true) public A fixedHeight() { jdiAssert(element().hasFixedHeight(), Matchers.is(true), "Table's header doesn't have fixed height"); return (A) this; } - @JDIAction("Assert that {name} first column has required element") + @JDIAction(value = "Assert that {name} first column has required element", isAssert = true) public A cellValue(int colNum, int rowNum, String data) { jdiAssert(element().getCell(colNum, rowNum).getText(), Matchers.is(data)); return (A) this; } - @JDIAction("Assert that {name} column has title") + @JDIAction(value = "Assert that {name} column has title", isAssert = true) public A columnTitle(int colNum, String reqTitle) { jdiAssert(element().header().get(colNum), Matchers.is(reqTitle)); return (A) this; } - @JDIAction("Assert that {name} has {0} height") + @JDIAction(value = "Assert that {name} has {0} height", isAssert = true) public A height(int height) { jdiAssert(element().height(), Matchers.is(height)); return (A) this; diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/timelines/TimeLineAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/timelines/TimeLineAssert.java index 1c636d11e9..092167fc43 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/timelines/TimeLineAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/timelines/TimeLineAssert.java @@ -11,27 +11,27 @@ public class TimeLineAssert extends UISelectAssert implements DenseAssert { - @JDIAction("Assert that '{name}' is align to top") + @JDIAction(value = "Assert that '{name}' is align to top", isAssert = true) public TimeLineAssert alignTop() { - jdiAssert(element().isAlignTop() ? "align to top" : "not align to top", Matchers.is("align to top")); + jdiAssert(element().isAlignTop(), Matchers.is(true), "Timeline is not align to top"); return this; } - @JDIAction("Assert that '{name}' is not align to top") + @JDIAction(value = "Assert that '{name}' is not align to top", isAssert = true) public TimeLineAssert notAlignTop() { - jdiAssert(element().isAlignTop() ? "align to top" : "not align to top", Matchers.is("not align to top")); + jdiAssert(element().isAlignTop(), Matchers.is(false), "Timeline is align to top"); return this; } - @JDIAction("Assert that '{name}' is reversed") + @JDIAction(value = "Assert that '{name}' is reversed", isAssert = true) public TimeLineAssert reversed() { - jdiAssert(element().isReversed() ? "reversed" : "not reversed", Matchers.is("reversed")); + jdiAssert(element().isReversed(), Matchers.is(true), "Timeline is not reversed"); return this; } - @JDIAction("Assert that '{name}' is not reversed") + @JDIAction(value = "Assert that '{name}' is not reversed", isAssert = true) public TimeLineAssert notReversed() { - jdiAssert(element().isReversed() ? "reversed" : "not reversed", Matchers.is("not reversed")); + jdiAssert(element().isReversed(), Matchers.is(false), "Timeline is reversed"); return this; } } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/timelines/TimeLineItemAssert.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/timelines/TimeLineItemAssert.java index cbfd6f8ee2..1aa5440fa3 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/timelines/TimeLineItemAssert.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/timelines/TimeLineItemAssert.java @@ -10,25 +10,25 @@ public class TimeLineItemAssert extends UIAssert { - @JDIAction("Assert that '{name}' is small") + @JDIAction(value = "Assert that '{name}' is small", isAssert = true) public TimeLineItemAssert smallDot() { - jdiAssert(element().isSmall() ? "small" : "not small", Matchers.is("small")); + jdiAssert(element().isSmall(), Matchers.is(true), "TimeLineItem does not have small dot"); return this; } - @JDIAction("Assert that '{name}' is large") + @JDIAction(value = "Assert that '{name}' is large", isAssert = true) public TimeLineItemAssert largeDot() { - jdiAssert(element().isLarge() ? "large" : "not large", Matchers.is("large")); + jdiAssert(element().isLarge(), Matchers.is(true), "TimeLineItem does not have large dot"); return this; } - @JDIAction("Assert that dot color of '{name}' is equal to '{0}'") + @JDIAction(value = "Assert that dot color of '{name}' is equal to '{0}'", isAssert = true) public TimeLineItemAssert dotColor(String color) { jdiAssert(element().dotColor(), equalTo(color)); return this; } - @JDIAction("Assert that dot color of '{name}' is equal to '{0}'") + @JDIAction(value = "Assert that dot color of '{name}' is equal to '{0}'", isAssert = true) public TimeLineItemAssert dotColor(Enum color) { jdiAssert(element().dotColor(), equalTo(color.toString())); return this; diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/elements/complex/ChipGroup.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/elements/complex/ChipGroup.java index 09692d88c9..ef78aab3c2 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/elements/complex/ChipGroup.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/elements/complex/ChipGroup.java @@ -11,7 +11,6 @@ import java.util.Collections; import java.util.List; -import java.util.Set; import java.util.stream.Collectors; public class ChipGroup extends UIBaseElement implements IsGroupElement, HasTheme, HasColor { @@ -76,10 +75,10 @@ public Icon previous() { } @JDIAction("Get '{name}' chips texts") - public Set getTexts() { + public List getTexts() { return groupElements().stream() .map(Chip::getText) - .collect(Collectors.toSet()); + .collect(Collectors.toList()); } @Override diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/elements/complex/Combobox.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/elements/complex/Combobox.java index 8a5404dbb5..19e80b4a25 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/elements/complex/Combobox.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/elements/complex/Combobox.java @@ -357,7 +357,7 @@ public boolean hasCounter() { } @JDIAction("Get if '{name}' has counter") - public String hasCounterValue() { + public String counterValue() { return counter().getText(); } diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/elements/complex/TextField.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/elements/complex/TextField.java index 8d95e658f6..e1056af7cb 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/elements/complex/TextField.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/elements/complex/TextField.java @@ -239,6 +239,11 @@ public String labelText() { return label().getText(); } + @Override + public String placeholder() { + return this.labelText(); + } + @JDIAction("Get if '{name}' has placeholder") public boolean hasPlaceholder() { return core().hasClass("v-text-field--placeholder"); diff --git a/test-examples/jdi-light-examples/src/test/java/io/github/epam/testng/TestNGListener.java b/test-examples/jdi-light-examples/src/test/java/io/github/epam/testng/TestNGListener.java index 2b0f624062..026fc7a578 100644 --- a/test-examples/jdi-light-examples/src/test/java/io/github/epam/testng/TestNGListener.java +++ b/test-examples/jdi-light-examples/src/test/java/io/github/epam/testng/TestNGListener.java @@ -21,7 +21,7 @@ import static java.lang.System.currentTimeMillis; public class TestNGListener implements IInvokedMethodListener { - private Long start = currentTimeMillis(); + private long start = currentTimeMillis(); @Override public void beforeInvocation(IInvokedMethod m, ITestResult tr) { diff --git a/test-examples/jdi-performance/src/test/java/org/mytests/tests/testng/TestNGListener.java b/test-examples/jdi-performance/src/test/java/org/mytests/tests/testng/TestNGListener.java index da210321d2..196afadc6d 100644 --- a/test-examples/jdi-performance/src/test/java/org/mytests/tests/testng/TestNGListener.java +++ b/test-examples/jdi-performance/src/test/java/org/mytests/tests/testng/TestNGListener.java @@ -22,7 +22,7 @@ public class TestNGListener implements IInvokedMethodListener { - private Long start = 0L; + private long start = currentTimeMillis(); @Override public void beforeInvocation(IInvokedMethod m, ITestResult tr) { diff --git a/test-templates/jdi-light-testng-template/src/test/java/org/mytests/tests/testng/TestNGListener.java b/test-templates/jdi-light-testng-template/src/test/java/org/mytests/tests/testng/TestNGListener.java index 53f57d72e5..a28365ae3c 100644 --- a/test-templates/jdi-light-testng-template/src/test/java/org/mytests/tests/testng/TestNGListener.java +++ b/test-templates/jdi-light-testng-template/src/test/java/org/mytests/tests/testng/TestNGListener.java @@ -21,7 +21,7 @@ import static java.lang.System.currentTimeMillis; public class TestNGListener implements IInvokedMethodListener { - private Long start = currentTimeMillis(); + private long start = currentTimeMillis(); @Override public void beforeInvocation(IInvokedMethod m, ITestResult tr) {