test(community): add test that invites a user to the community

This commit is contained in:
Jonathan Rainville 2022-10-25 14:39:21 -04:00
parent 8055662621
commit 68fbaeadc1
47 changed files with 118 additions and 6 deletions

View File

@ -45,6 +45,11 @@ class CommunityScreenComponents(Enum):
CHAT_INPUT_ROOT = "chatInput_Root"
TOGGLE_PIN_MESSAGE_BUTTON = "chatView_TogglePinMessageButton"
PIN_TEXT = "chatInfoButton_Pin_Text"
ADD_MEMBERS_BUTTON = "community_AddMembers_Button"
EXISTING_CONTACTS_LISTVIEW = "community_InviteFirends_Popup_ExistinContacts_ListView"
INVITE_POPUP_NEXT_BUTTON = "community_InviteFriendsToCommunityPopup_NextButton"
INVITE_POPUP_MESSAGE_INPUT = "community_ProfilePopupInviteMessagePanel_MessageInput"
INVITE_POPUP_SEND_BUTTON = "community_InviteFriend_SendButton"
class CommunitySettingsComponents(Enum):
EDIT_COMMUNITY_SCROLL_VIEW = "communitySettings_EditCommunity_ScrollView"
@ -322,3 +327,26 @@ class StatusCommunityScreen:
def check_pin_count(self, wanted_pin_count: int):
pin_text_obj = wait_and_get_obj(CommunityScreenComponents.PIN_TEXT.value)
verify_equals(pin_text_obj.text, wanted_pin_count)
def invite_user_to_community(self, user_name: str, message: str):
click_obj_by_name(CommunityScreenComponents.ADD_MEMBERS_BUTTON.value)
contacts_list = wait_and_get_obj(CommunityScreenComponents.EXISTING_CONTACTS_LISTVIEW.value)
contact_item = None
found = False
for index in range(contacts_list.count):
contact_item = contacts_list.itemAtIndex(index)
if (contact_item.userName.toLower() == user_name.lower()):
found = True
break
if not found:
verify_failure("Contact with name " + user_name + " not found in the Existing Contacts list")
click_obj(contact_item)
click_obj_by_name(CommunityScreenComponents.INVITE_POPUP_NEXT_BUTTON.value)
time.sleep(0.5)
type(CommunityScreenComponents.INVITE_POPUP_MESSAGE_INPUT.value, message)
click_obj_by_name(CommunityScreenComponents.INVITE_POPUP_SEND_BUTTON.value)

View File

