mirror of
https://github.com/status-im/status-mobile.git
synced 2025-01-11 17:24:27 +00:00
extend group chat e2e to 3 members
Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com>
This commit is contained in:
parent
fedb7131a9
commit
cd8e953c46
@ -105,48 +105,58 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase):
|
||||
@marks.high
|
||||
def test_offline_add_new_group_chat_member(self):
|
||||
message_before_adding = 'message before adding new user'
|
||||
message_after_adding = 'message after adding new user'
|
||||
chat_member = chat_users['A']
|
||||
message_after_adding = 'message from new member'
|
||||
message_from_old_member_after_adding = 'message from old member'
|
||||
|
||||
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()
|
||||
device_1_key, device_1_username = device_1.get_public_key_and_username(True)
|
||||
device_1_home.home_button.click()
|
||||
chat_name = device_1_home.get_random_chat_name()
|
||||
self.create_drivers(3)
|
||||
devices_home, devices_key, devices_username, devices_chat = {}, {}, {}, {}
|
||||
for key in self.drivers:
|
||||
sign_in_view = SignInView(self.drivers[key])
|
||||
devices_home[key] = sign_in_view.create_user()
|
||||
devices_key[key], devices_username[key] = sign_in_view.get_public_key_and_username(True)
|
||||
sign_in_view.home_button.click()
|
||||
|
||||
device_2.just_fyi('Create group chat with some user')
|
||||
device_2_key, device_2_username = device_2.get_public_key_and_username(True)
|
||||
device_2.home_button.click()
|
||||
for key in chat_member['public_key'], device_2_key:
|
||||
device_1_home.add_contact(key)
|
||||
device_1_home.get_back_to_home_view()
|
||||
device_1_chat = device_1_home.create_group_chat([chat_member['username']], chat_name)
|
||||
device_1_chat.send_message(message_before_adding)
|
||||
chat_name = devices_home[0].get_random_chat_name()
|
||||
for i in range(1, 3):
|
||||
devices_home[0].add_contact(devices_key[i])
|
||||
devices_home[0].get_back_to_home_view()
|
||||
devices_chat[0] = devices_home[0].create_group_chat([devices_username[1]], chat_name)
|
||||
devices_chat[0].send_message(message_before_adding)
|
||||
|
||||
device_2.just_fyi('Put member device to offline and check that invite will be fetched')
|
||||
invite_system_message = device_1_chat.invite_system_message(device_1_username,chat_member['username'])
|
||||
device_2_home.toggle_airplane_mode()
|
||||
device_1_chat.add_members_to_group_chat([device_2_username])
|
||||
device_2_home.toggle_airplane_mode()
|
||||
device_2_home.connection_status.wait_for_invisibility_of_element(60)
|
||||
if not device_2_home.get_chat(chat_name).is_element_displayed():
|
||||
devices_home[1].just_fyi('Join to chat as chat member')
|
||||
devices_chat[1] = devices_home[1].get_chat(chat_name).click()
|
||||
devices_chat[1].join_chat_button.click()
|
||||
|
||||
devices_home[2].just_fyi('Put not added member device to offline and check that invite will be fetched')
|
||||
invite_system_message = devices_chat[0].invite_system_message(devices_username[0],devices_username[1])
|
||||
devices_home[2].toggle_airplane_mode()
|
||||
devices_chat[0].add_members_to_group_chat([devices_username[2]])
|
||||
devices_home[2].toggle_airplane_mode()
|
||||
devices_home[2].connection_status.wait_for_invisibility_of_element(60)
|
||||
if not devices_home[2].get_chat(chat_name).is_element_displayed():
|
||||
self.driver[0].fail('Invite to group chat was not fetched from offline')
|
||||
device_2_chat = device_2_home.get_chat(chat_name).click()
|
||||
if not device_2_chat.element_by_text(invite_system_message).is_element_displayed():
|
||||
devices_chat[2] = devices_home[2].get_chat(chat_name).click()
|
||||
if not devices_chat[2].element_by_text(invite_system_message).is_element_displayed():
|
||||
self.errors.append('Message about adding first chat member is not shown for new added member')
|
||||
if device_2_chat.element_by_text(message_before_adding).is_element_displayed():
|
||||
if devices_chat[2].element_by_text(message_before_adding).is_element_displayed():
|
||||
self.errors.append('Message sent before adding user is shown')
|
||||
|
||||
device_2.just_fyi('Put admin device to offline and check that message from new member will be fetched')
|
||||
device_1_chat.toggle_airplane_mode()
|
||||
device_2_chat.join_chat_button.click()
|
||||
device_2_chat.send_message(message_after_adding)
|
||||
device_1_chat.toggle_airplane_mode()
|
||||
device_1_chat.connection_status.wait_for_invisibility_of_element(60)
|
||||
for chat in (device_2_chat, device_1_chat):
|
||||
if not chat.chat_element_by_text(message_after_adding).is_element_displayed(20):
|
||||
self.errors.append('Message sent after adding new member is not shown!')
|
||||
devices_chat[0].just_fyi('Put admin device to offline and check that message from new member will be fetched')
|
||||
devices_chat[0].toggle_airplane_mode()
|
||||
devices_chat[2].join_chat_button.click()
|
||||
devices_chat[2].send_message(message_after_adding)
|
||||
devices_chat[0].toggle_airplane_mode()
|
||||
devices_chat[0].connection_status.wait_for_invisibility_of_element(60)
|
||||
for key in devices_chat:
|
||||
if not devices_chat[key].chat_element_by_text(message_after_adding).is_element_displayed(
|
||||
20):
|
||||
self.errors.append("Message with text '%s' was not received" % message_after_adding)
|
||||
|
||||
devices_chat[0].just_fyi('Send message from old member and check that it is fetched')
|
||||
devices_chat[1].send_message(message_from_old_member_after_adding)
|
||||
for key in devices_chat:
|
||||
if not devices_chat[key].chat_element_by_text(message_from_old_member_after_adding).is_element_displayed(20):
|
||||
self.errors.append("Message with text '%s' was not received" % message_from_old_member_after_adding)
|
||||
|
||||
self.errors.verify_no_errors()
|
||||
|
||||
@ -210,7 +220,7 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase):
|
||||
left_message = devices_chat[0].leave_system_message(devices_username[1])
|
||||
for key in devices_chat:
|
||||
if not devices_chat[key].chat_element_by_text(left_message).is_element_displayed():
|
||||
self.errors.append("Message with text '%s' was not received" % left_message)
|
||||
self.errors.append("Message with text '%s' was not received" % left_message)
|
||||
|
||||
devices_chat[0].just_fyi("Check that input field is not available after removing")
|
||||
if devices_chat[1].chat_message_input.is_element_displayed():
|
||||
|
Loading…
x
Reference in New Issue
Block a user