mirror of
https://github.com/status-im/status-mobile.git
synced 2025-01-12 17:54:32 +00:00
e2e: communities fix
This commit is contained in:
parent
1654c32ea0
commit
6530713c3f
@ -631,7 +631,6 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase):
|
||||
self.errors.verify_no_errors()
|
||||
|
||||
@marks.testrail_id(702843)
|
||||
@marks.xfail(reason="blocked by 14797")
|
||||
def test_community_message_edit(self):
|
||||
message_before_edit, message_after_edit = 'Message BEFORE edit', "Message AFTER edit 2"
|
||||
if not self.channel_2.chat_message_input.is_element_displayed():
|
||||
@ -696,25 +695,6 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase):
|
||||
self.errors.append('Reply message was not received by the sender')
|
||||
self.errors.verify_no_errors()
|
||||
|
||||
@marks.testrail_id(702841)
|
||||
def test_community_unread_messages_badge(self):
|
||||
self.channel_1.send_message('пиу')
|
||||
self.channel_1.click_system_back_button_until_element_is_shown()
|
||||
message = 'test message'
|
||||
self.channel_2.send_message(message)
|
||||
self.home_1.just_fyi('Check new messages badge is shown for community')
|
||||
community_element_1 = self.home_1.get_chat(self.community_name, community=True)
|
||||
if not community_element_1.new_messages_community.is_element_displayed():
|
||||
self.errors.append('New message community badge is not shown')
|
||||
|
||||
community_1 = community_element_1.click()
|
||||
channel_1_element = community_1.get_chat(self.channel_name)
|
||||
self.home_1.just_fyi('Check new messages badge is shown for community')
|
||||
if not channel_1_element.new_messages_public_chat.is_element_displayed():
|
||||
self.errors.append('New messages channel badge is not shown on channel')
|
||||
channel_1_element.click()
|
||||
self.errors.verify_no_errors()
|
||||
|
||||
@marks.testrail_id(702844)
|
||||
def test_community_links_with_previews_github_youtube_twitter_gif_send_enable(self):
|
||||
giphy_url = 'https://giphy.com/gifs/this-is-fine-QMHoU66sBXqqLqYvGO'
|
||||
@ -774,11 +754,33 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase):
|
||||
self.errors.append("Preview is shown for sender without permission")
|
||||
self.errors.verify_no_errors()
|
||||
|
||||
@marks.testrail_id(702841)
|
||||
def test_community_unread_messages_badge(self):
|
||||
self.channel_1.send_message('пиу')
|
||||
self.channel_1.jump_to_communities_home()
|
||||
message = 'test message'
|
||||
self.channel_2.send_message(message)
|
||||
self.home_1.just_fyi('Check new messages badge is shown for community')
|
||||
community_element_1 = self.home_1.get_chat(self.community_name, community=True)
|
||||
if not community_element_1.new_messages_community.is_element_displayed():
|
||||
self.errors.append('New message community badge is not shown')
|
||||
|
||||
community_1 = community_element_1.click()
|
||||
channel_1_element = community_1.get_chat('# %s' % self.channel_name)
|
||||
# blocked of 14906
|
||||
# self.home_1.just_fyi('Check new messages badge is shown for community')
|
||||
# if not channel_1_element.new_messages_public_chat.is_element_displayed():
|
||||
# self.errors.append('New messages channel badge is not shown on channel')
|
||||
channel_1_element.click()
|
||||
self.errors.verify_no_errors()
|
||||
|
||||
|
||||
|
||||
@marks.testrail_id(702842)
|
||||
@marks.xfail(reason='blocked due to navigation issue 14906')
|
||||
def test_community_mark_all_messages_as_read(self):
|
||||
self.channel_1.back_button.click()
|
||||
self.channel_2.send_message(self.text_message)
|
||||
chan_1_element = self.community_1.get_chat(self.channel_name)
|
||||
chan_1_element = self.community_1.get_chat('# %s' % self.channel_name)
|
||||
if not chan_1_element.new_messages_public_chat.is_element_displayed():
|
||||
self.errors.append('New messages counter is not shown in public chat')
|
||||
chan_1_element.long_press_element()
|
||||
|
@ -79,6 +79,7 @@ class HomeButton(TabButton):
|
||||
self.click_until_presence_of_element(element)
|
||||
return self.navigate()
|
||||
|
||||
|
||||
class CommunitiesTab(TabButton):
|
||||
def __init__(self, driver):
|
||||
super().__init__(driver, accessibility_id="communities-stack-tab")
|
||||
@ -97,10 +98,12 @@ class WalletTab(TabButton):
|
||||
def __init__(self, driver):
|
||||
super().__init__(driver, accessibility_id="wallet-stack-tab")
|
||||
|
||||
|
||||
class BrowserTab(TabButton):
|
||||
def __init__(self, driver):
|
||||
super().__init__(driver, accessibility_id="browser-stack-tab")
|
||||
|
||||
|
||||
class DappTabButton(TabButton):
|
||||
def __init__(self, driver):
|
||||
super().__init__(driver, xpath="//*[contains(@content-desc,'tab, 2 out of 5')]")
|
||||
@ -257,6 +260,8 @@ class BaseView(object):
|
||||
self.browser_tab = BrowserTab(self.driver)
|
||||
self.wallet_tab = WalletTab(self.driver)
|
||||
|
||||
self.jump_to_button = Button(self.driver, accessibility_id="jump-to")
|
||||
|
||||
self.yes_button = Button(self.driver, xpath="//*[@text='YES' or @text='GOT IT']")
|
||||
self.no_button = Button(self.driver, translation_id="no")
|
||||
self.back_button = BackButton(self.driver)
|
||||
@ -591,6 +596,14 @@ class BaseView(object):
|
||||
sign_in_view = self.get_sign_in_view()
|
||||
sign_in_view.sign_in(password)
|
||||
|
||||
def jump_to_messages_home(self):
|
||||
self.jump_to_button.click()
|
||||
self.chats_tab.click()
|
||||
|
||||
def jump_to_communities_home(self):
|
||||
self.jump_to_button.click()
|
||||
self.communities_tab.click()
|
||||
|
||||
def reopen_app(self, password=common_password):
|
||||
self.driver.close_app()
|
||||
self.driver.launch_app()
|
||||
|
@ -329,10 +329,10 @@ class HomeView(BaseView):
|
||||
except TimeoutException:
|
||||
break
|
||||
|
||||
def get_chat(self, username, community=False, wait_time=30):
|
||||
def get_chat(self, username, community=False, wait_time=10):
|
||||
self.driver.info("Looking for chat: '%s'" % username)
|
||||
chat_element = ChatElement(self.driver, username[:25], community=community)
|
||||
if not chat_element.is_element_displayed(10):
|
||||
if not chat_element.is_element_displayed(wait_time):
|
||||
if self.notifications_unread_badge.is_element_displayed(30):
|
||||
chat_in_ac = ActivityCenterElement(self.driver, username[:25])
|
||||
self.open_activity_center_button.click_until_presence_of_element(chat_in_ac)
|
||||
|
Loading…
x
Reference in New Issue
Block a user