@@ -22,76 +22,75 @@ main() {
2222 const callNumber = IntegrationTestEnvironmentConfig .CALL_NUMBER_A ;
2323 const crossCallSleep = Duration (seconds: IntegrationTestEnvironmentConfig .CROSS_CALL_SLEEP_SECONDS );
2424
25- patrolTest (
26- 'Should make call and verify sub actions e.g minimize, hold, switch to video, speaker, mute etc' ,
27- ($ ) async {
28- await bootstrap ();
29- await pumpRootAndWaitUntilVisible ($);
25+ patrolTest ('Should make call and verify sub actions e.g minimize, hold, switch to video, speaker, mute etc' , (
26+ $ ,
27+ ) async {
28+ await bootstrap ();
29+ await pumpRootAndWaitUntilVisible ($);
3030
31- // Login if not.
32- if ($(LoginModeSelectScreen ).visible) {
33- await loginByMethod ($, defaultLoginMethod);
34- // Wait some time for components loading and session establishment.
35- await pumpFor (const Duration (seconds: 5 ), $);
36- }
37-
38- // Make a call and check if it is active.
39- await $(MainFlavor .keypad.toNavBarKey ()).tap ();
40- await enterKeypadNumber ($, callNumber);
41- await $(actionPadStartKey).tap ();
42- await $(CallActiveScaffold ).waitUntilVisible ();
31+ // Login if not.
32+ if ($(LoginModeSelectScreen ).visible) {
33+ await loginByMethod ($, defaultLoginMethod);
34+ // Wait some time for components loading and session establishment.
4335 await pumpFor (const Duration (seconds: 5 ), $);
44- expect (find.textContaining ('00:0' ), findsOneWidget, reason: 'Call should be active' );
36+ }
37+
38+ // Make a call and check if it is active.
39+ await $(MainFlavor .keypad.toNavBarKey ()).tap ();
40+ await enterKeypadNumber ($, callNumber);
41+ await $(actionPadStartKey).tap ();
42+ await $(CallActiveScaffold ).waitUntilVisible ();
43+ await pumpFor (const Duration (seconds: 5 ), $);
44+ expect (find.textContaining ('00:0' ), findsOneWidget, reason: 'Call should be active' );
4545
46- // Minimize call and check if it is minimized.
47- await $.native .pressBack ();
48- await pumpFor (const Duration (seconds: 1 ), $);
49- expect ($(CallActiveScaffold ).visible, false , reason: 'Call should be minimized' );
50- expect ($(CallActiveThumbnail ), findsOneWidget, reason: 'Thumbnail should be visible' );
51- await $(CallActiveThumbnail ).tap ();
52- await pumpFor (const Duration (seconds: 1 ), $);
53- expect ($(CallActiveScaffold ).visible, true , reason: 'Call should be active' );
54- expect ($(CallActiveThumbnail ), findsNothing, reason: 'Thumbnail should disappear' );
46+ // Minimize call and check if it is minimized.
47+ await $.native .pressBack ();
48+ await pumpFor (const Duration (seconds: 1 ), $);
49+ expect ($(CallActiveScaffold ).visible, false , reason: 'Call should be minimized' );
50+ expect ($(CallActiveThumbnail ), findsOneWidget, reason: 'Thumbnail should be visible' );
51+ await $(CallActiveThumbnail ).tap ();
52+ await pumpFor (const Duration (seconds: 1 ), $);
53+ expect ($(CallActiveScaffold ).visible, true , reason: 'Call should be active' );
54+ expect ($(CallActiveThumbnail ), findsNothing, reason: 'Thumbnail should disappear' );
5555
56- // Check mute function
57- await $(callActionsMuteKey).tap ();
58- await pumpFor (const Duration (seconds: 1 ), $);
59- expect (find.widgetWithIcon (TextButton , Icons .mic_off), findsOneWidget, reason: 'Call should be muted' );
60- await $(callActionsMuteKey).tap ();
61- await pumpFor (const Duration (seconds: 1 ), $);
62- expect (find.widgetWithIcon (TextButton , Icons .mic), findsOneWidget, reason: 'Call should be unmuted' );
56+ // Check mute function
57+ await $(callActionsMuteKey).tap ();
58+ await pumpFor (const Duration (seconds: 1 ), $);
59+ expect (find.widgetWithIcon (TextButton , Icons .mic_off), findsOneWidget, reason: 'Call should be muted' );
60+ await $(callActionsMuteKey).tap ();
61+ await pumpFor (const Duration (seconds: 1 ), $);
62+ expect (find.widgetWithIcon (TextButton , Icons .mic), findsOneWidget, reason: 'Call should be unmuted' );
6363
64- // Check speaker function
65- await $(callActionsSpeakerKey).tap ();
66- await pumpFor (const Duration (seconds: 1 ), $);
67- expect (find.widgetWithIcon (TextButton , Icons .volume_up), findsOneWidget, reason: 'Speaker should be on' );
68- await $(callActionsSpeakerKey).tap ();
69- await pumpFor (const Duration (seconds: 1 ), $);
70- expect (find.widgetWithIcon (TextButton , Icons .volume_off), findsOneWidget, reason: 'Speaker should be off' );
64+ // Check speaker function
65+ await $(callActionsSpeakerKey).tap ();
66+ await pumpFor (const Duration (seconds: 1 ), $);
67+ expect (find.widgetWithIcon (TextButton , Icons .volume_up), findsOneWidget, reason: 'Speaker should be on' );
68+ await $(callActionsSpeakerKey).tap ();
69+ await pumpFor (const Duration (seconds: 1 ), $);
70+ expect (find.widgetWithIcon (TextButton , Icons .volume_off), findsOneWidget, reason: 'Speaker should be off' );
7171
72- // Check hold function
73- await $(callActionsHoldKey).tap ();
74- await pumpFor (const Duration (seconds: 1 ), $);
75- expect (find.text ('On hold' ), findsOneWidget, reason: 'Call should be on hold' );
76- await $(callActionsHoldKey).tap ();
77- await pumpFor (const Duration (seconds: 1 ), $);
78- expect (find.textContaining ('00:' ), findsOneWidget, reason: 'Call should be active again' );
72+ // Check hold function
73+ await $(callActionsHoldKey).tap ();
74+ await pumpFor (const Duration (seconds: 1 ), $);
75+ expect (find.text ('On hold' ), findsOneWidget, reason: 'Call should be on hold' );
76+ await $(callActionsHoldKey).tap ();
77+ await pumpFor (const Duration (seconds: 1 ), $);
78+ expect (find.textContaining ('00:' ), findsOneWidget, reason: 'Call should be active again' );
7979
80- // Check switch to video function
81- await $(callActionsVideoCallKey).tap ();
82- await pumpFor (const Duration (seconds: 2 ), $);
83- expect ($(callFrontCameraPreviewKey), findsOneWidget, reason: 'Front camera frame should appear' );
84- final rtcRenderersWithData = $( RTCVideoView ). which (
85- ( RTCVideoView widget) => widget.videoRenderer.videoValue.renderVideo == true ,
86- );
87- expect (rtcRenderersWithData, findsOneWidget, reason: 'Check video renderer' );
80+ // Check switch to video function
81+ await $(callActionsVideoCallKey).tap ();
82+ await pumpFor (const Duration (seconds: 2 ), $);
83+ expect ($(callFrontCameraPreviewKey), findsOneWidget, reason: 'Front camera frame should appear' );
84+ final rtcRenderersWithData = $(
85+ RTCVideoView ,
86+ ). which (( RTCVideoView widget) => widget.videoRenderer.videoValue.renderVideo == true );
87+ expect (rtcRenderersWithData, findsOneWidget, reason: 'Check video renderer' );
8888
89- // Hangup call and check if it is done.
90- await $(callActionsHangupKey).tap ();
91- await pumpFor (const Duration (seconds: 2 ), $);
92- expect ($(CallActiveScaffold ).visible, false , reason: 'Call should be ended' );
89+ // Hangup call and check if it is done.
90+ await $(callActionsHangupKey).tap ();
91+ await pumpFor (const Duration (seconds: 2 ), $);
92+ expect ($(CallActiveScaffold ).visible, false , reason: 'Call should be ended' );
9393
94- await Future .delayed (crossCallSleep);
95- },
96- );
94+ await Future .delayed (crossCallSleep);
95+ });
9796}
0 commit comments