2023-09-22 08:44:29 +00:00
|
|
|
import allure
|
|
|
|
|
2023-10-06 08:33:42 +00:00
|
|
|
from gui.elements.button import Button
|
|
|
|
from gui.elements.object import QObject
|
2024-02-28 12:48:42 +00:00
|
|
|
from gui.objects_map import names, communities_names
|
2023-09-22 08:44:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
class ChangesDetectedToastMessage(QObject):
|
|
|
|
|
|
|
|
def __init__(self):
|
2023-10-09 17:04:29 +00:00
|
|
|
super(ChangesDetectedToastMessage, self).__init__(
|
2024-02-13 09:04:24 +00:00
|
|
|
names.mainWindow_settingsDirtyToastMessage_SettingsDirtyToastMessage)
|
2024-02-14 10:04:51 +00:00
|
|
|
self._save_button = Button(names.mainWindow_Save_changes_StatusButton)
|
2023-09-22 08:44:29 +00:00
|
|
|
|
|
|
|
@allure.step('Save changes')
|
2024-03-07 10:48:41 +00:00
|
|
|
def click_save_changes_button(self):
|
2023-09-22 08:44:29 +00:00
|
|
|
self._save_button.click()
|
2024-03-07 10:48:41 +00:00
|
|
|
|
|
|
|
@allure.step('Check if save changes button is visible')
|
2024-03-15 07:28:40 +00:00
|
|
|
def is_save_changes_button_visible(self) -> bool:
|
2024-03-07 10:48:41 +00:00
|
|
|
return self._save_button.is_visible
|
2024-02-16 05:08:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
class PermissionsChangesDetectedToastMessage(QObject):
|
|
|
|
|
|
|
|
def __init__(self):
|
2024-02-28 12:48:42 +00:00
|
|
|
super().__init__(communities_names.editPermissionView_settingsDirtyToastMessage_SettingsDirtyToastMessage)
|
2024-03-15 07:28:40 +00:00
|
|
|
self._update_permission_button = Button(communities_names.editPermissionView_Update_permission_StatusButton)
|
2024-02-16 05:08:57 +00:00
|
|
|
|
|
|
|
@allure.step('Update permission')
|
|
|
|
def update_permission(self):
|
|
|
|
self._update_permission_button.click()
|
|
|
|
self.wait_until_hidden()
|