From 5691004e552c07c2b8b355d0092d7a223657b365 Mon Sep 17 00:00:00 2001 From: Anastasiya <82375995+anastasiyaig@users.noreply.github.com> Date: Wed, 22 Nov 2023 13:42:26 +0300 Subject: [PATCH] chore: stabilise test (#333) * chore: fix testnet toggle test and total balace wallet test * chore: increase timeout for syncing test * chore: disable test mode and remove keycard hide steps --- ci/Jenkinsfile | 4 ++-- driver/aut.py | 1 - gui/main_window.py | 5 ++--- gui/screens/wallet.py | 2 +- tests/communities/test_communities.py | 2 +- tests/onboarding/test_onboarding_import_seed.py | 1 - tests/onboarding/test_onboarding_syncing.py | 6 ++++-- .../test_wallet_settings_networks_testnet_mode.py | 2 +- 8 files changed, 11 insertions(+), 12 deletions(-) diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile index 57b584a..874bbbd 100644 --- a/ci/Jenkinsfile +++ b/ci/Jenkinsfile @@ -70,8 +70,8 @@ pipeline { TESTRAIL_URL = 'https://ethstatus.testrail.net' TESTRAIL_PROJECT_ID = 17 - /* Runtime flag to make testing of the app easier. */ - STATUS_RUNTIME_TEST_MODE = '1' + /* Runtime flag to make testing of the app easier. Switched off: unpredictable app behavior under new tests */ + /* STATUS_RUNTIME_TEST_MODE = '1' */ } stages { diff --git a/driver/aut.py b/driver/aut.py index 5f30290..a7b1c25 100644 --- a/driver/aut.py +++ b/driver/aut.py @@ -128,7 +128,6 @@ class AUT: else: raise err - @allure.step('Restart application') def restart(self): self.stop() diff --git a/gui/main_window.py b/gui/main_window.py index cf66468..a189e52 100644 --- a/gui/main_window.py +++ b/gui/main_window.py @@ -138,8 +138,9 @@ class MainWindow(Window): super(MainWindow, self).__init__('statusDesktop_mainWindow') self.left_panel = LeftPanel() + # TODO: we need to handle all the issues with keycard mock var before using keycard window in tests def prepare(self) -> 'Window': - MockedKeycardController().wait_until_appears().hide() + # MockedKeycardController().wait_until_appears().hide() return super().prepare() @allure.step('Sign Up user') @@ -159,7 +160,6 @@ class MainWindow(Window): SplashScreen().wait_until_appears().wait_until_hidden() if not configs.system.TEST_MODE: BetaConsentPopup().confirm() - MockedKeycardController().wait_until_appears().hide() return self @allure.step('Log in user') @@ -168,7 +168,6 @@ class MainWindow(Window): SplashScreen().wait_until_appears().wait_until_hidden() if not configs.system.TEST_MODE: BetaConsentPopup().confirm() - MockedKeycardController().wait_until_appears().hide() return self @allure.step('Authorize user') diff --git a/gui/screens/wallet.py b/gui/screens/wallet.py index 1066eab..f8efa90 100644 --- a/gui/screens/wallet.py +++ b/gui/screens/wallet.py @@ -59,7 +59,7 @@ class LeftPanel(QObject): @allure.step('Get total balance value from All accounts') def get_total_balance_value(self): - return self._all_accounts_balance.text[:-4] + return self._all_accounts_balance.text @allure.step('Choose saved addresses on left wallet panel') @close_exists(BasePopup()) diff --git a/tests/communities/test_communities.py b/tests/communities/test_communities.py index a6f966b..512f3b2 100644 --- a/tests/communities/test_communities.py +++ b/tests/communities/test_communities.py @@ -17,7 +17,7 @@ from scripts.tools import image @allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703084', 'Create community') @pytest.mark.case(703084) -# @pytest.mark.skip(reason="https://github.com/status-im/desktop-qa-automation/issues/167") +@pytest.mark.skip(reason="https://github.com/status-im/desktop-qa-automation/issues/167") @pytest.mark.parametrize('params', [constants.community_params]) def test_create_community(user_account, main_screen: MainWindow, params): with step('Create community'): diff --git a/tests/onboarding/test_onboarding_import_seed.py b/tests/onboarding/test_onboarding_import_seed.py index bbabee4..bd49ba2 100644 --- a/tests/onboarding/test_onboarding_import_seed.py +++ b/tests/onboarding/test_onboarding_import_seed.py @@ -49,7 +49,6 @@ def test_import_seed_phrase(aut: AUT, keys_screen, main_window, user_account, au SplashScreen().wait_until_appears().wait_until_hidden() if not configs.system.TEST_MODE: BetaConsentPopup().confirm() - MockedKeycardController().wait_until_appears().hide() with (step('Verify that restored account reveals correct status wallet address')): status_acc_view = ( diff --git a/tests/onboarding/test_onboarding_syncing.py b/tests/onboarding/test_onboarding_syncing.py index f43b1b6..51ca655 100644 --- a/tests/onboarding/test_onboarding_syncing.py +++ b/tests/onboarding/test_onboarding_syncing.py @@ -69,9 +69,11 @@ def test_sync_device_during_onboarding(multiple_instance, user_data): sync_start = sync_view.open_enter_sync_code_form() sync_start.paste_sync_code() sync_device_found = SyncDeviceFoundView() - assert driver.waitFor(lambda: 'Device found!' in sync_device_found.device_found_notifications) + assert driver.waitFor( + lambda: 'Device found!' in sync_device_found.device_found_notifications, 15000) sync_result = SyncResultView().wait_until_appears() - assert driver.waitFor(lambda: 'Device synced!' in sync_result.device_synced_notifications) + assert driver.waitFor( + lambda: 'Device synced!' in sync_result.device_synced_notifications, 15000) assert user.name in sync_device_found.device_found_notifications with step('Sign in to synced account'): diff --git a/tests/settings/settings_wallet/test_wallet_settings_networks_testnet_mode.py b/tests/settings/settings_wallet/test_wallet_settings_networks_testnet_mode.py index 6b48d06..d6fbe2b 100644 --- a/tests/settings/settings_wallet/test_wallet_settings_networks_testnet_mode.py +++ b/tests/settings/settings_wallet/test_wallet_settings_networks_testnet_mode.py @@ -56,7 +56,7 @@ def test_switch_testnet_mode(main_screen: MainWindow): assert message == WalletNetworkSettings.TESTNET_DISABLED_TOAST_MESSAGE.value, \ f"Toast message is incorrect, current message is {message}" if not configs.system.TEST_MODE: - TestnetModeBanner().wait_until_appears() + TestnetModeBanner().wait_until_hidden() assert not networks.is_testnet_mode_toggle_checked(), f"Testnet toggle is on when it should not"