From 5a6d35fde25dadf07c840942ab9978d99d23fbda Mon Sep 17 00:00:00 2001 From: Anastasiya Semenkevich Date: Fri, 8 Dec 2023 12:19:17 +0300 Subject: [PATCH] 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) --- test/e2e/gui/components/wallet/testnet_mode_popup.py | 11 ++++++++--- test/e2e/gui/screens/settings.py | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/test/e2e/gui/components/wallet/testnet_mode_popup.py b/test/e2e/gui/components/wallet/testnet_mode_popup.py index 196f80874d..23d1e69d64 100644 --- a/test/e2e/gui/components/wallet/testnet_mode_popup.py +++ b/test/e2e/gui/components/wallet/testnet_mode_popup.py @@ -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): diff --git a/test/e2e/gui/screens/settings.py b/test/e2e/gui/screens/settings.py index 11e16eef3e..c5b6e237e3 100644 --- a/test/e2e/gui/screens/settings.py +++ b/test/e2e/gui/screens/settings.py @@ -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):