@ -14,6 +14,8 @@ mainWindow_ScrollView_2 = {"container": statusDesktop_mainWindow, "occurrence":
mainWindow_ProfileNavBarButton = {"container": statusDesktop_mainWindow, "objectName": "statusProfileNavBarTabButton", "type": "StatusNavBarTabButton", "visible": True}
settings_navbar_settings_icon_StatusIcon = {"container": mainWindow_navBarListView_ListView, "objectName": "settings-icon", "type": "StatusIcon", "visible": True}
splashScreen = {"container": statusDesktop_mainWindow, "objectName": "splashScreen", "type": "SplashScreen"}
navBarListView_Chat_navbar_StatusNavBarTabButton = {"checkable": True, "container": mainWindow_navBarListView_ListView, "objectName": "Chat-navbar", "type": "StatusNavBarTabButton", "visible": True}
# main right panel
mainWindow_RighPanel= {"container": statusDesktop_mainWindow, "type": "ColumnLayout", "objectName": "mainRightView", "visible": True}

View File

@ -7,5 +7,5 @@ loginView_currentUserNameLabel = {"container": statusDesktop_mainWindow, "object
loginView_submitBtn = {"container": statusDesktop_mainWindow, "type": "StatusRoundButton", "visible": True}
loginView_main = {"container": statusDesktop_mainWindow, "type": "LoginView", "visible": True}
loginView_errMsgLabel = {"container": statusDesktop_mainWindow, "objectName": "loginPassworkInputValidationErrorText", "type": "StatusBaseText", "visible": True}
accountsView_accountListPanel = {"container": statusDesktop_mainWindow, "type": "ListView", "visible": True} # This probably is missing an objectName
accountsView_accountListPanel = {"container": statusDesktop_mainWindow, "objectName": "LoginView_AccountsRepeater", "type": "Repeater", "visible": True}
loginView_userImage = {"container": statusDesktop_mainWindow, "objectName": "loginViewUserImage", "type": "UserImage", "visible": True}

View File

@ -0,0 +1,8 @@
<testconfig version="1.0">
<information>
<summary/>
<description/>
</information>
<testsettings/>
<passwords/>
</testconfig>

View File

@ -19,6 +19,14 @@ mainWindow_chatInfoBtnInHeader_StatusChatInfoButton = {"container": statusDeskto
communityChatListCategories_Repeater = {"container": statusDesktop_mainWindow, "objectName": "communityChatListCategories", "type": "Repeater"}
chatInput_Root = {"container": statusDesktop_mainWindow, "objectName": "statusChatInput", "type": "Rectangle", "visible": True}
emojiPopup_Emoji_Button_Placeholder = {"container": statusDesktop_mainWindow, "objectName": "statusEmoji_%NAME%", "type": "StatusEmoji", "visible": True}
community_AddMembers_Button = {"container": statusDesktop_mainWindow, "objectName": "CommunityWelcomeBannerPanel_AddMembersButton", "type": "StatusButton", "visible": True}
community_InviteFirends_Popup_InvitePanel = {"container": statusDesktop_mainWindow_overlay, "objectName": "CommunityProfilePopupInviteFrindsPanel_ColumnLayout", "type": "ColumnLayout", "visible": True}
community_InviteFirends_Popup_ExistinContacts_ListView = {"container": community_InviteFirends_Popup_InvitePanel, "objectName": "ExistingContacts_ListView", "type": "StatusListView", "visible": True}
community_InviteFriendsToCommunityPopup_NextButton = {"container": statusDesktop_mainWindow_overlay, "objectName": "InviteFriendsToCommunityPopup_NextButton", "type": "StatusButton", "visible": True}
community_InviteFriends_Popup_MessagePanel = {"container": statusDesktop_mainWindow_overlay, "objectName": "CommunityProfilePopupInviteMessagePanel_ColumnLayout", "type": "ColumnLayout", "visible": True}
community_ProfilePopupInviteMessagePanel_MessageInput = {"container": community_InviteFriends_Popup_MessagePanel, "objectName": "CommunityProfilePopupInviteMessagePanel_MessageInput", "type": "TextEdit", "visible": True}
community_InviteFriend_SendButton = {"container": statusDesktop_mainWindow_overlay, "objectName": "InviteFriendsToCommunityPopup_SendButton", "type": "StatusButton", "visible": True}
# Community channel popup:
createOrEditCommunityChannelNameInput_TextEdit = {"container": statusDesktop_mainWindow_overlay, "objectName": "createOrEditCommunityChannelNameInput", "type": "TextEdit", "visible": True}

View File

@ -111,6 +111,9 @@ def step(context, emoji_description: str):
def step(context):
_statusCommunityScreen.delete_current_community_channel()
@When("the admin invites the user named |any| to the community with message |any|")
def step(context, user_name, message):
_statusCommunityScreen.invite_user_to_community(user_name, message)
#########################
### VERIFICATIONS region:
@ -184,4 +187,5 @@ def the_admin_creates_a_community_category(name: str, channels: str, method: str
_statusCommunityScreen.create_community_category(name, channels, method)
def the_category_contains_channels(category_name: str, channels: str):
_statusCommunityScreen.verify_category_contains_channels(category_name, channels)
_statusCommunityScreen.verify_category_contains_channels(category_name, channels)

View File

@ -1,6 +1,7 @@
AUT=nim_status_client
ENVVARS=envvars
LANGUAGE=Python
OBJECTMAPSTYLE=script
TEST_CASES=tst_communityFlows tst_searchFlows tst_communityMessageFlows
TEST_CASES=tst_communityFlows tst_searchFlows tst_communityMessageFlows tst_communityMemberFlows
VERSION=3
WRAPPERS=Qt

View File

@ -0,0 +1,32 @@
#******************************************************************************
# Status.im
#*****************************************************************************/
#/**
# * \file test.feature
# *
# * \test Status Desktop - Community Member Flows
# * \date August 2022
# **
# *****************************************************************************/
Feature: Status Desktop community members
As a user I want to interact with members in a community
Background:
Given the user starts the application with a specific data folder "../../../fixtures/mutual_contacts"
When the user "tester123" logs in with password "TesTEr16843/!@00"
Then the user lands on the signed in app
Given the user opens the community portal section
And the user lands on the community portal section
And the user creates a community named "test_community", with description "Community description", intro "community intro" and outro "commmunity outro"
Then the user lands on the community named "test_community"
Scenario: User invites a mutual contact
When the admin invites the user named Athletic to the community with message You are invited to my community
And the user opens the chat section
And the user switches to "Athletic" chat
Then the last chat message contains "You are invited to my community"

View File

@ -0,0 +1,9 @@
source(findFile('scripts', 'python/bdd.py'))
setupHooks('../../global_shared/scripts/bdd_hooks.py')
collectStepDefinitions('./steps', '../shared/steps/', '../../global_shared/steps/', '../../suite_onboarding/shared/steps/', '../../suite_messaging/shared/steps/')
def main():
testSettings.throwOnFailure = True
runFeatureFile('test.feature')

View File

@ -0,0 +1,8 @@
<testconfig version="1.0">
<information>
<summary/>
<description/>
</information>
<testsettings/>
<passwords/>
</testconfig>

View File

@ -40,7 +40,7 @@ def step(context):
@Given("the group chat is created")
def step(context):
the_group_chat_is_created()
@Given("the user clicks on \"|any|\" chat")
def step(context, chatName):
_statusMain.open_chat(chatName)
@ -81,6 +81,7 @@ def step(context):
### ACTIONS region:
#########################
@When("the user opens the chat section")
def step(context):
the_user_opens_the_chat_section()

View File

@ -1,4 +1,5 @@
AUT=nim_status_client
ENVVARS=envvars
LANGUAGE=Python
OBJECTMAPSTYLE=script
TEST_CASES=tst_ChatFlow tst_groupChat tst_adminGroupChat

View File

@ -6,7 +6,7 @@ Feature: Status Desktop Group Chat
Background:
Given the user starts the application with a specific data folder "../../../fixtures/group_chat"
Given the user starts the application with a specific data folder "../../../fixtures/mutual_contacts"
When the user "tester123" logs in with password "TesTEr16843/!@00"
Then the user lands on the signed in app

View File

@ -6,7 +6,7 @@ Feature: Status Desktop Group Chat
Background:
Given the user starts the application with a specific data folder "../../../fixtures/group_chat"
Given the user starts the application with a specific data folder "../../../fixtures/mutual_contacts"
When the user "tester123" logs in with password "TesTEr16843/!@00"
Then the user lands on the signed in app

View File

@ -14,6 +14,7 @@ import shared.status 1.0
ColumnLayout {
id: root
objectName: "CommunityProfilePopupInviteFrindsPanel_ColumnLayout"
property string headerTitle: ""

View File

@ -14,6 +14,7 @@ import shared.status 1.0
ColumnLayout {
id: root
objectName: "CommunityProfilePopupInviteMessagePanel_ColumnLayout"
property var pubKeys: ([])
@ -33,6 +34,7 @@ ColumnLayout {
StatusInput {
id: messageInput
input.edit.objectName: "CommunityProfilePopupInviteMessagePanel_MessageInput"
label: qsTr("Invitation Message")
charLimit: d.maxMsgLength
placeholderText: qsTr("The message a contact will get with community invitation")

View File

@ -83,6 +83,7 @@ Rectangle {
StatusButton {
id: addMembersBtn
objectName:"CommunityWelcomeBannerPanel_AddMembersButton"
text: qsTr("Add members")
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: welcomeText.bottom

View File

@ -58,6 +58,7 @@ StatusStackModal {
rightPadding: 0
nextButton: StatusButton {
objectName: "InviteFriendsToCommunityPopup_NextButton"
text: qsTr("Next")
enabled: root.pubKeys.length
onClicked: {
@ -66,6 +67,7 @@ StatusStackModal {
}
finishButton: StatusButton {
objectName: "InviteFriendsToCommunityPopup_SendButton"
enabled: root.pubKeys.length > 0
text: qsTr("Send Invites")
onClicked: {

View File

@ -289,6 +289,9 @@ Item {
width: parent.width
Repeater {
objectName: "LoginView_AccountsRepeater"
width: parent.width
height: parent.height
model: proxyModel
delegate: AccountMenuItemPanel {

View File

@ -40,6 +40,7 @@ Item {
StatusListView {
id: contactListView
objectName: "ExistingContacts_ListView"
anchors.fill: parent
rightMargin: 0
leftMargin: 0