1010import com .jdiai .tools .Timer ;
1111import org .hamcrest .Matchers ;
1212
13- import java .util .List ;
1413import java .util .Set ;
1514
1615import static com .epam .jdi .light .asserts .core .SoftAssert .jdiAssert ;
@@ -20,17 +19,13 @@ public class DatePickerMonthAssert extends UIAssert<DatePickerMonthAssert, DateP
2019 ThemeAssert <DatePickerMonthAssert , DatePickerMonth >, ElevationAssert <DatePickerMonthAssert , DatePickerMonth > {
2120 @ JDIAction ("Assert that '{name}' next year icon class is correct" )
2221 public DatePickerMonthAssert nextYearIconClass (String iconClass ) {
23- String actualIconClass = element ().getNextYearIconClass ();
24- jdiAssert (actualIconClass , Matchers .containsString (iconClass ), String .format ("Actual " +
25- "next year icon class '%s' is not equal to expected '%s'" , actualIconClass , iconClass ));
22+ jdiAssert (element ().getNextYearIconClass (), Matchers .containsString (iconClass ));
2623 return this ;
2724 }
2825
2926 @ JDIAction ("Assert that '{name}' previous year icon class is correct" )
3027 public DatePickerMonthAssert previousYearIconClass (String iconClass ) {
31- String actualIconClass = element ().getPreviousYearIconClass ();
32- jdiAssert (actualIconClass , Matchers .containsString (iconClass ), String .format ("Actual previous year icon class " +
33- "'%s' is not equal to expected '%s'" , actualIconClass , iconClass ));
28+ jdiAssert (element ().getPreviousYearIconClass (), Matchers .containsString (iconClass ));
3429 return this ;
3530 }
3631
@@ -43,27 +38,19 @@ public DatePickerMonthAssert additionalYearIcon() {
4338
4439 @ JDIAction ("Assert that '{name}' additional year icon class is correct" )
4540 public DatePickerMonthAssert additionalYearIconClass (String iconClass ) {
46- String actualIconClass = element ().getAdditionalYearIconClass ();
47- jdiAssert (actualIconClass , Matchers .containsString (iconClass ), String .format ("Actual additional year icon class " +
48- "'%s' is not equal to expected '%s'" , actualIconClass , iconClass ));
41+ jdiAssert (element ().getAdditionalYearIconClass (), Matchers .containsString (iconClass ));
4942 return this ;
5043 }
5144
5245 @ JDIAction ("Assert that '{name}' shown year is '{0}'" )
5346 public DatePickerMonthAssert year (int year ) {
54- Timer .waitCondition (() -> element ().getYear ().equals (year ));
55- int actualYear = element ().getYear ();
56- jdiAssert (actualYear , Matchers .is (year ), String .format ("Actual element's year '%s' is not equal to " +
57- "expected '%s'" , actualYear , year ));
47+ jdiAssert (element ().getYear (), Matchers .is (year ));
5848 return this ;
5949 }
6050
6151 @ JDIAction ("Assert that '{name}' shown month is '{0}'" )
6252 public DatePickerMonthAssert month (String month ) {
63- Timer .waitCondition (() -> element ().getMonth ().equals (month ));
64- String actualMonth = element ().getMonth ();
65- jdiAssert (actualMonth , Matchers .is (month ), String .format ("Actual element's shown month '%s' is not equal to " +
66- "expected '%s'" , actualMonth , month ));
53+ jdiAssert (element ().getMonth (), Matchers .is (month ));
6754 return this ;
6855 }
6956
@@ -102,19 +89,13 @@ public DatePickerMonthAssert nonClickableDisabledMonths() {
10289
10390 @ JDIAction ("Assert that all chosen months are correctly chosen" )
10491 public DatePickerMonthAssert properSetOfActiveMonths (Set <String > months ) {
105- Timer .waitCondition (() -> element ().getAllActiveMonths ().equals (months ));
106- List <String > actualActiveMonth = element ().getAllActiveMonths ();
107- jdiAssert (actualActiveMonth , Matchers .containsInAnyOrder (months .toArray ()), String .format ("Element's " +
108- "actual active months '%s' doesn't contain all of the expacted '%s'" , actualActiveMonth , months ));
92+ jdiAssert (element ().getAllActiveMonths (), Matchers .containsInAnyOrder (months .toArray ()));
10993 return this ;
11094 }
11195
112- @ JDIAction ("Assert that result date field has proper date" )
96+ @ JDIAction ("Assert that result date field has {0} date" )
11397 public DatePickerMonthAssert resultDate (String resultDate ) {
114- Timer .waitCondition (() -> element ().getResultDate ().equals (resultDate ));
115- String actualResultDate = element ().getResultDate ();
116- jdiAssert (actualResultDate , Matchers .is (resultDate ),
117- String .format ("Actual result date '$s' is not equal to expected '%s'" , actualResultDate , resultDate ));
98+ jdiAssert (element ().getResultDate (), Matchers .is (resultDate ));
11899 return this ;
119100 }
120101
0 commit comments