status-desktop/test/e2e/gui/components/community/new_permission_popup.py

33 lines
1.6 KiB
Python
Raw Normal View History

import allure
import configs
import driver
from driver.objects_access import walk_children
from gui.elements.button import Button
from gui.elements.check_box import CheckBox
from gui.elements.object import QObject
from gui.elements.text_edit import TextEdit
from gui.objects_map import communities_names
2024-11-06 18:49:46 +00:00
from gui.screens.community_settings import PermissionsSettingsView
2024-11-06 18:49:46 +00:00
class NewPermissionPopup(PermissionsSettingsView):
def __init__(self):
super(NewPermissionPopup, self).__init__()
self._who_holds_checkbox = CheckBox(communities_names.whoHoldsSwitch_StatusSwitch)
self._who_holds_asset_field = TextEdit(communities_names.edit_TextEdit)
self._who_holds_amount_field = TextEdit(communities_names.inputValue_StyledTextField)
self._asset_item = QObject(communities_names.o_TokenItem)
self._is_allowed_to_option_button = Button(communities_names.customPermissionListItem)
self._hide_permission_checkbox = CheckBox(communities_names.switchItem_StatusSwitch)
self._create_permission_button = Button(communities_names.create_permission_StatusButton)
self._add_button_who_holds = Button(communities_names.add_update_statusButton)
self._add_button_is_allowed_to = Button(communities_names.add_StatusButton)
self._who_holds_list_item = QObject(communities_names.who_holds_StatusItemSelector)
self._is_allowed_to_list_item = QObject(communities_names.is_allowed_to_StatusFlowSelector)
@allure.step('Click create permission')
def create_permission(self):
self._create_permission_button.click()
self._create_permission_button.wait_until_hidden()