e2e fix PNs

Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com>
This commit is contained in:
Churikova Tetiana 2021-04-23 14:36:38 +02:00
parent 67b646dcca
commit 3b6f3b77cc
No known key found for this signature in database
GPG Key ID: 0D4EA7B33B47E6D8
5 changed files with 27 additions and 12 deletions

View File

@ -72,7 +72,6 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase):
updated_timestamp_sender = sender_message.timestamp_message.text
if updated_timestamp_sender == timestamp_sender:
self.errors.append("Timestamp of message is not updated after signing transaction")
sender_message.transaction_status.wait_for_element_text(sender_message.pending)
chat_1.wallet_button.click()
wallet_1.find_transaction_in_history(amount=amount)

View File

@ -190,8 +190,8 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase):
device_2_chat = device_2_home.get_chat(chat_name).click()
device_2_chat.decline_invitation_button.click()
left_system_message = device_2_chat.leave_system_message(device_2_username)
if not device_1_chat.chat_element_by_text(left_system_message).is_element_displayed():
self.errors.append('No system message after user left the group chat')
if device_1_chat.chat_element_by_text(left_system_message).is_element_displayed():
self.errors.append('System message after user left the group chat is shown if declined before accepting in Activity Centre')
if device_2_home.element_by_text(chat_name).is_element_displayed():
self.errors.append("Group chat '%s' is shown, but user has left" % chat_name)
@ -513,7 +513,7 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase):
device_1_chat.send_message_button.click()
device_1_chat.chat_message_input.click()
for chat in device_1_chat, device_2_chat, device_3_chat:
if not chat.image_chat_item.is_element_displayed(30):
if not chat.image_chat_item.is_element_displayed(60):
self.errors.append('Image is not shown in chat after sending for %s' % chat.driver.number)
device_1.just_fyi('Send audio message to group chat and verify it on all devices')

View File

@ -64,7 +64,6 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase):
send_message = sender_message.sign_and_send.click()
send_message.next_button.click()
send_message.sign_transaction(keycard=True, default_gas_price=False)
sender_message.transaction_status.wait_for_element_text(sender_message.pending)
updated_timestamp_sender = sender_message.timestamp_message.text
if updated_timestamp_sender == timestamp_sender:
self.errors.append("Timestamp of message is not updated after signing transaction")

View File

@ -16,7 +16,7 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
@marks.testrail_id(6283)
@marks.high
def test_push_notification_1_1_chat(self):
def test_push_notification_1_1_chat_no_pn_activity_center(self):
self.create_drivers(2)
device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
device_1_home, device_2_home = device_1.create_user(), device_2.create_user(enable_notifications=True)
@ -28,14 +28,23 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
profile_1.profile_notifications_toggle_button.click()
device_1_home = profile_1.get_back_to_home_view()
device_2_public_key = device_2_home.get_public_key_and_username()
message_no_pn, message = 'No PN', 'Text push notification'
device_2.just_fyi("Device 2 check there is no PN when receiving new message to activity centre")
device_2.put_app_to_background()
device_1_chat = device_1_home.add_contact(device_2_public_key)
device_1_chat.send_message(message_no_pn)
device_2.open_notification_bar()
if device_2.element_by_text_part(message_no_pn).is_element_displayed():
self.errors.append("Push notification with text was received for new message in activity centre")
device_2.get_app_from_background()
device_2.home_button.click()
device_2_home.get_chat(default_username_1).click()
device_2_home.profile_button.click()
device_2.just_fyi("Device 2 puts app on background being on Profile view to receive PN with text")
device_2.click_system_home_button()
device_1_chat = device_1_home.add_contact(device_2_public_key)
message = 'Text push notification'
device_1_chat.chat_message_input.send_keys(message)
device_1_chat.send_message_button.click()
device_1_chat.send_message(message)
device_1.just_fyi("Device 1 puts app on background to receive emoji push notification")
device_1.profile_button.click()
@ -344,12 +353,15 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
default_username_1 = profile_1.default_username_text.text
home_1 = profile_1.get_back_to_home_view()
public_key_2 = home_2.get_public_key_and_username()
chat_1 = home_1.add_contact(public_key_2)
chat_1.send_message('hey')
home_2.home_button.double_click()
home_2.get_chat(default_username_1).click()
home_2.just_fyi("Put app on background (to check Push notification received for audio message)")
home_2.click_system_home_button()
home_2.just_fyi("Sending audio message to device who is on background")
chat_1 = home_1.add_contact(public_key_2)
chat_1.record_audio_message(message_length_in_seconds=125)
if not chat_1.element_by_text("Maximum recording time reached").is_element_displayed():
self.drivers[0].fail("Exceeded 2 mins limit of recording time.")

View File

@ -322,6 +322,11 @@ class BaseView(object):
for _ in range(times):
self.driver.press_keycode(4)
def get_app_from_background(self):
self.driver.info('*Get Status back from Recent apps*')
self.driver.press_keycode(187)
self.status_in_background_button.click()
def put_app_to_background_and_back(self, time_in_background=1):
self.driver.info('*Put app to background and back*')
self.driver.press_keycode(187)