diff --git a/test/ui-test/src/configs/__init__.py b/test/ui-test/src/configs/__init__.py new file mode 100644 index 00000000000..a47f6f22ada --- /dev/null +++ b/test/ui-test/src/configs/__init__.py @@ -0,0 +1 @@ +from . import squish diff --git a/test/ui-test/src/configs/squish.py b/test/ui-test/src/configs/squish.py new file mode 100644 index 00000000000..a6218900da2 --- /dev/null +++ b/test/ui-test/src/configs/squish.py @@ -0,0 +1,3 @@ + +UI_LOAD_TIMEOUT_MSEC = 5000 +APP_LOAD_TIMEOUT_MSEC = 60000 diff --git a/test/ui-test/src/drivers/SquishDriver.py b/test/ui-test/src/drivers/SquishDriver.py index 0808a85354d..21b08396adb 100755 --- a/test/ui-test/src/drivers/SquishDriver.py +++ b/test/ui-test/src/drivers/SquishDriver.py @@ -31,9 +31,17 @@ _SEARCH_IMAGES_PATH = "../shared/searchImages/" -def start_application(app_name: str): - squish.startApplication(app_name) - toplevelwindow.ToplevelWindow(squish.waitForObject(names.statusDesktop_mainWindow)).maximize() +def start_application(app_name: str, attempt = 2): + try: + squish.startApplication(app_name) + toplevelwindow.ToplevelWindow(squish.waitForObject(names.statusDesktop_mainWindow)).maximize() + except RuntimeError: + if attempt: + time.sleep(1) + [ctx.detach() for ctx in squish.applicationContextList()] + start_application(app_name, attempt-1) + else: + raise # Waits for the given object is loaded, visible and enabled. @@ -491,8 +499,8 @@ def sleep_test(seconds: float): squish.snooze(seconds) -def wait_for(py_condition_to_check: str, timeout_msec: int = 500): - squish.waitFor(py_condition_to_check, timeout_msec) +def wait_for(py_condition_to_check: str, timeout_msec: int = 500) -> bool: + return squish.waitFor(lambda: py_condition_to_check, timeout_msec) def wait_until_hidden(object_name: str, timeout_msec: int = _MAX_WAIT_OBJ_TIMEOUT) -> bool: diff --git a/test/ui-test/src/drivers/elements/base_element.py b/test/ui-test/src/drivers/elements/base_element.py index 3cd868d68f9..05bad8e1f91 100644 --- a/test/ui-test/src/drivers/elements/base_element.py +++ b/test/ui-test/src/drivers/elements/base_element.py @@ -1,5 +1,6 @@ import typing +import configs import names import object import squish @@ -8,7 +9,11 @@ class BaseElement: def __init__(self, object_name): + self.symbolic_name = object_name self.object_name = getattr(names, object_name) + + def __str__(self): + return f'{type(self).__qualname__}({self.symbolic_name})' @property def object(self): @@ -42,8 +47,8 @@ def is_selected(self) -> bool: @property def is_visible(self) -> bool: try: - return squish.waitForObject(self.object_name, 500).visible - except LookupError: + return squish.findObject(self.object_name).visible + except (LookupError, RuntimeError): return False def click( @@ -59,9 +64,9 @@ def click( button or squish.MouseButton.LeftButton ) - def wait_utill_appears(self, timeout_sec: int = 5): - assert squish.waitFor(lambda: self.is_visible, timeout_sec * 1000), 'Object is not visible' + def wait_until_appears(self, timeout_msec: int = configs.squish.UI_LOAD_TIMEOUT_MSEC): + assert squish.waitFor(lambda: self.is_visible, timeout_msec), f'Object {self} is not visible' return self - def wait_utill_hidden(self, timeout_sec: int = 5): - assert squish.waitFor(lambda: not self.is_visible, timeout_sec * 1000), 'Object is not hidden' + def wait_until_hidden(self, timeout_msec: int = configs.squish.UI_LOAD_TIMEOUT_MSEC): + assert squish.waitFor(lambda: not self.is_visible, timeout_msec), f'Object {self} is not hidden' diff --git a/test/ui-test/src/drivers/elements/text_edit.py b/test/ui-test/src/drivers/elements/text_edit.py index f1e32e02792..6b4ce131daf 100644 --- a/test/ui-test/src/drivers/elements/text_edit.py +++ b/test/ui-test/src/drivers/elements/text_edit.py @@ -16,6 +16,7 @@ def text(self, value: str): assert squish.waitFor(lambda: self.text == value) def type_text(self, value: str): + self.click() squish.type(self.object, value) assert squish.waitFor(lambda: self.text == value), \ f'Type text failed, value in field: "{self.text}", expected: {value}' diff --git a/test/ui-test/src/screens/SettingsScreen.py b/test/ui-test/src/screens/SettingsScreen.py index c344d7d9939..cedf8c2c519 100644 --- a/test/ui-test/src/screens/SettingsScreen.py +++ b/test/ui-test/src/screens/SettingsScreen.py @@ -23,8 +23,27 @@ from .components.social_links_popup import SocialLinksPopup -class SettingsScreenComponents(Enum): - SAVE_BUTTON: str = "settingsSave_StatusButton" +class SignOutPopup(BaseElement): + + def __init__(self): + super(SignOutPopup, self).__init__('statusDesktop_mainWindow_overlay') + self._sign_out_quit_button = Button('signOutConfirmation_StatusButton') + + def sign_out_and_quit(self): + self._sign_out_quit_button.click() + + +class MenuPanel(BaseElement): + + def __init__(self): + super(MenuPanel, self).__init__('mainWindow_LeftTabView') + self._scroll = Scroll('mainWindow_ScrollView') + self._back_up_seed_phrase_item = Button('sign_out_Quit_StatusNavigationListItem') + + def sign_out_and_quit(self): + self._scroll.vertical_scroll_to(self._back_up_seed_phrase_item) + self._back_up_seed_phrase_item.click() + SignOutPopup().wait_until_appears().sign_out_and_quit() class SidebarComponents(Enum): @@ -94,10 +113,6 @@ class WalletSettingsScreen(Enum): BACKUP_SEED_PHRASE_BUTTON: str = "settings_Wallet_MainView_BackupSeedPhrase" -class ConfirmationDialog(Enum): - SIGN_OUT_CONFIRMATION: str = "signOutConfirmation_StatusButton" - - class CommunitiesSettingsScreen(Enum): LIST_PANEL: str = "settings_Communities_CommunitiesListPanel" LEAVE_COMMUNITY_BUTTONS: str = "settings_Communities_MainView_LeaveCommunityButtons" @@ -124,6 +139,7 @@ class SettingsScreen: def __init__(self): verify_screen(SidebarComponents.ADVANCED_OPTION.value) + self.menu = MenuPanel() self._profile_view = ProfileSettingsView() self._profile_button = Button('profile_StatusNavigationListItem') @@ -237,11 +253,6 @@ def _find_account_index(self, account_name: str) -> int: return index return -1 - def sign_out_and_quit_the_app(self, pid: int): - SettingsScreen.__pid = pid - click_obj_by_name(SidebarComponents.SIGN_OUT_AND_QUIT_OPTION.value) - click_obj_by_name(ConfirmationDialog.SIGN_OUT_CONFIRMATION.value) - def verify_the_app_is_closed(self): verify_the_app_is_closed(SettingsScreen.__pid) @@ -448,7 +459,7 @@ def save_changes(self): def open_social_links_popup(self): self._scroll_view.vertical_scroll_to(self._add_more_links_label) self._add_more_links_label.click() - return SocialLinksPopup().wait_utill_appears() + return SocialLinksPopup().wait_until_appears() def verify_display_name(self, display_name: str): compare_text(display_name, self.display_name) @@ -485,4 +496,4 @@ def verify_social_no_links(self): def open_change_password_popup(self): self._scroll_view.vertical_scroll_to(self._change_password_button) self._change_password_button.click() - return ChangePasswordPopup().wait_utill_appears() + return ChangePasswordPopup().wait_until_appears() diff --git a/test/ui-test/src/screens/StatusLoginScreen.py b/test/ui-test/src/screens/StatusLoginScreen.py index 49948584e58..15835edab40 100755 --- a/test/ui-test/src/screens/StatusLoginScreen.py +++ b/test/ui-test/src/screens/StatusLoginScreen.py @@ -9,15 +9,17 @@ # *****************************************************************************/ from enum import Enum -from screens.StatusAccountsScreen import StatusAccountsScreen + from drivers.SquishDriver import * from drivers.SquishDriverVerification import * +from screens.StatusAccountsScreen import StatusAccountsScreen + +from .components.splash_screen import SplashScreen # It defines the identifier for each Login View component: class SLoginComponents(Enum): MAIN_VIEW = "loginView_main" - PASSWORD_INPUT = "loginView_passwordInput" SUBMIT_BTN = "loginView_submitBtn" CHANGE_ACCOUNT_BTN = "loginView_changeAccountBtn" CURRENT_USERNAME_LABEL = "loginView_currentUserNameLabel" @@ -38,10 +40,11 @@ class StatusLoginScreen(): def __init__(self): verify_screen(SLoginComponents.MAIN_VIEW.value) + self._password_text_edit = TextEdit('loginView_passwordInput') def login(self, account, password): self.select_account(account) - self.enter_password(password) + self.enter_password(password) def select_account(self, account): if self.is_account_selected(account): @@ -55,8 +58,7 @@ def is_account_selected(self, account): return obj.text == account def enter_password(self, password): - click_obj_by_name(SLoginComponents.PASSWORD_INPUT.value) - type_text(SLoginComponents.PASSWORD_INPUT.value, password) + self._password_text_edit.text = password click_obj_by_name(SLoginComponents.SUBMIT_BTN.value) def verify_error_message_is_displayed(self): @@ -72,11 +74,7 @@ def open_accounts_selector_popup(self): return click_obj_by_name(SLoginComponents.CHANGE_ACCOUNT_BTN.value) def get_password_placeholder_text(self): - result = "" - [loaded, obj] = is_loaded(SLoginComponents.PASSWORD_INPUT.value) - if loaded: - result = obj.placeholderText - return result + return self._password_text_edit.object.placeholderText def get_error_message_text(self): result = "" diff --git a/test/ui-test/src/screens/StatusMainScreen.py b/test/ui-test/src/screens/StatusMainScreen.py index fe45be93862..6b459f4eb11 100644 --- a/test/ui-test/src/screens/StatusMainScreen.py +++ b/test/ui-test/src/screens/StatusMainScreen.py @@ -16,6 +16,10 @@ from drivers.SquishDriver import * from drivers.SquishDriverVerification import * from utils.ObjectAccess import * +import configs + +from .components.splash_screen import SplashScreen +from .components.user_canvas import UserCanvas class MainScreenComponents(Enum): @@ -28,52 +32,72 @@ class MainScreenComponents(Enum): START_CHAT_BTN = "mainWindow_startChat" CHAT_LIST = "chatList" COMMUNITY_NAVBAR_BUTTONS = "navBarListView_All_Community_Buttons" - PROFILE_SETTINGS_VIEW = "mainWindow_ProfileSettingsView" - PROFILE_NAVBAR_BUTTON = "mainWindow_ProfileNavBarButton" - USERSTATUSMENU_ALWAYS_ACTIVE_ACTION = "userContextmenu_AlwaysActiveButton" - USERSTATUSMENU_INACTIVE_ACTION = "userContextmenu_InActiveButton" - USERSTATUSMENU_AUTOMATIC_ACTION = "userContextmenu_AutomaticButton" - USERSTATUSMENU_OPEN_PROFILE_POPUP = "userContextMenu_ViewMyProfileAction" - SPLASH_SCREEN = "splashScreen" + PROFILE_SETTINGS_VIEW = "mainWindow_ProfileSettingsView" TOOLBAR_BACK_BUTTON = "main_toolBar_back_button" LEAVE_CHAT_MENUITEM = "leaveChatMenuItem" CONTACTS_COLUMN_MESSAGES_HEADLINE = "mainWindow_ContactsColumn_Messages_Headline" SECURE_YOUR_SEED_PHRASE_BANNER = "mainWindow_secureYourSeedPhraseBanner_ModuleWarning" + class ProfilePopup(Enum): USER_IMAGE = "ProfileHeader_userImage" DISPLAY_NAME = "ProfilePopup_displayName" EDIT_PROFILE_BUTTON = "ProfilePopup_editButton" + class ChatNamePopUp(Enum): CHAT_NAME_TEXT = "chat_name_PlaceholderText" START_CHAT_BTN = "startChat_Btn" + class SharedPopup(Enum): POPUP_CONTENT: str = "sharedPopup_Popup_Content" PASSWORD_INPUT: str = "sharedPopup_Password_Input" PRIMARY_BUTTON: str = "sharedPopup_Primary_Button" + def authenticate_popup_enter_password(password): wait_for_object_and_type(SharedPopup.PASSWORD_INPUT.value, password) click_obj_by_name(SharedPopup.PRIMARY_BUTTON.value) + +class NavigationPanel(BaseElement): + + def __init__(self): + super(NavigationPanel, self).__init__('mainWindow_StatusAppNavBar') + self._profile_button = Button('mainWindow_ProfileNavBarButton') + + @property + def user_badge_color(self) -> str: + return str(self._profile_button.object.badge.color.name) + + def open_user_canvas(self) -> UserCanvas: + self._profile_button.click() + return UserCanvas().wait_until_appears() + + def user_is_online(self) -> bool: + return self.user_badge_color == '#4ebc60' + + def user_is_offline(self): + return self.user_badge_color == '#7f8990' + + def user_is_set_to_automatic(self): + return self.user_badge_color == '#4ebc60' + + class StatusMainScreen: def __init__(self): verify_screen(MainScreenComponents.CONTACTS_COLUMN_MESSAGES_HEADLINE.value) + self.navigation_panel = NavigationPanel() # Main screen is ready to interact with it (Splash screen animation not present) def is_ready(self): self.wait_for_splash_animation_ends() verify(is_displayed(MainScreenComponents.CONTACTS_COLUMN_MESSAGES_HEADLINE.value, 15000), "Verifying if the Messages headline is displayed") - def wait_for_splash_animation_ends(self, timeoutMSec: int = 10000): - do_until_validation_with_timeout( - do_fn = lambda: time.sleep(0.5), - validation_fn = lambda: not is_loaded_visible_and_enabled(MainScreenComponents.SPLASH_SCREEN.value, 1000)[0], - message = "Splash screen animation has ended", - timeout_ms = timeoutMSec) + def wait_for_splash_animation_ends(self, timeoutMSec: int = configs.squish.APP_LOAD_TIMEOUT_MSEC): + SplashScreen().wait_until_appears().wait_until_hidden(timeoutMSec) def open_chat_section(self): click_obj_by_name(MainScreenComponents.CHAT_NAVBAR_ICON.value) @@ -125,32 +149,25 @@ def verify_communities_count(self, expected_count: int): verify_equals(len(objects), int(expected_count)) def user_is_online(self): - profileButton = squish.waitForObject(getattr(names, MainScreenComponents.PROFILE_NAVBAR_BUTTON.value)) - verify_equal(profileButton.badge.color.name, "#4ebc60", "The user is not online by default") + verify_equal(wait_for(self.navigation_panel.user_is_online(), 10000), True, "The user is not online") def user_is_offline(self): - profileButton = squish.waitForObject(getattr(names, MainScreenComponents.PROFILE_NAVBAR_BUTTON.value)) - verify_equal(profileButton.badge.color.name, "#7f8990", "The user is not offline") + verify_equal(wait_for(self.navigation_panel.user_is_offline(), 10000), True, "The user is not offline") def user_is_set_to_automatic(self): - profileButton = squish.waitForObject(getattr(names, MainScreenComponents.PROFILE_NAVBAR_BUTTON.value)) - verify_equal(profileButton.badge.color.name, "#4ebc60", "The user is not online by default") + verify_equal(wait_for(self.navigation_panel.user_is_online(), 10000), True, "The user is not autoset") def set_user_state_offline(self): - click_obj_by_name(MainScreenComponents.PROFILE_NAVBAR_BUTTON.value) - click_obj_by_name(MainScreenComponents.USERSTATUSMENU_INACTIVE_ACTION.value) + self.navigation_panel.open_user_canvas().set_user_state_offline() def set_user_state_online(self): - click_obj_by_name(MainScreenComponents.PROFILE_NAVBAR_BUTTON.value) - click_obj_by_name(MainScreenComponents.USERSTATUSMENU_ALWAYS_ACTIVE_ACTION.value) + self.navigation_panel.open_user_canvas().set_user_state_online() def set_user_state_to_automatic(self): - click_obj_by_name(MainScreenComponents.PROFILE_NAVBAR_BUTTON.value) - click_obj_by_name(MainScreenComponents.USERSTATUSMENU_AUTOMATIC_ACTION.value) + self.navigation_panel.open_user_canvas().set_user_automatic_state() def open_own_profile_popup(self): - click_obj_by_name(MainScreenComponents.PROFILE_NAVBAR_BUTTON.value) - click_obj_by_name(MainScreenComponents.USERSTATUSMENU_OPEN_PROFILE_POPUP.value) + self.navigation_panel.open_user_canvas().open_profile_popup() def verify_profile_popup_display_name(self, display_name: str): verify_text_matching(ProfilePopup.DISPLAY_NAME.value, display_name) @@ -178,8 +195,7 @@ def profile_image_is_updated(self): image_present("loginUserName", True, 95, 75, 100, True, profilePopupImage) def profile_modal_image_is_updated(self): - click_obj_by_name(MainScreenComponents.PROFILE_NAVBAR_BUTTON.value) - click_obj_by_name(MainScreenComponents.USERSTATUSMENU_OPEN_PROFILE_POPUP.value) + self.navigation_panel.open_user_canvas().open_profile_popup() image_present("profiletestimage", True, 97, 95, 100, True) def profile_settings_image_is_updated(self): diff --git a/test/ui-test/src/screens/components/cahange_password_popup.py b/test/ui-test/src/screens/components/cahange_password_popup.py index 43e679dcf09..8f7e77c10fe 100644 --- a/test/ui-test/src/screens/components/cahange_password_popup.py +++ b/test/ui-test/src/screens/components/cahange_password_popup.py @@ -16,4 +16,4 @@ def change_password(self, old_pwd: str, new_pwd: str): self._new_password_text_field.text = new_pwd self._confirm_password_text_field.text = new_pwd self._submit_button.click() - self._quit_button.click() \ No newline at end of file + self._quit_button.wait_until_appears(15000).click() \ No newline at end of file diff --git a/test/ui-test/src/screens/components/social_links_popup.py b/test/ui-test/src/screens/components/social_links_popup.py index 7b12394fdfe..ce8a412eb98 100644 --- a/test/ui-test/src/screens/components/social_links_popup.py +++ b/test/ui-test/src/screens/components/social_links_popup.py @@ -30,4 +30,4 @@ def add_link(self, network: str, links: typing.List[str]): for occurrence, link in enumerate(links): self._get_text_field(occurrence).text = link self._add_button.click() - self.wait_utill_hidden() + self.wait_until_hidden() diff --git a/test/ui-test/src/screens/components/splash_screen.py b/test/ui-test/src/screens/components/splash_screen.py new file mode 100644 index 00000000000..11bf5f091a5 --- /dev/null +++ b/test/ui-test/src/screens/components/splash_screen.py @@ -0,0 +1,7 @@ +from drivers.SquishDriver import * + + +class SplashScreen(BaseElement): + + def __init__(self): + super(SplashScreen, self).__init__('splashScreen') diff --git a/test/ui-test/src/screens/components/user_canvas.py b/test/ui-test/src/screens/components/user_canvas.py new file mode 100644 index 00000000000..9198e92f512 --- /dev/null +++ b/test/ui-test/src/screens/components/user_canvas.py @@ -0,0 +1,27 @@ +from drivers.SquishDriver import * + + +class UserCanvas(BaseElement): + + def __init__(self): + super(UserCanvas, self).__init__('o_StatusListView') + self._always_active_button = Button('userContextmenu_AlwaysActiveButton') + self._inactive_button = Button('userContextmenu_InActiveButton') + self._automatic_button = Button('userContextmenu_AutomaticButton') + self._view_my_profile_button = Button('userContextMenu_ViewMyProfileAction') + + def set_user_state_online(self): + self._always_active_button.click() + self.wait_until_hidden() + + def set_user_state_offline(self): + self._inactive_button.click() + self.wait_until_hidden() + + def set_user_automatic_state(self): + self._automatic_button.click() + self.wait_until_hidden() + + def open_profile_popup(self): + self._view_my_profile_button.click() + # TODO: Return profile popup diff --git a/test/ui-test/testSuites/global_shared/scripts/global_names.py b/test/ui-test/testSuites/global_shared/scripts/global_names.py index 5f147726a0d..fc379bdb399 100644 --- a/test/ui-test/testSuites/global_shared/scripts/global_names.py +++ b/test/ui-test/testSuites/global_shared/scripts/global_names.py @@ -10,7 +10,7 @@ mainWindow_ProfileNavBarButton = {"container": statusDesktop_mainWindow, "objectName": "statusProfileNavBarTabButton", "type": "StatusNavBarTabButton", "visible": True} mainWindow_ProfileSettingsView = {"container": statusDesktop_mainWindow, "objectName": "myProfileSettingsView", "type": "MyProfileSettingsView", "visible": True} settings_navbar_settings_icon_StatusIcon = {"container": mainWindow_navBarListView_ListView, "objectName": "settings-icon", "type": "StatusIcon", "visible": True} -splashScreen = {"container": statusDesktop_mainWindow, "objectName": "splashScreen", "type": "SplashScreen"} +splashScreen = {"container": statusDesktop_mainWindow, "objectName": "splashScreen", "type": "DidYouKnowSplashScreen"} mainWindow_StatusToolBar = {"container": statusDesktop_mainWindow, "objectName": "statusToolBar", "type": "StatusToolBar", "visible": True} main_toolBar_back_button = {"container": mainWindow_StatusToolBar, "objectName": "toolBarBackButton", "type": "StatusFlatButton", "visible": True} mainWindow_emptyChatPanelImage = {"container": statusDesktop_mainWindow, "objectName": "emptyChatPanelImage", "type": "Image", "visible": True} @@ -20,11 +20,15 @@ # main right panel mainWindow_RighPanel= {"container": statusDesktop_mainWindow, "type": "ColumnLayout", "objectName": "mainRightView", "visible": True} +# Navigation Panel +mainWindow_StatusAppNavBar = {"container": statusDesktop_mainWindow, "type": "StatusAppNavBar", "unnamed": 1, "visible": True} + # User Status Profile Menu -userContextmenu_AlwaysActiveButton= {"container": statusDesktop_mainWindow_overlay, "objectName": "userStatusMenuAlwaysOnlineAction", "type": "StatusMenuItem", "visible": True} -userContextmenu_InActiveButton= {"container": statusDesktop_mainWindow_overlay, "objectName": "userStatusMenuInactiveAction", "type": "StatusMenuItem", "visible": True} -userContextmenu_AutomaticButton= {"container": statusDesktop_mainWindow_overlay, "objectName": "userStatusMenuAutomaticAction", "type": "StatusMenuItem", "visible": True} -userContextMenu_ViewMyProfileAction = {"container": statusDesktop_mainWindow_overlay, "objectName": "userStatusViewMyProfileAction", "type": "StatusMenuItem", "visible": True} +o_StatusListView = {"container": statusDesktop_mainWindow_overlay, "type": "StatusListView", "unnamed": 1, "visible": True} +userContextmenu_AlwaysActiveButton= {"container": o_StatusListView, "objectName": "userStatusMenuAlwaysOnlineAction", "type": "StatusMenuItem", "visible": True} +userContextmenu_InActiveButton= {"container": o_StatusListView, "objectName": "userStatusMenuInactiveAction", "type": "StatusMenuItem", "visible": True} +userContextmenu_AutomaticButton= {"container": o_StatusListView, "objectName": "userStatusMenuAutomaticAction", "type": "StatusMenuItem", "visible": True} +userContextMenu_ViewMyProfileAction = {"container": o_StatusListView, "objectName": "userStatusViewMyProfileAction", "type": "StatusMenuItem", "visible": True} # popups modal_Close_Button = {"container": statusDesktop_mainWindow_overlay, "objectName": "headerCloseButton", "type": "StatusFlatRoundButton", "visible": True} diff --git a/test/ui-test/testSuites/global_shared/scripts/settings_names.py b/test/ui-test/testSuites/global_shared/scripts/settings_names.py index ce5dfd24fe0..26dbb33f201 100644 --- a/test/ui-test/testSuites/global_shared/scripts/settings_names.py +++ b/test/ui-test/testSuites/global_shared/scripts/settings_names.py @@ -33,6 +33,8 @@ class SettingsSubsection(Enum): settings_Sidebar_ENS_Item = {"container": mainWindow_ScrollView, "objectName": SettingsSubsection.ENS_USERNAMES.value, "type": "StatusNavigationListItem"} settingsContentBase_ScrollView = {"container": statusDesktop_mainWindow, "objectName": "settingsContentBaseScrollView", "type": "StatusScrollView", "visible": True} settingsContentBaseScrollView_Item = {"container": settingsContentBase_ScrollView, "type": "Item", "unnamed": 1, "visible": True} +mainWindow_LeftTabView = {"container": statusDesktop_mainWindow, "type": "LeftTabView", "unnamed": 1, "visible": True} + # ENS view; settings_ENS_Start_Button = {"container": statusDesktop_mainWindow, "objectName": "ensStartButton", "type": "StatusButton"} diff --git a/test/ui-test/testSuites/global_shared/steps/settingsSteps.py b/test/ui-test/testSuites/global_shared/steps/settingsSteps.py index c1e5843ab5f..04a78f01950 100644 --- a/test/ui-test/testSuites/global_shared/steps/settingsSteps.py +++ b/test/ui-test/testSuites/global_shared/steps/settingsSteps.py @@ -134,8 +134,7 @@ def step(context, native): @When("the user clicks on Sign out and Quit") def step(context: any): - ctx = currentApplicationContext() - _settingsScreen.sign_out_and_quit_the_app(ctx.pid) + _settingsScreen.menu.sign_out_and_quit() @Given("the user opens the communities settings") @When("the user opens the communities settings") diff --git a/test/ui-test/testSuites/global_shared/steps/steps.py b/test/ui-test/testSuites/global_shared/steps/steps.py index 29f68d4261a..ec0bb0b10a2 100644 --- a/test/ui-test/testSuites/global_shared/steps/steps.py +++ b/test/ui-test/testSuites/global_shared/steps/steps.py @@ -1,5 +1,7 @@ # -*- coding: utf-8 -*- +import time + # ****************************************************************************** # Status.im # *****************************************************************************/ @@ -14,11 +16,10 @@ # * with a pattern which is matched against the steps being executed. # ***************************************************************************** import common.Common as common -import time - import steps.commonInitSteps as init_steps -from screens.StatusMainScreen import StatusMainScreen +from drivers.SquishDriver import start_application from screens.StatusChatScreen import StatusChatScreen +from screens.StatusMainScreen import StatusMainScreen _statusMain = StatusMainScreen() _statusChat = StatusChatScreen() @@ -93,9 +94,8 @@ def step(context, obj): ########################################################################### def the_user_restarts_the_app(context: any): - waitFor(lambda: currentApplicationContext().detach(), 500) - time.sleep(5) - startApplication(context.userData["aut_name"]) + [ctx.detach() for ctx in squish.applicationContextList()] + start_application(context.userData["aut_name"]) def the_user_joins_chat_room(room: str): init_steps.the_user_joins_chat_room(room) diff --git a/test/ui-test/testSuites/suite_settings/tst_contactsFlow/test.feature b/test/ui-test/testSuites/suite_settings/tst_contactsFlow/test.feature index b704b2d5d40..237df15517a 100644 --- a/test/ui-test/testSuites/suite_settings/tst_contactsFlow/test.feature +++ b/test/ui-test/testSuites/suite_settings/tst_contactsFlow/test.feature @@ -9,7 +9,6 @@ Feature: Status Desktop Contacts Flows And the user opens app settings screen - @mayfail Scenario: The user can add a contact with a chat key When the user opens the messaging settings And the user opens the contacts settings diff --git a/test/ui-test/testSuites/suite_settings/tst_mainSettingsSection/bdd_hooks.py b/test/ui-test/testSuites/suite_settings/tst_mainSettingsSection/bdd_hooks.py index 82b83b09a3b..86a03d9871c 100644 --- a/test/ui-test/testSuites/suite_settings/tst_mainSettingsSection/bdd_hooks.py +++ b/test/ui-test/testSuites/suite_settings/tst_mainSettingsSection/bdd_hooks.py @@ -6,19 +6,14 @@ import steps.commonInitSteps as init_steps -# Global properties for the specific feature -_user = "tester123" -_password = "TesTEr16843/!@00" @OnFeatureStart def hook(context): init_steps.context_init(context, testSettings) - init_steps.signs_up_process_steps(context, _user, _password) -@OnFeatureEnd +@OnScenarioEnd def hook(context): - currentApplicationContext().detach() - snooze(_app_closure_timeout) + [ctx.detach() for ctx in squish.applicationContextList()] @OnStepEnd def hook(context): diff --git a/test/ui-test/testSuites/suite_settings/tst_mainSettingsSection/test.feature b/test/ui-test/testSuites/suite_settings/tst_mainSettingsSection/test.feature index 0b7d0f8a24d..253dc3d0d7d 100644 --- a/test/ui-test/testSuites/suite_settings/tst_mainSettingsSection/test.feature +++ b/test/ui-test/testSuites/suite_settings/tst_mainSettingsSection/test.feature @@ -2,33 +2,32 @@ Feature: Status Desktop Main Settings Section As a user I want to login the app go to Settings and make basic settings actions like change my online state and/or store my seed phrase. - The feature start sequence is the following (setup on its own `bdd_hooks`): - ** given A first time user lands on the status desktop and generates new key - ** when user signs up with username "tester123" and password "TesTEr16843/!@00" - ** and the user lands on the signed in app Background: Open settings section - Given the user opens app settings screen + Given A first time user lands on the status desktop and generates new key + And the user signs up with username "tester123" and password "TesTEr16843/!@00" + And the user lands on the signed in app + And the user opens app settings screen Scenario: The user can backup seed phrase When the user backs up the wallet seed phrase Then the backup seed phrase indicator is not displayed And the Secure Your Seed Phrase Banner is not displayed - @mayfail Scenario: The user can switch state to offline When the users switches state to offline Then the user appears offline Given the user restarts the app And the user "tester123" logs in with password "TesTEr16843/!@00" + Then the user lands on the signed in app Then the user appears offline - @mayfail Scenario: The user can switch state to online When the users switches state to offline And the user restarts the app And the user "tester123" logs in with password "TesTEr16843/!@00" + Then the user lands on the signed in app Then the user appears offline When the users switches state to online @@ -36,18 +35,18 @@ Feature: Status Desktop Main Settings Section When the user restarts the app And the user "tester123" logs in with password "TesTEr16843/!@00" + Then the user lands on the signed in app Then the user appears online - @mayfail Scenario: The user can switch state to automatic When the users switches state to automatic Then the user status is automatic When the user restarts the app And the user "tester123" logs in with password "TesTEr16843/!@00" + Then the user lands on the signed in app Then the user status is automatic - @mayfail Scenario: The user can change the password and login with new password When the user changes the password from TesTEr16843/!@00 to NewPassword@12345 And the user restarts the app diff --git a/test/ui-test/testSuites/suite_settings/tst_signUpAndQuit/test.feature b/test/ui-test/testSuites/suite_settings/tst_signUpAndQuit/test.feature index b01620d334c..fc119d28571 100644 --- a/test/ui-test/testSuites/suite_settings/tst_signUpAndQuit/test.feature +++ b/test/ui-test/testSuites/suite_settings/tst_signUpAndQuit/test.feature @@ -10,8 +10,6 @@ Feature: Status Desktop Sign out and Quit And the user lands on the signed in app Given the user opens app settings screen - # TODO: Unstable. It fails sometimes reporting a FATAL error in CI execution: "The AUT did not respond to network communication" - @mayfail Scenario: The user quits the app When the user clicks on Sign out and Quit Then the app is closed \ No newline at end of file