chore: group chat e2e test is fixed

This commit is contained in:
Anastasiya Semenkevich 2024-09-16 13:10:33 +03:00 committed by Anastasiya
parent 7cd2ed888c
commit 2949e5ccd4
3 changed files with 8 additions and 6 deletions

View File

@ -49,7 +49,7 @@ mainWindow_scrollView_StatusScrollView = {"container": statusDesktop_mainWindow,
mainWindow_ScrollView = {"container": statusDesktop_mainWindow, "type": "StatusScrollView", "unnamed": 1, "visible": True}
scrollView_StatusChatListItem = {"container": mainWindow_ScrollView, "type": "StatusChatListItem", "visible": True}
tiny_pin_icon_StatusIcon = {"container": chatLogView_chatMessageViewDelegate_MessageView, "objectName": "tiny/pin-icon", "type": "StatusIcon"}
add_remove_from_group_StatusMenuItem = {"checkable": False, "container": mainWindow_Overlay, "enabled": True, "type": "StatusMenuItem", "unnamed": 1, "visible": True}
add_remove_from_group_StatusMenuItem = {"container": mainWindow_Overlay, "enabled": True, "objectName": "addRemoveFromGroupStatusAction", "type": "StatusMenuItem", "visible": True}
mainWindow_inputScrollView_StatusScrollView = {"container": statusDesktop_mainWindow, "id": "inputScrollView", "type": "StatusScrollView", "unnamed": 1, "visible": True}
inputScrollView_messageInputField_TextArea = {"container": mainWindow_inputScrollView_StatusScrollView, "objectName": "messageInputField", "type": "TextArea", "visible": True}
mainWindow_statusChatInputEmojiButton_StatusFlatRoundButton = {"container": statusDesktop_mainWindow, "objectName": "statusChatInputEmojiButton", "type": "StatusFlatRoundButton", "visible": True}

View File

@ -288,13 +288,14 @@ class CreateChatView(QObject):
@property
@allure.step('Get contacts')
def contacts(self) -> typing.List[str]:
return self._create_chat_contacts_list.get_values('title')
def contact_names(self) -> typing.List[str]:
user_names = [str(item.userName) for item in self._create_chat_contacts_list.items]
return user_names
@allure.step('Select contact in the list')
def select_contact(self, contact: str):
assert driver.waitFor(lambda: contact in self.contacts), f'Contact: {contact} not found in {self.contacts}'
self._create_chat_contacts_list.select(contact, 'title')
assert driver.waitFor(lambda: contact in self.contact_names), f'Contact: {contact} was not found in {self.contact_names}'
self._create_chat_contacts_list.select(contact, 'userName')
@allure.step('Create chat by adding contacts from contact list')
def create_chat(self, members):
@ -528,7 +529,7 @@ class Members(QObject):
@property
@allure.step('Get group members')
def members(self) -> typing.List[str]:
return [str(member.title) for member in driver.findAllObjects(self._member_item.real_name)]
return [str(member.userName) for member in driver.findAllObjects(self._member_item.real_name)]
class MessagesScreen(QObject):

View File

@ -64,6 +64,7 @@ StatusMenu {
}
StatusAction {
objectName: "addRemoveFromGroupStatusAction"
text: root.amIChatAdmin ? qsTr("Add / remove from group") : qsTr("Add to group")
icon.name: "add-to-dm"
enabled: (root.chatType === Constants.chatType.privateGroupChat)