12
12
13
13
public class PaginatorAssert extends UIAssert <PaginatorAssert , Paginator > {
14
14
@ JDIAction (value = "Assert that '{name}' has '{0}' label" , isAssert = true )
15
- public PaginatorAssert itemPerPageLabel (final String label ) {
15
+ public PaginatorAssert pageSizeLabel (final String label ) {
16
16
jdiAssert (element ().itemPerPageLabel (), Matchers .equalTo (label ));
17
17
return this ;
18
18
}
@@ -38,8 +38,7 @@ public PaginatorAssert rangeLabel(final String label) {
38
38
39
39
@ JDIAction (value = "Assert that '{name}' has '{0}' color theme" , isAssert = true )
40
40
public PaginatorAssert colorTheme (final AngularColors value ) {
41
- final AngularColors color = AngularColors .fromName (element ().colorTheme ());
42
- jdiAssert (color , Matchers .equalTo (value ));
41
+ jdiAssert (AngularColors .fromName (element ().colorTheme ()), Matchers .equalTo (value ));
43
42
return this ;
44
43
}
45
44
@@ -51,8 +50,7 @@ public PaginatorAssert colorTheme(final String value) {
51
50
52
51
@ JDIAction (value = "Assert that '{name}' has '{0}' color of the boarder" , isAssert = true )
53
52
public PaginatorAssert borderColor (final AngularColors value ) {
54
- AngularColors actualColor = AngularColors .fromColor (element ().boarderColor ());
55
- jdiAssert (actualColor , Matchers .equalTo (value ));
53
+ jdiAssert (AngularColors .fromColor (element ().boarderColor ()), Matchers .equalTo (value ));
56
54
return this ;
57
55
}
58
56
@@ -64,8 +62,7 @@ public PaginatorAssert borderColor(final String value) {
64
62
65
63
@ JDIAction (value = "Assert that '{name}' has '{0}' color of the selected option" , isAssert = true )
66
64
public PaginatorAssert selectedOptionColor (final AngularColors value ) {
67
- AngularColors actualColorInList = AngularColors .fromColor (element ().selectedOptionColor ());
68
- jdiAssert (actualColorInList , Matchers .equalTo (value ));
65
+ jdiAssert (AngularColors .fromColor (element ().selectedOptionColor ()), Matchers .equalTo (value ));
69
66
return this ;
70
67
}
71
68
@@ -97,7 +94,7 @@ public PaginatorAssert hiddenPageSize(boolean value) {
97
94
@ JDIAction (value = "Assert that '{name}' has shown first and last page buttons" , isAssert = true )
98
95
public PaginatorAssert firstLastButtonsShown (boolean value ) {
99
96
jdiAssert (element ().isFirstLastButtonsShown (), Matchers .is (value ),
100
- value ? "first and last buttons should be shown " : "first and last buttons should be hidden "
97
+ value ? "first and last buttons should be SHOWN " : "first and last buttons should be DISPLAYED "
101
98
);
102
99
return this ;
103
100
}
@@ -111,51 +108,58 @@ public PaginatorAssert pageIndexCurrent(int pageIndex) {
111
108
return this ;
112
109
}
113
110
114
- @ JDIAction (value = "Assert that '{name}' has page index of {0} " , isAssert = true )
115
- public PaginatorAssert totalNumberOfItems (int length ) {
116
- jdiAssert (element ().totalNumberOfItems (), Matchers .equalTo (length ));
111
+ @ JDIAction (value = "Assert that '{name}' has {0} total number of items that are being paginated " , isAssert = true )
112
+ public PaginatorAssert totalNumberOfPaginatedItems (int length ) {
113
+ jdiAssert (element ().totalNumberOfPaginatedItems (), Matchers .equalTo (length ));
117
114
return this ;
118
115
}
119
116
120
117
@ JDIAction (value = "Assert that previous button enabled for '{name}'" , isAssert = true )
121
- public PaginatorAssert previousEnabled () {
122
- jdiAssert (element ().previousButton ().isEnabled () ? "enabled" : "disabled" , Matchers .equalTo ("enabled" ));
118
+ public PaginatorAssert previousPageButtonEnabled () {
119
+ jdiAssert (element ().previousButton ().isEnabled (), Matchers .is (true ),
120
+ "previous button should be ENABLED" );
123
121
return this ;
124
122
}
125
123
126
124
@ JDIAction (value = "Assert that previous button disabled for '{name}'" , isAssert = true )
127
- public PaginatorAssert previousDisabled () {
128
- jdiAssert (element ().previousButton ().isEnabled () ? "enabled" : "disabled" , Matchers .equalTo ("disabled" ));
125
+ public PaginatorAssert previousPageButtonDisabled () {
126
+ jdiAssert (element ().previousButton ().isDisabled (), Matchers .is (true ),
127
+ "previous button should be DISABLED" );
129
128
return this ;
130
129
}
131
130
132
131
@ JDIAction (value = "Assert that next button enabled for '{name}'" , isAssert = true )
133
- public PaginatorAssert nextEnabled () {
134
- jdiAssert (element ().nextButton ().isEnabled () ? "enabled" : "disabled" , Matchers .equalTo ("enabled" ));
132
+ public PaginatorAssert nextPageButtonEnabled () {
133
+ jdiAssert (element ().nextButton ().isEnabled (), Matchers .is (true ),
134
+ "next button should be ENABLED" );
135
135
return this ;
136
136
}
137
137
138
138
@ JDIAction (value = "Assert that next button disabled for '{name}'" , isAssert = true )
139
- public PaginatorAssert nextDisabled () {
140
- jdiAssert (element ().nextButton ().isEnabled () ? "enabled" : "disabled" , Matchers .equalTo ("disabled" ));
139
+ public PaginatorAssert nextPageButtonDisabled () {
140
+ jdiAssert (element ().nextButton ().isDisabled (), Matchers .is (true ),
141
+ "previous button should be DISABLED" );
141
142
return this ;
142
143
}
143
144
144
145
@ JDIAction (value = "Assert that item per page selector is disabled for '{name}'" , isAssert = true )
145
146
public PaginatorAssert itemPerPageSelectorDisabled () {
146
- jdiAssert (element ().itemPerPageSelector ().isDisabled () ? "disabled" : "enabled" , Matchers .equalTo ("disabled" ));
147
+ jdiAssert (element ().itemPerPageSelector ().isDisabled (), Matchers .is (true ),
148
+ "item per page selector should be DISABLED" );
147
149
return this ;
148
150
}
149
151
150
152
@ 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 .equalTo (value ? "displayed" : "hidden" ));
153
+ public PaginatorAssert firstPageButtonDisplayed (boolean value ) {
154
+ jdiAssert (element ().firstPageButton ().isDisplayed (), Matchers .is (value ),
155
+ value ? "fist page button should be DISPLAYED" : "first page button should be HIDDEN" );
153
156
return this ;
154
157
}
155
158
156
159
@ 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 .equalTo (value ? "displayed" : "hidden" ));
160
+ public PaginatorAssert lastPageButtonDisplayed (boolean value ) {
161
+ jdiAssert (element ().lastPageButton ().isDisplayed (), Matchers .is (value ),
162
+ value ? "last page button should be DISPLAYED" : "last page button should be HIDDEN" );
159
163
return this ;
160
164
}
161
165
}
0 commit comments