2023-09-11 18:24:13 +00:00
|
|
|
import allure
|
|
|
|
|
|
|
|
from gui.components.base_popup import BasePopup
|
2023-10-09 17:04:29 +00:00
|
|
|
from gui.components.community.authenticate_popup import AuthenticatePopup
|
2023-10-06 08:33:42 +00:00
|
|
|
from gui.elements.button import Button
|
|
|
|
from gui.elements.object import QObject
|
|
|
|
from gui.elements.text_label import TextLabel
|
2023-09-11 18:24:13 +00:00
|
|
|
from scripts.tools.image import Image
|
|
|
|
|
|
|
|
|
|
|
|
class WelcomeCommunityPopup(BasePopup):
|
|
|
|
|
|
|
|
def __init__(self):
|
|
|
|
super().__init__()
|
|
|
|
self._title_text_label = TextLabel('headerTitle_StatusBaseText')
|
|
|
|
self._community_icon = QObject('image_StatusImage')
|
|
|
|
self._intro_text_label = TextLabel('intro_StatusBaseText')
|
|
|
|
self._select_address_button = Button('select_addresses_to_share_StatusFlatButton')
|
|
|
|
self._join_button = Button('join_StatusButton')
|
2023-12-08 07:20:15 +00:00
|
|
|
self._authenticate_button = Button('welcome_authenticate_StatusButton')
|
|
|
|
self._share_address_button = Button('share_your_addresses_to_join_StatusButton')
|
2023-09-11 18:24:13 +00:00
|
|
|
|
|
|
|
@property
|
|
|
|
@allure.step('Get title')
|
|
|
|
def title(self) -> str:
|
|
|
|
return self._title_text_label.text
|
|
|
|
|
|
|
|
@property
|
|
|
|
@allure.step('Get community icon')
|
|
|
|
def community_icon(self) -> Image:
|
|
|
|
return self._community_icon.image
|
|
|
|
|
|
|
|
@property
|
|
|
|
@allure.step('Get community intro')
|
|
|
|
def intro(self) -> str:
|
|
|
|
return self._intro_text_label.text
|
|
|
|
|
|
|
|
@allure.step('Join community')
|
|
|
|
def join(self) -> AuthenticatePopup:
|
|
|
|
self._join_button.click()
|
2023-12-08 07:20:15 +00:00
|
|
|
self._authenticate_button.click()
|
2023-09-11 18:24:13 +00:00
|
|
|
return AuthenticatePopup().wait_until_appears()
|
2023-12-08 07:20:15 +00:00
|
|
|
|
|
|
|
def share_address(self):
|
|
|
|
self._share_address_button.click()
|