chore(@e2e): edit community test improved

This commit is contained in:
Anastasiya Semenkevich 2024-10-21 12:16:06 +03:00 committed by Anastasiya
parent b19bdcf97f
commit 7b3936522f
13 changed files with 68 additions and 58 deletions

View File

@ -72,3 +72,8 @@ class BlockPopupWarnings(Enum):
UNBLOCK_TEXT_1 = 'Unblocking ' UNBLOCK_TEXT_1 = 'Unblocking '
UNBLOCK_TEXT_2 = ' will allow new messages you receive from ' UNBLOCK_TEXT_2 = ' will allow new messages you receive from '
UNBLOCK_TEXT_3 = ' to reach you.' UNBLOCK_TEXT_3 = ' to reach you.'
class Channel(Enum):
DEFAULT_CHANNEL_NAME = 'general'
DEFAULT_CHANNEL_DESC = 'General channel for the community'

View File

@ -6,11 +6,10 @@ import allure
import configs import configs
import driver import driver
from constants import RandomCommunity, CommunityData from constants import CommunityData
from gui.components.base_popup import BasePopup from gui.components.base_popup import BasePopup
from gui.components.community.color_select_popup import ColorSelectPopup from gui.components.community.color_select_popup import ColorSelectPopup
from gui.components.community.tags_select_popup import TagsSelectPopup from gui.components.community.tags_select_popup import TagsSelectPopup
from gui.components.os.open_file_dialogs import OpenFileDialog
from gui.components.picture_edit_popup import PictureEditPopup from gui.components.picture_edit_popup import PictureEditPopup
from gui.elements.button import Button from gui.elements.button import Button
from gui.elements.check_box import CheckBox from gui.elements.check_box import CheckBox

View File

@ -0,0 +1,15 @@
import allure
from gui.components.base_popup import BasePopup
from gui.elements.button import Button
from gui.objects_map import communities_names
class LeaveCommunityConfirmationPopup(BasePopup):
def __init__(self):
super().__init__()
self.leave_button = Button(communities_names.leaveCommunityContextMenuItem)
def confirm_action(self):
self.leave_button.click()

View File

@ -1,6 +1,7 @@
import allure import allure
from gui.components.community.invite_contacts import InviteContactsPopup from gui.components.community.invite_contacts import InviteContactsPopup
from gui.components.community.leave_community_confirmation import LeaveCommunityConfirmationPopup
from gui.elements.object import QObject from gui.elements.object import QObject
from gui.objects_map import names, communities_names from gui.objects_map import names, communities_names
@ -21,13 +22,21 @@ class ContextMenu(QObject):
self.delete_channel_from_context = QObject(communities_names.delete_Channel_StatusMenuItem) self.delete_channel_from_context = QObject(communities_names.delete_Channel_StatusMenuItem)
self.invite_from_context = QObject(communities_names.invite_People_StatusMenuItem) self.invite_from_context = QObject(communities_names.invite_People_StatusMenuItem)
self.mute_from_context = QObject(communities_names.mute_Community_StatusMenuItem) self.mute_from_context = QObject(communities_names.mute_Community_StatusMenuItem)
self.leave_community_option = QObject(communities_names.leave_Community_StatusMenuItem)
@allure.step('Select in context menu') @allure.step('Select in context menu')
def select(self, value: str): def select(self, value: str):
self.menu_item.real_name['text'] = value self.menu_item.real_name['text'] = value
self.menu_item.click() self.menu_item.click()
@allure.step('Select invite people to community') @allure.step('Select invite people to community in context menu')
def select_invite_people(self): def select_invite_people(self):
self.invite_from_context.click() self.invite_from_context.click()
return InviteContactsPopup() return InviteContactsPopup()
@allure.step('Select leave community in context menu')
def leave_community(self):
self.leave_community_option.click()
return LeaveCommunityConfirmationPopup()

View File

