Skip to content

Commit

Permalink
chore(@e2e): change tests according to new UI
Browse files Browse the repository at this point in the history
  • Loading branch information
anastasiyaig authored and caybro committed Jan 7, 2025
1 parent 3d3a996 commit f0809e6
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
8 changes: 5 additions & 3 deletions test/e2e/gui/objects_map/settings_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,12 @@
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}
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_sentRequests_ContactsListPanel = {"container": mainWindow_ContactsView, "objectName": "sentRequests_ContactsListPanel", "type": "ContactsListPanel", "visible": True}
contactsTabBar_Contacts_StatusTabButton = {"container": mainWindow_ContactsView, "id": "contactsBtn", "type": "StatusTabButton", "unnamed": 1, "visible": True}
settingsContentBaseScrollView_sentRequests_ContactsListPanel = {"container": mainWindow_ContactsView, "objectName": "ContactListPanel", "type": "ContactsListPanel", "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_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}
Expand Down
6 changes: 3 additions & 3 deletions test/e2e/gui/screens/settings_messaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,16 @@ def __repr__(self):
return self.contact

def init_ui(self):
self.contact = str(self.object.userName)
for child in walk_children(self.object):
if str(getattr(child, 'id', '')) == 'iconOrImage':
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))
elif str(getattr(child, 'objectName', '')) == 'acceptBtn':
self._accept_button = Button(real_name=driver.objectMap.realName(child))
elif str(getattr(child, 'objectName', '')) == 'declineBtn':
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':
self._chat_button = Button(real_name=driver.objectMap.realName(child))

Expand Down Expand Up @@ -110,6 +109,7 @@ def __init__(self):
self._contacts_items_list = List(settings_names.settingsContentBaseScrollView_ContactListPanel)
self._pending_request_sent_panel = QObject(
settings_names.settingsContentBaseScrollView_sentRequests_ContactsListPanel)
self.section_header = QObject(settings_names.settingsContentBaseScrollView_ContactListPanel_Header)
self._pending_request_received_panel = QObject(
settings_names.settingsContentBaseScrollView_receivedRequests_ContactsListPanel)
self._contacts_panel = QObject(settings_names.settingsContentBaseScrollView_mutualContacts_ContactsListPanel)
Expand Down
8 changes: 4 additions & 4 deletions test/e2e/tests/crtitical_tests_prs/test_messaging_1x1_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def test_1x1_chat_add_contact_in_settings(multiple_instances):
contacts_settings.open_pending_requests()
assert Messaging.CONTACT_REQUEST_SENT.value == contacts_settings.contact_items[0].object.contactText
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()

with step(f'Verify that contact request was received by {user_two.name}'):
Expand All @@ -75,7 +75,7 @@ def test_1x1_chat_add_contact_in_settings(multiple_instances):
messaging_settings = settings.left_panel.open_messaging_settings()
contacts_settings = messaging_settings.open_contacts_settings()
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 len(contacts_settings.contact_items) == 1

Expand All @@ -94,7 +94,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'):
contacts_settings = main_window.left_panel.open_settings().left_panel.open_messaging_settings().open_contacts_settings()
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 len(contacts_settings.contact_items) == 1
main_window.hide()
Expand All @@ -104,7 +104,7 @@ def test_1x1_chat_add_contact_in_settings(multiple_instances):
main_window.prepare()
contacts_settings = main_window.left_panel.open_settings().left_panel.open_messaging_settings().open_contacts_settings()
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 len(contacts_settings.contact_items) == 1

Expand Down
1 change: 1 addition & 0 deletions ui/app/AppLayouts/Profile/views/ContactsView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ SettingsContentBase {
StatusTabButton {
readonly property int panelUsage: Constants.contactsPanelUsage.mutualContacts

objectName: "ContactsView_Contacts_Button"
width: implicitWidth
text: qsTr("Contacts")
}
Expand Down

0 comments on commit f0809e6

Please sign in to comment.