chore: fix delete account test according new designs

This commit is contained in:
Anastasiya Semiankevich 2023-12-13 11:18:29 +03:00 committed by Anastasiya
parent 4f73e0eb52
commit 0573a1ea29
3 changed files with 13 additions and 5 deletions

View File

@ -1,21 +1,27 @@
import allure
import configs
from gui.components.base_popup import BasePopup
from gui.elements.button import Button
from gui.elements.check_box import CheckBox
from gui.elements.text_label import TextLabel
from gui.screens.settings_wallet import *
from gui.elements.object import QObject
class RemoveAccountConfirmationSettings(QObject):
class RemoveAccountConfirmationSettings(BasePopup):
def __init__(self):
super(RemoveAccountConfirmationSettings, self).__init__('removeConfirmationTextTitle')
super(RemoveAccountConfirmationSettings, self).__init__()
self._remove_confirmation_close_button = Button('removeConfirmationCrossCloseButton')
self._remove_confirmation_title_text = TextLabel('removeConfirmationTextTitle')
self._remove_confirmation_body_text = TextLabel('removeConfirmationTextBody')
self._remove_confirmation_remove_account_button = Button('removeConfirmationRemoveButton')
self._remove_confirmation_agreement_checkbox = CheckBox('removeConfirmationAgreementCheckBox')
self._remove_confirmation_confirm_button = Button('removeConfirmationConfirmButton')
@allure.step('Click Remove account button')
def click_remove_account_button(self):
self._remove_confirmation_remove_account_button.click()
def remove_account_with_confirmation(self):
self._remove_confirmation_agreement_checkbox.set(True)
self._remove_confirmation_confirm_button.click()

View File

@ -281,6 +281,8 @@ removeConfirmationCrossCloseButton = {"container": statusDesktop_mainWindow_over
removeConfirmationTextTitle = {"container": statusDesktop_mainWindow_overlay, "objectName": "headerTitle", "type": "StatusBaseText", "visible": True}
removeConfirmationTextBody = {"container": statusDesktop_mainWindow_overlay, "type": "StatusBaseText", "unnamed": 1, "visible": True}
removeConfirmationRemoveButton = {"container": statusDesktop_mainWindow_overlay, "objectName": RegularExpression("confirm*"), "type": "StatusButton"}
removeConfirmationAgreementCheckBox = {"container": statusDesktop_mainWindow_overlay, "objectName": "RemoveAccountPopup-HavePenPaper", "type": "StatusCheckBox"}
removeConfirmationConfirmButton = {"checkable": False, "container": statusDesktop_mainWindow_overlay, "objectName": "RemoveAccountPopup-ConfirmButton", "type": "StatusButton"}
# Testnet mode popup
turn_on_testnet_mode_StatusButton = {"container": statusDesktop_mainWindow_overlay, "id": "acceptBtn", "text": "Turn on testnet mode", "type": "StatusButton", "unnamed": 1, "visible": True}

View File

@ -57,7 +57,7 @@ def test_delete_generated_account_from_wallet_settings(
with step('Delete generated account'):
delete_confirmation_popup = acc_view.click_remove_account_button()
delete_confirmation_popup.click_remove_account_button()
delete_confirmation_popup.remove_account_with_confirmation()
with step('Verify toast message notification when removing account'):
messages = ToastMessage().get_toast_messages