From c3112e9f23a7851b04c28ece78e22fea4fc7dd34 Mon Sep 17 00:00:00 2001 From: Valentina1133 <141633821+Valentina1133@users.noreply.github.com> Date: Thu, 20 Jun 2024 17:18:10 +0700 Subject: [PATCH] chore: replaced inviting people to community by another method (#15226) --- test/e2e/gui/objects_map/names.py | 2 ++ test/e2e/gui/screens/community.py | 7 +++++++ test/e2e/tests/communities/test_communities.py | 8 ++++---- .../test_communities_add_a_contact_from_member_list.py | 10 +++++----- .../test_communities_pin_and_unpin_messages.py | 8 ++++---- .../tests/online_identifier/test_online_identifier.py | 8 ++++---- 6 files changed, 26 insertions(+), 17 deletions(-) diff --git a/test/e2e/gui/objects_map/names.py b/test/e2e/gui/objects_map/names.py index ebcc8168a1..80908f1253 100644 --- a/test/e2e/gui/objects_map/names.py +++ b/test/e2e/gui/objects_map/names.py @@ -18,6 +18,7 @@ closeCrossPopupButton = {"container": statusDesktop_mainWindow_overlay, "objectN mainWindow_RighPanel = {"container": statusDesktop_mainWindow, "type": "ColumnLayout", "objectName": "mainRightView", "visible": True} # Navigation Panel +mainWindow_scrollView_StatusScrollView = {"container": mainWindow_StatusWindow, "id": "scrollView", "type": "StatusScrollView", "unnamed": 1, "visible": True} mainWindow_StatusAppNavBar = {"container": statusDesktop_mainWindow, "type": "StatusAppNavBar", "unnamed": 1, "visible": True} messages_navbar_StatusNavBarTabButton = {"checkable": True, "container": mainWindow_StatusAppNavBar, "objectName": "Messages-navbar", "type": "StatusNavBarTabButton", "visible": True} mainWindow_statusMainNavBarListView_ListView = {"container": statusDesktop_mainWindow, "objectName": "statusMainNavBarListView", "type": "ListView", "visible": True} @@ -28,6 +29,7 @@ mainWindow_ProfileNavBarButton = {"container": statusDesktop_mainWindow, "object mainWindow_statusCommunityMainNavBarListView_ListView = {"container": statusDesktop_mainWindow, "objectName": "statusCommunityMainNavBarListView", "type": "ListView", "visible": True} statusCommunityMainNavBarListView_CommunityNavBarButton = {"checkable": True, "container": mainWindow_statusCommunityMainNavBarListView_ListView, "objectName": "CommunityNavBarButton", "type": "StatusNavBarTabButton", "visible": True} invite_People_StatusMenuItem = {"container": statusDesktop_mainWindow_overlay, "enabled": True, "objectName": "invitePeople", "type": "StatusMenuItem", "visible": True} +scrollView_Add_members_StatusButton = {"checkable": False, "container": mainWindow_scrollView_StatusScrollView, "objectName": "CommunityWelcomeBannerPanel_AddMembersButton", "type": "StatusButton", "visible": True} # Banners secureYourSeedPhraseBanner_ModuleWarning = {"container": statusDesktop_mainWindow, "objectName": "secureYourSeedPhraseBanner", "type": "ModuleWarning", "visible": True} diff --git a/test/e2e/gui/screens/community.py b/test/e2e/gui/screens/community.py index 6ff9e4fb5c..45d8df060c 100644 --- a/test/e2e/gui/screens/community.py +++ b/test/e2e/gui/screens/community.py @@ -10,6 +10,7 @@ from constants import UserChannel, ColorCodes from driver.objects_access import walk_children from gui.components.community.community_category_popup import NewCategoryPopup, EditCategoryPopup, CategoryPopup from gui.components.community.community_channel_popups import EditChannelPopup, NewChannelPopup +from gui.components.community.invite_contacts import InviteContactsPopup from gui.components.community.welcome_community import WelcomeCommunityPopup from gui.components.context_menu import ContextMenu from gui.components.delete_popup import DeletePopup, DeleteCategoryPopup @@ -208,6 +209,7 @@ class LeftPanel(QObject): communities_names.scrollView_addButton_StatusChatListCategoryItemButton) self._more_button = Button(communities_names.scrollView_menuButton_StatusChatListCategoryItemButton) self._arrow_button = Button(communities_names.scrollView_toggleButton_StatusChatListCategoryItemButton) + self._add_members_button = Button(names.scrollView_Add_members_StatusButton) @property @allure.step('Get community logo') @@ -380,6 +382,11 @@ class LeftPanel(QObject): def right_click_on_panel(self): super(LeftPanel, self).right_click() + @allure.step('Invite people to community') + def invite_people_to_community(self, contacts: typing.List[str], message: str): + self._add_members_button.click() + InviteContactsPopup().wait_until_appears().invite(contacts, message) + class Chat(QObject): diff --git a/test/e2e/tests/communities/test_communities.py b/test/e2e/tests/communities/test_communities.py index 88425e9787..0438839b98 100644 --- a/test/e2e/tests/communities/test_communities.py +++ b/test/e2e/tests/communities/test_communities.py @@ -176,10 +176,10 @@ def test_community_admin_kick_member_and_delete_message(multiple_instances): settings = main_screen.left_panel.open_settings() settings.left_panel.open_advanced_settings().enable_creation_of_communities() - main_screen.create_community(community_params['name'], community_params['description'], - community_params['intro'], community_params['outro'], - community_params['logo']['fp'], community_params['banner']['fp']) - main_screen.left_panel.invite_people_in_community([user_one.name], 'Message', community_params['name']) + community = main_screen.create_community(community_params['name'], community_params['description'], + community_params['intro'], community_params['outro'], + community_params['logo']['fp'], community_params['banner']['fp']) + community.left_panel.invite_people_to_community([user_one.name], 'Message') main_screen.hide() with step(f'User {user_one.name}, accept invitation from {user_two.name}'): diff --git a/test/e2e/tests/communities/test_communities_add_a_contact_from_member_list.py b/test/e2e/tests/communities/test_communities_add_a_contact_from_member_list.py index 9ddc20e980..20fc259b13 100644 --- a/test/e2e/tests/communities/test_communities_add_a_contact_from_member_list.py +++ b/test/e2e/tests/communities/test_communities_add_a_contact_from_member_list.py @@ -95,11 +95,11 @@ def test_add_a_contact_from_community_member_list(multiple_instances): with step('Enable creation of community option'): settings = main_screen.left_panel.open_settings() settings.left_panel.open_advanced_settings().enable_creation_of_communities() - main_screen.create_community(community_params['name'], community_params['description'], - community_params['intro'], community_params['outro'], - community_params['logo']['fp'], community_params['banner']['fp']) - main_screen.left_panel.invite_people_in_community([user_one.name], 'Message', community_params['name']) - main_screen.left_panel.invite_people_in_community([user_three.name], 'Message', community_params['name']) + community = main_screen.create_community(community_params['name'], community_params['description'], + community_params['intro'], community_params['outro'], + community_params['logo']['fp'], community_params['banner']['fp']) + community.left_panel.invite_people_to_community([user_one.name], 'Message') + community.left_panel.invite_people_to_community([user_three.name], 'Message') main_screen.hide() with step(f'User {user_three.name}, accept invitation from {user_two.name}'): diff --git a/test/e2e/tests/communities/test_communities_pin_and_unpin_messages.py b/test/e2e/tests/communities/test_communities_pin_and_unpin_messages.py index 9e5196d0aa..f06591fcc7 100644 --- a/test/e2e/tests/communities/test_communities_pin_and_unpin_messages.py +++ b/test/e2e/tests/communities/test_communities_pin_and_unpin_messages.py @@ -70,10 +70,10 @@ def test_join_community_and_pin_unpin_message(multiple_instances): with step('Enable creation of community option'): settings = main_screen.left_panel.open_settings() settings.left_panel.open_advanced_settings().enable_creation_of_communities() - main_screen.create_community(community_params['name'], community_params['description'], - community_params['intro'], community_params['outro'], - community_params['logo']['fp'], community_params['banner']['fp']) - main_screen.left_panel.invite_people_in_community([user_one.name], 'Message', community_params['name']) + community = main_screen.create_community(community_params['name'], community_params['description'], + community_params['intro'], community_params['outro'], + community_params['logo']['fp'], community_params['banner']['fp']) + community.left_panel.invite_people_to_community([user_one.name], 'Message') main_screen.hide() with step(f'User {user_one.name}, accept invitation from {user_two.name}'): diff --git a/test/e2e/tests/online_identifier/test_online_identifier.py b/test/e2e/tests/online_identifier/test_online_identifier.py index bad5de8b43..1623d0d7d2 100644 --- a/test/e2e/tests/online_identifier/test_online_identifier.py +++ b/test/e2e/tests/online_identifier/test_online_identifier.py @@ -86,10 +86,10 @@ def test_switch_state_to_offline_online_automatic(multiple_instances): with step('Enable creation of community option'): settings = main_screen.left_panel.open_settings() settings.left_panel.open_advanced_settings().enable_creation_of_communities() - main_screen.create_community(community_params['name'], community_params['description'], - community_params['intro'], community_params['outro'], - community_params['logo']['fp'], community_params['banner']['fp']) - main_screen.left_panel.invite_people_in_community([user_one.name], 'Message', community_params['name']) + community = main_screen.create_community(community_params['name'], community_params['description'], + community_params['intro'], community_params['outro'], + community_params['logo']['fp'], community_params['banner']['fp']) + community.left_panel.invite_people_to_community([user_one.name], 'Message') main_screen.hide() with step(f'User {user_one.name}, accept invitation from {user_two.name}'):