From b798b18c18c176e3521eae8265a0aebb88945365 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Mon, 23 Jan 2023 16:31:26 -0500 Subject: [PATCH] test(community): re-add a couple of chat tests in community tests Fixes #9240 #9241 #9242 #9243 #9239 --- test/ui-test/src/screens/StatusChatScreen.py | 4 ++ test/ui-test/src/screens/StatusMainScreen.py | 2 - .../global_shared/scripts/global_names.py | 8 ++++ .../shared/scripts/community_names.py | 5 ++ .../tst_communityMessageFlows/test.feature | 48 +++++++++++++++++++ .../shared/scripts/chat_names.py | 12 ----- 6 files changed, 65 insertions(+), 14 deletions(-) diff --git a/test/ui-test/src/screens/StatusChatScreen.py b/test/ui-test/src/screens/StatusChatScreen.py index 2bdc34fbb4..4c42f8736b 100644 --- a/test/ui-test/src/screens/StatusChatScreen.py +++ b/test/ui-test/src/screens/StatusChatScreen.py @@ -481,7 +481,11 @@ class StatusChatScreen: verify(str(chat_image_loader.source.path) in image_link, "The url is most probably the one expected") def verify_image_unfurled_status(self, image_link: str, unfurled: bool): + message_list = get_obj(ChatComponents.CHAT_LOG.value) + message_list.positionViewAtEnd() self._verify_image_unfurled_status_for_component(ChatComponents.LINK_PREVIEW_UNFURLED_IMAGE.value, image_link, unfurled) def verify_link_image_unfurled_status(self, image_link: str, unfurled: bool): + message_list = get_obj(ChatComponents.CHAT_LOG.value) + message_list.positionViewAtEnd() self._verify_image_unfurled_status_for_component(ChatComponents.LINK_PREVIEW_UNFURLED_LINK_IMAGE.value, image_link, unfurled) diff --git a/test/ui-test/src/screens/StatusMainScreen.py b/test/ui-test/src/screens/StatusMainScreen.py index d3f92b6594..479d70eac7 100644 --- a/test/ui-test/src/screens/StatusMainScreen.py +++ b/test/ui-test/src/screens/StatusMainScreen.py @@ -22,7 +22,6 @@ class MainScreenComponents(Enum): POPUP_OVERLAY = "statusDesktop_mainWindow_overlay" CHAT_NAVBAR_ICON = "navBarListView_Chat_navbar_StatusNavBarTabButton" COMMUNITY_PORTAL_BUTTON = "navBarListView_Communities_Portal_navbar_StatusNavBarTabButton" - JOIN_PUBLIC_CHAT = "join_public_chat_StatusMenuItem" SETTINGS_BUTTON = "navBarListView_Settings_navbar_StatusNavBarTabButton" WALLET_BUTTON = "wallet_navbar_wallet_icon_StatusIcon" START_CHAT_BTN = "mainWindow_startChat" @@ -47,7 +46,6 @@ class ProfilePopup(Enum): class ChatNamePopUp(Enum): CHAT_NAME_TEXT = "chat_name_PlaceholderText" - INPUT_ROOM_TOPIC_TEXT = "joinPublicChat_input" START_CHAT_BTN = "startChat_Btn" diff --git a/test/ui-test/testSuites/global_shared/scripts/global_names.py b/test/ui-test/testSuites/global_shared/scripts/global_names.py index f1bb7719a5..ac5f614613 100644 --- a/test/ui-test/testSuites/global_shared/scripts/global_names.py +++ b/test/ui-test/testSuites/global_shared/scripts/global_names.py @@ -42,6 +42,14 @@ chatView_StatusChatInfoButton = {"container": statusDesktop_mainWindow, "objectN chatInfoButton_Pin_Text = {"container": chatView_StatusChatInfoButton, "objectName": "StatusChatInfo_pinText", "type": "StatusBaseText", "visible": True} startChat_Btn = {"container": statusDesktop_mainWindow_overlay, "objectName": "startChatButton", "type": "StatusButton"} chatButtonsPanelConfirmDeleteMessageButton_StatusButton = {"container": statusDesktop_mainWindow_overlay, "objectName": "chatButtonsPanelConfirmDeleteMessageButton", "type": "StatusButton"} +chatView_chatLogView_lastMsg_MessageView = {"container": chatView_log, "index": 0, "type": "MessageView"} +chatView_lastChatText_Text = {"container": chatView_chatLogView_lastMsg_MessageView, "type": "TextEdit", "objectName": "StatusTextMessage_chatText", "visible": True} +chatView_gifPopupButton = {"container": statusDesktop_mainWindow, "objectName": "gifPopupButton", "type": "StatusFlatRoundButton", "visible": True} +chatView_ChatToolbarMoreOptionsButton = {"container": statusDesktop_mainWindow, "objectName": "chatToolbarMoreOptionsButton", "type": "StatusFlatRoundButton", "visible": True} + +# Gif popup: +gifPopup_enableGifButton = {"container": statusDesktop_mainWindow_overlay, "objectName": "enableGifsButton", "type": "StatusButton"} +gifPopup_gifMouseArea = {"container": statusDesktop_mainWindow_overlay, "objectName": "gifMouseArea_1", "type": "MouseArea"} # My Profile Popup ProfileHeader_userImage = {"container": statusDesktop_mainWindow_overlay, "objectName": "ProfileHeader_userImage", "type": "UserImage", "visible": True} diff --git a/test/ui-test/testSuites/suite_communities/shared/scripts/community_names.py b/test/ui-test/testSuites/suite_communities/shared/scripts/community_names.py index ded7ed8d29..071e3f3103 100644 --- a/test/ui-test/testSuites/suite_communities/shared/scripts/community_names.py +++ b/test/ui-test/testSuites/suite_communities/shared/scripts/community_names.py @@ -29,10 +29,15 @@ communitySettings_Members_NavigationListItem = {"container": statusDesktop_mainW communitySettings_MembersTab_Members_ListView = {"container": statusDesktop_mainWindow, "objectName": "CommunityMembersTabPanel_MembersListViews", "type": "ListView", "visible": True} communitySettings_MembersTab_Member_Kick_Button = {"container": communitySettings_MembersTab_Members_ListView, "objectName": "MemberListIten_KickButton", "type": "StatusButton", "visible": True} communitySettings_KickModal_Kick_Button = {"container": statusDesktop_mainWindow_overlay, "objectName": "CommunityMembers_KickModal_KickButton", "type": "StatusButton", "visible": True} + +# Chat components chatView_TogglePinMessageButton = {"container": chatView_log, "objectName": "MessageView_toggleMessagePin", "type": "StatusFlatRoundButton", "visible": True} chatView_ReplyToMessageButton = {"container": chatView_log, "objectName": "replyToMessageButton", "type": "StatusFlatRoundButton", "visible": True} chatView_editMessageInputComponent = {"container": statusDesktop_mainWindow, "objectName": "editMessageInput", "type": "StatusChatInput", "visible": True} chatView_editMessageInputTextArea = {"container": chatView_editMessageInputComponent, "objectName": "messageInputField", "type": "TextArea", "visible": True} +clearHistoryMenuItem = {"container": statusDesktop_mainWindow_overlay, "objectName": "clearHistoryMenuItem", "type": "StatusMenuItem", "visible": True} +chatView_unfurledImageComponent_linkImage = {"container": chatView_log, "objectName": "LinksMessageView_unfurledImageComponent_linkImage", "type": "StatusChatImageLoader", "visible": True} +emojiSuggestions_first_inputListRectangle ={"container": statusDesktop_mainWindow_overlay, "objectName": "inputListRectangle_0", "type": "Rectangle"} # Community channel popup: createOrEditCommunityChannelNameInput_TextEdit = {"container": statusDesktop_mainWindow_overlay, "objectName": "createOrEditCommunityChannelNameInput", "type": "TextEdit", "visible": True} diff --git a/test/ui-test/testSuites/suite_communities/tst_communityMessageFlows/test.feature b/test/ui-test/testSuites/suite_communities/tst_communityMessageFlows/test.feature index 8cd3e40ac1..970c06cf6d 100644 --- a/test/ui-test/testSuites/suite_communities/tst_communityMessageFlows/test.feature +++ b/test/ui-test/testSuites/suite_communities/tst_communityMessageFlows/test.feature @@ -78,3 +78,51 @@ Feature: Status Desktop community messages Examples: | edited | | Edited by me | + + Scenario Outline: The user can delete his/her own message + Given the user sends a chat message "" + When the user deletes the message at index 0 + Then the last message displayed is not "" + Examples: + | message | + | random chat message | + + Scenario: The user can clear chat history + Given the user sends a chat message "Hi hi" + And the user sends a chat message "testing chat" + And the user sends a chat message "history" + When the user clears chat history + Then the chat is cleared + + Scenario: The user can send a GIF + Given the user opens app settings screen + And the user opens the messaging settings + When the user activates the link preview if it is deactivated + And the user activates tenor GIFs preview + And the user opens the community named "test_community" + Then the user lands on the community named "test_community" + When the user sends a GIF message + Then the GIF message is displayed + + @mayfail + # Test fails at finding the link. Issue #9380 + Scenario Outline: The user can activate image unfurling + Given the user sends a chat message "" + And the image "" is not unfurled in the chat + And the user opens app settings screen + And the user opens the messaging settings + When the user activates the link preview if it is deactivated + And the user activates image unfurling + And the user opens the community named "test_community" + Then the user lands on the community named "test_community" + When the user switches to "general" chat + Then the image "" is unfurled in the chat + Examples: + | image_url | + | https://github.com/status-im/status-desktop/raw/master/test/ui-test/fixtures/images/doggo.jpeg | + + Scenario: The user is able to use emoji suggestions + Given the user types "hello :thumbs" + And the user selects the emoji in the suggestion's list + When the user presses enter + Then the last chat message contains "👍" \ No newline at end of file diff --git a/test/ui-test/testSuites/suite_messaging/shared/scripts/chat_names.py b/test/ui-test/testSuites/suite_messaging/shared/scripts/chat_names.py index 6023b4b8c3..e8c0c328e9 100644 --- a/test/ui-test/testSuites/suite_messaging/shared/scripts/chat_names.py +++ b/test/ui-test/testSuites/suite_messaging/shared/scripts/chat_names.py @@ -2,25 +2,17 @@ from scripts.global_names import * # Chat view: mainWindow_scrollView_ScrollView = {"container": statusDesktop_mainWindow, "id": "scrollView", "type": "StatusScrollView", "unnamed": 1, "visible": True} -chatView_chatLogView_lastMsg_MessageView = {"container": chatView_log, "index": 0, "type": "MessageView"} -chatView_lastChatText_Text = {"container": chatView_chatLogView_lastMsg_MessageView, "type": "TextEdit", "objectName": "StatusTextMessage_chatText", "visible": True} -chatView_editMessageInputComponent = {"container": statusDesktop_mainWindow, "objectName": "editMessageInput", "type": "StatusChatInput", "visible": True} mark_as_Read_StatusMenuItem = {"container": statusDesktop_mainWindow_overlay, "objectName": "chatMarkAsReadMenuItem", "type": "StatusMenuItem", "visible": True} chat_Input_Stickers_Button = {"container": statusDesktop_mainWindow, "objectName": "statusChatInputStickersButton", "type": "StatusFlatRoundButton", "visible": True} chatView_SuggestionBoxPanel ={"container": statusDesktop_mainWindow, "objectName": "suggestionsBox", "type": "SuggestionBoxPanel"} chatView_suggestion_ListView ={"container": chatView_SuggestionBoxPanel, "objectName": "suggestionBoxList", "type": "StatusListView"} chatView_userMentioned_ProfileView ={"container": statusDesktop_mainWindow_overlay, "objectName": "profileView", "type": "ProfileView"} -emojiSuggestions_first_inputListRectangle ={"container": statusDesktop_mainWindow_overlay, "objectName": "inputListRectangle_0", "type": "Rectangle"} emojiPopup_Emoji_Button_Placeholder = {"container": statusDesktop_mainWindow, "objectName": "statusEmoji_%NAME%", "type": "StatusEmoji", "visible": True} chatInput_Emoji_Button = {"container": statusDesktop_mainWindow, "objectName": "statusChatInputEmojiButton", "type": "StatusFlatRoundButton", "visible": True} -chatView_ChatToolbarMoreOptionsButton = {"container": statusDesktop_mainWindow, "objectName": "chatToolbarMoreOptionsButton", "type": "StatusFlatRoundButton", "visible": True} -chatView_gifPopupButton = {"container": statusDesktop_mainWindow, "objectName": "gifPopupButton", "type": "StatusFlatRoundButton", "visible": True} -chatView_unfurledImageComponent_linkImage = {"container": chatView_log, "objectName": "LinksMessageView_unfurledImageComponent_linkImage", "type": "StatusChatImageLoader", "visible": True} chatView_unfurledLinkComponent_linkImage = {"container": chatView_log, "objectName": "LinksMessageView_unfurledLinkComponent_linkImage", "type": "StatusChatImageLoader", "visible": True} chatView_LinksMessageView_enableBtn = {"container": chatView_log, "objectName": "LinksMessageView_enableBtn", "type": "StatusFlatButton", "visible": True} # More options menu -clearHistoryMenuItem = {"container": statusDesktop_mainWindow_overlay, "objectName": "clearHistoryMenuItem", "type": "StatusMenuItem", "visible": True} editNameAndImageMenuItem = {"container": statusDesktop_mainWindow_overlay, "objectName": "editNameAndImageMenuItem", "type": "StatusMenuItem", "visible": True} leaveChatMenuItem = {"container": statusDesktop_mainWindow_overlay, "enabled": True, "objectName": "deleteOrLeaveMenuItem", "type": "StatusMenuItem", "visible": True} @@ -33,10 +25,6 @@ groupChatEdit_workflowItem= {"container": statusDesktop_mainWindow, "type": "Ite groupChatEdit_cropperAcceptButton = {"container": statusDesktop_mainWindow, "type": "StatusButton", "objectName": "imageCropperAcceptButton"} groupChatEdit_image = {"container": statusDesktop_mainWindow_overlay, "objectName": "groupChatEdit_image", "type": "EditCroppedImagePanel"} -# Gif popup: -gifPopup_enableGifButton = {"container": statusDesktop_mainWindow_overlay, "objectName": "enableGifsButton", "type": "StatusButton"} -gifPopup_gifMouseArea = {"container": statusDesktop_mainWindow_overlay, "objectName": "gifMouseArea_1", "type": "MouseArea"} - # Join chat popup: chat_name_PlaceholderText = {"container": statusDesktop_mainWindow_overlay, "text": "chat-name", "type": "PlaceholderText", "unnamed": 1, "visible": True}