2023-09-01 11:18:04 +00:00
|
|
|
import allure
|
|
|
|
|
2024-11-06 11:05:25 +00:00
|
|
|
from gui.components.community.community_category_popup import CategoryPopup, EditCategoryPopup
|
2024-05-31 10:45:47 +00:00
|
|
|
from gui.components.community.invite_contacts import InviteContactsPopup
|
2024-10-21 09:16:06 +00:00
|
|
|
from gui.components.community.leave_community_confirmation import LeaveCommunityConfirmationPopup
|
2024-11-06 11:05:25 +00:00
|
|
|
from gui.components.delete_popup import DeleteCategoryPopup
|
2023-10-06 08:33:42 +00:00
|
|
|
from gui.elements.object import QObject
|
2024-02-27 09:05:39 +00:00
|
|
|
from gui.objects_map import names, communities_names
|
2023-09-01 11:18:04 +00:00
|
|
|
|
|
|
|
|
|
|
|
class ContextMenu(QObject):
|
|
|
|
|
|
|
|
def __init__(self):
|
2024-02-13 09:04:24 +00:00
|
|
|
super(ContextMenu, self).__init__(names.contextMenu_PopupItem)
|
2024-08-29 13:25:59 +00:00
|
|
|
self.menu_item = QObject(names.contextMenuItem)
|
|
|
|
self.add_watched_address_from_context = QObject(names.contextMenuItem_AddWatchOnly)
|
|
|
|
self.delete_from_context = QObject(names.contextMenuItem_Delete)
|
|
|
|
self.edit_from_context = QObject(names.contextMenuItem_Edit)
|
|
|
|
self.copy_address_from_context = QObject(names.contextMenuItem_Copy_Address)
|
|
|
|
self.hide_include_in_total_balance = QObject(names.contextMenuItem_HideInclude)
|
|
|
|
self.edit_saved_address_from_context = QObject(names.contextSavedAddressEdit)
|
|
|
|
self.delete_saved_address_from_context = QObject(names.contextSavedAddressDelete)
|
|
|
|
self.edit_channel_from_context = QObject(communities_names.edit_Channel_StatusMenuItem)
|
|
|
|
self.delete_channel_from_context = QObject(communities_names.delete_Channel_StatusMenuItem)
|
|
|
|
self.invite_from_context = QObject(communities_names.invite_People_StatusMenuItem)
|
|
|
|
self.mute_from_context = QObject(communities_names.mute_Community_StatusMenuItem)
|
2024-10-21 09:16:06 +00:00
|
|
|
self.leave_community_option = QObject(communities_names.leave_Community_StatusMenuItem)
|
2024-11-06 11:05:25 +00:00
|
|
|
self.edit_category_item = QObject(communities_names.edit_Category_StatusMenuItem)
|
|
|
|
self.delete_category_item = QObject(communities_names.delete_Category_StatusMenuItem)
|
2023-09-01 11:18:04 +00:00
|
|
|
|
|
|
|
@allure.step('Select in context menu')
|
|
|
|
def select(self, value: str):
|
2024-08-29 13:25:59 +00:00
|
|
|
self.menu_item.real_name['text'] = value
|
|
|
|
self.menu_item.click()
|
2024-05-31 10:45:47 +00:00
|
|
|
|
2024-10-21 09:16:06 +00:00
|
|
|
@allure.step('Select invite people to community in context menu')
|
2024-05-31 10:45:47 +00:00
|
|
|
def select_invite_people(self):
|
2024-08-29 13:25:59 +00:00
|
|
|
self.invite_from_context.click()
|
2024-05-31 10:45:47 +00:00
|
|
|
return InviteContactsPopup()
|
2024-10-21 09:16:06 +00:00
|
|
|
|
|
|
|
@allure.step('Select leave community in context menu')
|
|
|
|
def leave_community(self):
|
|
|
|
self.leave_community_option.click()
|
|
|
|
return LeaveCommunityConfirmationPopup()
|
|
|
|
|
2024-11-06 11:05:25 +00:00
|
|
|
@allure.step('Open edit category popup')
|
|
|
|
def open_edit_category_popup(self) -> EditCategoryPopup:
|
|
|
|
self.edit_category_item.click()
|
|
|
|
return EditCategoryPopup().wait_until_appears()
|
|
|
|
|
|
|
|
@allure.step('Open delete category popup')
|
|
|
|
def open_delete_category_popup(self) -> DeleteCategoryPopup:
|
|
|
|
self.delete_category_item.click()
|
|
|
|
return DeleteCategoryPopup().wait_until_appears()
|
|
|
|
|
2024-10-21 09:16:06 +00:00
|
|
|
|