22
33import org .openqa .selenium .WebElement ;
44
5- @ ChunkDefs ({
6- @ ChunkDef (name = "empty" , value ={
5+ @ Chunks ({
6+ @ Chunk (id = "empty" ,
7+ description = "empty" , elements ={
78 }),
8- @ ChunkDef (name = "one element" , value ={
9+ @ Chunk (id = "one" ,
10+ description = "one element" , elements ={
911 @ Element ({10 , 20 , 40 , 50 })
1012 }),
11- @ ChunkDef (name = "two overlapping elements" , value ={
13+ @ Chunk (id = "two_overlapping" ,
14+ description = "two overlapping elements" , elements ={
1215 @ Element ({10 , 20 , 30 , 35 }),
1316 @ Element ({15 , 25 , 35 , 50 }),
1417 }),
15- @ ChunkDef (name ="three elements with different sizes in a row with different gutters" , value ={
18+ @ Chunk (id = "three" ,
19+ description ="three elements with different sizes in a row with different gutters" , elements ={
1620 @ Element ({100 , 50 , 300 , 60 }),
1721 @ Element ({400 , 50 , 700 , 60 }),
1822 @ Element ({900 , 50 , 1200 , 60 }),
1923 }),
20- @ ChunkDef (name ="seven elements in three rows with different sizes and gutters" , value ={
24+ @ Chunk (id = "seven" ,
25+ description ="seven elements in three rows with different sizes and gutters" , elements ={
2126 @ Element ({100 , 50 , 300 , 60 }),
2227 @ Element ({400 , 50 , 700 , 70 }),
2328 @ Element ({900 , 50 , 1200 , 80 }),
@@ -34,16 +39,16 @@ public interface ChunkUIElementValidator {
3439
3540 // ? filled needs to be expressed somehow
3641 // areAlignedInColumns(numberOfColumns)
37- @ ValidChunks ({
38- @ Chunk ( name = "empty" , params = {"3" }),
39- @ Chunk ( name = "one element " , params = {"1" }),
40- @ Chunk ( name = "three elements with different sizes in a row with different gutters " , params = {"3" , "4" }),
41- @ Chunk ( name = "seven elements in three rows with different sizes and gutters " , params = {"3" }),
42+ @ Valid ({
43+ @ Scenario ( chunk = "empty" , params = {"3" }),
44+ @ Scenario ( chunk = "one" , params = {"1" }),
45+ @ Scenario ( chunk = "three" , params = {"3" , "4" }),
46+ @ Scenario ( chunk = "seven" , params = {"3" }),
4247 })
43- @ InvalidChunks ({
44- @ Chunk ( name = "empty" , params = {"3" }, oneOrMore = true ),
45- @ Chunk ( name = "three elements with different sizes in a row with different gutters " , params = {"2" }),
46- @ Chunk ( name = "seven elements in three rows with different sizes and gutters " , params = {"2" , "4" }),
48+ @ NotValid ({
49+ @ Scenario ( chunk = "empty" , params = {"3" }, oneOrMore = true ),
50+ @ Scenario ( chunk = "three" , params = {"2" }),
51+ @ Scenario ( chunk = "seven" , params = {"2" , "4" }),
4752 })
4853 ChunkUIElementValidator alignedAsGrid (int horizontalGridSize );
4954
@@ -55,29 +60,29 @@ public interface ChunkUIElementValidator {
5560 *
5661 * @return this
5762 */
58- @ ValidChunks ({
59- @ Chunk ( name = "empty" ),
60- @ Chunk ( name = "single element " ),
61- @ Chunk ( name = "seven elements in three rows with different sizes and gutters " ),
63+ @ Valid ({
64+ @ Scenario ( chunk = "empty" ),
65+ @ Scenario ( chunk = "one " ),
66+ @ Scenario ( chunk = "seven" ),
6267 })
63- @ InvalidChunks ({
64- @ Chunk ( name = "empty" , oneOrMore = true ),
65- @ Chunk ( name = "two overlapping elements " ),
68+ @ NotValid ({
69+ @ Scenario ( chunk = "empty" , oneOrMore = true ),
70+ @ Scenario ( chunk = "two_overlapping " ),
6671 })
6772 ChunkUIElementValidator areAlignedAsGridCells ();
6873
6974
7075 // area
71- @ ValidChunks ({
72- @ Chunk ( name = "one element " , params = {"1, 1" }),
73- @ Chunk ( name = "three elements with different sizes in a row with different gutters " , params = {"3, 1" , "4, 1" }),
74- @ Chunk ( name = "seven elements in three rows with different sizes and gutters " , params = {"3, 3" }),
76+ @ Valid ({
77+ @ Scenario ( chunk = "one" , params = {"1, 1" }),
78+ @ Scenario ( chunk = "three" , params = {"3, 1" , "4, 1" }),
79+ @ Scenario ( chunk = "seven" , params = {"3, 3" }),
7580 })
76- @ InvalidChunks ({
77- @ Chunk ( name = "empty" , params = {"3, 3" }, oneOrMore = true ),
78- @ Chunk ( name = "empty" , params = {"3, 3" }),
79- @ Chunk ( name = "three elements with different sizes in a row with different gutters " , params = {"3, 2" , "4, 2" }),
80- @ Chunk ( name = "seven elements in three rows with different sizes and gutters " , params = {"3, 2" , "3, 4" , "4, 1" }),
81+ @ NotValid ({
82+ @ Scenario ( chunk = "empty" , params = {"3, 3" }, oneOrMore = true ),
83+ @ Scenario ( chunk = "empty" , params = {"3, 3" }),
84+ @ Scenario ( chunk = "three" , params = {"3, 2" , "4, 2" }),
85+ @ Scenario ( chunk = "seven" , params = {"3, 2" , "3, 4" , "4, 1" }),
8186 })
8287 ChunkUIElementValidator alignedAsGrid (int horizontalGridSize , int verticalGridSize );
8388
@@ -86,29 +91,71 @@ public interface ChunkUIElementValidator {
8691
8792 // size
8893
94+ @ Valid ({
95+ @ Scenario (chunk = "empty" ),
96+ @ Scenario (chunk = "one" ),
97+ })
98+ @ NotValid ({
99+ @ Scenario (chunk = "empty" , oneOrMore = true ),
100+ })
89101 ChunkUIElementValidator haveEqualSize ();
102+ @ Valid ({
103+ @ Scenario (chunk = "empty" ),
104+ @ Scenario (chunk = "one" ),
105+ })
106+ @ NotValid ({
107+ @ Scenario (chunk = "empty" , oneOrMore = true ),
108+ })
90109 ChunkUIElementValidator haveEqualWidth ();
110+ @ Valid ({
111+ @ Scenario (chunk = "empty" ),
112+ @ Scenario (chunk = "one" ),
113+ })
114+ @ NotValid ({
115+ @ Scenario (chunk = "empty" , oneOrMore = true ),
116+ })
91117 ChunkUIElementValidator haveEqualHeight ();
118+ @ Valid ({
119+ @ Scenario (chunk = "empty" ),
120+ @ Scenario (chunk = "one" ),
121+ })
122+ @ NotValid ({
123+ @ Scenario (chunk = "empty" , oneOrMore = true ),
124+ })
92125 ChunkUIElementValidator haveDifferentSizes ();
126+ @ Valid ({
127+ @ Scenario (chunk = "empty" ),
128+ @ Scenario (chunk = "one" ),
129+ })
130+ @ NotValid ({
131+ @ Scenario (chunk = "empty" , oneOrMore = true ),
132+ })
93133 ChunkUIElementValidator haveDifferentWidths ();
134+ @ Valid ({
135+ @ Scenario (chunk = "empty" ),
136+ @ Scenario (chunk = "one" ),
137+ })
138+ @ NotValid ({
139+ @ Scenario (chunk = "empty" , oneOrMore = true ),
140+ })
94141 ChunkUIElementValidator haveDifferentHeights ();
95142
96143 // alignment
97144
98- @ ValidChunks ({
99- @ Chunk ( name = "one element " ),
145+ @ Valid ({
146+ @ Scenario ( chunk = "one" ),
100147 })
101148 ChunkUIElementValidator areLeftAligned ();
102- @ ValidChunks ({
103- @ Chunk ( name = "one element " ),
149+ @ Valid ({
150+ @ Scenario ( chunk = "one" ),
104151 })
105152 ChunkUIElementValidator areRightAligned ();
106- @ ValidChunks ({
107- @ Chunk ( name = "one element " ),
153+ @ Valid ({
154+ @ Scenario ( chunk = "one" ),
108155 })
109156 ChunkUIElementValidator areTopAligned ();
110- @ ValidChunks ({
111- @ Chunk ( name = "one element " ),
157+ @ Valid ({
158+ @ Scenario ( chunk = "one" ),
112159 })
113160 ChunkUIElementValidator areBottomAligned ();
114161
0 commit comments