Index: tst_ServiceShutdown/test.py =================================================================== diff -u -rc1b9d926e38745dcd9fb3e0503176b1c85182294 -r316fd2f51b0fa89c0f69949d79ef246e1e4bc4ed --- tst_ServiceShutdown/test.py (.../test.py) (revision c1b9d926e38745dcd9fb3e0503176b1c85182294) +++ tst_ServiceShutdown/test.py (.../test.py) (revision 316fd2f51b0fa89c0f69949d79ef246e1e4bc4ed) @@ -1,39 +1,44 @@ # -*- coding: utf-8 -*- - -## -# Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. -# copyright -# THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, -# IN PART OR IN WHOLE, -# WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. +########################################################################### # -# file tst_ServiceShutdown -# date 2019/11/20 -# author Behrouz NematiPour +# Copyright (c) 2020-2025 Diality Inc. - All Rights Reserved. # -import utils +# THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN +# WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. +# +# @file test.py +# +# @author (last) Behrouz NematiPour +# @date (last) 08-Nov-2020 +# @author (original) Behrouz NematiPour +# @date (original) 09-Apr-2020 +# +############################################################################ + import names -import globals -import denaliMessages +from dialin.squish import utils, denaliMessages + ################################################################################ # This test need to be changed when the Service screen has been implemented # # This is only checking the functionality exists and it's working # ################################################################################ def test_MainMenu_CurrentItem(vSRSUI=""): # test.compare(waitForObjectExists(names.o_mainMenu).currentIndex, 0) - test.compare(str(waitForObjectExists(names.o_mainMenu).currentTitle), "Treatment", globals.SRSUI(vSRSUI)) + test.compare(str(waitForObjectExists(names.o_mainMenu).currentTitle), "Treatment", utils.SRSUI(vSRSUI)) def gotoScreenNtest_Contains_PowerOffButton(vSRSUI=""): mouseClick (waitForObjectExists(names.o_mainMenu_settings)) utils.waitForGUI() - test.compare(waitForObjectExists(names.o_settingsHome).visible, True, globals.SRSUI(vSRSUI)) + test.compare(waitForObjectExists(names.o_settingsHome).visible, True, utils.SRSUI(vSRSUI)) + # the settings test page reverted back and it's no longer on the diagnostic page. + #mouseClick(waitForObjectExists(names.o_diagnostics)) def gotoScreenNtest_Contains_TreatmentHome(vSRSUI=""): mouseClick (waitForObjectExists(names.o_mainMenu_treatment)) utils.waitForGUI() - test.compare(waitForObjectExists(names.o_treatmentHome).visible, True, globals.SRSUI(vSRSUI)) + test.compare(waitForObjectExists(names.o_treatmentHome).visible, True, utils.SRSUI(vSRSUI)) def showNtest_PowerOffDialog(vSRSUI=""): denaliMessages.show_PowerOffDialog() @@ -44,7 +49,7 @@ test_PowerOffButton(vSRSUI) def showNtest_PowerOffNotificationDialog(vSRSUI=""): - mSRSUI = globals.SRSUI(vSRSUI) + mSRSUI = utils.SRSUI(vSRSUI) denaliMessages.show_PowerOffNotificationDialog() test.compare(str(waitForObjectExists(names.o_poweroff_notification).baseUrl.path), "/dialogs/AutoHideInfo.qml", mSRSUI + " - Dialog") constantPartOfTheMessage = "System is shutting down" @@ -53,7 +58,7 @@ utils.waitForGUI(1) # animation transition def showNtest_PowerOffRejectionDialog(vSRSUI=""): - mSRSUI = globals.SRSUI(vSRSUI) + mSRSUI = utils.SRSUI(vSRSUI) denaliMessages.show_PowerOffRejectionDialog() test.compare(str(waitForObjectExists(names.o_poweroff_rejection).baseUrl.path), "/dialogs/AutoHideInfo.qml", mSRSUI + " - Dialog") constantPartOfTheMessage = "Cannot shutdown during " # there might be the reason, concatenated at the end of the string. @@ -63,30 +68,34 @@ def test_PowerOffButton(vSRSUI=""): - test.compare(waitForObjectExists(names.o_poweroffButton).visible, True, globals.SRSUI(vSRSUI)) + test.compare(waitForObjectExists(names.o_poweroffButton).visible, True, utils.SRSUI(vSRSUI)) def test_PowerOffDialog(vSRSUI=""): - test.compare(waitForObjectExists(names.o_modalDialog).visible, True, globals.SRSUI(vSRSUI)) + test.compare(waitForObjectExists(names.o_modalDialog).visible, True, utils.SRSUI(vSRSUI)) def testNclick_ShutdownButton_onPowerOffConfirm(vSRSUI=""): - test.compare(waitForObjectExists(names.o_poweroff_shutdown).visible, True, globals.SRSUI(vSRSUI)) + test.compare(waitForObjectExists(names.o_poweroff_shutdown).visible, True, utils.SRSUI(vSRSUI)) mouseClick (waitForObjectExists(names.o_poweroff_shutdown)) utils.waitForGUI (1) # Wait for the animation def testNclick_CancelButton_onPowerOffConfirm(vSRSUI=""): - test.compare(waitForObjectExists(names.o_poweroff_cancel).visible, True, globals.SRSUI(vSRSUI)) + test.compare(waitForObjectExists(names.o_poweroff_cancel).visible, True, utils.SRSUI(vSRSUI)) mouseClick (waitForObjectExists(names.o_poweroff_cancel)) utils.waitForGUI (1) # Wait for the animation def main(): + utils.tstStart(__file__) + # Start the Application - startApplication("denaliSquish") + startApplication(names.AUT_NAME) + utils.waitForGUI(1) + # 535 : The "Treatment" button shall be selected by default on the Home Screen. test_MainMenu_CurrentItem(535) # 028 : The Home Screen shall display a "Settings" button. - test.compare(str(waitForObjectExists(names.o_mainMenu_settings).text.text), "Settings", globals.SRSUI(28)) + test.compare(str(waitForObjectExists(names.o_mainMenu_settings).text.text), "Settings", utils.SRSUI(28)) utils.waitForGUI() # 029 : Upon "Settings" button depress on the Home Screen; the UI shall navigate the user to the Device Settings Screen. @@ -117,3 +126,4 @@ # 534 : The "Treatment" button shall be selected by default on the Home Screen. gotoScreenNtest_Contains_TreatmentHome(534) + utils.tstDone() \ No newline at end of file