4
4
5
5
import com .epam .jdi .light .angular .elements .complex .GridList ;
6
6
import com .epam .jdi .light .asserts .generic .UIAssert ;
7
+ import com .epam .jdi .light .angular .elements .enums .AngularColors ;
7
8
import com .epam .jdi .light .common .JDIAction ;
8
9
import org .hamcrest .Matchers ;
9
10
10
11
public class GridListAssert extends UIAssert <GridListAssert , GridList > {
11
12
12
13
@ JDIAction ("Assert that '{name}' has number of columns '{0}'" )
13
- public GridListAssert numberOfColumnsInGridList ( String expectedNumberOfColumns ) {
14
- String actualNumberOfColumns = element ().numberOfColumnsInGridList ();
14
+ public GridListAssert numberOfColumns ( int expectedNumberOfColumns ) {
15
+ int actualNumberOfColumns = element ().numberOfColumns ();
15
16
jdiAssert (actualNumberOfColumns , Matchers .is (expectedNumberOfColumns ),
16
17
String .format ("\n Actual number of columns in Grid List: '%s'\n " +
17
18
"is not equal to expected: '%s'" , actualNumberOfColumns , expectedNumberOfColumns ));
@@ -21,54 +22,42 @@ public GridListAssert numberOfColumnsInGridList(String expectedNumberOfColumns)
21
22
@ JDIAction ("Assert that '{name}' has row's height '{0}'" )
22
23
public GridListAssert rowHeight (String expectedRowHeight ) {
23
24
String actualRowHeight = element ().rowHeight ();
24
- jdiAssert (actualRowHeight , Matchers .is (expectedRowHeight ),
25
- String .format ("\n Actual row height: '%s'\n " +
26
- "is not equal to expected: '%s'" , actualRowHeight , expectedRowHeight ));
25
+ jdiAssert (actualRowHeight , Matchers .is (expectedRowHeight ));
27
26
return this ;
28
27
}
29
28
30
29
@ JDIAction ("Assert that '{name}' has gutter size '{0}'" )
31
30
public GridListAssert gutterSize (String expectedGutterSize ) {
32
31
String actualGutterSize = element ().gutterSize ();
33
- jdiAssert (actualGutterSize , Matchers .is (expectedGutterSize ),
34
- String .format ("\n Actual gutter size: '%s'\n " +
35
- "is not equal to expected: '%s'" , actualGutterSize , expectedGutterSize ));
32
+ jdiAssert (actualGutterSize , Matchers .is (expectedGutterSize ));
36
33
return this ;
37
34
}
38
35
39
36
@ JDIAction ("Assert that '{name}' cell has text '{1}'" )
40
- public GridListAssert cellText (int cellIndex , String ExpectedText ) {
37
+ public GridListAssert cellText (int cellIndex , String expectedText ) {
41
38
String actualText = element ().cellByIndex (cellIndex ).text ();
42
- jdiAssert (actualText , Matchers .is (ExpectedText ),
43
- String .format ("\n Actual cell's text: '%s'\n " +
44
- "is not equal to expected: '%s'" , actualText , ExpectedText ));
39
+ jdiAssert (actualText , Matchers .is (expectedText ));
45
40
return this ;
46
41
}
47
42
48
43
@ JDIAction ("Assert that '{name}' cell has background color '{1}'" )
49
44
public GridListAssert cellBackgroundColor (int cellIndex , String expectedColor ) {
50
45
String actualColor = element ().cellBackgroundColorByIndex (cellIndex );
51
- jdiAssert (actualColor , Matchers .is (expectedColor ),
52
- String .format ("\n Actual cell's background color: '%s'\n " +
53
- "is not equal to expected: '%s'" , actualColor , expectedColor ));
46
+ jdiAssert (actualColor , Matchers .is (expectedColor ));
54
47
return this ;
55
48
}
56
49
57
50
@ JDIAction ("Assert that '{name}' cell has number of columns '{1}'" )
58
- public GridListAssert numberOfColumnsInCell (int cellIndex , String expectedNumberOfColumns ) {
59
- String actualNumberOfColumns = element ().numberOfColumnsInCellByIndex (cellIndex );
60
- jdiAssert (actualNumberOfColumns , Matchers .is (expectedNumberOfColumns ),
61
- String .format ("\n Actual number of columns in cell: '%s'\n " +
62
- "is not equal to expected: '%s'" , actualNumberOfColumns , expectedNumberOfColumns ));
51
+ public GridListAssert numberOfColumnsInCell (int cellIndex , int expectedNumberOfColumns ) {
52
+ int actualNumberOfColumns = element ().numberOfColumnsInCellByIndex (cellIndex );
53
+ jdiAssert (actualNumberOfColumns , Matchers .is (expectedNumberOfColumns ));
63
54
return this ;
64
55
}
65
56
66
57
@ JDIAction ("Assert that '{name}' cell has number of rows '{1}'" )
67
- public GridListAssert numberOfRowsInCell (int cellIndex , String expectedNumberOfRows ) {
68
- String actualNumberOfRows = element ().numberOfRowsInCellByIndex (cellIndex );
69
- jdiAssert (actualNumberOfRows , Matchers .is (expectedNumberOfRows ),
70
- String .format ("\n Actual number of rows in cell: '%s'\n " +
71
- "is not equal to expected: '%s'" , actualNumberOfRows , expectedNumberOfRows ));
58
+ public GridListAssert numberOfRowsInCell (int cellIndex , int expectedNumberOfRows ) {
59
+ int actualNumberOfRows = element ().numberOfRowsInCellByIndex (cellIndex );
60
+ jdiAssert (actualNumberOfRows , Matchers .is (expectedNumberOfRows ));
72
61
return this ;
73
62
}
74
63
}
0 commit comments