From 2949e5ccd4f33a3f420fd830184e40c21558930c Mon Sep 17 00:00:00 2001 From: Anastasiya Semenkevich Date: Mon, 16 Sep 2024 13:10:33 +0300 Subject: [PATCH] chore: group chat e2e test is fixed --- test/e2e/gui/objects_map/messaging_names.py | 2 +- test/e2e/gui/screens/messages.py | 11 ++++++----- ui/imports/shared/views/chat/ChatContextMenuView.qml | 1 + 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/test/e2e/gui/objects_map/messaging_names.py b/test/e2e/gui/objects_map/messaging_names.py index f3d7f1c008..8d662fd453 100644 --- a/test/e2e/gui/objects_map/messaging_names.py +++ b/test/e2e/gui/objects_map/messaging_names.py @@ -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} diff --git a/test/e2e/gui/screens/messages.py b/test/e2e/gui/screens/messages.py index 48389e9dd2..dc996d69bd 100644 --- a/test/e2e/gui/screens/messages.py +++ b/test/e2e/gui/screens/messages.py @@ -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): diff --git a/ui/imports/shared/views/chat/ChatContextMenuView.qml b/ui/imports/shared/views/chat/ChatContextMenuView.qml index 70ebde710b..bf8e6e7385 100644 --- a/ui/imports/shared/views/chat/ChatContextMenuView.qml +++ b/ui/imports/shared/views/chat/ChatContextMenuView.qml @@ -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)