2023-08-29 14:43:00 +00:00
|
|
|
import allure
|
|
|
|
|
2023-12-23 07:27:34 +00:00
|
|
|
import driver
|
2023-09-11 18:24:13 +00:00
|
|
|
from gui.components.community.create_community_popups import CreateCommunitiesBanner, CreateCommunityPopup
|
2023-10-06 08:33:42 +00:00
|
|
|
from gui.elements.button import Button
|
|
|
|
from gui.elements.object import QObject
|
2024-02-20 09:19:00 +00:00
|
|
|
from gui.objects_map import communities_names
|
2023-08-29 14:43:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
class CommunitiesPortal(QObject):
|
|
|
|
|
|
|
|
def __init__(self):
|
2024-02-20 09:19:00 +00:00
|
|
|
super().__init__(communities_names.mainWindow_communitiesPortalLayout_CommunitiesPortalLayout)
|
|
|
|
self._create_community_button = Button(communities_names.mainWindow_Create_New_Community_StatusButton)
|
2023-08-29 14:43:00 +00:00
|
|
|
|
|
|
|
@allure.step('Open create community popup')
|
2023-09-11 18:24:13 +00:00
|
|
|
def open_create_community_popup(self) -> CreateCommunityPopup:
|
2023-08-29 14:43:00 +00:00
|
|
|
self._create_community_button.click()
|
2023-12-23 07:27:34 +00:00
|
|
|
try:
|
|
|
|
assert driver.waitForObjectExists(CreateCommunitiesBanner().real_name, 5000), \
|
|
|
|
f'Create community banner is not present within 5 seconds'
|
|
|
|
except (Exception, AssertionError) as ex:
|
|
|
|
raise ex
|
|
|
|
return CreateCommunitiesBanner().open_create_community_popup()
|