@@ -31,11 +31,11 @@ Future<void> testStreamsTab(
3131 await tester.testDuration (audioSourceTestData.duration);
3232 }
3333
34- // Live stream takes some time to get initialized
35- final timeout = Duration (seconds: audioSourceTestData.isLiveStream ? 8 : 1 );
34+ // Sources take some time to get initialized
35+ const timeout = Duration (seconds: 8 );
3636
3737 await tester.pumpAndSettle ();
38- await tester.tap (find. byKey ( const Key ('play_button' ) ));
38+ await tester.scrollToAndTap ( const Key ('play_button' ));
3939 await tester.pumpAndSettle ();
4040
4141 // Cannot test more precisely as it is dependent on pollInterval
@@ -79,7 +79,7 @@ Future<void> testStreamsTab(
7979 await tester.testPlayerState (PlayerState .completed);
8080 await tester.testOnPlayerState (PlayerState .completed);
8181 } else if (audioSourceTestData.duration > const Duration (seconds: 5 )) {
82- await tester.tap (find. byKey ( const Key ('pause_button' ) ));
82+ await tester.scrollToAndTap ( const Key ('pause_button' ));
8383 await tester.pumpAndSettle ();
8484 await tester.testPlayerState (PlayerState .paused);
8585 await tester.testOnPlayerState (PlayerState .paused);
@@ -141,7 +141,7 @@ extension StreamWidgetTester on WidgetTester {
141141 Future <void > stopStream () async {
142142 final st = StackTrace .current.toString ();
143143
144- await tap (find. byKey ( const Key ('stop_button' ) ));
144+ await scrollToAndTap ( const Key ('stop_button' ));
145145 await waitOneshot (const Key ('toast-player-stopped-0' ), stackTrace: st);
146146 await pumpAndSettle ();
147147 }
@@ -154,7 +154,7 @@ extension StreamWidgetTester on WidgetTester {
154154 final st = StackTrace .current.toString ();
155155 await waitFor (
156156 () async {
157- await tap (find. byKey ( const Key ('getDuration' ) ));
157+ await scrollToAndTap ( const Key ('getDuration' ));
158158 await pump ();
159159 expectWidgetHasDuration (
160160 const Key ('durationText' ),
@@ -176,7 +176,7 @@ extension StreamWidgetTester on WidgetTester {
176176 final st = StackTrace .current.toString ();
177177 await waitFor (
178178 () async {
179- await tap (find. byKey ( const Key ('getPosition' ) ));
179+ await scrollToAndTap ( const Key ('getPosition' ));
180180 await pump ();
181181 expectWidgetHasDuration (
182182 const Key ('positionText' ),
@@ -196,7 +196,7 @@ extension StreamWidgetTester on WidgetTester {
196196 final st = StackTrace .current.toString ();
197197 await waitFor (
198198 () async {
199- await tap (find. byKey ( const Key ('getPlayerState' ) ));
199+ await scrollToAndTap ( const Key ('getPlayerState' ));
200200 await pump ();
201201 expectWidgetHasText (
202202 const Key ('playerStateText' ),
@@ -210,7 +210,7 @@ extension StreamWidgetTester on WidgetTester {
210210
211211 Future <void > testOnDuration (
212212 Duration duration, {
213- Duration timeout = const Duration (seconds: 8 ),
213+ Duration timeout = const Duration (seconds: 10 ),
214214 }) async {
215215 printOnFailure ('Test OnDuration: $duration ' );
216216 final st = StackTrace .current.toString ();
@@ -227,7 +227,7 @@ extension StreamWidgetTester on WidgetTester {
227227 Future <void > testOnPosition (
228228 Duration position, {
229229 Matcher Function (Duration ) matcher = equals,
230- Duration timeout = const Duration (seconds: 8 ),
230+ Duration timeout = const Duration (seconds: 10 ),
231231 }) async {
232232 printOnFailure ('Test OnPosition: $position ' );
233233 final st = StackTrace .current.toString ();
@@ -244,7 +244,7 @@ extension StreamWidgetTester on WidgetTester {
244244
245245 Future <void > testOnPlayerState (
246246 PlayerState playerState, {
247- Duration timeout = const Duration (seconds: 8 ),
247+ Duration timeout = const Duration (seconds: 10 ),
248248 }) async {
249249 printOnFailure ('Test OnState: $playerState ' );
250250 final st = StackTrace .current.toString ();
0 commit comments