status-desktop/test/e2e/gui/components/change_password_popup.py

32 lines
1.5 KiB
Python
Raw Normal View History

import allure
import driver
2024-02-10 10:02:47 +00:00
from constants.settings import PasswordView
from gui.components.base_popup import BasePopup
from gui.elements.button import Button
2024-02-10 10:02:47 +00:00
from gui.elements.text_label import TextLabel
from gui.objects_map import names
class ChangePasswordPopup(BasePopup):
def __init__(self):
super(ChangePasswordPopup, self).__init__()
self._re_encrypt_data_restart_button = Button(names.reEncryptRestartButton)
self._re_encryption_complete_element = TextLabel(names.reEncryptionComplete)
2024-02-10 10:02:47 +00:00
def click_re_encrypt_data_restart_button(self):
"""
2024-03-01 08:29:01 +00:00
Timeout is set as rough estimation of 30 seconds. What is happening when changing password is
the process of re-hashing DB initiated. Taking into account the user is new , so DB is relatively small
2024-03-01 08:29:01 +00:00
I assume, 30 seconds should be enough to finish re-hashing and show the Restart button
2024-02-10 10:02:47 +00:00
This time is not really predictable, especially for huge DBs.
2024-03-01 08:29:01 +00:00
In case it does not please check https://github.com/status-im/status-desktop/issues/13013 for context
"""
2024-02-10 10:02:47 +00:00
self._re_encrypt_data_restart_button.click()
assert driver.waitForObject(self._re_encryption_complete_element.real_name, 30000), \
f'Re-encryption confirmation is not present within 30 seconds'
assert driver.waitForObject(self._re_encrypt_data_restart_button.real_name, 30000)
2024-02-10 10:02:47 +00:00
assert getattr(self._re_encrypt_data_restart_button.object, 'text') == PasswordView.RESTART_STATUS.value
self._re_encrypt_data_restart_button.click()