test(community): add test for the right click menu to create channel
Fixes #6609
This commit is contained in:
parent
e20929be4c
commit
3f10da868a
|
@ -83,6 +83,11 @@ 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):
|
||||
obj = squish.waitForObject(getattr(names, objName))
|
||||
|
|
|
@ -14,6 +14,10 @@ import time
|
|||
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 @@ class StatusCommunityScreen:
|
|||
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):
|
||||
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 @@ class StatusCommunityScreen:
|
|||
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 @@ class StatusCommunityScreen:
|
|||
type(CreateOrEditCommunityChannelPopup.COMMUNITY_CHANNEL_NAME_INPUT.value, newCommunityChannelName)
|
||||
click_obj_by_name(CreateOrEditCommunityChannelPopup.COMMUNITY_CHANNEL_BUTTON.value)
|
||||
time.sleep(0.5)
|
||||
|
||||
|
|
@ -210,3 +210,4 @@ mainWallet_Add_Account_Popup_Footer_Add_Account = {"container": mainWallet_Add_A
|
|||
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"}
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -34,17 +34,18 @@ Feature: Status Desktop community
|
|||
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 <community_channel_name>, with description <community_channel_description>
|
||||
When the admin creates a community channel named <community_channel_name>, with description <community_channel_description> with the method <method>
|
||||
Then the user lands on the community channel named <community_channel_name>
|
||||
|
||||
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 <community_channel_name> to the name <new_community_channel_name>
|
||||
Then the user lands on the community channel named <new_community_channel_name>
|
||||
|
@ -52,3 +53,4 @@ Feature: Status Desktop community
|
|||
Examples:
|
||||
| community_channel_name | community_channel_description | new_community_channel_name |
|
||||
| test-channel | Community channel description tested 1 | new-test-channel |
|
||||
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue