e2e: discover communities (#16957)
This commit is contained in:
parent
6550bc058d
commit
5a3d886055
|
@ -2,7 +2,7 @@
|
||||||
name: MVPBug Report
|
name: MVPBug Report
|
||||||
about: MVPBug Report
|
about: MVPBug Report
|
||||||
title: ''
|
title: ''
|
||||||
labels: 'E:Mobile Bugfixes MVP'
|
labels: 'E:Mobile Bug MVP'
|
||||||
assignees: ''
|
assignees: ''
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
|
@ -309,6 +309,7 @@ class TestCommunityOneDeviceMerged(MultipleSharedDeviceTestCase):
|
||||||
self.drivers, self.loop = create_shared_drivers(1)
|
self.drivers, self.loop = create_shared_drivers(1)
|
||||||
self.sign_in = SignInView(self.drivers[0])
|
self.sign_in = SignInView(self.drivers[0])
|
||||||
self.username = 'first user'
|
self.username = 'first user'
|
||||||
|
self.discovery_community_attributes = "Contributors' test community", 'test anything here', 'Web3', 'Software dev'
|
||||||
|
|
||||||
self.home = self.sign_in.create_user(username=self.username)
|
self.home = self.sign_in.create_user(username=self.username)
|
||||||
self.home.communities_tab.click_until_presence_of_element(self.home.plus_community_button)
|
self.home.communities_tab.click_until_presence_of_element(self.home.plus_community_button)
|
||||||
|
@ -320,13 +321,31 @@ class TestCommunityOneDeviceMerged(MultipleSharedDeviceTestCase):
|
||||||
self.community_view = self.home.get_community_view()
|
self.community_view = self.home.get_community_view()
|
||||||
self.channel = self.community_view.get_channel(self.channel_name).click()
|
self.channel = self.community_view.get_channel(self.channel_name).click()
|
||||||
|
|
||||||
|
@marks.testrail_id(703503)
|
||||||
|
def test_community_discovery(self):
|
||||||
|
self.home.jump_to_communities_home()
|
||||||
|
self.home.discover_communities_button.click()
|
||||||
|
for text in self.discovery_community_attributes:
|
||||||
|
if not self.home.element_by_text(text).is_element_displayed(10):
|
||||||
|
self.errors.append("%s in not in Discovery!" % text)
|
||||||
|
self.home.element_by_text(self.discovery_community_attributes[0]).click()
|
||||||
|
element_templates = {
|
||||||
|
self.community_view.join_button: 'discovery_join_button.png',
|
||||||
|
self.community_view.get_channel_avatar(): 'discovery_general_channel.png',
|
||||||
|
}
|
||||||
|
for element, template in element_templates.items():
|
||||||
|
if element.is_element_differs_from_template(template):
|
||||||
|
element.save_new_screenshot_of_element('%s_different.png' % element.name)
|
||||||
|
self.errors.append("%s is different from expected %s!" % (element.name, template))
|
||||||
|
self.errors.verify_no_errors()
|
||||||
|
|
||||||
@marks.testrail_id(702846)
|
@marks.testrail_id(702846)
|
||||||
def test_community_navigate_to_channel_when_relaunch(self):
|
def test_community_navigate_to_channel_when_relaunch(self):
|
||||||
text_message = 'some_text'
|
text_message = 'some_text'
|
||||||
if not self.channel.chat_message_input.is_element_displayed():
|
if not self.channel.chat_message_input.is_element_displayed():
|
||||||
self.home.communities_tab.double_click()
|
self.home.click_system_back_button_until_element_is_shown()
|
||||||
self.home.get_chat(self.community_name, community=True).click()
|
self.home.get_to_community_channel_from_home(self.community_name)
|
||||||
self.community.get_chat(self.channel_name).click()
|
|
||||||
self.channel.send_message(text_message)
|
self.channel.send_message(text_message)
|
||||||
self.channel.reopen_app()
|
self.channel.reopen_app()
|
||||||
if not self.channel.chat_element_by_text(text_message).is_element_displayed(30):
|
if not self.channel.chat_element_by_text(text_message).is_element_displayed(30):
|
||||||
|
|
|
@ -393,6 +393,7 @@ class CommunityView(HomeView):
|
||||||
self.join_button = Button(self.driver, accessibility_id="show-request-to-join-screen-button")
|
self.join_button = Button(self.driver, accessibility_id="show-request-to-join-screen-button")
|
||||||
self.join_community_button = Button(self.driver, accessibility_id="join-community-button")
|
self.join_community_button = Button(self.driver, accessibility_id="join-community-button")
|
||||||
self.follow_button = Button(self.driver, translation_id="follow")
|
self.follow_button = Button(self.driver, translation_id="follow")
|
||||||
|
self.community_tags = BaseElement(self.driver, xpath="//*[@content-desc='chat-name-text']/../android.widget.HorizontalScrollView")
|
||||||
|
|
||||||
#### NEW UI
|
#### NEW UI
|
||||||
# Communities initial page
|
# Communities initial page
|
||||||
|
@ -427,6 +428,9 @@ class CommunityView(HomeView):
|
||||||
self.community_info_button.wait_and_click()
|
self.community_info_button.wait_and_click()
|
||||||
self.leave_community_button.scroll_and_click()
|
self.leave_community_button.scroll_and_click()
|
||||||
|
|
||||||
|
def get_channel_avatar(self, channel_name='general'):
|
||||||
|
return Button(self.driver, xpath='//*[@text="# %s"]/../*[@content-desc="channel-avatar"]' % channel_name)
|
||||||
|
|
||||||
def copy_community_link(self):
|
def copy_community_link(self):
|
||||||
self.driver.info("Copy community link")
|
self.driver.info("Copy community link")
|
||||||
self.community_options_button.click()
|
self.community_options_button.click()
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
Binary file not shown.
After Width: | Height: | Size: 5.0 KiB |
|
@ -304,6 +304,7 @@ class HomeView(BaseView):
|
||||||
# New UI
|
# New UI
|
||||||
self.new_chat_button = Button(self.driver, accessibility_id="new-chat-button")
|
self.new_chat_button = Button(self.driver, accessibility_id="new-chat-button")
|
||||||
self.jump_to_button = Button(self.driver, accessibility_id="jump-to")
|
self.jump_to_button = Button(self.driver, accessibility_id="jump-to")
|
||||||
|
self.discover_communities_button = Button(self.driver, accessibility_id="communities-home-discover-card")
|
||||||
|
|
||||||
# New UI bottom sheet
|
# New UI bottom sheet
|
||||||
self.start_a_new_chat_bottom_sheet_button = Button(self.driver, accessibility_id="start-a-new-chat")
|
self.start_a_new_chat_bottom_sheet_button = Button(self.driver, accessibility_id="start-a-new-chat")
|
||||||
|
|
Loading…
Reference in New Issue