@ -9,6 +9,7 @@ mainWindow_Create_New_Community_StatusButton = {"checkable": False, "container":
# Community View # Community View
mainWindow_communityLoader_Loader = {"container": statusDesktop_mainWindow, "objectName": "StatusSectionLayout", "type": "ContentItem", "visible": True} mainWindow_communityLoader_Loader = {"container": statusDesktop_mainWindow, "objectName": "StatusSectionLayout", "type": "ContentItem", "visible": True}
# Left Panel # Left Panel
mainWindow_communityColumnView_CommunityColumnView = {"container": mainWindow_communityLoader_Loader, "objectName": "communityColumnView", "type": "CommunityColumnView", "visible": True} mainWindow_communityColumnView_CommunityColumnView = {"container": mainWindow_communityLoader_Loader, "objectName": "communityColumnView", "type": "CommunityColumnView", "visible": True}
mainWindow_communityHeaderButton_StatusChatInfoButton = {"checkable": False, "container": mainWindow_communityColumnView_CommunityColumnView, "objectName": "communityHeaderButton", "type": "StatusChatInfoButton", "visible": True} mainWindow_communityHeaderButton_StatusChatInfoButton = {"checkable": False, "container": mainWindow_communityColumnView_CommunityColumnView, "objectName": "communityHeaderButton", "type": "StatusChatInfoButton", "visible": True}
@ -43,6 +44,7 @@ add_channels_StatusButton = {"checkable": False, "container": mainWindow_scrollV
scrollView_general_StatusChatListItem = {"container": mainWindow_scrollView_StatusScrollView, "objectName": "general", "type": "StatusChatListItem", "visible": True} scrollView_general_StatusChatListItem = {"container": mainWindow_scrollView_StatusScrollView, "objectName": "general", "type": "StatusChatListItem", "visible": True}
invite_People_StatusMenuItem = {"checkable": False, "container": statusDesktop_mainWindow_overlay, "enabled": True, "objectName": "invitePeople", "type": "StatusMenuItem", "visible": True} invite_People_StatusMenuItem = {"checkable": False, "container": statusDesktop_mainWindow_overlay, "enabled": True, "objectName": "invitePeople", "type": "StatusMenuItem", "visible": True}
mute_Community_StatusMenuItem = {"checkable": False, "container": statusDesktop_mainWindow_overlay, "enabled": True, "objectName": "StatusMenuItemDelegate", "type": "StatusMenuItem", "visible": True} mute_Community_StatusMenuItem = {"checkable": False, "container": statusDesktop_mainWindow_overlay, "enabled": True, "objectName": "StatusMenuItemDelegate", "type": "StatusMenuItem", "visible": True}
leave_Community_StatusMenuItem = {"checkable": False, "container": statusDesktop_mainWindow_overlay, "enabled": True, "objectName": "leaveCommunityMenuItem", "type": "StatusMenuItem", "visible": True}
# Tool Bar # Tool Bar
mainWindow_statusToolBar_StatusToolBar = {"container": mainWindow_StatusWindow, "objectName": "statusToolBar", "type": "StatusToolBar", "visible": True} mainWindow_statusToolBar_StatusToolBar = {"container": mainWindow_StatusWindow, "objectName": "statusToolBar", "type": "StatusToolBar", "visible": True}
@ -78,6 +80,7 @@ mainWindow_OverviewSettingsPanel = {"container": mainWindow_communityLoader_Load
communityOverviewSettingsCommunityName_StatusBaseText = {"container": mainWindow_OverviewSettingsPanel, "objectName": "communityOverviewSettingsCommunityName", "type": "StatusBaseText", "visible": True} communityOverviewSettingsCommunityName_StatusBaseText = {"container": mainWindow_OverviewSettingsPanel, "objectName": "communityOverviewSettingsCommunityName", "type": "StatusBaseText", "visible": True}
communityOverviewSettingsCommunityDescription_StatusBaseText = {"container": mainWindow_OverviewSettingsPanel, "objectName": "communityOverviewSettingsCommunityDescription", "type": "StatusBaseText", "visible": True} communityOverviewSettingsCommunityDescription_StatusBaseText = {"container": mainWindow_OverviewSettingsPanel, "objectName": "communityOverviewSettingsCommunityDescription", "type": "StatusBaseText", "visible": True}
mainWindow_Edit_Community_StatusButton = {"container": statusDesktop_mainWindow, "objectName": "communityOverviewSettingsEditCommunityButton", "type": "StatusButton", "visible": True} mainWindow_Edit_Community_StatusButton = {"container": statusDesktop_mainWindow, "objectName": "communityOverviewSettingsEditCommunityButton", "type": "StatusButton", "visible": True}
# Members Settings View # Members Settings View
mainWindow_MembersSettingsPanel = {"container": mainWindow_communityLoader_Loader, "type": "MembersSettingsPanel", "unnamed": 1, "visible": True} mainWindow_MembersSettingsPanel = {"container": mainWindow_communityLoader_Loader, "type": "MembersSettingsPanel", "unnamed": 1, "visible": True}
membersListViews_ListView = {"container": mainWindow_MembersSettingsPanel, "objectName": "CommunityMembersTabPanel_MembersListViews", "type": "ListView", "visible": True} membersListViews_ListView = {"container": mainWindow_MembersSettingsPanel, "objectName": "CommunityMembersTabPanel_MembersListViews", "type": "ListView", "visible": True}
@ -236,3 +239,6 @@ statusBadge_StatusBadge = {"container": userListPanel_StatusMemberListItem, "id"
mainWindow_membersTabBar_StatusTabBar = {"container": statusDesktop_mainWindow, "id": "membersTabBar", "type": "StatusTabBar", "unnamed": 1, "visible": True} mainWindow_membersTabBar_StatusTabBar = {"container": statusDesktop_mainWindow, "id": "membersTabBar", "type": "StatusTabBar", "unnamed": 1, "visible": True}
membersTabBar_Banned_StatusTabButton = {"checkable": True, "container": mainWindow_membersTabBar_StatusTabBar, "objectName": "bannedButton", "type": "StatusTabButton", "visible": True} membersTabBar_Banned_StatusTabButton = {"checkable": True, "container": mainWindow_membersTabBar_StatusTabBar, "objectName": "bannedButton", "type": "StatusTabButton", "visible": True}
membersTabBar_All_Members_StatusTabButton = {"checkable": True, "container": mainWindow_membersTabBar_StatusTabBar, "objectName": "allMembersButton", "type": "StatusTabButton", "visible": True} membersTabBar_All_Members_StatusTabButton = {"checkable": True, "container": mainWindow_membersTabBar_StatusTabBar, "objectName": "allMembersButton", "type": "StatusTabButton", "visible": True}
# Context menu
leaveCommunityContextMenuItem = {"checkable": False, "container": statusDesktop_mainWindow_overlay, "objectName": "CommunitiesListPanel_leaveCommunityButtonInPopup", "type": "StatusButton", "visible": True}

View File

@ -5,7 +5,7 @@ import allure
import configs import configs
import driver import driver
from constants.community_settings import MintOwnerTokensElements from constants.community import MintOwnerTokensElements
from gui.components.sign_transaction_popup import SignTransactionPopup from gui.components.sign_transaction_popup import SignTransactionPopup
from gui.elements.button import Button from gui.elements.button import Button
from gui.elements.check_box import CheckBox from gui.elements.check_box import CheckBox

View File

@ -6,7 +6,7 @@ from allure_commons._allure import step
import driver import driver
from constants import UserAccount, RandomUser, RandomCommunity, CommunityData from constants import UserAccount, RandomUser, RandomCommunity, CommunityData
from constants.community_settings import ToastMessages from constants.community import ToastMessages
from gui.screens.community import Members from gui.screens.community import Members
from gui.screens.messages import MessagesScreen from gui.screens.messages import MessagesScreen
from . import marks from . import marks
@ -17,49 +17,6 @@ from gui.main_window import MainWindow
pytestmark = marks pytestmark = marks
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703630', 'Create community')
@pytest.mark.case(703630)
def test_create_community(user_account, main_screen: MainWindow):
with step('Enable creation of community option'):
settings = main_screen.left_panel.open_settings()
settings.left_panel.open_advanced_settings().enable_creation_of_communities()
with step('Open create community popup'):
communities_portal = main_screen.left_panel.open_communities_portal()
create_community_form = communities_portal.open_create_community_popup()
with step('Verify fields of create community popup and create community'):
community = RandomCommunity()
community_screen = create_community_form.create_community(community_data=community)
with step('Verify community parameters in community overview'):
assert community_screen.left_panel.name == community.name
assert '1' in community_screen.left_panel.members
with step('Verify General channel is present for recently created community'):
community_screen.verify_channel(
'general',
'General channel for the community',
None
)
with step('Verify community parameters in community settings view'):
community_setting = community_screen.left_panel.open_community_settings()
overview_setting = community_setting.left_panel.open_overview()
assert overview_setting.name == community.name
assert overview_setting.description == community.description
members_settings = community_setting.left_panel.open_members()
assert user_account.name in members_settings.members
with step('Verify community parameters in community settings screen'):
settings_screen = main_screen.left_panel.open_settings()
community_settings = settings_screen.left_panel.open_communities_settings()
community = community_settings.get_community_info(community.name)
assert community.name == community.name
assert community.description == community.description
assert '1' in community.members
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703252', 'Kick user') @allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703252', 'Kick user')
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703254', 'Edit chat - Delete any message') @allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703254', 'Edit chat - Delete any message')
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/736991', 'Owner can ban member') @allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/736991', 'Owner can ban member')

View File

@ -6,7 +6,7 @@ import configs
import constants import constants
import driver import driver
from constants import permission_data_member, RandomCommunity from constants import permission_data_member, RandomCommunity
from constants.community_settings import LimitWarnings from constants.community import LimitWarnings
from gui.main_window import MainWindow from gui.main_window import MainWindow
from . import marks from . import marks

View File

@ -5,7 +5,7 @@ from allure_commons._allure import step
from constants import RandomCommunity from constants import RandomCommunity
from . import marks from . import marks
from constants.community_settings import AirdropsElements, TokensElements, PermissionsElements from constants.community import AirdropsElements, TokensElements, PermissionsElements
from constants.images_paths import AIRDROPS_WELCOME_IMAGE_PATH, TOKENS_WELCOME_IMAGE_PATH, PERMISSION_WELCOME_IMAGE_PATH from constants.images_paths import AIRDROPS_WELCOME_IMAGE_PATH, TOKENS_WELCOME_IMAGE_PATH, PERMISSION_WELCOME_IMAGE_PATH
from gui.main_window import MainWindow from gui.main_window import MainWindow

View File

@ -3,12 +3,12 @@ import pytest
from allure_commons._allure import step from allure_commons._allure import step
from constants import RandomCommunity from constants import RandomCommunity
from constants.community import Channel
from scripts.utils.generators import random_community_name, random_community_description, random_community_introduction, \ from scripts.utils.generators import random_community_name, random_community_description, random_community_introduction, \
random_community_leave_message random_community_leave_message
from . import marks from . import marks
import configs.testpath import configs.testpath
import constants
from gui.main_window import MainWindow from gui.main_window import MainWindow
pytestmark = marks pytestmark = marks
@ -17,15 +17,29 @@ pytestmark = marks
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703057', 'Edit community') @allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703057', 'Edit community')
@pytest.mark.case(703057) @pytest.mark.case(703057)
@pytest.mark.critical @pytest.mark.critical
def test_edit_community(main_screen: MainWindow): def test_create_edit_community(main_screen: MainWindow):
with step('Enable creation of community option'): with step('Enable creation of community option'):
settings = main_screen.left_panel.open_settings() settings = main_screen.left_panel.open_settings()
settings.left_panel.open_advanced_settings().enable_creation_of_communities() settings.left_panel.open_advanced_settings().enable_creation_of_communities()
with step('Create community and select it'): with step('Open create community popup'):
communities_portal = main_screen.left_panel.open_communities_portal()
create_community_form = communities_portal.open_create_community_popup()
with step('Verify fields of create community popup and create community'):
community = RandomCommunity() community = RandomCommunity()
main_screen.create_community(community_data=community) community_screen = create_community_form.create_community(community_data=community)
community_screen = main_screen.left_panel.select_community(community.name)
with step('Verify community parameters in community overview'):
assert community_screen.left_panel.name == community.name
assert '1' in community_screen.left_panel.members
with step('Verify General channel is present for recently created community'):
community_screen.verify_channel(
Channel.DEFAULT_CHANNEL_NAME.value,
Channel.DEFAULT_CHANNEL_DESC.value,
None
)
with step('Edit community'): with step('Edit community'):
community_setting = community_screen.left_panel.open_community_settings() community_setting = community_screen.left_panel.open_community_settings()
@ -56,3 +70,8 @@ def test_edit_community(main_screen: MainWindow):
assert community_info.name == new_name assert community_info.name == new_name
assert community_info.description == new_description assert community_info.description == new_description
assert '1' in community_info.members assert '1' in community_info.members
assert new_name in main_screen.left_panel.communities, \
f'Community {new_name} should be present in the list of communities but it is not'
context_menu = main_screen.left_panel.open_community_context_menu(new_name)
assert not context_menu.leave_community_option.is_visible, f'Leave option should not be present'

