2023-09-20 11:35:56 +00:00
|
|
|
import allure
|
|
|
|
|
2024-02-10 10:02:47 +00:00
|
|
|
import configs
|
2023-12-15 14:48:20 +00:00
|
|
|
import driver
|
2024-02-10 10:02:47 +00:00
|
|
|
from constants.settings import PasswordView
|
2023-09-20 11:35:56 +00:00
|
|
|
from gui.components.base_popup import BasePopup
|
2023-10-06 08:33:42 +00:00
|
|
|
from gui.elements.button import Button
|
2024-02-10 10:02:47 +00:00
|
|
|
from gui.elements.text_label import TextLabel
|
2023-09-20 11:35:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
class ChangePasswordPopup(BasePopup):
|
|
|
|
|
|
|
|
def __init__(self):
|
|
|
|
super(ChangePasswordPopup, self).__init__()
|
2024-02-10 10:02:47 +00:00
|
|
|
self._re_encrypt_data_restart_button = Button('reEncryptRestartButton')
|
|
|
|
self._re_encryption_complete_element = TextLabel('reEncryptionComplete')
|
2023-12-15 14:48:20 +00:00
|
|
|
|
2024-02-10 10:02:47 +00:00
|
|
|
def click_re_encrypt_data_restart_button(self):
|
2023-12-15 14:48:20 +00:00
|
|
|
"""
|
2024-02-12 14:13:40 +00:00
|
|
|
Timeout is set as rough estimation of 20 seconds. What is happening when changing password is
|
2023-12-22 10:23:35 +00:00
|
|
|
the process of re-hashing DB initiated. Taking into account the user is new , so DB is relatively small
|
2024-02-12 14:13:40 +00:00
|
|
|
I assume, 20 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.
|
2023-12-15 14:48:20 +00:00
|
|
|
"""
|
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, 15000), \
|
|
|
|
f'Re-encryption confirmation is not present within 15 seconds'
|
2024-02-12 14:13:40 +00:00
|
|
|
assert driver.waitForObject(self._re_encrypt_data_restart_button.real_name, 20000)
|
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()
|
|
|
|
|
2023-12-22 10:23:35 +00:00
|
|
|
|
|
|
|
|