From 767f388b573aaafd4bee8c9f969e2f9a6c4c77a7 Mon Sep 17 00:00:00 2001 From: Anastasiya Semenkevich Date: Tue, 19 Dec 2023 16:12:24 +0300 Subject: [PATCH] chore: raise exceptions when needed --- .../gui/components/community/create_community_popups.py | 4 ++-- test/e2e/gui/screens/messages.py | 4 ++-- test/e2e/gui/screens/settings_messaging.py | 2 +- test/e2e/gui/screens/wallet.py | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/test/e2e/gui/components/community/create_community_popups.py b/test/e2e/gui/components/community/create_community_popups.py index fa31988a6b..6e02cc8dc7 100644 --- a/test/e2e/gui/components/community/create_community_popups.py +++ b/test/e2e/gui/components/community/create_community_popups.py @@ -76,12 +76,12 @@ class CreateCommunityPopup(BasePopup): self._add_logo_button.click() try: return OpenFileDialog().wait_until_appears() - except LookupError as err: + except Exception as err: if attempt: LOG.debug(err) return self._open_logo_file_dialog(attempt - 1) else: - raise + raise err @logo.setter @allure.step('Set community logo') diff --git a/test/e2e/gui/screens/messages.py b/test/e2e/gui/screens/messages.py index cc7f57c306..a83a996898 100644 --- a/test/e2e/gui/screens/messages.py +++ b/test/e2e/gui/screens/messages.py @@ -57,11 +57,11 @@ class LeftPanel(QObject): try: self._open_context_menu_for_chat(chat_name).select('Leave group') return LeaveGroupPopup().wait_until_appears() - except: + except Exception as ex: if attempt: return self.open_leave_group_popup(chat_name, attempt - 1) else: - raise + raise ex class ToolBar(QObject): diff --git a/test/e2e/gui/screens/settings_messaging.py b/test/e2e/gui/screens/settings_messaging.py index 634995fe73..d4d08de143 100644 --- a/test/e2e/gui/screens/settings_messaging.py +++ b/test/e2e/gui/screens/settings_messaging.py @@ -80,7 +80,7 @@ class ContactItem: self._open_canvas_button.click(attempt - 1) return self else: - raise f"Popup didn't appear" + raise LookupError(f"Popup didn't appear") class ContactsSettingsView(QObject): diff --git a/test/e2e/gui/screens/wallet.py b/test/e2e/gui/screens/wallet.py index b349b493d1..11e59e1e7a 100644 --- a/test/e2e/gui/screens/wallet.py +++ b/test/e2e/gui/screens/wallet.py @@ -101,11 +101,11 @@ class LeftPanel(QObject): try: self._open_context_menu_for_account(account_name).select_edit_account_from_context_menu() return AccountPopup().wait_until_appears() - except: + except Exception as ex: if attempt: return self.open_edit_account_popup_from_context_menu(account_name, attempt - 1) else: - raise + raise ex @allure.step('Open account popup') def open_add_account_popup(self, attempt: int = 2): @@ -128,11 +128,11 @@ class LeftPanel(QObject): try: self._open_context_menu_for_account(account_name).select_delete_account_from_context_menu() return RemoveWalletAccountPopup().wait_until_appears() - except: + except Exception as ex: if attempt: return self.delete_account_from_context_menu(account_name, attempt - 1) else: - raise + raise ex class SavedAddressesView(QObject):