e2e: fixes for edit/delete message in tests
This commit is contained in:
parent
2525620730
commit
9c3ff8c88c
|
@ -374,6 +374,7 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase):
|
|||
def test_community_message_edit(self):
|
||||
message_before_edit, message_after_edit = 'Message BEFORE edit', "Message AFTER edit 2"
|
||||
self.channel_1.send_message(message_before_edit)
|
||||
self.channel_1.chat_element_by_text(message_before_edit).wait_for_sent_state()
|
||||
self.channel_1.edit_message_in_chat(message_before_edit, message_after_edit)
|
||||
for channel in (self.channel_1, self.channel_2):
|
||||
if not channel.element_by_text_part(message_after_edit).is_element_displayed(60):
|
||||
|
@ -391,6 +392,7 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase):
|
|||
message_to_delete_everyone = 'delete for everyone'
|
||||
message_to_delete_for_me = 'delete for me'
|
||||
self.channel_2.send_message(message_to_delete_everyone)
|
||||
self.channel_2.chat_element_by_text(message_to_delete_everyone).wait_for_sent_state()
|
||||
self.home_2.just_fyi('Delete for message everyone. Checking that message is deleted for all members')
|
||||
self.channel_2.delete_message_in_chat(message_to_delete_everyone)
|
||||
for channel in (self.channel_1, self.channel_2):
|
||||
|
|
|
@ -1016,9 +1016,8 @@ class ChatView(BaseView):
|
|||
|
||||
def edit_message_in_chat(self, message_to_edit, message_to_update):
|
||||
self.driver.info("Looking for message '%s' to edit it" % message_to_edit)
|
||||
element = self.element_by_translation_id("edit-message")
|
||||
self.chat_element_by_text(message_to_edit).message_body.long_press_until_element_is_shown(element)
|
||||
element.click()
|
||||
self.chat_element_by_text(message_to_edit).message_body.long_press_element()
|
||||
self.element_by_translation_id("edit-message").click()
|
||||
self.chat_message_input.clear()
|
||||
self.chat_message_input.send_keys(message_to_update)
|
||||
self.send_message_button.click()
|
||||
|
@ -1029,7 +1028,6 @@ class ChatView(BaseView):
|
|||
delete_button = self.element_by_translation_id("delete-for-everyone")
|
||||
else:
|
||||
delete_button = self.element_by_translation_id("delete-for-me")
|
||||
# self.chat_element_by_text(message).message_body.long_press_until_element_is_shown(delete_button)
|
||||
self.chat_element_by_text(message).message_body.long_press_element()
|
||||
delete_button.click()
|
||||
|
||||
|
|
|
@ -399,7 +399,7 @@ class HomeView(BaseView):
|
|||
if self.toast_content_element.is_element_displayed(10):
|
||||
self.toast_content_element.wait_for_invisibility_of_element()
|
||||
try:
|
||||
self.notifications_unread_badge.wait_for_visibility_of_element(30)
|
||||
self.notifications_unread_badge.wait_for_visibility_of_element(60)
|
||||
except TimeoutException:
|
||||
pass
|
||||
self.open_activity_center_button.click_until_presence_of_element(self.close_activity_centre)
|
||||
|
|
Loading…
Reference in New Issue