2023-09-01 11:18:04 +00:00
|
|
|
import allure
|
|
|
|
|
2024-05-31 10:45:47 +00:00
|
|
|
from gui.components.community.invite_contacts import InviteContactsPopup
|
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)
|
|
|
|
self._menu_item = QObject(names.contextMenuItem)
|
|
|
|
self._context_add_watched_address_option = QObject(names.contextMenuItem_AddWatchOnly)
|
|
|
|
self._context_delete_account_option = QObject(names.contextMenuItem_Delete)
|
|
|
|
self._context_edit_account_option = QObject(names.contextMenuItem_Edit)
|
|
|
|
self._context_hide_include_in_total_balance = QObject(names.contextMenuItem_HideInclude)
|
|
|
|
self._context_edit_saved_address_option = QObject(names.contextSavedAddressEdit)
|
|
|
|
self._context_delete_saved_address_option = QObject(names.contextSavedAddressDelete)
|
2024-02-27 09:05:39 +00:00
|
|
|
self._edit_channel_context_item = QObject(communities_names.edit_Channel_StatusMenuItem)
|
|
|
|
self._delete_channel_context_item = QObject(communities_names.delete_Channel_StatusMenuItem)
|
2024-05-31 10:45:47 +00:00
|
|
|
self._invite_people_item = QObject(communities_names.invite_People_StatusMenuItem)
|
|
|
|
self._mute_community_item = QObject(communities_names.mute_Community_StatusMenuItem)
|
2024-02-27 09:05:39 +00:00
|
|
|
|
|
|
|
@allure.step('Is edit channel option present in context menu')
|
|
|
|
def is_edit_channel_option_present(self):
|
|
|
|
return self._edit_channel_context_item.exists
|
|
|
|
|
|
|
|
@allure.step('Is delete channel option present in context menu')
|
|
|
|
def is_delete_channel_option_present(self):
|
|
|
|
return self._delete_channel_context_item.exists
|
2023-09-01 11:18:04 +00:00
|
|
|
|
|
|
|
@allure.step('Select in context menu')
|
|
|
|
def select(self, value: str):
|
|
|
|
self._menu_item.real_name['text'] = value
|
2023-10-09 17:04:29 +00:00
|
|
|
self._menu_item.click()
|
2023-10-11 10:38:55 +00:00
|
|
|
|
2024-01-09 14:43:56 +00:00
|
|
|
@allure.step('Click Edit saved address option')
|
|
|
|
def select_edit_saved_address(self):
|
|
|
|
self._context_edit_saved_address_option.click()
|
|
|
|
|
|
|
|
@allure.step('Click Delete saved address option')
|
|
|
|
def select_delete_saved_address(self):
|
|
|
|
self._context_delete_saved_address_option.click()
|
|
|
|
|
2023-10-11 10:38:55 +00:00
|
|
|
@allure.step('Select add watched address option from context menu')
|
|
|
|
def select_add_watched_address_from_context_menu(self):
|
|
|
|
self._context_add_watched_address_option.click()
|
|
|
|
|
|
|
|
@allure.step('Select delete account option from context menu')
|
|
|
|
def select_delete_account_from_context_menu(self):
|
|
|
|
self._context_delete_account_option.click()
|
|
|
|
|
2023-11-10 15:04:49 +00:00
|
|
|
@allure.step('Select Hide/Include in total balance option from context menu')
|
|
|
|
def select_hide_include_total_balance_from_context_menu(self):
|
|
|
|
self._context_hide_include_in_total_balance.click()
|
|
|
|
|
2023-10-11 10:38:55 +00:00
|
|
|
@allure.step('Select edit account option from context menu')
|
|
|
|
def select_edit_account_from_context_menu(self):
|
|
|
|
self._context_edit_account_option.click()
|
2023-10-24 12:32:19 +00:00
|
|
|
|
|
|
|
@allure.step('Check delete option visibility in context menu')
|
|
|
|
def is_delete_account_option_present(self):
|
|
|
|
return self._context_delete_account_option.is_visible
|
2024-05-31 10:45:47 +00:00
|
|
|
|
|
|
|
@allure.step('Select invite people to community')
|
|
|
|
def select_invite_people(self):
|
|
|
|
self._invite_people_item.click()
|
|
|
|
return InviteContactsPopup()
|