chore: fails fixed

This commit is contained in:
Valentina Novgorodtceva 2024-03-05 14:22:02 +07:00 committed by Anastasiya
parent 778dfbe9e3
commit 68c1bac111
6 changed files with 29 additions and 24 deletions

View File

@ -8,4 +8,5 @@ class Messaging(Enum):
NEW_CONTACT_REQUEST = 'New Contact Request' NEW_CONTACT_REQUEST = 'New Contact Request'
MESSAGE_NOTE_IDENTITY_REQUEST = 'Ask a question only they can answer' MESSAGE_NOTE_IDENTITY_REQUEST = 'Ask a question only they can answer'
YOU_NEED_TO_BE_A_MEMBER = 'You need to be a member of this group to send messages' YOU_NEED_TO_BE_A_MEMBER = 'You need to be a member of this group to send messages'
ID_VERIFICATION_REQUEST_SENT = 'ID verification request sent'
ID_VERIFICATION_REPLY_SENT = 'ID verification reply sent'

View File

@ -20,8 +20,8 @@ class SocialLinksPopup(BasePopup):
self._add_button = Button(names.social_links_add_StatusBackButton) self._add_button = Button(names.social_links_add_StatusBackButton)
@allure.step('Get social link') @allure.step('Get social link')
def _get_list_item(self, title: str) -> QObject: def _get_list_item(self, index: int) -> QObject:
self._add_social_link_list_item.real_name['title'] = title self._add_social_link_list_item.real_name['index'] = index
return self._add_social_link_list_item return self._add_social_link_list_item
@allure.step('Get social link field') @allure.step('Get social link field')
@ -35,8 +35,8 @@ class SocialLinksPopup(BasePopup):
return self._social_link_text_field return self._social_link_text_field
@allure.step('Add link to link field') @allure.step('Add link to link field')
def add_link(self, network: str, links: typing.List[str]): def add_link(self, index: int, links: typing.List[str]):
self._get_list_item(network).click() self._get_list_item(index).click()
time.sleep(0.5) time.sleep(0.5)
for occurrence, link in enumerate(links): for occurrence, link in enumerate(links):
self._get_text_field(occurrence).text = link self._get_text_field(occurrence).text = link

View File

