fix group chat tests
Signed-off-by: Serhy <sergii@status.im>
This commit is contained in:
parent
4dca2e9caa
commit
471d26c6d1
|
@ -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: open group chat
|
||||||
device_2_chat = device_2_home.get_chat_with_user(chat_name).click()
|
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
|
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)
|
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)
|
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
|
user2_left_chat_system_message = "*%s* left the group" % device_2_default_username
|
||||||
|
|
||||||
# device 2: delete group chat
|
# device 2: delete group chat
|
||||||
|
@ -165,6 +165,7 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase):
|
||||||
|
|
||||||
# device 2: open the chat and check messages
|
# device 2: open the chat and check messages
|
||||||
device_2_chat = device_2_home.get_chat_with_user(chat_name).click()
|
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():
|
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')
|
self.errors.append('Message that was sent after device 2 has joined is not visible')
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ class TestBrowsing(SingleDeviceTestCase):
|
||||||
sign_in = SignInView(self.driver)
|
sign_in = SignInView(self.driver)
|
||||||
home_view = sign_in.create_user()
|
home_view = sign_in.create_user()
|
||||||
start_new_chat = home_view.plus_button.click()
|
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.url_edit_box_lock_icon.click()
|
||||||
browsing_view.find_full_text(connection_not_secure_text)
|
browsing_view.find_full_text(connection_not_secure_text)
|
||||||
|
|
||||||
|
|
|
@ -200,6 +200,12 @@ class ProfileSendTransactionButton(BaseButton):
|
||||||
self.locator = self.Locator.accessibility_id('send-transaction-button')
|
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):
|
class ChatElementByText(BaseText):
|
||||||
def __init__(self, driver, text):
|
def __init__(self, driver, text):
|
||||||
super(ChatElementByText, self).__init__(driver)
|
super(ChatElementByText, self).__init__(driver)
|
||||||
|
@ -312,6 +318,7 @@ class ChatView(BaseView):
|
||||||
self.clear_button = ClearButton(self.driver)
|
self.clear_button = ClearButton(self.driver)
|
||||||
self.leave_chat_button = LeaveChatButton(self.driver)
|
self.leave_chat_button = LeaveChatButton(self.driver)
|
||||||
self.leave_button = LeaveButton(self.driver)
|
self.leave_button = LeaveButton(self.driver)
|
||||||
|
self.join_chat_button = JoinChatButton(self.driver)
|
||||||
|
|
||||||
self.chat_settings = ChatSettings(self.driver)
|
self.chat_settings = ChatSettings(self.driver)
|
||||||
self.view_profile_button = ViewProfileButton(self.driver)
|
self.view_profile_button = ViewProfileButton(self.driver)
|
||||||
|
|
Loading…
Reference in New Issue