# -*- 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_Alarm # date 2020/04/08 # author Behrouz NematiPour # import names import utils import denaliMessages def main(): utils.tstStart() startApplication("denaliSquish") utils.waitForGUI(1) denaliMessages.sendAlarm(3, 26, 2, 0, 0) test.compare(waitForObjectExists(names.o_ALARM_ID_MESSAGE).level, 3) test.compare(waitForObjectExists(names.o_ALARM_ID_MESSAGE).color.name, "#c53b33") utils.waitForGUI() # visual delay denaliMessages.sendAlarm(3, 26, 2, 0, 65535) test.compare(waitForObjectExists(names.o_ALARM_ID_MESSAGE).level, 3) test.compare(waitForObjectExists(names.o_ALARM_ID_MESSAGE).color.name, "#c53b33") utils.waitForGUI() # visual delay denaliMessages.sendAlarm(2, 2, 0, 10, 100) test.compare(waitForObjectExists(names.o_ALARM_ID_MESSAGE).level, 2) test.compare(waitForObjectExists(names.o_ALARM_ID_MESSAGE).color.name, "#ffa500") utils.waitForGUI() # visual delay denaliMessages.sendAlarm(1, 3, 0, 0, 54) test.compare(waitForObjectExists(names.o_ALARM_ID_MESSAGE).level, 1) test.compare(waitForObjectExists(names.o_ALARM_ID_MESSAGE).color.name, "#008000") utils.waitForGUI() # visual delay denaliMessages.sendAlarm(0, 4, 0, 0, 91) test.compare(waitForObjectExists(names.o_ALARM_ID_MESSAGE).level, 0) test.compare(waitForObjectExists(names.o_ALARM_ID_MESSAGE).color.name, "#ffffff") utils.waitForGUI() # visual delay denaliMessages.sendAlarm(3, 255, 0, 0, 0) test.compare(waitForObjectExists(names.o_ALARM_ID_MESSAGE).level, 3) test.compare(waitForObjectExists(names.o_ALARM_ID_MESSAGE).color.name, "#c53b33") utils.waitForGUI() # visual delay denaliMessages.sendAlarm(0, 0, 0, 0, 0) try: # Notification Bar should be hidden waitForObjectExists(names.o_ALARM_ID_MESSAGE,0) test.compare(False, True) except LookupError: test.compare(False, False) # Coverage : These messages have not been implemented completely yet. # but as long as the coverage is 100% it means the portion of the implementation for them are working fine. denaliMessages.setAlarmTriggered(1) denaliMessages.send_acknowledge_UI() denaliMessages.setAlarmCleared (1) denaliMessages.send_acknowledge_UI() denaliMessages.sendUnknown_HD() denaliMessages.sendUnknown_DG() utils.tstDone()