2023-09-28 06:45:49 +00:00
|
|
|
import allure
|
|
|
|
import pyperclip
|
|
|
|
|
|
|
|
from gui.components.base_popup import BasePopup
|
2023-10-06 08:33:42 +00:00
|
|
|
from gui.elements.button import Button
|
|
|
|
from gui.elements.text_edit import TextEdit
|
2023-09-28 06:45:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
class SyncNewDevicePopup(BasePopup):
|
|
|
|
|
|
|
|
def __init__(self):
|
|
|
|
super().__init__()
|
|
|
|
self._copy_button = Button('copy_SyncCodeStatusButton')
|
|
|
|
self._done_button = Button('done_SyncCodeStatusButton')
|
|
|
|
self._sync_code_field = TextEdit('syncCodeInput_StatusPasswordInput')
|
|
|
|
|
|
|
|
@property
|
|
|
|
@allure.step('Get syncing code')
|
|
|
|
def syncing_code(self):
|
|
|
|
self._copy_button.click()
|
|
|
|
return pyperclip.paste()
|
|
|
|
|
|
|
|
@allure.step('Click done')
|
|
|
|
def done(self):
|
|
|
|
self._done_button.click()
|
|
|
|
self.wait_until_hidden()
|