status-desktop/test/e2e/gui/screens/settings_password.py

28 lines
1.2 KiB
Python
Raw Normal View History

2024-02-10 10:02:47 +00:00
import allure
from gui.components.change_password_popup import ChangePasswordPopup
from gui.elements.button import Button
from gui.elements.object import QObject
from gui.elements.scroll import Scroll
from gui.elements.text_edit import TextEdit
from gui.objects_map import names, settings_names
2024-02-10 10:02:47 +00:00
class ChangePasswordView(QObject):
def __init__(self):
super().__init__(settings_names.mainWindow_PasswordView)
2024-07-10 05:00:53 +00:00
self._scroll_view = Scroll(settings_names.settingsContentBase_ScrollView)
self._change_password_button = Button(names.change_password_menu_change_password_button)
self._current_password_text_field = TextEdit(names.change_password_menu_current_password)
self._new_password_text_field = TextEdit(names.change_password_menu_new_password)
self._confirm_password_text_field = TextEdit(names.change_password_menu_new_password_confirm)
2024-02-10 10:02:47 +00:00
@allure.step('Fill in the form, submit and sign out')
def change_password(self, old_pwd: str, new_pwd: str):
self._current_password_text_field.text = old_pwd
self._new_password_text_field.text = new_pwd
self._confirm_password_text_field.text = new_pwd
self._change_password_button.click()
return ChangePasswordPopup()