2024-07-30 08:15:14 +00:00
|
|
|
import allure
|
|
|
|
import pyperclip
|
|
|
|
|
|
|
|
from gui.components.base_popup import BasePopup
|
|
|
|
from gui.elements.button import Button
|
|
|
|
from gui.elements.object import QObject
|
|
|
|
from gui.objects_map import names
|
|
|
|
|
|
|
|
|
|
|
|
class ReceivePopup(BasePopup):
|
|
|
|
|
|
|
|
def __init__(self):
|
|
|
|
super().__init__()
|
2024-10-12 13:26:01 +00:00
|
|
|
self.account_selector_text = QObject(names.textContent_StatusBaseText)
|
|
|
|
self.copy_button = Button(names.greenCircleAroundIcon_Rectangle)
|
2024-07-30 08:15:14 +00:00
|
|
|
self.qr_code = QObject(names.qrCodeImage_Image)
|
|
|
|
|
|
|
|
@allure.step('Get current text in account selector')
|
|
|
|
def get_text_from_account_selector(self) -> str:
|
2024-10-12 13:26:01 +00:00
|
|
|
return str(self.account_selector_text.object.text)
|
2024-07-30 08:15:14 +00:00
|
|
|
|
|
|
|
@allure.step('Copy address')
|
|
|
|
def copy_address(self) -> str:
|
2024-10-12 13:26:01 +00:00
|
|
|
self.copy_button.click()
|
2024-07-30 08:15:14 +00:00
|
|
|
return str(pyperclip.paste())
|
|
|
|
|