# -*- coding: utf-8 -*- import names import time import subprocess ################################################################################ # 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 main(): startApplication("denaliSquish") # Check the Home screen has the settings button on the Main Menu test.compare(str(waitForObjectExists(names.o_mainMenu_settings ).text.text), "Settings" , "SRSUI 028") # Click on Settings button on the Main Menu mouseClick (waitForObjectExists(names.o_mainMenu_settings )) # Upon depress the settings screen shall be visible test.compare(waitForObjectExists(names.o_settingsHome ).visible, True , "SRSUI 029") # Check the shutdown button exists test.compare(waitForObjectExists(names.o_poweroffButton).visible, True) # Click on shutdown button mouseClick (waitForObjectExists(names.o_poweroffButton)) # Sending can message to show Power off dialog subprocess.call(['cansend', 'can0', '020#A5.01.00.01.00.6F.00.00']) # The PowerOff screen shall have a shutdown button test.compare(waitForObjectExists(names.o_poweroff_shutdown).visible, True) # Click on the PowerOff Dialog's shutdown button mouseClick (waitForObjectExists(names.o_poweroff_shutdown)) # Wait for the animation time.sleep(1) # Going back to the screen which has the PowerOff screen test.compare(waitForObjectExists(names.o_poweroffButton).visible, True) # Click on shutdown button mouseClick (waitForObjectExists(names.o_poweroffButton)) # Sending can message to show Power off dialog subprocess.call(['cansend', 'can0', '020#A5.01.00.01.00.6F.00.00']) # The PowerOff screen shall have a Cancel button test.compare(waitForObjectExists(names.o_poweroff_cancel).visible, True) # Click on the PowerOff Dialog's Cancel button mouseClick (waitForObjectExists(names.o_poweroff_cancel)) # Wait for the animation #SRSUI 556 test.compare(waitForObjectExists(names.o_poweroffButton).visible, True) # Sending can message to show Power off dialog subprocess.call(['cansend', 'can0', '020#A5.01.00.01.00.6F.00.00']) # Test the Power Off dialog is visible upon HD Request test.compare(waitForObjectExists(names.o_powerOffDialog).visible, True) # wait for user reaction and if there is no reaction timeout time.sleep(1) # Sending can message to Hide Power off dialog subprocess.call(['cansend', 'can0', '020#A5.01.00.01.01.5E.00.00']) # Wait for the animation time.sleep(1) # Test the Power Off dialog is hidden upon HD Request after timeout, so the entry screen with power off button is visible again. test.compare(waitForObjectExists(names.o_poweroffButton).visible, True , "SRSUI 556") # Go back to Home Screen mouseClick (waitForObjectExists(names.o_mainMenu_treatment)) test.compare(waitForObjectExists(names.o_treatmentHome).visible, True , "SRSUI 535") print(0)