chore: add attempts to click the cross button

1. test_toggle_testnet_toggle_on_and_close_the_confirmation fails now in nightly. I added attempts to click the cross button and removed wait_untll_appears (and related assert)
This commit is contained in:
Anastasiya Semenkevich 2023-12-08 12:19:17 +03:00 committed by Anastasiya
parent 5afb3b6811
commit 5a6d35fde2
2 changed files with 10 additions and 5 deletions

View File

@ -13,9 +13,14 @@ class TestnetModePopup(BasePopup):
self._turn_off_button = Button('turn_off_testnet_mode_StatusButton')
@allure.step('Close testnet mode modal with cross button')
def close_testnet_modal_with_cross_button(self):
self._close_cross_button.click()
self.wait_until_hidden()
def close_testnet_modal_with_cross_button(self, attempts: int = 2):
try:
self._close_cross_button.click()
except Exception as ec:
if attempts:
self.close_testnet_modal_with_cross_button(attempts - 1)
else:
raise ec
@allure.step('Confirm turning on in the testnet modal')
def turn_on_testnet_mode_in_testnet_modal(self):

View File

@ -60,11 +60,11 @@ class LeftPanel(QObject):
self._open_settings('8-MainMenuItem')
try:
return SyncingSettingsView().wait_until_appears()
except AssertionError:
except (AssertionError, LookupError) as ec:
if attempts:
return self.open_syncing_settings(attempts - 1)
else:
raise f"Sync settings was not opened"
raise ec
@allure.step('Choose sign out and quit in settings')
def open_sign_out_and_quit(self):