View File

@ -8,7 +8,7 @@ import configs
import constants import constants
import driver import driver
from constants import permission_data, RandomCommunity from constants import permission_data, RandomCommunity
from constants.community_settings import ToastMessages, PermissionsElements from constants.community import ToastMessages, PermissionsElements
from gui.components.changes_detected_popup import PermissionsChangesDetectedToastMessage from gui.components.changes_detected_popup import PermissionsChangesDetectedToastMessage
from gui.components.delete_popup import DeletePermissionPopup from gui.components.delete_popup import DeletePermissionPopup
from gui.main_window import MainWindow from gui.main_window import MainWindow

View File

@ -5,7 +5,7 @@ from allure_commons._allure import step
import constants import constants
import driver import driver
from constants import UserAccount, RandomUser from constants import UserAccount, RandomUser
from constants.community_settings import BlockPopupWarnings, ToastMessages from constants.community import BlockPopupWarnings, ToastMessages
from gui.main_window import MainWindow from gui.main_window import MainWindow
import configs import configs
from gui.screens.messages import ToolBar from gui.screens.messages import ToolBar

View File

@ -14,7 +14,7 @@ from helpers.OnboardingHelper import open_generate_new_keys_view, open_import_se
finalize_onboarding_and_login finalize_onboarding_and_login
from helpers.SettingsHelper import enable_testnet_mode from helpers.SettingsHelper import enable_testnet_mode
from tests.communities import marks from tests.communities import marks
from constants.community_settings import MintOwnerTokensElements from constants.community import MintOwnerTokensElements
from gui.screens.community_settings_tokens import MintedTokensView from gui.screens.community_settings_tokens import MintedTokensView
pytestmark = marks pytestmark = marks