From 471d26c6d111d29842cde0e865a1b74fd9ee8e04 Mon Sep 17 00:00:00 2001 From: Anton Danchenko Date: Tue, 15 Jan 2019 12:30:16 +0200 Subject: [PATCH] fix group chat tests Signed-off-by: Serhy --- test/appium/tests/atomic/chats/test_group_chat.py | 5 +++-- .../tests/atomic/dapps_and_browsing/test_browsing.py | 2 +- test/appium/views/chat_view.py | 7 +++++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/test/appium/tests/atomic/chats/test_group_chat.py b/test/appium/tests/atomic/chats/test_group_chat.py index bd7ea8acd3..ca9572cf90 100644 --- a/test/appium/tests/atomic/chats/test_group_chat.py +++ b/test/appium/tests/atomic/chats/test_group_chat.py @@ -27,7 +27,7 @@ def create_and_join_group_chat(device_1_home, device_2_home, chat_name): # device 2: open group chat device_2_chat = device_2_home.get_chat_with_user(chat_name).click() - device_2_home.element_by_text_part('JOIN CHAT').click() + device_2_chat.join_chat_button.click() return device_1_chat, device_2_chat @@ -87,7 +87,7 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase): device_1_chat, device_2_chat = create_and_join_group_chat(device_1_home, device_2_home, chat_name) admin_created_chat_system_message = "*%s* created the group *%s*" % (username_1, chat_name) - user2_joined_chat_system_message = "*%s* joined the group" % device_2_default_username + user2_joined_chat_system_message = "*%s* has joined the group" % device_2_default_username user2_left_chat_system_message = "*%s* left the group" % device_2_default_username # device 2: delete group chat @@ -165,6 +165,7 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase): # device 2: open the chat and check messages device_2_chat = device_2_home.get_chat_with_user(chat_name).click() + device_2_chat.join_chat_button.click() if not device_2_chat.chat_element_by_text(message_for_device_2).is_element_displayed(): self.errors.append('Message that was sent after device 2 has joined is not visible') diff --git a/test/appium/tests/atomic/dapps_and_browsing/test_browsing.py b/test/appium/tests/atomic/dapps_and_browsing/test_browsing.py index 08218f6a77..1d83a0c6ef 100644 --- a/test/appium/tests/atomic/dapps_and_browsing/test_browsing.py +++ b/test/appium/tests/atomic/dapps_and_browsing/test_browsing.py @@ -36,7 +36,7 @@ class TestBrowsing(SingleDeviceTestCase): sign_in = SignInView(self.driver) home_view = sign_in.create_user() start_new_chat = home_view.plus_button.click() - browsing_view = start_new_chat.open_url('www.bbc.com') + browsing_view = start_new_chat.open_url('http://www.dvwa.co.uk') browsing_view.url_edit_box_lock_icon.click() browsing_view.find_full_text(connection_not_secure_text) diff --git a/test/appium/views/chat_view.py b/test/appium/views/chat_view.py index f1dddc52e2..9b1b1a297c 100644 --- a/test/appium/views/chat_view.py +++ b/test/appium/views/chat_view.py @@ -200,6 +200,12 @@ class ProfileSendTransactionButton(BaseButton): self.locator = self.Locator.accessibility_id('send-transaction-button') +class JoinChatButton(BaseButton): + def __init__(self, driver): + super(JoinChatButton, self).__init__(driver) + self.locator = self.Locator.text_part_selector('JOIN CHAT') + + class ChatElementByText(BaseText): def __init__(self, driver, text): super(ChatElementByText, self).__init__(driver) @@ -312,6 +318,7 @@ class ChatView(BaseView): self.clear_button = ClearButton(self.driver) self.leave_chat_button = LeaveChatButton(self.driver) self.leave_button = LeaveButton(self.driver) + self.join_chat_button = JoinChatButton(self.driver) self.chat_settings = ChatSettings(self.driver) self.view_profile_button = ViewProfileButton(self.driver)