chore: closing build showcase popup added

This commit is contained in:
Valentina Novgorodtceva 2024-02-27 15:30:54 +07:00 committed by Anastasiya
parent d793b3108c
commit 838b91f03e
4 changed files with 46 additions and 2 deletions

View File

@ -0,0 +1,24 @@
import allure
import configs
from gui.components.base_popup import BasePopup
from gui.elements.button import Button
from gui.objects_map import names
class BuildShowcasePopup(BasePopup):
def __init__(self):
super().__init__()
self._build_your_showcase_button = Button(names.build_your_showcase_StatusButton)
self._close_button = Button(names.closeCrossPopupButton)
@allure.step('Wait until appears {0}')
def wait_until_appears(self, timeout_msec: int = configs.timeouts.UI_LOAD_TIMEOUT_MSEC):
self._build_your_showcase_button.wait_until_appears(timeout_msec)
return self
@allure.step('Close build showcase popup')
def close(self):
self._close_button.click()
self.wait_until_hidden()

View File

@ -9,7 +9,7 @@ class TestnetModePopup(BasePopup):
def __init__(self):
super(TestnetModePopup, self).__init__()
self._cancel_button = Button(names.testnet_mode_cancelButton)
self._close_cross_button = Button(names.testnet_mode_closeCrossButton)
self._close_cross_button = Button(names.closeCrossPopupButton)
self._turn_on_button = Button(names.turn_on_testnet_mode_StatusButton)
self._turn_off_button = Button(names.turn_off_testnet_mode_StatusButton)

View File

@ -8,8 +8,11 @@ statusDesktop_mainWindow_overlay = {"container": statusDesktop_mainWindow, "type
statusDesktop_mainWindow_overlay_popup2 = {"container": statusDesktop_mainWindow_overlay, "occurrence": 2, "type": "PopupItem", "unnamed": 1, "visible": True}
scrollView_StatusScrollView = {"container": statusDesktop_mainWindow_overlay, "id": "scrollView", "type": "StatusScrollView", "unnamed": 1, "visible": True}
splashScreen = {"container": statusDesktop_mainWindow, "objectName": "splashScreen", "type": "DidYouKnowSplashScreen"}
# Common names
settingsSave_StatusButton = {"container": statusDesktop_mainWindow, "objectName": "settingsDirtyToastMessageSaveButton", "type": "StatusButton", "visible": True}
mainWindow_Save_changes_StatusButton = {"container": statusDesktop_mainWindow, "objectName": "settingsDirtyToastMessageSaveButton", "type": "DisabledTooltipButton", "visible": True}
closeCrossPopupButton = {"container": statusDesktop_mainWindow_overlay, "objectName": "headerActionsCloseButton", "type": "StatusFlatRoundButton", "visible": True}
# Main right panel
mainWindow_RighPanel = {"container": statusDesktop_mainWindow, "type": "ColumnLayout", "objectName": "mainRightView", "visible": True}
@ -326,7 +329,6 @@ removeConfirmationConfirmButton = {"checkable": False, "container": statusDeskto
turn_on_testnet_mode_StatusButton = {"container": statusDesktop_mainWindow_overlay, "id": "acceptBtn", "text": "Turn on testnet mode", "type": "StatusButton", "unnamed": 1, "visible": True}
turn_off_testnet_mode_StatusButton = {"container": statusDesktop_mainWindow_overlay, "id": "acceptBtn", "text": "Turn off testnet mode", "type": "StatusButton", "unnamed": 1, "visible": True}
testnet_mode_cancelButton = {"container": statusDesktop_mainWindow_overlay, "type": "StatusButton", "unnamed": 1, "visible": True}
testnet_mode_closeCrossButton = {"container": statusDesktop_mainWindow_overlay, "objectName": "headerActionsCloseButton", "type": "StatusFlatRoundButton", "visible": True}
# Testnet mode banner
mainWindow_testnetBanner_ModuleWarning = {"container": statusDesktop_mainWindow, "objectName": "testnetBanner", "type": "ModuleWarning", "visible": True}
@ -432,6 +434,9 @@ refuse_Verification_StatusButton = {"checkable": False, "container": statusDeskt
change_answer_StatusFlatButton = {"checkable": False, "container": statusDesktop_mainWindow_overlay, "objectName": "changeAnswerButton", "type": "StatusFlatButton", "visible": True}
close_StatusButton = {"checkable": False, "container": statusDesktop_mainWindow_overlay, "objectName": "closeButton", "type": "StatusButton", "visible": True}
# Build showcase popup
build_your_showcase_StatusButton = {"checkable": False, "container": statusDesktop_mainWindow_overlay, "objectName": "buildShowcaseButton", "type": "StatusButton", "visible": True}
# OS NAMES
# Open Files Dialog
chooseAnImageALogo_QQuickWindow = {"title": RegularExpression("Choose.*"), "type": "QQuickWindow", "unnamed": 1, "visible": True}

View File

@ -4,6 +4,7 @@ import configs.timeouts
import driver
from driver.objects_access import walk_children
from gui.components.change_password_popup import ChangePasswordPopup
from gui.components.settings.build_your_showcase_popup import BuildShowcasePopup
from gui.components.social_links_popup import SocialLinksPopup
from gui.elements.button import Button
from gui.elements.object import QObject
@ -30,11 +31,15 @@ class ProfileSettingsView(QObject):
@allure.step('Get display name')
def display_name(self) -> str:
self._identity_tab_button.click()
if BuildShowcasePopup().is_visible:
BuildShowcasePopup().close()
return self._display_name_text_field.text
@allure.step('Set user name')
def set_name(self, value: str):
self._identity_tab_button.click()
if BuildShowcasePopup().is_visible:
BuildShowcasePopup().close()
self._display_name_text_field.text = value
self.save_changes()
@ -42,12 +47,16 @@ class ProfileSettingsView(QObject):
@allure.step('Get bio')
def bio(self) -> str:
self._identity_tab_button.click()
if BuildShowcasePopup().is_visible:
BuildShowcasePopup().close()
return self._bio_text_field.text
@bio.setter
@allure.step('Set bio')
def bio(self, value: str):
self._identity_tab_button.click()
if BuildShowcasePopup().is_visible:
BuildShowcasePopup().close()
self._bio_text_field.text = value
self.save_changes()
@ -55,6 +64,8 @@ class ProfileSettingsView(QObject):
@allure.step('Get social links')
def social_links(self) -> dict:
self._web_tab_button.click()
if BuildShowcasePopup().is_visible:
BuildShowcasePopup().close()
links = {}
for link_name in walk_children(
driver.waitForObjectExists(self._links_list.real_name, configs.timeouts.UI_LOAD_TIMEOUT_MSEC)):
@ -84,6 +95,8 @@ class ProfileSettingsView(QObject):
@allure.step('Verify social links')
def verify_social_links(self, links):
self._web_tab_button.click()
if BuildShowcasePopup().is_visible:
BuildShowcasePopup().close()
twitter = links[0]
personal_site = links[1]
github = links[2]
@ -106,6 +119,8 @@ class ProfileSettingsView(QObject):
@allure.step('Open social links form')
def open_social_links_popup(self):
self._web_tab_button.click()
if BuildShowcasePopup().is_visible:
BuildShowcasePopup().close()
self._add_more_links_label.click()
return SocialLinksPopup().wait_until_appears()