diff --git a/test/e2e/gui/components/community/invite_contacts.py b/test/e2e/gui/components/community/invite_contacts.py index 9ff48e638d6..02498f79235 100644 --- a/test/e2e/gui/components/community/invite_contacts.py +++ b/test/e2e/gui/components/community/invite_contacts.py @@ -7,6 +7,7 @@ import driver from gui.components.base_popup import BasePopup from gui.elements.button import Button +from gui.elements.check_box import CheckBox from gui.elements.object import QObject from gui.elements.text_edit import TextEdit from gui.objects_map import names @@ -17,6 +18,7 @@ class InviteContactsPopup(BasePopup): def __init__(self): super().__init__() self._member_item = QObject(names.o_StatusMemberListItem) + self.member_checkbox = CheckBox(names.memberListCheckbox) self._next_button = Button(names.next_StatusButton) self._message_text_edit = TextEdit(names.communityProfilePopupInviteMessagePanel_MessageInput_TextEdit) self._invited_member_item = QObject(names.o_StatusMemberListItem_2) @@ -39,12 +41,13 @@ def invite(self, contacts: typing.List[str], message: str): f'Contact: {contact} not found in {self.contacts}' selected = [] - for member in driver.findAllObjects(self._member_item.real_name): - if str(getattr(member, 'userName', '')) in contacts: - driver.mouseClick(member) - selected.append(member.userName) + for member in driver.findAllObjects(self.member_checkbox.real_name): + if str(getattr(member, 'objectName', '')).split('-')[1] in contacts: + CheckBox(member).set(True) + assert member.checkState != 0, f"Member item checkbox is not checked" + selected.append(str(getattr(member, 'objectName', '')).split('-')[1]) - assert len(contacts) == len(selected), f'Selected contacts: {selected}, expected: {contacts}' + assert set(contacts) == set(selected), f'Selected contacts: {selected}, expected: {contacts}' self._next_button.click() self._message_text_edit.text = message diff --git a/test/e2e/gui/objects_map/names.py b/test/e2e/gui/objects_map/names.py index 8e2081a2c3f..e07b4ef0de5 100644 --- a/test/e2e/gui/objects_map/names.py +++ b/test/e2e/gui/objects_map/names.py @@ -179,11 +179,12 @@ # Invite Contacts Popup communityProfilePopupInviteFrindsPanel = {"container": statusDesktop_mainWindow_overlay, "objectName": "CommunityProfilePopupInviteFrindsPanel_ColumnLayout", "type": "ProfilePopupInviteFriendsPanel", "visible": True} communityProfilePopupInviteMessagePanel = {"container": statusDesktop_mainWindow_overlay, "objectName": "CommunityProfilePopupInviteMessagePanel_ColumnLayout", "type": "ProfilePopupInviteMessagePanel", "visible": True} -o_StatusMemberListItem = {"container": communityProfilePopupInviteFrindsPanel, "type": "StatusMemberListItem", "unnamed": 1, "visible": True} -next_StatusButton = {"checkable": False, "container": statusDesktop_mainWindow_overlay, "objectName": "InviteFriendsToCommunityPopup_NextButton", "text": "Next", "type": "StatusButton", "visible": True} +o_StatusMemberListItem = {"container": statusDesktop_mainWindow_overlay, "objectName": RegularExpression("statusMemberListItem*"), "type": "StatusMemberListItem", "visible": True} +memberListCheckbox = {"checkable": True, "container": statusDesktop_mainWindow_overlay, "objectName": RegularExpression("contactCheckbox-*"), "type": "StatusCheckBox", "visible": True} +next_StatusButton = {"checkable": False, "container": statusDesktop_mainWindow_overlay, "objectName": "InviteFriendsToCommunityPopup_NextButton", "type": "StatusButton", "visible": True} communityProfilePopupInviteMessagePanel_MessageInput_TextEdit = {"container": communityProfilePopupInviteMessagePanel, "objectName": "CommunityProfilePopupInviteMessagePanel_MessageInput", "type": "TextEdit", "visible": True} -send_1_invite_StatusButton = {"checkable": False, "container": statusDesktop_mainWindow_overlay, "objectName": "InviteFriendsToCommunityPopup_SendButton", "text": "Send 1 invite", "type": "StatusButton", "visible": True} -o_StatusMemberListItem_2 = {"container": communityProfilePopupInviteMessagePanel, "type": "StatusMemberListItem", "unnamed": 1, "visible": True} +send_1_invite_StatusButton = {"checkable": False, "container": statusDesktop_mainWindow_overlay, "objectName": "InviteFriendsToCommunityPopup_SendButton", "type": "StatusButton", "visible": True} +o_StatusMemberListItem_2 = {"container": communityProfilePopupInviteMessagePanel, "objectName": RegularExpression("statusMemberListItem*"), "type": "StatusMemberListItem", "visible": True} copy_icon_StatusIcon = {"container": statusDesktop_mainWindow_overlay, "objectName": "copy-icon", "type": "StatusIcon", "visible": True} # Welcome community