Skip to content

Commit 3b6f3b7

Browse files
committed
e2e fix PNs
Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com>
1 parent 67b646d commit 3b6f3b7

File tree

5 files changed

+27
-12
lines changed

5 files changed

+27
-12
lines changed

test/appium/tests/atomic/chats/test_commands.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ def test_send_eth_in_1_1_chat_transaction_push(self):
7272
updated_timestamp_sender = sender_message.timestamp_message.text
7373
if updated_timestamp_sender == timestamp_sender:
7474
self.errors.append("Timestamp of message is not updated after signing transaction")
75-
sender_message.transaction_status.wait_for_element_text(sender_message.pending)
7675
chat_1.wallet_button.click()
7776
wallet_1.find_transaction_in_history(amount=amount)
7877

test/appium/tests/atomic/chats/test_group_chat.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@ def test_decline_invitation_to_group_chat(self):
190190
device_2_chat = device_2_home.get_chat(chat_name).click()
191191
device_2_chat.decline_invitation_button.click()
192192
left_system_message = device_2_chat.leave_system_message(device_2_username)
193-
if not device_1_chat.chat_element_by_text(left_system_message).is_element_displayed():
194-
self.errors.append('No system message after user left the group chat')
193+
if device_1_chat.chat_element_by_text(left_system_message).is_element_displayed():
194+
self.errors.append('System message after user left the group chat is shown if declined before accepting in Activity Centre')
195195
if device_2_home.element_by_text(chat_name).is_element_displayed():
196196
self.errors.append("Group chat '%s' is shown, but user has left" % chat_name)
197197

@@ -513,7 +513,7 @@ def test_pair_devices_group_chat_different_messages_nicknames(self):
513513
device_1_chat.send_message_button.click()
514514
device_1_chat.chat_message_input.click()
515515
for chat in device_1_chat, device_2_chat, device_3_chat:
516-
if not chat.image_chat_item.is_element_displayed(30):
516+
if not chat.image_chat_item.is_element_displayed(60):
517517
self.errors.append('Image is not shown in chat after sending for %s' % chat.driver.number)
518518

519519
device_1.just_fyi('Send audio message to group chat and verify it on all devices')

test/appium/tests/atomic/chats/test_keycard_commands.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ def test_keycard_send_eth_in_1_1_chat(self):
6464
send_message = sender_message.sign_and_send.click()
6565
send_message.next_button.click()
6666
send_message.sign_transaction(keycard=True, default_gas_price=False)
67-
sender_message.transaction_status.wait_for_element_text(sender_message.pending)
6867
updated_timestamp_sender = sender_message.timestamp_message.text
6968
if updated_timestamp_sender == timestamp_sender:
7069
self.errors.append("Timestamp of message is not updated after signing transaction")

test/appium/tests/atomic/chats/test_one_to_one.py

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
1616

1717
@marks.testrail_id(6283)
1818
@marks.high
19-
def test_push_notification_1_1_chat(self):
19+
def test_push_notification_1_1_chat_no_pn_activity_center(self):
2020
self.create_drivers(2)
2121
device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
2222
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):
2828
profile_1.profile_notifications_toggle_button.click()
2929
device_1_home = profile_1.get_back_to_home_view()
3030
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()
3144

3245
device_2.just_fyi("Device 2 puts app on background being on Profile view to receive PN with text")
3346
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)
3948

4049
device_1.just_fyi("Device 1 puts app on background to receive emoji push notification")
4150
device_1.profile_button.click()
@@ -344,12 +353,15 @@ def test_send_audio_message_with_push_notification_check(self):
344353
default_username_1 = profile_1.default_username_text.text
345354
home_1 = profile_1.get_back_to_home_view()
346355
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()
347360

348361
home_2.just_fyi("Put app on background (to check Push notification received for audio message)")
349362
home_2.click_system_home_button()
350363

351364
home_2.just_fyi("Sending audio message to device who is on background")
352-
chat_1 = home_1.add_contact(public_key_2)
353365
chat_1.record_audio_message(message_length_in_seconds=125)
354366
if not chat_1.element_by_text("Maximum recording time reached").is_element_displayed():
355367
self.drivers[0].fail("Exceeded 2 mins limit of recording time.")

test/appium/views/base_view.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,11 @@ def click_system_back_button(self, times=1):
322322
for _ in range(times):
323323
self.driver.press_keycode(4)
324324

325+
def get_app_from_background(self):
326+
self.driver.info('*Get Status back from Recent apps*')
327+
self.driver.press_keycode(187)
328+
self.status_in_background_button.click()
329+
325330
def put_app_to_background_and_back(self, time_in_background=1):
326331
self.driver.info('*Put app to background and back*')
327332
self.driver.press_keycode(187)

0 commit comments

Comments
 (0)