E2E to receive message while in different tab
Signed-off-by: Serhy <sergii@status.im>
This commit is contained in:
parent
151b6a3cbf
commit
efab1d30ed
|
@ -59,12 +59,15 @@ class TestCreateAccount(SingleDeviceTestCase):
|
|||
for text in texts:
|
||||
if not home_view.element_by_text(text).is_element_displayed():
|
||||
self.errors.append("'%s' text is not shown" % text)
|
||||
sign_in.element_by_text("#status").click()
|
||||
sign_in.back_button.click()
|
||||
profile_view = home_view.profile_button.click()
|
||||
shown_username = profile_view.default_username_text.text
|
||||
if shown_username != username:
|
||||
self.errors.append("Default username '%s' doesn't match '%s'" % (shown_username, username))
|
||||
profile_view.home_button.click()
|
||||
profile_view.cross_icon_iside_welcome_screen_button.click()
|
||||
home_view.cross_icon_iside_welcome_screen_button.click()
|
||||
home_view.delete_chat_long_press("#status")
|
||||
if home_view.element_by_text(texts[0]).is_element_displayed():
|
||||
self.errors.append("'%s' text is shown, but welcome view was closed" % texts[0])
|
||||
home_view.relogin()
|
||||
|
|
|
@ -155,6 +155,24 @@ class TestPublicChatMultipleDevice(MultipleDeviceTestCase):
|
|||
self.errors.append('Reply message was not received by the sender')
|
||||
self.errors.verify_no_errors()
|
||||
|
||||
@marks.testrail_id(6275)
|
||||
@marks.medium
|
||||
def test_public_chat_messaging(self):
|
||||
self.create_drivers(2)
|
||||
device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
|
||||
home_1, home_2 = device_1.create_user(), device_2.create_user()
|
||||
public_chat_name = home_1.get_public_chat_name()
|
||||
chat_1, chat_2 = home_1.join_public_chat(public_chat_name), home_2.join_public_chat(public_chat_name)
|
||||
|
||||
browser = device_1.dapp_tab_button.click()
|
||||
message = 'hello'
|
||||
chat_2.send_message(message)
|
||||
|
||||
if home_1.home_button.public_unread_messages.is_element_displayed():
|
||||
device_1.home_button.click_until_absense_of_element(browser.enter_url_editbox)
|
||||
if not chat_1.chat_element_by_text(message).is_element_displayed():
|
||||
self.driver.fail("No message if it received while another tab opened")
|
||||
|
||||
|
||||
@marks.chat
|
||||
class TestPublicChatSingleDevice(SingleDeviceTestCase):
|
||||
|
|
|
@ -103,7 +103,7 @@ class TabButton(BaseButton):
|
|||
class PublicChatUnreadMessages(BaseElement):
|
||||
def __init__(self, driver):
|
||||
super(PublicChatUnreadMessages, self).__init__(driver)
|
||||
self.locator = self.Locator.accessibility_id('unviewed-messages-public')
|
||||
self.locator = self.Locator.accessibility_id('public-unread-badge')
|
||||
|
||||
return PublicChatUnreadMessages(self.driver)
|
||||
|
||||
|
|
|
@ -133,7 +133,7 @@ class ChatElement(BaseButton):
|
|||
class UnreadMessagesPublicChat(BaseElement):
|
||||
def __init__(self, driver):
|
||||
super(UnreadMessagesPublicChat, self).__init__(driver)
|
||||
self.locator = self.Locator.accessibility_id('public-unread-badge')
|
||||
self.locator = self.Locator.accessibility_id('unviewed-messages-public')
|
||||
|
||||
return UnreadMessagesPublicChat(self.driver)
|
||||
|
||||
|
|
Loading…
Reference in New Issue