mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-16 16:47:24 +00:00
parent
50b49446f0
commit
016e3927f2
@ -116,6 +116,10 @@ def click_obj_by_name(objName: str):
|
|||||||
obj = squish.waitForObject(getattr(names, objName))
|
obj = squish.waitForObject(getattr(names, objName))
|
||||||
squish.mouseClick(obj, squish.Qt.LeftButton)
|
squish.mouseClick(obj, squish.Qt.LeftButton)
|
||||||
|
|
||||||
|
def click_obj_by_attr(attr: str):
|
||||||
|
obj = squish.waitForObject(attr)
|
||||||
|
squish.mouseClick(obj, squish.Qt.LeftButton)
|
||||||
|
|
||||||
def click_obj_by_wildcards_name(objName: str, wildcardString: str):
|
def click_obj_by_wildcards_name(objName: str, wildcardString: str):
|
||||||
wildcardRealName = copy.deepcopy(getattr(names, objName))
|
wildcardRealName = copy.deepcopy(getattr(names, objName))
|
||||||
wildcardRealName["objectName"] = Wildcard(wildcardString)
|
wildcardRealName["objectName"] = Wildcard(wildcardString)
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
import copy
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from drivers.SquishDriver import *
|
from drivers.SquishDriver import *
|
||||||
from drivers.SquishDriverVerification import *
|
from drivers.SquishDriverVerification import *
|
||||||
@ -31,6 +32,8 @@ class ChatComponents(Enum):
|
|||||||
SUGGESTIONS_BOX = "chatView_SuggestionBoxPanel"
|
SUGGESTIONS_BOX = "chatView_SuggestionBoxPanel"
|
||||||
SUGGESTIONS_LIST = "chatView_suggestion_ListView"
|
SUGGESTIONS_LIST = "chatView_suggestion_ListView"
|
||||||
MENTION_PROFILE_VIEW = "chatView_userMentioned_ProfileView"
|
MENTION_PROFILE_VIEW = "chatView_userMentioned_ProfileView"
|
||||||
|
CHAT_INPUT_EMOJI_BUTTON = "chatInput_Emoji_Button"
|
||||||
|
EMOJI_POPUP_EMOJI_PLACEHOLDER = "emojiPopup_Emoji_Button_Placeholder"
|
||||||
|
|
||||||
|
|
||||||
class ChatMessagesHistory(Enum):
|
class ChatMessagesHistory(Enum):
|
||||||
@ -180,3 +183,15 @@ class StatusChatScreen:
|
|||||||
break
|
break
|
||||||
verify(found, "Checking if the following display name is in the mention's list: " + displayName)
|
verify(found, "Checking if the following display name is in the mention's list: " + displayName)
|
||||||
|
|
||||||
|
|
||||||
|
def send_emoji(self, emoji_short_name: str, message: str):
|
||||||
|
if (message != ""):
|
||||||
|
type(ChatComponents.MESSAGE_INPUT.value, message)
|
||||||
|
|
||||||
|
click_obj_by_name(ChatComponents.CHAT_INPUT_EMOJI_BUTTON.value)
|
||||||
|
emojiAttr = copy.deepcopy(getattr(names, ChatComponents.EMOJI_POPUP_EMOJI_PLACEHOLDER.value))
|
||||||
|
emojiAttr["objectName"] = emojiAttr["objectName"].replace("%NAME%", emoji_short_name)
|
||||||
|
click_obj_by_attr(emojiAttr)
|
||||||
|
|
||||||
|
press_enter(ChatComponents.MESSAGE_INPUT.value)
|
||||||
|
|
||||||
|
@ -21,8 +21,8 @@ mark_as_Read_StatusMenuItemDelegate = {"container": statusDesktop_mainWindow_ove
|
|||||||
chatView_SuggestionBoxPanel ={"container": statusDesktop_mainWindow, "objectName": "suggestionsBox", "type": "SuggestionBoxPanel"}
|
chatView_SuggestionBoxPanel ={"container": statusDesktop_mainWindow, "objectName": "suggestionsBox", "type": "SuggestionBoxPanel"}
|
||||||
chatView_suggestion_ListView ={"container": chatView_SuggestionBoxPanel, "objectName": "suggestionBoxList", "type": "StatusListView"}
|
chatView_suggestion_ListView ={"container": chatView_SuggestionBoxPanel, "objectName": "suggestionBoxList", "type": "StatusListView"}
|
||||||
chatView_userMentioned_ProfileView ={"container": statusDesktop_mainWindow_overlay, "objectName": "profileView", "type": "ProfileView"}
|
chatView_userMentioned_ProfileView ={"container": statusDesktop_mainWindow_overlay, "objectName": "profileView", "type": "ProfileView"}
|
||||||
# This will conflict with Jo's PR. Resolve it on rebase.
|
|
||||||
emojiPopup_Emoji_Button_Placeholder = {"container": statusDesktop_mainWindow, "objectName": "statusEmoji_%NAME%", "type": "StatusEmoji", "visible": True}
|
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}
|
||||||
|
|
||||||
# Join chat popup:
|
# Join chat popup:
|
||||||
startChat_Btn = {"container": statusDesktop_mainWindow_overlay, "objectName": "startChatButton", "type": "StatusButton"}
|
startChat_Btn = {"container": statusDesktop_mainWindow_overlay, "objectName": "startChatButton", "type": "StatusButton"}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
|
|
||||||
|
|
||||||
from random import randint
|
from random import randint
|
||||||
from drivers.SquishDriver import *
|
from drivers.SquishDriver import *
|
||||||
from screens.StatusMainScreen import StatusMainScreen
|
from screens.StatusMainScreen import StatusMainScreen
|
||||||
@ -89,7 +90,23 @@ def step(context, message):
|
|||||||
@Then("the last message is not the random message")
|
@Then("the last message is not the random message")
|
||||||
def step(context):
|
def step(context):
|
||||||
_statusChat.verify_last_message_sent_is_not(context.userData["randomMessage"])
|
_statusChat.verify_last_message_sent_is_not(context.userData["randomMessage"])
|
||||||
|
|
||||||
|
@When("user sends the emoji |any| as a message")
|
||||||
|
def step(context, emoji_short_name):
|
||||||
|
_statusChat.send_emoji(emoji_short_name, "")
|
||||||
|
|
||||||
|
@When("user sends the emoji |any| with message |any|")
|
||||||
|
def step(context, emoji_short_name, message):
|
||||||
|
_statusChat.send_emoji(emoji_short_name, message)
|
||||||
|
|
||||||
|
@Then("the emoji |any| is displayed in the last message")
|
||||||
|
def step(context, emoji):
|
||||||
|
_statusChat.verify_last_message_sent(emoji)
|
||||||
|
|
||||||
|
@Then("the message |any| is displayed in the last message")
|
||||||
|
def step(context, message):
|
||||||
|
_statusChat.verify_last_message_sent(message)
|
||||||
|
|
||||||
@Then("the user cannot input a mention to a not existing user |any|")
|
@Then("the user cannot input a mention to a not existing user |any|")
|
||||||
def step(context, displayName):
|
def step(context, displayName):
|
||||||
_statusChat.cannot_do_mention(displayName)
|
_statusChat.cannot_do_mention(displayName)
|
||||||
|
@ -74,4 +74,12 @@ Feature: Status Desktop Chat
|
|||||||
Examples:
|
Examples:
|
||||||
| displayName |
|
| displayName |
|
||||||
| notExistingAccount |
|
| notExistingAccount |
|
||||||
| asdfgNoNo |
|
| asdfgNoNo |
|
||||||
|
|
||||||
|
Scenario: User can send an emoji in a message
|
||||||
|
When user joins chat room automation-test
|
||||||
|
When user sends the emoji heart_eyes as a message
|
||||||
|
Then the emoji 😍 is displayed in the last message
|
||||||
|
When user sends the emoji sunglasses with message wow I'm so cool
|
||||||
|
Then the emoji 😎 is displayed in the last message
|
||||||
|
And the message wow I'm so cool is displayed in the last message
|
||||||
|
@ -1210,6 +1210,7 @@ Rectangle {
|
|||||||
|
|
||||||
StatusQ.StatusFlatRoundButton {
|
StatusQ.StatusFlatRoundButton {
|
||||||
id: emojiBtn
|
id: emojiBtn
|
||||||
|
objectName: "statusChatInputEmojiButton"
|
||||||
enabled: !control.emojiPopupOpened
|
enabled: !control.emojiPopupOpened
|
||||||
implicitHeight: 32
|
implicitHeight: 32
|
||||||
implicitWidth: 32
|
implicitWidth: 32
|
||||||
|
@ -89,7 +89,6 @@ Item {
|
|||||||
anchors.leftMargin: emojiSection.imageMargin
|
anchors.leftMargin: emojiSection.imageMargin
|
||||||
|
|
||||||
StatusEmoji {
|
StatusEmoji {
|
||||||
// TODO: this will conflict with Jo's PR, fix it on rebase
|
|
||||||
objectName: "statusEmoji_" + modelData.shortname.replace(/:/g, "")
|
objectName: "statusEmoji_" + modelData.shortname.replace(/:/g, "")
|
||||||
|
|
||||||
width: emojiSection.imageWidth
|
width: emojiSection.imageWidth
|
||||||
|
Loading…
x
Reference in New Issue
Block a user