@@ -16,7 +16,7 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
16
16
17
17
@marks .testrail_id (6283 )
18
18
@marks .high
19
- def test_push_notification_1_1_chat (self ):
19
+ def test_push_notification_1_1_chat_no_pn_activity_center (self ):
20
20
self .create_drivers (2 )
21
21
device_1 , device_2 = SignInView (self .drivers [0 ]), SignInView (self .drivers [1 ])
22
22
device_1_home , device_2_home = device_1 .create_user (), device_2 .create_user (enable_notifications = True )
@@ -28,14 +28,23 @@ def test_push_notification_1_1_chat(self):
28
28
profile_1 .profile_notifications_toggle_button .click ()
29
29
device_1_home = profile_1 .get_back_to_home_view ()
30
30
device_2_public_key = device_2_home .get_public_key_and_username ()
31
+ message_no_pn , message = 'No PN' , 'Text push notification'
32
+
33
+ device_2 .just_fyi ("Device 2 check there is no PN when receiving new message to activity centre" )
34
+ device_2 .put_app_to_background ()
35
+ device_1_chat = device_1_home .add_contact (device_2_public_key )
36
+ device_1_chat .send_message (message_no_pn )
37
+ device_2 .open_notification_bar ()
38
+ if device_2 .element_by_text_part (message_no_pn ).is_element_displayed ():
39
+ self .errors .append ("Push notification with text was received for new message in activity centre" )
40
+ device_2 .get_app_from_background ()
41
+ device_2 .home_button .click ()
42
+ device_2_home .get_chat (default_username_1 ).click ()
43
+ device_2_home .profile_button .click ()
31
44
32
45
device_2 .just_fyi ("Device 2 puts app on background being on Profile view to receive PN with text" )
33
46
device_2 .click_system_home_button ()
34
-
35
- device_1_chat = device_1_home .add_contact (device_2_public_key )
36
- message = 'Text push notification'
37
- device_1_chat .chat_message_input .send_keys (message )
38
- device_1_chat .send_message_button .click ()
47
+ device_1_chat .send_message (message )
39
48
40
49
device_1 .just_fyi ("Device 1 puts app on background to receive emoji push notification" )
41
50
device_1 .profile_button .click ()
@@ -344,12 +353,15 @@ def test_send_audio_message_with_push_notification_check(self):
344
353
default_username_1 = profile_1 .default_username_text .text
345
354
home_1 = profile_1 .get_back_to_home_view ()
346
355
public_key_2 = home_2 .get_public_key_and_username ()
356
+ chat_1 = home_1 .add_contact (public_key_2 )
357
+ chat_1 .send_message ('hey' )
358
+ home_2 .home_button .double_click ()
359
+ home_2 .get_chat (default_username_1 ).click ()
347
360
348
361
home_2 .just_fyi ("Put app on background (to check Push notification received for audio message)" )
349
362
home_2 .click_system_home_button ()
350
363
351
364
home_2 .just_fyi ("Sending audio message to device who is on background" )
352
- chat_1 = home_1 .add_contact (public_key_2 )
353
365
chat_1 .record_audio_message (message_length_in_seconds = 125 )
354
366
if not chat_1 .element_by_text ("Maximum recording time reached" ).is_element_displayed ():
355
367
self .drivers [0 ].fail ("Exceeded 2 mins limit of recording time." )
0 commit comments