e2e: Fixes for jump-to

This commit is contained in:
Yevheniia Berdnyk 2023-06-13 06:24:21 +03:00
parent f38c85546f
commit 6f920afcf7
No known key found for this signature in database
GPG Key ID: 0642C73C66214825
5 changed files with 21 additions and 11 deletions

View File

@ -370,7 +370,7 @@ class SauceSharedMultipleDeviceTestCase(AbstractTestCase):
'%s_geth%s.log' % (test_suite_data.current_test.name, str(self.drivers[driver].number))) '%s_geth%s.log' % (test_suite_data.current_test.name, str(self.drivers[driver].number)))
geth_contents.append(self.pull_geth(self.drivers[driver])) geth_contents.append(self.pull_geth(self.drivers[driver]))
except (WebDriverException, AttributeError, RemoteDisconnected): except (WebDriverException, AttributeError, RemoteDisconnected, ProtocolError):
pass pass
finally: finally:
try: try:

View File

@ -1148,8 +1148,10 @@ class TestOneToOneChatMultipleSharedDevicesNewUi(MultipleSharedDeviceTestCase):
@marks.testrail_id(702733) @marks.testrail_id(702733)
def test_1_1_chat_text_message_delete_push_disappear(self): def test_1_1_chat_text_message_delete_push_disappear(self):
self.chat_2.jump_to_card_by_text(self.username_1) if not self.chat_2.chat_message_input.is_element_displayed():
self.chat_1.jump_to_card_by_text(self.username_2) self.chat_2.jump_to_card_by_text(self.username_1)
if not self.chat_1.chat_message_input.is_element_displayed():
self.chat_1.jump_to_card_by_text(self.username_2)
self.device_2.just_fyi("Verify Device1 can not edit and delete received message from Device2") self.device_2.just_fyi("Verify Device1 can not edit and delete received message from Device2")
message_after_edit_1_1 = 'smth I should edit' message_after_edit_1_1 = 'smth I should edit'

View File

@ -454,9 +454,9 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase):
(", ".join(sent_time_variants), timestamp)) (", ".join(sent_time_variants), timestamp))
self.channel_1.verify_message_is_under_today_text(message, self.errors) self.channel_1.verify_message_is_under_today_text(message, self.errors)
new_message = "new message" new_message = "new message"
self.channel_1.send_message(message) self.channel_1.send_message(new_message)
self.channel_2.verify_message_is_under_today_text(new_message, self.errors, 60) self.channel_2.verify_message_is_under_today_text(new_message, self.errors, 60)
if self.channel_2.chat_element_by_text(message).username.text != self.username_1: if self.channel_2.chat_element_by_text(new_message).username.text != self.username_1:
self.errors.append("Default username '%s' is not shown next to the received message" % self.username_1) self.errors.append("Default username '%s' is not shown next to the received message" % self.username_1)
self.errors.verify_no_errors() self.errors.verify_no_errors()
@ -542,7 +542,7 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase):
self.channel_2.chat_message_input.send_keys(message_text) self.channel_2.chat_message_input.send_keys(message_text)
self.channel_2.send_message_button.click() self.channel_2.send_message_button.click()
chat_element_1 = self.channel_1.chat_element_by_text(message_text) chat_element_1 = self.channel_1.chat_element_by_text(message_text)
if not chat_element_1.is_element_displayed(sec=60) or chat_element_1.replied_message_text != 'Image': if not chat_element_1.is_element_displayed(sec=60) or chat_element_1.replied_message_text != image_description:
self.errors.append('Reply message was not received by the sender') self.errors.append('Reply message was not received by the sender')
self.errors.verify_no_errors() self.errors.verify_no_errors()
@ -566,7 +566,7 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase):
self.channel_2.chat_message_input.send_keys(message_text) self.channel_2.chat_message_input.send_keys(message_text)
self.channel_2.send_message_button.click() self.channel_2.send_message_button.click()
chat_element_1 = self.channel_1.chat_element_by_text(message_text) chat_element_1 = self.channel_1.chat_element_by_text(message_text)
if not chat_element_1.is_element_displayed(sec=60) or chat_element_1.replied_message_text != 'Image': if not chat_element_1.is_element_displayed(sec=60) or chat_element_1.replied_message_text != image_description:
self.errors.append('Reply message was not received by the sender') self.errors.append('Reply message was not received by the sender')
self.errors.verify_no_errors() self.errors.verify_no_errors()
@ -760,8 +760,13 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase):
@marks.testrail_id(703086) @marks.testrail_id(703086)
def test_community_mark_all_messages_as_read(self): def test_community_mark_all_messages_as_read(self):
self.channel_1.jump_to_communities_home() self.channel_1.click_system_back_button_until_element_is_shown()
self.home_2.jump_to_card_by_text('# %s' % self.channel_name) self.home_1.communities_tab.click()
if not self.channel_2.chat_message_input.is_element_displayed():
self.channel_2.click_system_back_button_until_element_is_shown()
self.home_2.communities_tab.click()
self.home_2.get_chat(self.community_name, community=True).click()
self.community_2.get_channel(self.channel_name).click()
self.channel_2.send_message(self.text_message) self.channel_2.send_message(self.text_message)
community_1_element = self.community_1.get_chat(self.community_name) community_1_element = self.community_1.get_chat(self.community_name)
if not community_1_element.new_messages_public_chat.is_element_displayed(90): if not community_1_element.new_messages_public_chat.is_element_displayed(90):

View File

@ -369,7 +369,7 @@ class BaseView(object):
def hide_keyboard_if_shown(self): def hide_keyboard_if_shown(self):
if self.driver.is_keyboard_shown(): if self.driver.is_keyboard_shown():
self.driver.hide_keyboard() self.click_system_back_button()
def click_system_back_button(self, times=1): def click_system_back_button(self, times=1):
self.driver.info('Click system back button') self.driver.info('Click system back button')
@ -598,14 +598,17 @@ class BaseView(object):
sign_in_view.sign_in(password) sign_in_view.sign_in(password)
def jump_to_messages_home(self): def jump_to_messages_home(self):
self.hide_keyboard_if_shown()
self.jump_to_button.click() self.jump_to_button.click()
self.chats_tab.click_until_presence_of_element(self.jump_to_button) self.chats_tab.click_until_presence_of_element(self.jump_to_button)
def jump_to_communities_home(self): def jump_to_communities_home(self):
self.hide_keyboard_if_shown()
self.jump_to_button.click() self.jump_to_button.click()
self.communities_tab.click_until_presence_of_element(self.jump_to_button) self.communities_tab.click_until_presence_of_element(self.jump_to_button)
def jump_to_card_by_text(self, text: str): def jump_to_card_by_text(self, text: str):
self.hide_keyboard_if_shown()
self.jump_to_button.click() self.jump_to_button.click()
self.element_by_text(text).click() self.element_by_text(text).click()

View File

@ -1167,7 +1167,7 @@ class ChatView(BaseView):
self.allow_button.click_if_shown() self.allow_button.click_if_shown()
[self.get_image_by_index(i).click() for i in indexes] [self.get_image_by_index(i).click() for i in indexes]
self.images_confirm_selection_button.click() self.images_confirm_selection_button.click()
self.chat_message_input.set_value(description) self.chat_message_input.send_keys(description)
self.send_message_button.click() self.send_message_button.click()
@staticmethod @staticmethod