Clear group chat history

Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com>
This commit is contained in:
Churikova Tetiana 2019-04-10 11:48:14 +02:00
parent 1d00e9bb3d
commit e26844547d
No known key found for this signature in database
GPG Key ID: 0D4EA7B33B47E6D8
2 changed files with 47 additions and 2 deletions

View File

@ -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()

View File

@ -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()