9
9
import java .util .List ;
10
10
11
11
import static com .epam .jdi .light .asserts .core .SoftAssert .jdiAssert ;
12
- import static com .jdiai .tools .StringUtils .format ;
13
12
14
13
public class PaginatorAssert extends UIAssert <PaginatorAssert , Paginator > {
15
14
@ JDIAction (value = "Assert that '{name}' has '{0}' label" , isAssert = true )
@@ -33,53 +32,71 @@ public PaginatorAssert itemsPerPageList(final List<Integer> options) {
33
32
34
33
@ JDIAction (value = "Assert that range is '{0}' for '{name}'" , isAssert = true )
35
34
public PaginatorAssert rangeLabel (String label ) {
36
- String expected = format (label );
37
- jdiAssert (element ().range (), Matchers .is (expected ));
35
+ jdiAssert (element ().range (), Matchers .is (label ));
38
36
return this ;
39
37
}
40
38
41
39
@ JDIAction (value = "Assert that '{name}' has '{0}' color theme" , isAssert = true )
42
- public PaginatorAssert color (AngularColors value ) {
43
- jdiAssert (element ().color (), Matchers .equalTo (value ));
40
+ public PaginatorAssert colorTheme (AngularColors value ) {
41
+ final AngularColors color = AngularColors .fromName (element ().colorTheme ());
42
+ jdiAssert (color , Matchers .equalTo (value ));
43
+ return this ;
44
+ }
45
+
46
+ @ JDIAction (value = "Assert that '{name}' has '{0}' color theme" , isAssert = true )
47
+ public PaginatorAssert colorTheme (String value ) {
48
+ jdiAssert (element ().colorTheme (), Matchers .equalToIgnoringCase (value ));
44
49
return this ;
45
50
}
46
51
47
52
@ JDIAction (value = "Assert that '{name}' has '{0}' color of the boarder" , isAssert = true )
48
- public PaginatorAssert colorOfBoarder (AngularColors value ) {
49
- AngularColors actualColor = AngularColors .fromColor (element ().colorOfBoarder ());
53
+ public PaginatorAssert borderColor (AngularColors value ) {
54
+ AngularColors actualColor = AngularColors .fromColor (element ().boarderColor ());
50
55
jdiAssert (actualColor , Matchers .equalTo (value ));
51
56
return this ;
52
57
}
53
58
59
+ @ JDIAction (value = "Assert that '{name}' has '{0}' color of the boarder" , isAssert = true )
60
+ public PaginatorAssert borderColor (String value ) {
61
+ jdiAssert (element ().boarderColor (), Matchers .equalTo (value ));
62
+ return this ;
63
+ }
64
+
54
65
@ JDIAction (value = "Assert that '{name}' has '{0}' color of the selected option" , isAssert = true )
55
- public PaginatorAssert colorOfSelectedOption (AngularColors value ) {
56
- AngularColors actualColorInList = AngularColors .fromColor (element ().colorInList ());
66
+ public PaginatorAssert selectedOptionColor (AngularColors value ) {
67
+ AngularColors actualColorInList = AngularColors .fromColor (element ().selectedOptionColor ());
57
68
jdiAssert (actualColorInList , Matchers .equalTo (value ));
58
69
return this ;
59
70
}
60
71
72
+ @ JDIAction (value = "Assert that '{name}' has '{0}' color of the selected option" , isAssert = true )
73
+ public PaginatorAssert selectedOptionColor (String value ) {
74
+ jdiAssert (element ().selectedOptionColor (), Matchers .equalTo (value ));
75
+ return this ;
76
+ }
77
+
61
78
@ JDIAction (value = "Assert that '{name} has firstPageLabel='{0}'" , isAssert = true )
62
79
public PaginatorAssert firstPageLabel (String label ) {
63
- jdiAssert (element ().firstPageLabel (), Matchers .is (label ));
80
+ jdiAssert (element ().firstPageLabel (), Matchers .equalTo (label ));
64
81
return this ;
65
82
}
66
83
67
84
@ JDIAction (value = "Assert that '{name} has lastPageLabel='{0}'" , isAssert = true )
68
85
public PaginatorAssert lastPageLabel (String label ) {
69
- jdiAssert (element ().lastPageLabel (), Matchers .is (label ));
86
+ jdiAssert (element ().lastPageLabel (), Matchers .equalTo (label ));
70
87
return this ;
71
88
}
72
89
73
90
@ JDIAction (value = "Assert that '{name}' has hidden page size" , isAssert = true )
74
91
public PaginatorAssert hiddenPageSize (final boolean value ) {
75
- jdiAssert (element ().hidePageSize (), Matchers .is (value ),
92
+ jdiAssert (element ().isPageSizeHidden (), Matchers .is (value ),
76
93
value ? "page size should be hidden" : "page size should be visible" );
77
94
return this ;
78
95
}
79
96
80
97
@ JDIAction (value = "Assert that '{name}' has shown first and last page buttons" , isAssert = true )
81
- public PaginatorAssert showFirstLastButtons (boolean value ) {
82
- jdiAssert (element ().showFirstLastButtons (), Matchers .is (value ),
98
+ public PaginatorAssert firstLastButtonsShown (boolean value ) {
99
+ jdiAssert (element ().isFirstLastButtonsShown (), Matchers .is (value ),
83
100
value ? "first and last buttons should be shown" : "first and last buttons should be hidden"
84
101
);
85
102
return this ;
@@ -99,5 +116,47 @@ public PaginatorAssert length(int length) {
99
116
jdiAssert (element ().length (), Matchers .is (length ));
100
117
return this ;
101
118
}
119
+
120
+ @ JDIAction (value = "Assert that previous button enabled for '{name}'" , isAssert = true )
121
+ public PaginatorAssert previousEnabled () {
122
+ jdiAssert (element ().previousButton ().isEnabled () ? "enabled" : "disabled" , Matchers .is ("enabled" ));
123
+ return this ;
124
+ }
125
+
126
+ @ JDIAction (value = "Assert that previous button disabled for '{name}'" , isAssert = true )
127
+ public PaginatorAssert previousDisabled () {
128
+ jdiAssert (element ().previousButton ().isEnabled () ? "enabled" : "disabled" , Matchers .is ("disabled" ));
129
+ return this ;
130
+ }
131
+
132
+ @ JDIAction (value = "Assert that next button enabled for '{name}'" , isAssert = true )
133
+ public PaginatorAssert nextEnabled () {
134
+ jdiAssert (element ().nextButton ().isEnabled () ? "enabled" : "disabled" , Matchers .is ("enabled" ));
135
+ return this ;
136
+ }
137
+
138
+ @ JDIAction (value = "Assert that next button disabled for '{name}'" , isAssert = true )
139
+ public PaginatorAssert nextDisabled () {
140
+ jdiAssert (element ().nextButton ().isEnabled () ? "enabled" : "disabled" , Matchers .is ("disabled" ));
141
+ return this ;
142
+ }
143
+
144
+ @ JDIAction (value = "Assert that item per page selector is disabled for '{name}'" , isAssert = true )
145
+ public PaginatorAssert itemPerPageSelectorDisabled () {
146
+ jdiAssert (element ().itemPerPageSelector ().isDisabled () ? "disabled" : "enabled" , Matchers .is ("disabled" ));
147
+ return this ;
148
+ }
149
+
150
+ @ JDIAction (value = "Assert that first page button displayed={0} for '{name}'" , isAssert = true )
151
+ public PaginatorAssert firstPageDisplayed (boolean value ) {
152
+ jdiAssert (element ().firstPageButton ().isDisplayed () ? "displayed" : "hidden" , Matchers .is (value ? "displayed" : "hidden" ));
153
+ return this ;
154
+ }
155
+
156
+ @ JDIAction (value = "Assert that last page button displayed={0} for '{name}'" , isAssert = true )
157
+ public PaginatorAssert lastPageDisplayed (boolean value ) {
158
+ jdiAssert (element ().lastPageButton ().isDisplayed () ? "displayed" : "hidden" , Matchers .is (value ? "displayed" : "hidden" ));
159
+ return this ;
160
+ }
102
161
}
103
162
0 commit comments