test: test_sign_out_and_quit added (#224)

This commit is contained in:
Valentina1133 2023-10-30 09:59:01 +01:00 committed by GitHub
parent 9661e9d247
commit 87819e0eb5
3 changed files with 28 additions and 0 deletions

View File

@ -11,6 +11,7 @@ mainWindow_LeftTabView = {"container": mainWindow_StatusSectionLayout_ContentIte
mainWindow_Settings_StatusNavigationPanelHeadline = {"container": mainWindow_LeftTabView, "type": "StatusNavigationPanelHeadline", "unnamed": 1, "visible": True} mainWindow_Settings_StatusNavigationPanelHeadline = {"container": mainWindow_LeftTabView, "type": "StatusNavigationPanelHeadline", "unnamed": 1, "visible": True}
mainWindow_scrollView_StatusScrollView = {"container": mainWindow_LeftTabView, "id": "scrollView", "type": "StatusScrollView", "unnamed": 1, "visible": True} mainWindow_scrollView_StatusScrollView = {"container": mainWindow_LeftTabView, "id": "scrollView", "type": "StatusScrollView", "unnamed": 1, "visible": True}
scrollView_MenuItem_StatusNavigationListItem = {"container": mainWindow_scrollView_StatusScrollView, "type": "StatusNavigationListItem", "visible": True} scrollView_MenuItem_StatusNavigationListItem = {"container": mainWindow_scrollView_StatusScrollView, "type": "StatusNavigationListItem", "visible": True}
scrollView_Flickable = {"container": mainWindow_scrollView_StatusScrollView, "type": "Flickable", "unnamed": 1, "visible": True}
# Communities View # Communities View
mainWindow_CommunitiesView = {"container": statusDesktop_mainWindow, "type": "CommunitiesView", "unnamed": 1, "visible": True} mainWindow_CommunitiesView = {"container": statusDesktop_mainWindow, "type": "CommunitiesView", "unnamed": 1, "visible": True}

View File

@ -2,6 +2,7 @@ import allure
from gui.components.back_up_your_seed_phrase_popup import BackUpYourSeedPhrasePopUp from gui.components.back_up_your_seed_phrase_popup import BackUpYourSeedPhrasePopUp
from gui.elements.object import QObject from gui.elements.object import QObject
from gui.elements.scroll import Scroll
from gui.screens.settings_communities import CommunitiesSettingsView from gui.screens.settings_communities import CommunitiesSettingsView
from gui.screens.settings_messaging import MessagingSettingsView from gui.screens.settings_messaging import MessagingSettingsView
from gui.screens.settings_profile import ProfileSettingsView from gui.screens.settings_profile import ProfileSettingsView
@ -14,9 +15,12 @@ class LeftPanel(QObject):
def __init__(self): def __init__(self):
super().__init__('mainWindow_LeftTabView') super().__init__('mainWindow_LeftTabView')
self._settings_section_template = QObject('scrollView_MenuItem_StatusNavigationListItem') self._settings_section_template = QObject('scrollView_MenuItem_StatusNavigationListItem')
self._scroll = Scroll('scrollView_Flickable')
def _open_settings(self, object_name: str): def _open_settings(self, object_name: str):
self._settings_section_template.real_name['objectName'] = object_name self._settings_section_template.real_name['objectName'] = object_name
if not self._settings_section_template.is_visible:
self._scroll.vertical_down_to(self._settings_section_template)
self._settings_section_template.click() self._settings_section_template.click()
@allure.step('Check back up seed option menu item presence') @allure.step('Check back up seed option menu item presence')
@ -54,6 +58,10 @@ class LeftPanel(QObject):
self._open_settings('8-MainMenuItem') self._open_settings('8-MainMenuItem')
return SyncingSettingsView() return SyncingSettingsView()
@allure.step('Choose sign out and quit in settings')
def sign_out_and_quit(self):
self._open_settings('16-ExtraMenuItem')
class SettingsScreen(QObject): class SettingsScreen(QObject):

View File

@ -0,0 +1,19 @@
import allure
import pytest
from allure_commons._allure import step
from gui.main_window import MainWindow
from scripts.utils.local_system import wait_for_close
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703010', 'Settings - Sign out & Quit')
@pytest.mark.case(703010)
def test_sign_out_and_quit(aut, main_screen: MainWindow):
with step('Open settings'):
settings = main_screen.left_panel.open_settings()
with step('Click sign out and quit in settings'):
settings.left_panel.sign_out_and_quit()
with step('Check that app was closed'):
wait_for_close(aut.pid)