@ -37,7 +37,7 @@ add_channels_StatusButton = {"checkable": False, "container": mainWindow_scrollV
scrollView_general_StatusChatListItem = {"container": mainWindow_scrollView_StatusScrollView, "objectName": "general", "type": "StatusChatListItem", "visible": True} scrollView_general_StatusChatListItem = {"container": mainWindow_scrollView_StatusScrollView, "objectName": "general", "type": "StatusChatListItem", "visible": True}
# Tool Bar # Tool Bar
mainWindow_statusToolBar_StatusToolBar = {"container": mainWindow_communityLoader_Loader, "objectName": "statusToolBar", "type": "StatusToolBar", "visible": True} mainWindow_statusToolBar_StatusToolBar = {"container": mainWindow_StatusWindow, "objectName": "statusToolBar", "type": "StatusToolBar", "visible": True}
statusToolBar_chatToolbarMoreOptionsButton = {"container": mainWindow_statusToolBar_StatusToolBar, "objectName": "chatToolbarMoreOptionsButton", "type": "StatusFlatRoundButton", "visible": True} statusToolBar_chatToolbarMoreOptionsButton = {"container": mainWindow_statusToolBar_StatusToolBar, "objectName": "chatToolbarMoreOptionsButton", "type": "StatusFlatRoundButton", "visible": True}
delete_Channel_StatusMenuItem = {"checkable": False, "container": statusDesktop_mainWindow_overlay, "enabled": True, "objectName": "deleteOrLeaveMenuItem", "type": "StatusMenuItem", "visible": True} delete_Channel_StatusMenuItem = {"checkable": False, "container": statusDesktop_mainWindow_overlay, "enabled": True, "objectName": "deleteOrLeaveMenuItem", "type": "StatusMenuItem", "visible": True}
edit_Channel_StatusMenuItem = {"checkable": False, "container": statusDesktop_mainWindow_overlay, "enabled": True, "objectName": "editChannelMenuItem", "type": "StatusMenuItem", "visible": True} edit_Channel_StatusMenuItem = {"checkable": False, "container": statusDesktop_mainWindow_overlay, "enabled": True, "objectName": "editChannelMenuItem", "type": "StatusMenuItem", "visible": True}

View File

@ -349,7 +349,7 @@ reEncryptRestartButton = {"container": statusDesktop_mainWindow_overlay, "object
reEncryptionComplete = {"container": statusDesktop_mainWindow_overlay, "objectName": "statusListItemSubTitle", "type": "StatusTextWithLoadingState", "visible": True} reEncryptionComplete = {"container": statusDesktop_mainWindow_overlay, "objectName": "statusListItemSubTitle", "type": "StatusTextWithLoadingState", "visible": True}
# Social Links Popup # Social Links Popup
socialLink_StatusListItem = {"container": statusDesktop_mainWindow_overlay, "type": "StatusListItem", "title": "", "visible": True} socialLink_StatusListItem = {"container": statusDesktop_mainWindow_overlay, "index": 1, "type": "StatusListItem", "unnamed": 1, "visible": True}
placeholder_StatusBaseText = {"container": statusDesktop_mainWindow_overlay, "id": "placeholder", "type": "StatusBaseText", "unnamed": 1, "visible": True} placeholder_StatusBaseText = {"container": statusDesktop_mainWindow_overlay, "id": "placeholder", "type": "StatusBaseText", "unnamed": 1, "visible": True}
social_links_back_StatusBackButton = {"container": statusDesktop_mainWindow_overlay, "type": "StatusBackButton", "unnamed": 1, "visible": True} social_links_back_StatusBackButton = {"container": statusDesktop_mainWindow_overlay, "type": "StatusBackButton", "unnamed": 1, "visible": True}
social_links_add_StatusBackButton = {"container": statusDesktop_mainWindow_overlay, "type": "StatusButton", "unnamed": 1, "visible": True} social_links_add_StatusBackButton = {"container": statusDesktop_mainWindow_overlay, "type": "StatusButton", "unnamed": 1, "visible": True}

View File

@ -79,18 +79,18 @@ class ProfileSettingsView(QObject):
@allure.step('Set social links') @allure.step('Set social links')
def social_links(self, links): def social_links(self, links):
links = { links = {
'Twitter': [links[0]], 0: [links[0]],
'Personal site': [links[1]], 1: [links[1]],
'Github': [links[2]], 2: [links[2]],
'YouTube channel': [links[3]], 3: [links[3]],
'Discord handle': [links[4]], 4: [links[4]],
'Telegram handle': [links[5]], 5: [links[5]],
'Custom link': [links[6], links[7]], 6: [links[6], links[7]],
} }
for network, link in links.items(): for index, link in links.items():
social_links_popup = self.open_social_links_popup() social_links_popup = self.open_social_links_popup()
social_links_popup.add_link(network, link) social_links_popup.add_link(index, link)
@allure.step('Verify social links') @allure.step('Verify social links')
def verify_social_links(self, links): def verify_social_links(self, links):
@ -108,12 +108,12 @@ class ProfileSettingsView(QObject):
actual_links = self.social_links actual_links = self.social_links
assert actual_links['Twitter'] == twitter assert actual_links['X (Twitter)'] == twitter
assert actual_links['Personal site'] == personal_site assert actual_links['Personal'] == personal_site
assert actual_links['Github'] == github assert actual_links['Github'] == github
assert actual_links['YouTube channel'] == youtube assert actual_links['YouTube'] == youtube
assert actual_links['Discord handle'] == discord assert actual_links['Discord'] == discord
assert actual_links['Telegram handle'] == telegram assert actual_links['Telegram'] == telegram
assert actual_links[custom_link_text] == custom_link assert actual_links[custom_link_text] == custom_link
@allure.step('Open social links form') @allure.step('Open social links form')

View File

@ -69,6 +69,10 @@ def test_messaging_settings_identity_verification(multiple_instance, user_data_o
assert verify_identity_popup.message_note == Messaging.MESSAGE_NOTE_IDENTITY_REQUEST.value assert verify_identity_popup.message_note == Messaging.MESSAGE_NOTE_IDENTITY_REQUEST.value
assert not verify_identity_popup.is_send_verification_button_enabled assert not verify_identity_popup.is_send_verification_button_enabled
verify_identity_popup.type_message('Hi. Is that you?').send_verification() verify_identity_popup.type_message('Hi. Is that you?').send_verification()
with step('Verify toast message about sent ID verification request'):
toast_messages = main_window.wait_for_notification()
assert Messaging.ID_VERIFICATION_REQUEST_SENT.value in toast_messages
main_window.hide() main_window.hide()
with step(f'Check incoming identity request for {user_two.name}'): with step(f'Check incoming identity request for {user_two.name}'):
@ -78,6 +82,6 @@ def test_messaging_settings_identity_verification(multiple_instance, user_data_o
respond_identity_popup = contacts_settings.open_more_options_popup(user_one.name).respond_to_id_request() respond_identity_popup = contacts_settings.open_more_options_popup(user_one.name).respond_to_id_request()
respond_identity_popup.type_message('Hi. Yes, its me').send_answer() respond_identity_popup.type_message('Hi. Yes, its me').send_answer()
with step(f'Answer has been sent {user_two.name}'): with step('Verify toast message about sent ID verification reply'):
assert respond_identity_popup.is_change_answer_button_visible toast_messages = main_window.wait_for_notification()
respond_identity_popup.close() assert Messaging.ID_VERIFICATION_REPLY_SENT.value in toast_messages