From 5ed7dbd9cf747ead38241928581107f6def68555 Mon Sep 17 00:00:00 2001 From: Anastasiya <82375995+anastasiyaig@users.noreply.github.com> Date: Thu, 26 Oct 2023 14:19:32 +0300 Subject: [PATCH] chore: add attempts for clicking networks and next buttons (#216) --- test/e2e/gui/screens/onboarding.py | 12 +++++++++--- test/e2e/gui/screens/settings_wallet.py | 10 ++++++++-- test/e2e/tests/communities/test_airdrops.py | 1 + test/e2e/tests/communities/test_tokens.py | 1 + .../onboarding/test_onboarding_generate_new_keys.py | 4 ++-- 5 files changed, 21 insertions(+), 7 deletions(-) diff --git a/test/e2e/gui/screens/onboarding.py b/test/e2e/gui/screens/onboarding.py index 15d49fad04..468ffada04 100755 --- a/test/e2e/gui/screens/onboarding.py +++ b/test/e2e/gui/screens/onboarding.py @@ -288,10 +288,16 @@ class YourProfileView(OnboardingView): return PictureEditPopup().wait_until_appears() @allure.step('Open Emoji and Icon view') - def next(self) -> 'EmojiAndIconView': + def next(self, attempts: int = 2) -> 'EmojiAndIconView': self._next_button.click() - time.sleep(1) - return EmojiAndIconView() + try: + return EmojiAndIconView().wait_until_appears() + except AssertionError as err: + if attempts: + return self.next(attempts - 1) + else: + raise err + @allure.step('Go back') def back(self): diff --git a/test/e2e/gui/screens/settings_wallet.py b/test/e2e/gui/screens/settings_wallet.py index 157e91af44..2013631804 100644 --- a/test/e2e/gui/screens/settings_wallet.py +++ b/test/e2e/gui/screens/settings_wallet.py @@ -38,9 +38,15 @@ class WalletSettingsView(QObject): return AccountPopup().wait_until_appears() @allure.step('Open networks in wallet settings') - def open_networks(self): + def open_networks(self, attempts: int = 2): self._wallet_network_button.click() - return NetworkWalletSettings().wait_until_appears() + try: + return NetworkWalletSettings().wait_until_appears() + except AssertionError as err: + if attempts: + return self.open_networks(attempts - 1) + else: + raise err @allure.step('Open account order in wallet settings') def open_account_order(self): diff --git a/test/e2e/tests/communities/test_airdrops.py b/test/e2e/tests/communities/test_airdrops.py index 2b7ef27df3..e20edfefbc 100644 --- a/test/e2e/tests/communities/test_airdrops.py +++ b/test/e2e/tests/communities/test_airdrops.py @@ -12,6 +12,7 @@ from scripts.tools import image 'Manage community: Manage Airdrops screen overview') @pytest.mark.case(703200) @pytest.mark.parametrize('params', [constants.community_params]) +@pytest.mark.skip(reason='https://github.com/status-im/desktop-qa-automation/issues/186') def test_airdrops_screen(main_screen: MainWindow, params): with step('Create community'): main_screen.create_community(params) diff --git a/test/e2e/tests/communities/test_tokens.py b/test/e2e/tests/communities/test_tokens.py index edc46fdce0..0c6696b95d 100644 --- a/test/e2e/tests/communities/test_tokens.py +++ b/test/e2e/tests/communities/test_tokens.py @@ -12,6 +12,7 @@ from scripts.tools import image 'Manage community: Manage Mint Tokens screen overview') @pytest.mark.case(703199) @pytest.mark.parametrize('params', [constants.community_params]) +@pytest.mark.skip(reason='https://github.com/status-im/desktop-qa-automation/issues/186') def test_tokens_screen(main_screen: MainWindow, params): with step('Create community'): main_screen.create_community(params) diff --git a/test/e2e/tests/onboarding/test_onboarding_generate_new_keys.py b/test/e2e/tests/onboarding/test_onboarding_generate_new_keys.py index adb36ff32e..5e37dbcf5b 100755 --- a/test/e2e/tests/onboarding/test_onboarding_generate_new_keys.py +++ b/test/e2e/tests/onboarding/test_onboarding_generate_new_keys.py @@ -20,8 +20,8 @@ def keys_screen(main_window) -> KeysView: if configs.system.IS_MAC: AllowNotificationsView().wait_until_appears().allow() BeforeStartedPopUp().get_started() - wellcome_screen = WelcomeToStatusView().wait_until_appears() - return wellcome_screen.get_keys() + welcome_screen = WelcomeToStatusView().wait_until_appears() + return welcome_screen.get_keys() @allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703421', 'Generate new keys')