@@ -47,20 +47,12 @@ void main() async {
47
47
await $(OverallSpacesPage .guestShortcutBtn)
48
48
.tap (settleTimeout: const Duration (seconds: 10 ));
49
49
await $(AppBarPage .spacesDrawerButton).waitUntilVisible ().tap ();
50
- SpacesDrawerPage .guestLooksAsExpected ($);
50
+ SpacesDrawerPage .commonElementsLookAsExpected ($);
51
51
52
52
// iterate thru spaces by clicking on spaces icons directly
53
53
for (final space in Space .values) {
54
54
await $(SpacesDrawerPage .chooserItem (space)).tap ();
55
- expect (
56
- $(SpacesDrawerPage .chooserIcon (space)),
57
- findsOneWidget,
58
- );
59
- final children = find.descendant (
60
- of: $(SpacesDrawerPage .guestMenuItems),
61
- matching: find.byWidgetPredicate ((widget) => true ),
62
- );
63
- expect ($(children), findsAtLeast (1 ));
55
+ await SpacesDrawerPage .guestLooksAsExpected ($, space);
64
56
}
65
57
SelectorUtils .isDisabled ($, $(SpacesDrawerPage .chooserNextBtn));
66
58
},
@@ -75,25 +67,17 @@ void main() async {
75
67
await $(AppBarPage .spacesDrawerButton).waitUntilVisible ().tap ();
76
68
77
69
// iterate thru spaces by clicking next
78
- for (var i = 0 ; i < Space .values.length; i++ ) {
70
+ for (final space in Space .values) {
71
+ await SpacesDrawerPage .guestLooksAsExpected ($, space);
79
72
await $(SpacesDrawerPage .chooserNextBtn).tap ();
80
- final children = find.descendant (
81
- of: $(SpacesDrawerPage .guestMenuItems),
82
- matching: find.byWidgetPredicate ((widget) => true ),
83
- );
84
- expect ($(children), findsAtLeast (1 ));
85
73
SelectorUtils .isEnabled ($, $(SpacesDrawerPage .chooserPrevBtn));
86
74
}
87
75
SelectorUtils .isDisabled ($, $(SpacesDrawerPage .chooserNextBtn));
88
76
89
77
// iterate thru spaces by clicking previous
90
- for (var i = 0 ; i < Space .values.length; i++ ) {
78
+ for (final space in Space .values.reversed) {
79
+ await SpacesDrawerPage .guestLooksAsExpected ($, space);
91
80
await $(SpacesDrawerPage .chooserPrevBtn).tap ();
92
- final children = find.descendant (
93
- of: $(SpacesDrawerPage .guestMenuItems),
94
- matching: find.byWidgetPredicate ((widget) => true ),
95
- );
96
- expect ($(children), findsAtLeast (1 ));
97
81
SelectorUtils .isEnabled ($, $(SpacesDrawerPage .chooserNextBtn));
98
82
}
99
83
SelectorUtils .isDisabled ($, $(SpacesDrawerPage .chooserPrevBtn));
@@ -107,7 +91,11 @@ void main() async {
107
91
await $(OverallSpacesPage .userShortcutBtn)
108
92
.tap (settleTimeout: const Duration (seconds: 10 ));
109
93
await $(AppBarPage .spacesDrawerButton).waitUntilVisible ().tap ();
110
- await SpacesDrawerPage .userLooksAsExpected ($);
94
+ SpacesDrawerPage .commonElementsLookAsExpected ($);
95
+ for (final space in Space .values) {
96
+ await $(SpacesDrawerPage .chooserItem (space)).tap ();
97
+ await SpacesDrawerPage .userLooksAsExpected ($, space);
98
+ }
111
99
},
112
100
);
113
101
0 commit comments