Index: shared/scripts/configuration/config.py =================================================================== diff -u -r67cc737eecd7b95ec6f3ab752e5185a17cf718ef -r1831753ec20fe00bc9e67466c6b15e58568e98ff --- shared/scripts/configuration/config.py (.../config.py) (revision 67cc737eecd7b95ec6f3ab752e5185a17cf718ef) +++ shared/scripts/configuration/config.py (.../config.py) (revision 1831753ec20fe00bc9e67466c6b15e58568e98ff) @@ -366,5 +366,6 @@ 39: "REQUEST_REJECT_REASON_RINSEBACK_NOT_COMPLETED", } -UNDEFINED_ALARM_ID_MSG = "ALARM_ID_UNDEFINED" +UNDEFINED_ALARM_ID_MSG = "ALARM_ID_UNDEFINED" +ALARM_TITLE = "Alarm" \ No newline at end of file Index: shared/scripts/names.py =================================================================== diff -u -r67cc737eecd7b95ec6f3ab752e5185a17cf718ef -r1831753ec20fe00bc9e67466c6b15e58568e98ff --- shared/scripts/names.py (.../names.py) (revision 67cc737eecd7b95ec6f3ab752e5185a17cf718ef) +++ shared/scripts/names.py (.../names.py) (revision 1831753ec20fe00bc9e67466c6b15e58568e98ff) @@ -66,24 +66,26 @@ #alarm list -alarm_list_container = {"container": o_Overlay, "id": "_flickable", "type": "Flickable", "unnamed": 1, "visible": True} -notification_bar_alarm_list_button = {"container": o_Gui_MainView, "id": "_alarmListImage", "source": "qrc:/images/iList", "type": "Image", "unnamed": 1, "visible": True} -minimize_button = {"container": o_Overlay, "id": "_image", "source": "qrc:/images/iChevronDown", "type": "Image", "unnamed": 1, "visible": True} -maximize_button = {"container": o_Gui_MainView, "gradient": 0, "id": "_updownButton", "type": "UpDownButton", "unnamed": 1, "visible": True} -alarm_list_title_text = {"container": o_Overlay, "text": "Alarm list", "type": "Text", "unnamed": 1, "visible": True} -dialogue_bar_alarm_list_button = {"container": o_Overlay, "id": "_icon", "source": "qrc:/images/iList", "type": "Image", "unnamed": 1, "visible": True} -alarm_list_minimize_maximize_button = {"container": o_Overlay, "id": "_image", "source": "qrc:/images/iList", "type": "Image", "unnamed": 1, "visible": True} -alarm_id = {"container": o_Overlay, "id": "_text", "type": "Text", "unnamed": 1, "visible": True} -alarm_message = {"container": o_Overlay, "id": "_itemsValue", "type": "Text", "unnamed": 1, "visible": True} -alarm_list = {"container": o_Overlay, "id": "_grid", "type": "Grid", "unnamed": 1, "visible": True} -rejected_alarm_list_msg = {"container": o_Overlay, "id": "_desc", "objectName": "_NotificationDialog_Description", "type": "Text", "visible": True} +o_alarm_list_container = {"container": o_Overlay, "id": "_flickable", "type": "Flickable", "unnamed": 1, "visible": True} +o_notification_bar_alarm_list_button = {"container": o_Gui_MainView, "id": "_alarmListImage", "source": "qrc:/images/iList", "type": "Image", "unnamed": 1, "visible": True} +o_minimize_button = {"container": o_Overlay, "id": "_image", "source": "qrc:/images/iChevronDown", "type": "Image", "unnamed": 1, "visible": True} +o_maximize_button = {"container": o_Gui_MainView, "gradient": 0, "id": "_updownButton", "type": "UpDownButton", "unnamed": 1, "visible": True} +o_alarm_list_title_text = {"container": o_Overlay, "text": "Alarm list", "type": "Text", "unnamed": 1, "visible": True} +o_dialogue_bar_alarm_list_button = {"container": o_Overlay, "id": "_icon", "source": "qrc:/images/iList", "type": "Image", "unnamed": 1, "visible": True} +o_alarm_list_minimize_maximize_button = {"container": o_Overlay, "id": "_image", "source": "qrc:/images/iList", "type": "Image", "unnamed": 1, "visible": True} +o_alarm_id = {"container": o_Overlay, "id": "_text", "type": "Text", "unnamed": 1, "visible": True} +o_alarm_message = {"container": o_Overlay, "id": "_itemsValue", "type": "Text", "unnamed": 1, "visible": True} +o_alarm_list = {"container": o_Overlay, "id": "_grid", "type": "Grid", "unnamed": 1, "visible": True} +o_rejected_alarm_list_msg = {"container": o_Overlay, "id": "_desc", "objectName": "_NotificationDialog_Description", "type": "Text", "visible": True} +o_alarm_title_text = {"container": o_Overlay, "id": "_title", "type": "Text", "unnamed": 1, "visible": True} +o_alarm_dialogue_box_msg = {"container": o_Overlay, "id": "_desc", "objectName": "_NotificationDialog_Description", "type": "Text", "visible": True} def get_alarm_id_obj(id): - alarm_id["text"] = id - return alarm_id + o_alarm_id["text"] = id + return o_alarm_id def get_alarm_msg_obj(msg): - alarm_message["text"] = msg - return alarm_message + o_alarm_message["text"] = msg + return o_alarm_message \ No newline at end of file Index: tst_ui_alarms_list/test.py =================================================================== diff -u -r67cc737eecd7b95ec6f3ab752e5185a17cf718ef -r1831753ec20fe00bc9e67466c6b15e58568e98ff --- tst_ui_alarms_list/test.py (.../test.py) (revision 67cc737eecd7b95ec6f3ab752e5185a17cf718ef) +++ tst_ui_alarms_list/test.py (.../test.py) (revision 1831753ec20fe00bc9e67466c6b15e58568e98ff) @@ -41,14 +41,14 @@ """ Method to maximize the notification bar """ - mouseClick(waitForObjectExists(names.notification_bar_alarm_list_button)) + mouseClick(waitForObjectExists(names.o_notification_bar_alarm_list_button)) def minimize()-> None: """ Method to minimize the Alarm Dialogue bar """ - mouseClick(waitForObjectExists(names.minimize_button)) + mouseClick(waitForObjectExists(names.o_minimize_button)) def set_only_alarm_list_btn(no_minimize): @@ -67,10 +67,10 @@ only 'Alarm list' button is available """ test.log("Opening 'Alarm list'") - tapObject(waitForObjectExists(names.alarm_list_minimize_maximize_button)) - alarm_list_text = waitForObject(names.alarm_list_title_text) + tapObject(waitForObjectExists(names.o_alarm_list_minimize_maximize_button)) + alarm_list_text = waitForObject(names.o_alarm_list_title_text) if alarm_list_text.visible is False: - tapObject(waitForObject(names.alarm_list_minimize_maximize_button)) + tapObject(waitForObject(names.o_alarm_list_minimize_maximize_button)) else: test.log("Alarm List is displayed") alarm_list_title_text = alarm_list_text.text.toUtf8().constData() @@ -162,7 +162,7 @@ for index, id in enumerate(arranged_alarm_list): scroll_to_value_on_pop_up(value=names.get_alarm_id_obj(id=id), - container=names.alarm_list_container) + container=names.o_alarm_list_container) alarm_id = waitForObject(names.get_alarm_id_obj(id=id)) alarm_id_parent = object.parent(alarm_id) alarm_id_parent_list[id] = alarm_id_parent @@ -184,7 +184,7 @@ (expected_msg=ALARM_ID_AND_MESSAGES[id])) test.log("Verifying the Alarm's position in 'Alarm list'") - alarm_list_parent = waitForObject(names.alarm_list) + alarm_list_parent = waitForObject(names.o_alarm_list) alarm_list = object.children(alarm_list_parent) for index, alarm_id in enumerate(alarm_id_parent_list): @@ -195,7 +195,7 @@ elif accept==REJECTED: expected_message = REJECTION_REASON[0] + "\n" + REJECTION_REASON[reason_id] - rejected_alarm_list_msg = waitForObject(names.rejected_alarm_list_msg) + rejected_alarm_list_msg = waitForObject(names.o_rejected_alarm_list_msg) rejected_alarm_list_msg = rejected_alarm_list_msg.text.toUtf8().constData() test.compare(rejected_alarm_list_msg, expected_message, "When 'Alarm list' is not accepted " + @@ -285,7 +285,8 @@ alarm_id = waitForObject(names.get_alarm_id_obj(id=id)) alarm_id_parent = object.parent(alarm_id) alarm_id_parent_list[id] = alarm_id_parent - expected_msg = UNDEFINED_ALARM_ID_MSG + " " +"[" + str(id) + "]" + expected_msg = "{msg} [{id}]".format(msg=UNDEFINED_ALARM_ID_MSG, + id=str(id)) alarm_msg = waitForObject(\ names.get_alarm_msg_obj(msg=expected_msg)) test.log("Verifying 'Alarm ID'") @@ -302,7 +303,7 @@ "'Alarm Message': {expected_msg}".format(expected_msg=expected_msg)) test.log("Verifying the Alarm's position in 'Alarm list'") - alarm_list_parent = waitForObject(names.alarm_list) + alarm_list_parent = waitForObject(names.o_alarm_list) alarm_list = object.children(alarm_list_parent) for index, alarm_id in enumerate(alarm_id_parent_list): @@ -312,7 +313,46 @@ index=index) ) test.endSection() +def verify_alarm_dialogue_is_displayed(id, state): + """ + Method to verify the Alarm Dialogue + is opened automatically from 'Alarm list' + screen when new non-zero alarm is generated + and verify the undefined alarm id message + @param id: Alarm ID + @param state: Alarm priority + """ + test.startSection("Verify the Alarm Dialogue " + + "is opened automatically from 'Alarm list' " + + "screen when new non-zero alarm is generated" + + "and verify the undefined alarm id message") + alarm.cmd_activate_alarm_id(state=state, + alarm=id, + flags=set_only_alarm_list_btn(no_minimize=0)) + + utils.waitForGUI(2) + if object.exists(names.o_alarm_title_text): + alarm_title = waitForObject(names.o_alarm_title_text) + alarm_title = alarm_title.text.toUtf8().constData() + test.log("Verifying the Alarm title") + expected_title = "{alarm_title} [{id}]".format(\ + alarm_title=ALARM_TITLE, id=id) + test.compare(alarm_title, expected_title, "Alarm Dialogue bar " + + "is displayed upon generation of alarm " + + "and title '{alarm_title}' is displayed".format(\ + alarm_title=ALARM_TITLE, id=id)) + test.log("Verifying generated alarm message") + alarm_msg = waitForObject(names.o_alarm_dialogue_box_msg) + alarm_msg = alarm_msg.text.toUtf8().constData() + expected_msg = "{msg} [{id}]".format(msg=UNDEFINED_ALARM_ID_MSG, + id=str(id)) + test.compare(alarm_msg, expected_msg, + "Expected message {msg} ".format(msg=expected_msg) + + "should be displayed on alarm dialogue bar") + test.endSection() + + def main(): utils.tstStart(__file__) @@ -373,5 +413,8 @@ test.log("THEN: Undefined Alarm ID message is displayed along with ID") verify_alarm_msg_for_undefined_alarm_id() + utils.waitForGUI(1) + verify_alarm_dialogue_is_displayed(id=1000, state=2) + utils.tstDone() \ No newline at end of file