chore(@e2e): change tests according to new UI

This commit is contained in:
Anastasiya Semenkevich 2024-12-20 19:03:42 +03:00
parent 77975e9039
commit 6c476aa00b
5 changed files with 14 additions and 10 deletions

View File

@ -48,10 +48,12 @@ never_show_radioButton_StatusRadioButton = {"container": settingsContentBase_Scr
mainWindow_ContactsView = {"container": statusDesktop_mainWindow, "type": "ContactsView", "unnamed": 1, "visible": True} mainWindow_ContactsView = {"container": statusDesktop_mainWindow, "type": "ContactsView", "unnamed": 1, "visible": True}
mainWindow_Send_contact_request_to_chat_key_StatusButton = {"checkable": False, "container": mainWindow_ContactsView, "objectName": "ContactsView_ContactRequest_Button", "type": "StatusButton", "visible": True} mainWindow_Send_contact_request_to_chat_key_StatusButton = {"checkable": False, "container": mainWindow_ContactsView, "objectName": "ContactsView_ContactRequest_Button", "type": "StatusButton", "visible": True}
contactsTabBar_Pending_Requests_StatusTabButton = {"container": mainWindow_ContactsView, "objectName": "ContactsView_PendingRequest_Button", "type": "StatusTabButton", "visible": True} contactsTabBar_Pending_Requests_StatusTabButton = {"container": mainWindow_ContactsView, "objectName": "ContactsView_PendingRequest_Button", "type": "StatusTabButton", "visible": True}
settingsContentBaseScrollView_ContactListPanel = {"container": mainWindow_ContactsView, "objectName": "ContactListPanel_ListView", "type": "StatusListView", "visible": True} settingsContentBaseScrollView_ContactListPanel = {"container": settingsContentBase_ScrollView, "objectName": "ContactListPanel_ListView", "type": "ContactsListPanel", "visible": True}
settingsContentBaseScrollView_Item = {"container": mainWindow_ContactsView, "type": "Item", "unnamed": 1, "visible": True} settingsContentBaseScrollView_Item = {"container": mainWindow_ContactsView, "type": "Item", "unnamed": 1, "visible": True}
settingsContentBaseScrollView_sentRequests_ContactsListPanel = {"container": mainWindow_ContactsView, "objectName": "sentRequests_ContactsListPanel", "type": "ContactsListPanel", "visible": True} settingsContentBaseScrollView_sentRequests_ContactsListPanel = {"container": mainWindow_ContactsView, "objectName": "ContactListPanel", "type": "ContactsListPanel", "visible": True}
contactsTabBar_Contacts_StatusTabButton = {"container": mainWindow_ContactsView, "id": "contactsBtn", "type": "StatusTabButton", "unnamed": 1, "visible": True} settingsContentBaseScrollView_ContactListPanel_Header = {"container": settingsContentBase_ScrollView, "type": "SectionComponent", "unnamed": 1, "visible": True}
mainWindow_contactsTabBar_StatusTabBar = {"container": statusDesktop_mainWindow, "id": "contactsTabBar", "type": "StatusTabBar", "unnamed": 1, "visible": True}
contactsTabBar_Contacts_StatusTabButton = {"checkable": True, "container": mainWindow_contactsTabBar_StatusTabBar, "objectName": "ContactsView_Contacts_Button", "type": "StatusTabButton", "visible": True}
settingsContentBaseScrollView_receivedRequests_ContactsListPanel = {"container": mainWindow_ContactsView, "objectName": "ContactsListPanel", "type": "ContactsListPanel", "visible": True} settingsContentBaseScrollView_receivedRequests_ContactsListPanel = {"container": mainWindow_ContactsView, "objectName": "ContactsListPanel", "type": "ContactsListPanel", "visible": True}
settingsContentBaseScrollView_mutualContacts_ContactsListPanel = {"container": mainWindow_ContactsView, "id": "mutualContacts", "type": "ContactsListPanel", "unnamed": 1, "visible": True} settingsContentBaseScrollView_mutualContacts_ContactsListPanel = {"container": mainWindow_ContactsView, "id": "mutualContacts", "type": "ContactsListPanel", "unnamed": 1, "visible": True}
settingsContentBaseScrollView_Invite_friends_StatusButton = {"container": mainWindow_ContactsView, "type": "StatusButton", "unnamed": 1, "visible": True} settingsContentBaseScrollView_Invite_friends_StatusButton = {"container": mainWindow_ContactsView, "type": "StatusButton", "unnamed": 1, "visible": True}

View File

@ -59,17 +59,16 @@ class ContactItem:
return self.contact return self.contact
def init_ui(self): def init_ui(self):
self.contact = str(self.object.userName)
for child in walk_children(self.object): for child in walk_children(self.object):
if str(getattr(child, 'id', '')) == 'iconOrImage': if str(getattr(child, 'id', '')) == 'iconOrImage':
self.icon = Image(driver.objectMap.realName(child)) self.icon = Image(driver.objectMap.realName(child))
elif str(getattr(child, 'id', '')) == 'menuButton': elif str(getattr(child, 'objectName', '')) == 'moreBtn':
self._open_canvas_button = Button(real_name=driver.objectMap.realName(child)) self._open_canvas_button = Button(real_name=driver.objectMap.realName(child))
elif str(getattr(child, 'objectName', '')) == 'acceptBtn': elif str(getattr(child, 'objectName', '')) == 'acceptBtn':
self._accept_button = Button(real_name=driver.objectMap.realName(child)) self._accept_button = Button(real_name=driver.objectMap.realName(child))
elif str(getattr(child, 'objectName', '')) == 'declineBtn': elif str(getattr(child, 'objectName', '')) == 'declineBtn':
self._reject_button = Button(real_name=driver.objectMap.realName(child)) self._reject_button = Button(real_name=driver.objectMap.realName(child))
elif str(getattr(child, 'id', '')) == 'statusListItemTitle':
self.contact = str(child.text)
elif str(getattr(child, 'objectName', '')) == 'chat-icon': elif str(getattr(child, 'objectName', '')) == 'chat-icon':
self._chat_button = Button(real_name=driver.objectMap.realName(child)) self._chat_button = Button(real_name=driver.objectMap.realName(child))
@ -110,6 +109,7 @@ class ContactsSettingsView(QObject):
self._contacts_items_list = List(settings_names.settingsContentBaseScrollView_ContactListPanel) self._contacts_items_list = List(settings_names.settingsContentBaseScrollView_ContactListPanel)
self._pending_request_sent_panel = QObject( self._pending_request_sent_panel = QObject(
settings_names.settingsContentBaseScrollView_sentRequests_ContactsListPanel) settings_names.settingsContentBaseScrollView_sentRequests_ContactsListPanel)
self.section_header = QObject(settings_names.settingsContentBaseScrollView_ContactListPanel_Header)
self._pending_request_received_panel = QObject( self._pending_request_received_panel = QObject(
settings_names.settingsContentBaseScrollView_receivedRequests_ContactsListPanel) settings_names.settingsContentBaseScrollView_receivedRequests_ContactsListPanel)
self._contacts_panel = QObject(settings_names.settingsContentBaseScrollView_mutualContacts_ContactsListPanel) self._contacts_panel = QObject(settings_names.settingsContentBaseScrollView_mutualContacts_ContactsListPanel)

View File

@ -67,7 +67,7 @@ def test_1x1_chat_add_contact_in_settings(multiple_instances):
contacts_settings.open_pending_requests() contacts_settings.open_pending_requests()
assert Messaging.CONTACT_REQUEST_SENT.value == contacts_settings.contact_items[0].object.contactText assert Messaging.CONTACT_REQUEST_SENT.value == contacts_settings.contact_items[0].object.contactText
assert len(contacts_settings.contact_items) == 1 assert len(contacts_settings.contact_items) == 1
assert contacts_settings.pending_request_sent_list_title == 'Sent' assert str(contacts_settings.section_header.object.text) == 'Sent'
main_window.hide() main_window.hide()
with step(f'Verify that contact request was received by {user_two.name}'): with step(f'Verify that contact request was received by {user_two.name}'):
@ -77,7 +77,7 @@ def test_1x1_chat_add_contact_in_settings(multiple_instances):
messaging_settings = settings.left_panel.open_messaging_settings() messaging_settings = settings.left_panel.open_messaging_settings()
contacts_settings = messaging_settings.open_contacts_settings() contacts_settings = messaging_settings.open_contacts_settings()
contacts_settings.open_pending_requests() contacts_settings.open_pending_requests()
assert contacts_settings.pending_request_received_list_title == 'Received' assert str(contacts_settings.section_header.object.text) == 'Received'
assert user_one.name == contacts_settings.contact_items[0].contact assert user_one.name == contacts_settings.contact_items[0].contact
assert len(contacts_settings.contact_items) == 1 assert len(contacts_settings.contact_items) == 1
@ -96,7 +96,7 @@ def test_1x1_chat_add_contact_in_settings(multiple_instances):
with step(f'Verify that contact appeared in contacts list of {user_two.name} in messaging settings'): with step(f'Verify that contact appeared in contacts list of {user_two.name} in messaging settings'):
contacts_settings = main_window.left_panel.open_settings().left_panel.open_messaging_settings().open_contacts_settings() contacts_settings = main_window.left_panel.open_settings().left_panel.open_messaging_settings().open_contacts_settings()
contacts_settings.open_contacts() contacts_settings.open_contacts()
assert contacts_settings.contacts_list_title == 'Contacts' assert str(contacts_settings.section_header.object.text) == 'Contacts'
assert user_one.name == contacts_settings.contact_items[0].contact assert user_one.name == contacts_settings.contact_items[0].contact
assert len(contacts_settings.contact_items) == 1 assert len(contacts_settings.contact_items) == 1
main_window.hide() main_window.hide()
@ -106,7 +106,7 @@ def test_1x1_chat_add_contact_in_settings(multiple_instances):
main_window.prepare() main_window.prepare()
contacts_settings = main_window.left_panel.open_settings().left_panel.open_messaging_settings().open_contacts_settings() contacts_settings = main_window.left_panel.open_settings().left_panel.open_messaging_settings().open_contacts_settings()
contacts_settings.open_contacts() contacts_settings.open_contacts()
assert contacts_settings.contacts_list_title == 'Contacts' assert str(contacts_settings.section_header.object.text) == 'Contacts'
assert user_two.name == contacts_settings.contact_items[0].contact assert user_two.name == contacts_settings.contact_items[0].contact
assert len(contacts_settings.contact_items) == 1 assert len(contacts_settings.contact_items) == 1

View File

@ -9,3 +9,4 @@ from scripts.settings_names import *
from community_names import * from community_names import *
from community_portal_names import * from community_portal_names import *
from search_names import * from search_names import *
mainWindow_contactsTabBar_StatusTabBar = {"container": statusDesktop_mainWindow, "id": "contactsTabBar", "type": "StatusTabBar", "unnamed": 1, "visible": True}

View File

@ -75,6 +75,7 @@ SettingsContentBase {
StatusTabButton { StatusTabButton {
readonly property int panelUsage: Constants.contactsPanelUsage.mutualContacts readonly property int panelUsage: Constants.contactsPanelUsage.mutualContacts
objectName: "ContactsView_Contacts_Button"
width: implicitWidth width: implicitWidth
text: qsTr("Contacts") text: qsTr("Contacts")
} }