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)))
geth_contents.append(self.pull_geth(self.drivers[driver]))
except (WebDriverException, AttributeError, RemoteDisconnected):
except (WebDriverException, AttributeError, RemoteDisconnected, ProtocolError):
pass
finally:
try:

View File

@ -1148,8 +1148,10 @@ class TestOneToOneChatMultipleSharedDevicesNewUi(MultipleSharedDeviceTestCase):
@marks.testrail_id(702733)
def test_1_1_chat_text_message_delete_push_disappear(self):
self.chat_2.jump_to_card_by_text(self.username_1)
self.chat_1.jump_to_card_by_text(self.username_2)
if not self.chat_2.chat_message_input.is_element_displayed():
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")
message_after_edit_1_1 = 'smth I should edit'

View File

@ -454,9 +454,9 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase):
(", ".join(sent_time_variants), timestamp))
self.channel_1.verify_message_is_under_today_text(message, self.errors)
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)
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.verify_no_errors()
@ -542,7 +542,7 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase):
self.channel_2.chat_message_input.send_keys(message_text)
self.channel_2.send_message_button.click()
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.verify_no_errors()
@ -566,7 +566,7 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase):
self.channel_2.chat_message_input.send_keys(message_text)
self.channel_2.send_message_button.click()
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.verify_no_errors()
@ -760,8 +760,13 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase):
@marks.testrail_id(703086)
def test_community_mark_all_messages_as_read(self):
self.channel_1.jump_to_communities_home()
self.home_2.jump_to_card_by_text('# %s' % self.channel_name)
self.channel_1.click_system_back_button_until_element_is_shown()
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)
community_1_element = self.community_1.get_chat(self.community_name)
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):
if self.driver.is_keyboard_shown():
self.driver.hide_keyboard()
self.click_system_back_button()
def click_system_back_button(self, times=1):
self.driver.info('Click system back button')
@ -598,14 +598,17 @@ class BaseView(object):
sign_in_view.sign_in(password)
def jump_to_messages_home(self):
self.hide_keyboard_if_shown()
self.jump_to_button.click()
self.chats_tab.click_until_presence_of_element(self.jump_to_button)
def jump_to_communities_home(self):
self.hide_keyboard_if_shown()
self.jump_to_button.click()
self.communities_tab.click_until_presence_of_element(self.jump_to_button)
def jump_to_card_by_text(self, text: str):
self.hide_keyboard_if_shown()
self.jump_to_button.click()
self.element_by_text(text).click()

View File

@ -1167,7 +1167,7 @@ class ChatView(BaseView):
self.allow_button.click_if_shown()
[self.get_image_by_index(i).click() for i in indexes]
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()
@staticmethod