mirror of
https://github.com/status-im/status-mobile.git
synced 2025-01-26 00:19:44 +00:00
Clear group chat history
Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com>
This commit is contained in:
parent
1d00e9bb3d
commit
e26844547d
@ -280,4 +280,40 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase):
|
||||
# device 2: check that as admin can add new members to group chat
|
||||
device_2_chat.add_members_to_group_chat([chat_member['username']])
|
||||
|
||||
self.verify_no_errors()
|
||||
|
||||
@marks.testrail_id(5681)
|
||||
@marks.high
|
||||
def test_clear_history_of_group_chat_via_group_view(self):
|
||||
self.create_drivers(2)
|
||||
|
||||
device_1_home, device_2_home = create_users(self.drivers[0], self.drivers[1])
|
||||
chat_name = device_1_home.get_public_chat_name()
|
||||
|
||||
# create and join group chat
|
||||
device_1_chat, device_2_chat = create_and_join_group_chat(device_1_home, device_2_home, chat_name)
|
||||
messages = []
|
||||
|
||||
# device 1, device 2: send messages and clear history on device 1
|
||||
for chat in (device_1_chat, device_2_chat):
|
||||
message = "Message from device: %s" % chat.driver.number
|
||||
chat.send_message(message)
|
||||
messages.append(message)
|
||||
|
||||
device_1_chat.clear_history_via_group_info()
|
||||
|
||||
# device 1: check that history is deleted
|
||||
for message in messages:
|
||||
if device_1_chat.element_starts_with_text(message).is_element_present():
|
||||
device_1_chat.driver.fail(
|
||||
"Message '%s' is shown after re-login, but group chat history has been cleared" % message)
|
||||
|
||||
device_1_home.relogin()
|
||||
device_1_home.element_by_text(chat_name).click()
|
||||
|
||||
for message in messages:
|
||||
if device_1_chat.element_starts_with_text(message).is_element_present():
|
||||
device_1_chat.driver.fail(
|
||||
"Message '%s' is shown after re-login, but group chat history has been cleared" % message)
|
||||
|
||||
self.verify_no_errors()
|
@ -287,7 +287,7 @@ class ChatElementByText(BaseText):
|
||||
class EmptyPublicChatMessage(BaseText):
|
||||
def __init__(self, driver):
|
||||
super().__init__(driver)
|
||||
self.locator = self.Locator.text_part_selector("There are no messages")
|
||||
self.locator = self.Locator.text_part_selector("It's been quite here")
|
||||
|
||||
|
||||
class ChatItem(BaseElement):
|
||||
@ -334,8 +334,10 @@ class ChatView(BaseView):
|
||||
self.members_button = MembersButton(self.driver)
|
||||
self.delete_chat_button = DeleteChatButton(self.driver)
|
||||
self.clear_history_button = ClearHistoryButton(self.driver)
|
||||
self.group_info = GroupInfoButton(self.driver)
|
||||
self.clear_button = ClearButton(self.driver)
|
||||
|
||||
# Group chats
|
||||
self.group_info = GroupInfoButton(self.driver)
|
||||
self.leave_chat_button = LeaveChatButton(self.driver)
|
||||
self.leave_button = LeaveButton(self.driver)
|
||||
self.join_chat_button = JoinChatButton(self.driver)
|
||||
@ -415,6 +417,13 @@ class ChatView(BaseView):
|
||||
self.clear_history_button.click()
|
||||
self.clear_button.click()
|
||||
|
||||
def clear_history_via_group_info(self):
|
||||
self.chat_options.click()
|
||||
self.group_info.click()
|
||||
self.clear_history_button.click()
|
||||
self.clear_button.click()
|
||||
self.back_button.click()
|
||||
|
||||
def send_transaction_in_1_1_chat(self, asset, amount, password=common_password, wallet_set_up=False, **kwargs):
|
||||
self.commands_button.click()
|
||||
self.send_command.click()
|
||||
|
Loading…
x
Reference in New Issue
Block a user