diff --git a/test/ui-test/src/drivers/SquishDriver.py b/test/ui-test/src/drivers/SquishDriver.py index 951c07a86d4..3ea3d101572 100755 --- a/test/ui-test/src/drivers/SquishDriver.py +++ b/test/ui-test/src/drivers/SquishDriver.py @@ -82,6 +82,11 @@ def get_obj(objName: str): def click_obj_by_name(objName: str): obj = squish.waitForObject(getattr(names, objName)) squish.mouseClick(obj, squish.Qt.LeftButton) + +# It executes the right-click action into object with given object name: +def right_click_obj_by_name(objName: str): + obj = squish.waitForObject(getattr(names, objName)) + squish.mouseClick(obj, squish.Qt.RightButton) def scroll_obj_by_name(objName: str): diff --git a/test/ui-test/src/screens/StatusCommunityScreen.py b/test/ui-test/src/screens/StatusCommunityScreen.py index ef8fc5e15aa..83d23ac1a00 100644 --- a/test/ui-test/src/screens/StatusCommunityScreen.py +++ b/test/ui-test/src/screens/StatusCommunityScreen.py @@ -14,6 +14,10 @@ from drivers.SquishDriver import * from drivers.SquishDriverVerification import * +class CommunityCreateMethods(Enum): + BOTTOM_MENU = "bottom_menu" + RIGHT_CLICK_MENU = "right_click_menu" + class CommunityScreenComponents(Enum): COMMUNITY_HEADER_BUTTON = "mainWindow_communityHeader_StatusChatInfoButton" COMMUNITY_HEADER_NAME_TEXT= "community_ChatInfo_Name_Text" @@ -23,6 +27,7 @@ class CommunityScreenComponents(Enum): CHAT_IDENTIFIER_CHANNEL_NAME = "msgDelegate_channelIdentifierNameText_StyledText" CHAT_MORE_OPTIONS_BUTTON = "chat_moreOptions_menuButton" EDIT_CHANNEL_MENU_ITEM = "edit_Channel_StatusMenuItemDelegate" + COMMUNITY_COLUMN_VIEW = "mainWindow_communityColumnView_CommunityColumnView" class CreateOrEditCommunityChannelPopup(Enum): COMMUNITY_CHANNEL_NAME_INPUT: str = "createOrEditCommunityChannelNameInput_TextEdit" @@ -37,8 +42,14 @@ def __init__(self): def verify_community_name(self, communityName: str): verify_text_matching(CommunityScreenComponents.COMMUNITY_HEADER_NAME_TEXT.value, communityName) - def create_community_channel(self, communityChannelName: str, communityChannelDescription: str): - click_obj_by_name(CommunityScreenComponents.COMMUNITY_CREATE_CHANNEL_OR_CAT_BUTTON.value) + def create_community_channel(self, communityChannelName: str, communityChannelDescription: str, method: str): + if (method == CommunityCreateMethods.BOTTOM_MENU.value): + click_obj_by_name(CommunityScreenComponents.COMMUNITY_CREATE_CHANNEL_OR_CAT_BUTTON.value) + elif (method == CommunityCreateMethods.RIGHT_CLICK_MENU.value): + right_click_obj_by_name(CommunityScreenComponents.COMMUNITY_COLUMN_VIEW.value) + else: + print("Unknown method to create a channel: ", method) + click_obj_by_name(CommunityScreenComponents.COMMUNITY_CREATE_CHANNEL__MENU_ITEM.value) wait_for_object_and_type(CreateOrEditCommunityChannelPopup.COMMUNITY_CHANNEL_NAME_INPUT.value, communityChannelName) @@ -48,7 +59,7 @@ def create_community_channel(self, communityChannelName: str, communityChannelDe def verify_channel_name(self, communityChannelName: str): verify_text_matching(CommunityScreenComponents.CHAT_IDENTIFIER_CHANNEL_NAME.value, communityChannelName) - def editCommunityChannel(self, communityChannelName: str, newCommunityChannelName: str): + def edit_community_channel(self, communityChannelName: str, newCommunityChannelName: str): click_obj_by_name(CommunityScreenComponents.CHAT_MORE_OPTIONS_BUTTON.value) click_obj_by_name(CommunityScreenComponents.EDIT_CHANNEL_MENU_ITEM.value) @@ -57,5 +68,3 @@ def editCommunityChannel(self, communityChannelName: str, newCommunityChannelNam type(CreateOrEditCommunityChannelPopup.COMMUNITY_CHANNEL_NAME_INPUT.value, newCommunityChannelName) click_obj_by_name(CreateOrEditCommunityChannelPopup.COMMUNITY_CHANNEL_BUTTON.value) time.sleep(0.5) - - \ No newline at end of file diff --git a/test/ui-test/testSuites/suite_status/shared/scripts/names.py b/test/ui-test/testSuites/suite_status/shared/scripts/names.py index 7e45dbc3222..f4097da5159 100644 --- a/test/ui-test/testSuites/suite_status/shared/scripts/names.py +++ b/test/ui-test/testSuites/suite_status/shared/scripts/names.py @@ -210,3 +210,4 @@ settings_Wallet_MainView_GeneratedAccounts = {"container": statusDesktop_mainWindow, "objectName":'generatedAccounts', "type": 'ListView'} settings_Wallet_AccountView_DeleteAccount = {"container": statusDesktop_mainWindow, "type": "StatusButton", "objectName": "deleteAccountButton"} settings_Wallet_AccountView_DeleteAccount_Confirm = {"container": statusDesktop_mainWindow, "type": "StatusButton", "objectName": "confirmDeleteAccountButton"} +mainWindow_communityColumnView_CommunityColumnView = {"container": statusDesktop_mainWindow, "objectName": "communityColumnView", "type": "CommunityColumnView"} diff --git a/test/ui-test/testSuites/suite_status/shared/steps/communitySteps.py b/test/ui-test/testSuites/suite_status/shared/steps/communitySteps.py index 7ecc71db9e7..c12d7f1aa2d 100644 --- a/test/ui-test/testSuites/suite_status/shared/steps/communitySteps.py +++ b/test/ui-test/testSuites/suite_status/shared/steps/communitySteps.py @@ -25,13 +25,13 @@ def step(context, community_name): StatusCommunityScreen() _statusCommunityScreen.verify_community_name(community_name) -@When("the admin creates a community channel named |any|, with description |any|") -def step(context, community_channel_name, community_channel_description): - _statusCommunityScreen.create_community_channel(community_channel_name, community_channel_description) +@When("the admin creates a community channel named |any|, with description |any| with the method |any|") +def step(context, community_channel_name, community_channel_description, method): + _statusCommunityScreen.create_community_channel(community_channel_name, community_channel_description, method) @When("the admin edits a community channel named |any| to the name |any|") def step(context, community_channel_name, new_community_channel_name): - _statusCommunityScreen.editCommunityChannel(community_channel_name, new_community_channel_name) + _statusCommunityScreen.edit_community_channel(community_channel_name, new_community_channel_name) @Then("the user lands on the community channel named |any|") def step(context, community_channel_name): diff --git a/test/ui-test/testSuites/suite_status/tst_communityFlows/test.feature b/test/ui-test/testSuites/suite_status/tst_communityFlows/test.feature index b7a121a45cf..bcab7024cfd 100644 --- a/test/ui-test/testSuites/suite_status/tst_communityFlows/test.feature +++ b/test/ui-test/testSuites/suite_status/tst_communityFlows/test.feature @@ -27,28 +27,30 @@ Feature: Status Desktop community Then the user lands on the community named Examples: - | community_name | community_description | community_intro | community_outro | - | testCommunity1 | Community tested 1 | My intro for the community | My community outro | + | community_name | community_description | community_intro | community_outro | + | testCommunity1 | Community tested 1 | My intro for the community | My community outro | Scenario Outline: Admin creates a community channel When the user creates a community named myCommunity, with description My community description, intro Community Intro and outro Community Outro Then the user lands on the community named myCommunity - When the admin creates a community channel named , with description + When the admin creates a community channel named , with description with the method Then the user lands on the community channel named Examples: - | community_channel_name | community_channel_description | - | test-channel | Community channel description tested 1 | + | community_channel_name | community_channel_description | method | + | test-channel | Community channel description tested 1 | bottom_menu | + | test-channel2 | Community channel description tested 2 | right_click_menu | Scenario Outline: Admin edits a community channel When the user creates a community named myCommunity, with description My community description, intro Community Intro and outro Community Outro Then the user lands on the community named myCommunity - When the admin creates a community channel named test-channel, with description My description + When the admin creates a community channel named test-channel, with description My description with the method bottom_menu Then the user lands on the community channel named test-channel When the admin edits a community channel named to the name Then the user lands on the community channel named Examples: | community_channel_name | community_channel_description | new_community_channel_name | - | test-channel | Community channel description tested 1 | new-test-channel | + | test-channel | Community channel description tested 1 | new-test-channel | + diff --git a/ui/app/AppLayouts/Chat/views/CommunityColumnView.qml b/ui/app/AppLayouts/Chat/views/CommunityColumnView.qml index e1c27686ce3..b6943579467 100644 --- a/ui/app/AppLayouts/Chat/views/CommunityColumnView.qml +++ b/ui/app/AppLayouts/Chat/views/CommunityColumnView.qml @@ -19,6 +19,7 @@ import "../panels/communities" Item { id: root + objectName: "communityColumnView" width: 304 height: parent.height @@ -114,11 +115,11 @@ Item { } StatusPopupMenu { - property bool showInviteButton: false - id: adminPopupMenu enabled: communityData.amISectionAdmin + property bool showInviteButton: false + onClosed: adminPopupMenu.showInviteButton = false StatusMenuItem { @@ -510,9 +511,8 @@ Item { onClicked: { adminPopupMenu.showInviteButton = false adminPopupMenu.popup() - adminPopupMenu.y = Qt.binding(function () { - return root.height - adminPopupMenu.height - createChannelOrCategoryBtn.height - 20 - }) + adminPopupMenu.y = Qt.binding(() => root.height - adminPopupMenu.height + - createChannelOrCategoryBtn.height - 20) } } }