test(community): re-add test that does a mention

Fixes #9244
This commit is contained in:
Jonathan Rainville 2023-01-24 13:19:19 -05:00
parent b798b18c18
commit 5bb4a3741d
4 changed files with 31 additions and 23 deletions

View File

@ -399,26 +399,25 @@ class StatusChatScreen:
# This method expects to have just one mention / link in the last chat message
def verify_last_message_sent_contains_mention(self, displayName: str, message: str):
[loaded, last_message_obj] = is_loaded_visible_and_enabled(ChatComponents.LAST_MESSAGE_TEXT.value)
if not loaded:
verify_failure("No messages found in chat.")
if loaded:
# Verifying mention
verify_text_contains(str(last_message_obj.text), displayName)
# Verifying message
verify_text_contains(str(last_message_obj.text), message)
# Get link value from chat text:
try:
href_info = re.search(_LINK_HREF_REGEX, str(last_message_obj.text)).group(1)
except AttributeError:
# <a href=, "> not found in the original string
verify_failure("Mention link not found in last chat message.")
click_link(ChatComponents.LAST_MESSAGE_TEXT.value, href_info)
verify(is_found(ChatComponents.MENTION_PROFILE_VIEW.value), "Checking user mentioned profile popup is open.")
else:
verify_failure("No messages found in chat.")
# Verifying mention
verify_text_contains(str(last_message_obj.text), displayName)
# Verifying message
verify_text_contains(str(last_message_obj.text), message)
# Get link value from chat text:
try:
href_info = re.search(_LINK_HREF_REGEX, str(last_message_obj.text)).group(1)
except AttributeError:
# <a href=, "> not found in the original string
verify_failure("Mention link not found in last chat message.")
click_link(ChatComponents.LAST_MESSAGE_TEXT.value, href_info)
verify(is_found(ChatComponents.MENTION_PROFILE_VIEW.value), "Checking user mentioned profile popup is open.")
def verify_chat_title(self, title: str):
info_btn = get_obj(ChatComponents.TOOLBAR_INFO_BUTTON.value)

View File

@ -46,6 +46,9 @@ chatView_chatLogView_lastMsg_MessageView = {"container": chatView_log, "index":
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}
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"}
# Gif popup:
gifPopup_enableGifButton = {"container": statusDesktop_mainWindow_overlay, "objectName": "enableGifsButton", "type": "StatusButton"}

View File

@ -125,4 +125,13 @@ Feature: Status Desktop community messages
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 "👍"
Then the last chat message contains "👍"
@mayfail
# This tests fails. Issue #9314
Scenario Outline: The user can do a mention
When the user inputs a mention to "<displayName>" with message "<message>"
Then the "<displayName>" mention with message "<message>" have been sent
Examples:
| displayName | message |
| tester123 | testing mention |

View File

@ -4,9 +4,6 @@ from scripts.global_names import *
mainWindow_scrollView_ScrollView = {"container": statusDesktop_mainWindow, "id": "scrollView", "type": "StatusScrollView", "unnamed": 1, "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"}
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_unfurledLinkComponent_linkImage = {"container": chatView_log, "objectName": "LinksMessageView_unfurledLinkComponent_linkImage", "type": "StatusChatImageLoader", "visible": True}