From 41d431c1364161439599861e3d9163ccffddd2e3 Mon Sep 17 00:00:00 2001 From: Anastasiya <82375995+anastasiyaig@users.noreply.github.com> Date: Thu, 16 Nov 2023 13:48:17 +0300 Subject: [PATCH] chore: add object names to beta consent popup and test mode env variable condition (#308) * chore: add object names to beta popup * chore: add check for env variable --- test/e2e/configs/system.py | 2 ++ .../gui/components/onboarding/beta_consent_popup.py | 5 +++-- test/e2e/gui/main_window.py | 11 +++++------ test/e2e/gui/objects_map/component_names.py | 8 ++++---- .../onboarding/test_onboarding_generate_new_keys.py | 3 ++- .../tests/onboarding/test_onboarding_import_seed.py | 4 +++- .../onboarding/test_onboarding_negative_scenarios.py | 3 ++- test/e2e/tests/onboarding/test_onboarding_syncing.py | 7 ++++--- test/e2e/tests/onboarding/test_password_strength.py | 4 +++- 9 files changed, 28 insertions(+), 19 deletions(-) diff --git a/test/e2e/configs/system.py b/test/e2e/configs/system.py index aed484d477..a8db36ef3e 100644 --- a/test/e2e/configs/system.py +++ b/test/e2e/configs/system.py @@ -8,3 +8,5 @@ IS_WIN = True if platform.system() == 'Windows' else False OS_ID = 'lin' if IS_LIN else 'mac' if IS_MAC else 'win' DISPLAY = os.getenv('DISPLAY', ':0') + +TEST_MODE = os.getenv('STATUS_RUNTIME_TEST_MODE') diff --git a/test/e2e/gui/components/onboarding/beta_consent_popup.py b/test/e2e/gui/components/onboarding/beta_consent_popup.py index 1a3100214a..6a9132cb6a 100644 --- a/test/e2e/gui/components/onboarding/beta_consent_popup.py +++ b/test/e2e/gui/components/onboarding/beta_consent_popup.py @@ -3,15 +3,16 @@ import allure from gui.components.base_popup import BasePopup from gui.elements.button import Button from gui.elements.check_box import CheckBox +from gui.elements.object import QObject -class BetaConsentPopup(BasePopup): +class BetaConsentPopup(QObject): def __init__(self): self._agree_to_use_checkbox = CheckBox('agreeToUse_StatusCheckBox') self._ready_to_use_checkbox = CheckBox('readyToUse_StatusCheckBox') self._ready_to_use_button = Button('i_m_ready_to_use_Status_Desktop_Beta_StatusButton') - super(BetaConsentPopup, self).__init__() + super(BetaConsentPopup, self).__init__('betaConsent_StatusModal') @allure.step('Confirm all') def confirm(self): diff --git a/test/e2e/gui/main_window.py b/test/e2e/gui/main_window.py index e501b85b59..efc9375042 100644 --- a/test/e2e/gui/main_window.py +++ b/test/e2e/gui/main_window.py @@ -1,4 +1,5 @@ import logging +import os import typing import allure @@ -151,18 +152,16 @@ class MainWindow(Window): if configs.system.IS_MAC: BiometricsView().wait_until_appears().prefer_password() SplashScreen().wait_until_appears().wait_until_hidden() - if not configs.DEV_BUILD: - if driver.waitFor(lambda: BetaConsentPopup().exists, configs.timeouts.UI_LOAD_TIMEOUT_MSEC): - BetaConsentPopup().confirm() + if not configs.system.TEST_MODE: + BetaConsentPopup().confirm() return self @allure.step('Log in user') def log_in(self, user_account: UserAccount): LoginView().log_in(user_account) SplashScreen().wait_until_appears().wait_until_hidden() - if not configs.DEV_BUILD: - if driver.waitFor(lambda: BetaConsentPopup().exists, configs.timeouts.UI_LOAD_TIMEOUT_MSEC): - BetaConsentPopup().confirm() + if not configs.system.TEST_MODE: + BetaConsentPopup().confirm() return self @allure.step('Authorize user') diff --git a/test/e2e/gui/objects_map/component_names.py b/test/e2e/gui/objects_map/component_names.py index 1b4cc47870..f16c338309 100644 --- a/test/e2e/gui/objects_map/component_names.py +++ b/test/e2e/gui/objects_map/component_names.py @@ -66,10 +66,10 @@ copy_icon_StatusIcon = {"container": statusDesktop_mainWindow_overlay, "objectNa # Welcome Status Popup -agreeToUse_StatusCheckBox = {"checkable": True, "container": statusDesktop_mainWindow_overlay, "id": "agreeToUse", "type": "StatusCheckBox", "unnamed": 1, "visible": True} -readyToUse_StatusCheckBox = {"checkable": True, "container": statusDesktop_mainWindow_overlay, "id": "readyToUse", "type": "StatusCheckBox", "unnamed": 1, "visible": True} -i_m_ready_to_use_Status_Desktop_Beta_StatusButton = {"checkable": False, "container": statusDesktop_mainWindow_overlay, "type": "StatusButton", "unnamed": 1, "visible": True} - +betaConsent_StatusModal = {"container": statusDesktop_mainWindow_overlay, "objectName": "desktopBetaStatusModal", "type": "StatusModal", "visible": True} +agreeToUse_StatusCheckBox = {"checkable": True, "container": statusDesktop_mainWindow_overlay, "objectName": "desktopBetaAgreeCheckBox", "type": "StatusCheckBox", "visible": True} +readyToUse_StatusCheckBox = {"checkable": True, "container": statusDesktop_mainWindow_overlay, "objectName": "desktopBetaReadyCheckBox", "type": "StatusCheckBox", "visible": True} +i_m_ready_to_use_Status_Desktop_Beta_StatusButton = {"container": statusDesktop_mainWindow_overlay, "type": "StatusButton", "objectName": "desktopBetaStatusButton", "visible": True} """ Communities """ 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 8d19e360dc..7c5d1acd27 100755 --- a/test/e2e/tests/onboarding/test_onboarding_generate_new_keys.py +++ b/test/e2e/tests/onboarding/test_onboarding_generate_new_keys.py @@ -1,4 +1,5 @@ import logging +import os import allure import pytest @@ -73,7 +74,7 @@ def test_generate_new_keys(main_window, keys_screen, user_name: str, password, u assert BiometricsView().is_touch_id_button_visible(), f"TouchID button is not found" BiometricsView().wait_until_appears().prefer_password() SplashScreen().wait_until_appears().wait_until_hidden() - if not configs.DEV_BUILD: + if not configs.system.TEST_MODE: BetaConsentPopup().confirm() with step('Open User Canvas and verify user info'): diff --git a/test/e2e/tests/onboarding/test_onboarding_import_seed.py b/test/e2e/tests/onboarding/test_onboarding_import_seed.py index 2be6d9e325..9510271154 100644 --- a/test/e2e/tests/onboarding/test_onboarding_import_seed.py +++ b/test/e2e/tests/onboarding/test_onboarding_import_seed.py @@ -1,3 +1,5 @@ +import os + import allure import pytest from allure_commons._allure import step @@ -43,7 +45,7 @@ def test_import_seed_phrase(aut: AUT, keys_screen, main_window, user_account, au if configs.system.IS_MAC: BiometricsView().wait_until_appears().prefer_password() SplashScreen().wait_until_appears().wait_until_hidden() - if not configs.DEV_BUILD: + if not configs.system.TEST_MODE: BetaConsentPopup().confirm() with (step('Verify that restored account reveals correct status wallet address')): diff --git a/test/e2e/tests/onboarding/test_onboarding_negative_scenarios.py b/test/e2e/tests/onboarding/test_onboarding_negative_scenarios.py index ed4950d150..40be26a145 100644 --- a/test/e2e/tests/onboarding/test_onboarding_negative_scenarios.py +++ b/test/e2e/tests/onboarding/test_onboarding_negative_scenarios.py @@ -1,3 +1,4 @@ +import os import time import allure @@ -45,7 +46,7 @@ def test_login_with_wrong_password(aut: AUT, keys_screen, main_window, error: st if configs.system.IS_MAC: BiometricsView().wait_until_appears().prefer_password() SplashScreen().wait_until_appears().wait_until_hidden() - if not configs.DEV_BUILD: + if not configs.system.TEST_MODE: BetaConsentPopup().confirm() with step('Verify that the user logged in correctly'): diff --git a/test/e2e/tests/onboarding/test_onboarding_syncing.py b/test/e2e/tests/onboarding/test_onboarding_syncing.py index 9922b0ee0c..f43b1b694b 100644 --- a/test/e2e/tests/onboarding/test_onboarding_syncing.py +++ b/test/e2e/tests/onboarding/test_onboarding_syncing.py @@ -1,3 +1,5 @@ +import os + import allure import pyperclip import pytest @@ -75,9 +77,8 @@ def test_sync_device_during_onboarding(multiple_instance, user_data): with step('Sign in to synced account'): sync_result.sign_in() SplashScreen().wait_until_hidden() - if not configs.DEV_BUILD: - if driver.waitFor(lambda: BetaConsentPopup().exists, configs.timeouts.UI_LOAD_TIMEOUT_MSEC): - BetaConsentPopup().confirm() + if not configs.system.TEST_MODE: + BetaConsentPopup().confirm() with step('Verify user details are the same with user in first instance'): user_canvas = main_window.left_panel.open_user_canvas() diff --git a/test/e2e/tests/onboarding/test_password_strength.py b/test/e2e/tests/onboarding/test_password_strength.py index 2410569578..d85c077c81 100644 --- a/test/e2e/tests/onboarding/test_password_strength.py +++ b/test/e2e/tests/onboarding/test_password_strength.py @@ -1,3 +1,5 @@ +import os + import allure import pytest from allure_commons._allure import step @@ -57,7 +59,7 @@ def test_check_password_strength_and_login(keys_screen, main_window, user_accoun if configs.system.IS_MAC: BiometricsView().wait_until_appears().prefer_password() SplashScreen().wait_until_appears().wait_until_hidden() - if not configs.DEV_BUILD: + if not configs.system.TEST_MODE: BetaConsentPopup().confirm() with step('Verify that the user logged in correctly'):