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