Index: shared/scripts/configuration/config.py =================================================================== diff -u -r3f8003f8a5f8c61fba56c802c5a123d5340b9058 -r1d3192e66bed27fb83cc86d4468bc5bdcc79647a --- shared/scripts/configuration/config.py (.../config.py) (revision 3f8003f8a5f8c61fba56c802c5a123d5340b9058) +++ shared/scripts/configuration/config.py (.../config.py) (revision 1d3192e66bed27fb83cc86d4468bc5bdcc79647a) @@ -14,6 +14,7 @@ ############################################################################ import os +import names from configuration.strings import * AUT_NAME = "denaliSquish -k -K -S -q" @@ -34,13 +35,19 @@ DISINFECT_TEXT = "Disinfection" CHEMICAL_DISINFECT_TEXT = "Chemical Disinfect" +HEAT_DISINFECT_TEXT = "Heat Disinfect" +FLUSH_DISINFECT_TEXT = "Water Flush" + CURRENT_COLOR = '#000000' COMPLETE_COLOR= '#4290ec' ENABLED_COLOR = '#fcfcfc' INCOMPLETE_COLOR = '#607a91' HEAT_DISINFECT_TREATMENT_SCREENS = ["Disinfection", "Heat Disinfect"] -DISINFECT_TREATMENT_ID = ["_headStepBullet"," _nextStepsBullet"] +CHEMICAL_DISINFECT_TREATMENT_SCREENS = ["Disinfection", "Chemical Disinfect"] +FLUSH_DISINFECT_TREATMENT_SCREENS = ["Disinfection", "Water Flush"] +DISINFECT_TREATMENT_ID = ["_headStepBullet","_nextStepsBullet"] + NUM_OF_REQUEST_REJECT_REASONS = 46 Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r3f8003f8a5f8c61fba56c802c5a123d5340b9058 -r1d3192e66bed27fb83cc86d4468bc5bdcc79647a --- shared/scripts/configuration/utility.py (.../utility.py) (revision 3f8003f8a5f8c61fba56c802c5a123d5340b9058) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 1d3192e66bed27fb83cc86d4468bc5bdcc79647a) @@ -14,69 +14,73 @@ import math import squish +import object import sys +import names import test from dialin.common import MsgIds +from configuration import config from dialin.utils import * from dialin.protocols import DenaliMessage, DenaliCanMessenger, DenaliChannels from builtins import int as pyInt from datetime import datetime -def get_disinfect_bullet_object(): +def get_disinfect_bullet_object(id, screen_obj): """ To obtain a bullet object based on occurrence provided. @param screen_obj: provides the container on which the bullet must be present @param num: provides the occurrence value @returns a real name object """ - names.o_disinfect_dynamic_StepBullet["id"] = screen_obj + names.o_disinfect_dynamic_StepBullet["container"] = screen_obj + names.o_disinfect_dynamic_StepBullet["id"] = id return names.o_disinfect_dynamic_StepBullet -def verify_page_step_indicator_for_disinfect(treatment_id, treatment_step, treatment_screens): +def verify_page_step_indicator_for_disinfect(screen_obj, treatment_id, treatment_step, treatment_screens): """ Method to verify the Page Step indicators [the object on top of the screen which indicates the steps passed, current, remained] @param treatment_step : indicates the Current treatment step """ test.startSection("verification of page step indicators") - for page in range(len(treatment_screens)): - bullet_children = object.children(squish.waitForObjectExists(get_disinfect_bullet_object(treatment_id[page]))) + for page in range(len(treatment_screens)): + bullet_children = object.children(squish.waitForObjectExists(get_disinfect_bullet_object(treatment_id[page], screen_obj))) bullet_circle_color = bullet_children[0].color.name bullet_border_color = bullet_children[0].border.color.name - step_title = squish.waitForObjectExists(get_disinfect_text_object(treatment_screens[page])) - + step_title = squish.waitForObjectExists(get_disinfect_text_object(treatment_screens[page], screen_obj)) #To verify the step indicators of the completed treatment screens if page < treatment_step: - test.verify(squish.waitForObjectExists(get_disinfect_bullet_object(screen_obj, page)).complete) - test.verify(not squish.waitForObjectExists(get_disinfect_bullet_object(screen_obj, page)).current) + test.verify(squish.waitForObjectExists(get_disinfect_bullet_object(treatment_id[page], screen_obj)).complete) + test.verify(not squish.waitForObjectExists(get_disinfect_bullet_object(treatment_id[page], screen_obj)).current) test.compare(bullet_circle_color, config.COMPLETE_COLOR) test.compare(bullet_border_color,config.COMPLETE_COLOR) test.compare(step_title.color.name,config.ENABLED_COLOR) #To verify the step indicators of the current treatment screen elif page == treatment_step: - test.verify(squish.waitForObjectExists(get_disinfect_bullet_object(screen_obj, page)).current) - test.verify(not squish.waitForObjectExists(get_disinfect_bullet_object(screen_obj, page)).complete) + test.verify(squish.waitForObjectExists(get_disinfect_bullet_object(treatment_id[page], screen_obj)).current) + test.verify(not squish.waitForObjectExists(get_disinfect_bullet_object(treatment_id[page], screen_obj)).complete) test.compare(bullet_circle_color, config.CURRENT_COLOR) test.compare(bullet_border_color, config.COMPLETE_COLOR) test.compare(step_title.color.name, config.ENABLED_COLOR) test.verify(step_title.font.bold) #To verify the step indicators of the remaining treatment screens else: - test.verify(not squish.waitForObjectExists(get_disinfect_bullet_object(screen_obj, page)).current,) - test.verify(not squish.waitForObjectExists(get_disinfect_bullet_object(screen_obj, page)).complete,) + test.verify(not squish.waitForObjectExists(get_disinfect_bullet_object(treatment_id[page], screen_obj)).current) + test.verify(not squish.waitForObjectExists(get_disinfect_bullet_object(treatment_id[page], screen_obj)).complete) test.compare(step_title.color.name, config.INCOMPLETE_COLOR) test.compare(bullet_circle_color, config.CURRENT_COLOR) test.compare(bullet_border_color, config.INCOMPLETE_COLOR) test.endSection() -def get_disinfect_text_object(text): +def get_disinfect_text_object(text, screen_obj): """ To obtain a text object based on text provided @param screen_obj: provides the container on which the txt must be present @returns a real name object """ + names.o_disinfect_dynamic_StepBullet_Text["container"] = screen_obj names.o_disinfect_dynamic_StepBullet_Text["text"] = text return names.o_disinfect_dynamic_StepBullet_Text @@ -86,4 +90,3 @@ date = datetime.now() return str(date.strftime(date_format)) - Index: shared/scripts/names.py =================================================================== diff -u -r3f8003f8a5f8c61fba56c802c5a123d5340b9058 -r1d3192e66bed27fb83cc86d4468bc5bdcc79647a --- shared/scripts/names.py (.../names.py) (revision 3f8003f8a5f8c61fba56c802c5a123d5340b9058) +++ shared/scripts/names.py (.../names.py) (revision 1d3192e66bed27fb83cc86d4468bc5bdcc79647a) @@ -73,23 +73,53 @@ o_disinfectChemical_gridSteps_Grid = {"container": o_DisinfectStack_disinfectChemical_TreatmentFlowBase, "id": "_gridSteps", "occurrence": 2, "type": "Grid", "unnamed": 1, "visible": True} o_disinfectChemical_confirmButton_TouchRect = {"container": o_DisinfectStack_disinfectChemical_TreatmentFlowBase, "objectName": "_confirmButton", "type": "TouchRect", "visible": True} o_disinfectChemical_NotificationBar_NotificationBar = {"container": o_DisinfectStack_disinfectChemical_TreatmentFlowBase, "objectName": "NotificationBar", "type": "NotificationBar", "visible": True} +#o_disinfectHeat_NotificationBar_NotificationBar = {"container": o_DisinfectStack_disinfectHeat_TreatmentFlowBase, "objectName": "NotificationBar", "type": "NotificationBar", "visible": True} +#o_disinfectFlush_NotificationBar_NotificationBar = {"container": o_DisinfectStack_disinfectFlush_TreatmentFlowBase, "objectName": "NotificationBar", "type": "NotificationBar", "visible": True} + + + + o_disinfectChemical_back_navigation = {"container": o_DisinfectStack_disinfectChemical_TreatmentFlowBase, "text": "BACK", "type": "Text", "unnamed": 1, "visible": True} o_disinfectHome_Heat_Disinfect = {"container": o_DisinfectStack_disinfectHome_TreatmentFlowBase, "text": "Heat Disinfect", "type": "Text", "unnamed": 1, "visible": True} o_DisinfectStack_disinfectHeat_TreatmentFlowBase = {"container": o_DisinfectStack_DisinfectStack, "objectName": "_disinfectHeat", "type": "TreatmentFlowBase", "visible": True} -o_disinfect_dynamic_StepBullet = {"container": o_DisinfectStack_disinfectHeat_TreatmentFlowBase, "type": "StepBullet", "unnamed": 1, "visible": True} -o_disinfect_dynamic_StepBullet_Text = {"container": o_DisinfectStack_disinfectHeat_TreatmentFlowBase, "type": "Text", "unnamed": 1, "visible": True} +o_disinfect_dynamic_StepBullet = {"type": "StepBullet", "unnamed": 1, "visible": True} +o_disinfect_dynamic_StepBullet_Text = {"type": "Text", "unnamed": 1, "visible": True} - +o_DisinfectStack_disinfectFlush_TreatmentFlowBase = {"container": o_DisinfectStack_DisinfectStack, "objectName": "_disinfectFlush", "type": "TreatmentFlowBase", "visible": True} +o_disinfectHeat_Heat_Disinfect_Text = {"container": o_DisinfectStack_disinfectHeat_TreatmentFlowBase, "occurrence": 2, "text": "Heat Disinfect", "type": "Text", "unnamed": 1, "visible": True} +o_disinfectHeat_nextStepsBullet_StepBullet = {"container": o_DisinfectStack_disinfectHeat_TreatmentFlowBase, "id": "_nextStepsBullet", "type": "StepBullet", "unnamed": 1, "visible": True} + + + + +o_disinfectHeat_headStepBullet_StepBullet = {"container": o_DisinfectStack_disinfectHeat_TreatmentFlowBase, "id": "_headStepBullet", "type": "StepBullet", "unnamed": 1, "visible": True} +o_disinfectHeat_confirmButton_TouchRect = {"container": o_DisinfectStack_disinfectHeat_TreatmentFlowBase, "objectName": "_confirmButton", "type": "TouchRect", "visible": True} + +o_disinfectHeat_NotificationBar_NotificationBar = {"container": o_DisinfectStack_disinfectHeat_TreatmentFlowBase, "objectName": "NotificationBar", "type": "NotificationBar", "visible": True} +o_disinfectHeat_backButton_BackButton = {"container": o_DisinfectStack_disinfectHeat_TreatmentFlowBase, "objectName": "_backButton", "type": "BackButton", "visible": True} + + + +o_disinfectFlush_Water_Flush_Text = {"container": o_DisinfectStack_disinfectFlush_TreatmentFlowBase, "occurrence": 2, "text": "Water Flush", "type": "Text", "unnamed": 1, "visible": True} +o_disinfectFlush_nextStepsBullet_StepBullet = {"container": o_DisinfectStack_disinfectFlush_TreatmentFlowBase, "id": "_nextStepsBullet", "type": "StepBullet", "unnamed": 1, "visible": True} +o_disinfectFlush_headStepBullet_StepBullet = {"container": o_DisinfectStack_disinfectFlush_TreatmentFlowBase, "id": "_headStepBullet", "type": "StepBullet", "unnamed": 1, "visible": True} +o_disinfectFlush_confirmButton_TouchRect = {"container": o_DisinfectStack_disinfectFlush_TreatmentFlowBase, "objectName": "_confirmButton", "type": "TouchRect", "visible": True} +o_disinfectFlush_NotificationBar_NotificationBar = {"container": o_DisinfectStack_disinfectFlush_TreatmentFlowBase, "objectName": "NotificationBar", "type": "NotificationBar", "visible": True} + + +o_MainHome_NotificationBar_NotificationBar = {"container": o_MainHome_MainHome, "objectName": "NotificationBar", "type": "NotificationBar", "visible": False} +""" {"container": o_DisinfectStack_disinfectHeat_TreatmentFlowBase, "id": "_headStepBullet", "type": "StepBullet", "unnamed": 1, "visible": True} {"container": o_DisinfectStack_disinfectHeat_TreatmentFlowBase, "id": "_nextStepsBullet", "type": "StepBullet", "unnamed": 1, "visible": True} +{"container": o_DisinfectStack_disinfectChemical_TreatmentFlowBase, "id": "_headStepBullet", "type": "StepBullet", "unnamed": 1, "visible": True} +{"container": o_DisinfectStack_disinfectChemical_TreatmentFlowBase, "text": "Disinfection", "type": "Text", "unnamed": 1, "visible": True} - {"container": o_DisinfectStack_disinfectHeat_TreatmentFlowBase, "text": "Disinfection", "type": "Text", "unnamed": 1, "visible": True} {"container": o_DisinfectStack_disinfectHeat_TreatmentFlowBase, "text": "Heat Disinfect", "type": "Text", "unnamed": 1, "visible": True} +""" - Index: tst_disinfection/test.py =================================================================== diff -u -r3f8003f8a5f8c61fba56c802c5a123d5340b9058 -r1d3192e66bed27fb83cc86d4468bc5bdcc79647a --- tst_disinfection/test.py (.../test.py) (revision 3f8003f8a5f8c61fba56c802c5a123d5340b9058) +++ tst_disinfection/test.py (.../test.py) (revision 1d3192e66bed27fb83cc86d4468bc5bdcc79647a) @@ -11,12 +11,23 @@ from dialin.common.hd_defs import HDOpModes, HDOpSubModes from dateutil.tz._common import ZERO +DISINFECT_TREATMENT_OBJECT = { + "Chemical" : names.o_DisinfectStack_disinfectChemical_TreatmentFlowBase, + "Heat" : names.o_DisinfectStack_disinfectHeat_TreatmentFlowBase, + "Flush" : names.o_DisinfectStack_disinfectFlush_TreatmentFlowBase + + } +DISINFECT_NOTIFICATION_OBJECT = { + "Chemical" : names.o_disinfectChemical_NotificationBar_NotificationBar, + "Heat" : names.o_disinfectHeat_NotificationBar_NotificationBar, + "Flush" : names.o_disinfectFlush_NotificationBar_NotificationBar + + } hd_simulator = HDSimulator() dg_simulator = DGSimulator() - def verify_right_navigation_for_chemical_disinfection(num_of_instructions): """ The method is used to verify the functionality of the right arrow in the disinfection navigation, as well as the visibility of the two arrows @@ -78,14 +89,14 @@ test.endSection() -def verify_request_rejection_mode(): +def verify_request_rejection_mode(item): """ Method to verify rejection mode of create custom treatment """ test.startSection("Section to verify rejection mode of create custom treatment") for rejection in range(1, config.NUM_OF_REQUEST_REJECT_REASONS + 1): hd_simulator.cmd_send_hd_disinfect_response(accepted = 0, reason = rejection) - rejection_message = waitForObjectExists(names.o_disinfectChemical_NotificationBar_NotificationBar) + rejection_message = waitForObjectExists(DISINFECT_NOTIFICATION_OBJECT[item]) test.compare(rejection_message.text, config.REJECTION_REASON[rejection], "expected rejection {msg} displayed".format(msg=config.REJECTION_REASON[rejection])) test.endSection() @@ -96,12 +107,28 @@ """ test.startSection("Section to accept treatment response") hd_simulator.cmd_send_hd_disinfect_response(accepted = 1, reason = 0) + test.endSection() - def verify_disinfection_states(): - hd_simulator.cmd_send_hd_disinfection_state(sub_mode = 0, flush_mode = 0, heat_mode = 0, chemical_mode = 1) + test.startSection("Section to verifies disinfection states") + hd_simulator.cmd_send_hd_operation_mode(op_mode = 3, sub_mode = 1) + standby_status = waitForObjectExists(names.o_MainHome_NotificationBar_NotificationBar) + test.verify(standby_status.enabled, "Standby page should be displayed.") + + hd_simulator.cmd_send_hd_operation_mode(op_mode = 3, sub_mode = 2) + + hd_simulator.cmd_send_hd_disinfection_state(sub_mode = 3, flush_mode = 0, heat_mode = 0, chemical_mode = 1) + + verify_request_rejection_mode("Chemical") + verify_confirm_disinfect() + + + + + + def get_dynamic_bullet_count(): @@ -120,9 +147,10 @@ hd_simulator.cmd_set_hd_operation_mode_data(HDOpModes.MODE_STAN.value,HDOpSubModes.STANDBY_WAIT_FOR_DISINFECT_STATE.value) mouseClick(waitForObject(names.o_disinfectHome_Chemical_Disinfect)) + utility.verify_page_step_indicator_for_disinfect(DISINFECT_TREATMENT_OBJECT['Chemical'], config.DISINFECT_TREATMENT_ID, 1, config.CHEMICAL_DISINFECT_TREATMENT_SCREENS) + test.compare(waitForObjectExists(names.o_disinfectChemical_Chemical_Disinfect_Text).text, config.CHEMICAL_DISINFECT_TEXT, "Chemical disinfect text should be visible") test.compare(waitForObjectExists(names.o_disinfectChemical_Chemical_Disinfect_Text_2).text, config.CHEMICAL_DISINFECT_TEXT, "Chemical disinfect indicator should be visible") - test.verify(waitForObjectExists(names.o_disinfectChemical_Chemical_Disinfect_Text_2).font.bold, "Chemical disinfect text from page step indicator should be bold") test.compare(waitForObjectExists(names.o_disinfectChemical_Disinfection_Text).text, config.DISINFECT_TEXT, "Disinfection text should be visible") test.verify(not waitForObjectExists(names.o_disinfectChemical_Disinfection_Text).font.bold, "disinfect text from page step indicator should not be bold") @@ -137,14 +165,13 @@ for right_arrow in range(list_of_bullets-1): mouseClick(waitForObject(names.o_disinfectChemical_rightImage_Image)) - test.log("user clicked on tight image arrow for the iteration -> "+str(right_arrow)) + test.log("user clicked on right image arrow for the navigation -> "+str(right_arrow)) mouseClick(waitForObject(names.o_disinfectChemical_confirmButton_TouchRect)) - verify_request_rejection_mode() + verify_request_rejection_mode("Chemical") verify_confirm_disinfect() mouseClick(waitForObject(names.o_disinfectChemical_back_navigation)) - test.endSection() @@ -155,49 +182,53 @@ hd_simulator.cmd_set_hd_operation_mode_data(HDOpModes.MODE_STAN.value,HDOpSubModes.STANDBY_WAIT_FOR_DISINFECT_STATE.value) mouseClick(waitForObject(names.o_disinfectHome_Heat_Disinfect)) - utility.verify_page_step_indicator_for_disinfect(config.DISINFECT_TREATMENT_ID, 1, config.HEAT_DISINFECT_TREATMENT_SCREENS) + utility.verify_page_step_indicator_for_disinfect(DISINFECT_TREATMENT_OBJECT['Heat'],config.DISINFECT_TREATMENT_ID, 1, config.HEAT_DISINFECT_TREATMENT_SCREENS) - test.compare(waitForObjectExists(names.o_disinfectChemical_Chemical_Disinfect_Text).text, config.CHEMICAL_DISINFECT_TEXT, "Chemical disinfect text should be visible") - test.compare(waitForObjectExists(names.o_disinfectChemical_Chemical_Disinfect_Text_2).text, config.CHEMICAL_DISINFECT_TEXT, "Chemical disinfect indicator should be visible") - test.verify(waitForObjectExists(names.o_disinfectChemical_Chemical_Disinfect_Text_2).font.bold, "Chemical disinfect text from page step indicator should be bold") - test.compare(waitForObjectExists(names.o_disinfectChemical_Disinfection_Text).text, config.DISINFECT_TEXT, "Disinfection text should be visible") - test.verify(not waitForObjectExists(names.o_disinfectChemical_Disinfection_Text).font.bold, "disinfect text from page step indicator should not be bold") + test.compare(waitForObjectExists(names.o_disinfectHeat_Heat_Disinfect_Text).text, config.HEAT_DISINFECT_TEXT, "Heat disinfect text should be visible") + test.compare(waitForObjectExists(names.o_disinfectHeat_nextStepsBullet_StepBullet).text, config.HEAT_DISINFECT_TEXT, "Chemical disinfect indicator should be visible") + test.compare(waitForObjectExists(names.o_disinfectHeat_headStepBullet_StepBullet).text, config.DISINFECT_TEXT, "Disinfection text should be visible") + + test.verify(waitForObjectExists(names.o_disinfectHeat_confirmButton_TouchRect).enabled, "confirm button must be active") + mouseClick(waitForObject(names.o_disinfectHeat_confirmButton_TouchRect)) + verify_request_rejection_mode("Heat") + verify_confirm_disinfect() + + mouseClick(waitForObject(names.o_disinfectHeat_backButton_BackButton)) + test.endSection() - test.log("verification of instruction navigation from chemical disinfection.") - list_of_bullets = get_dynamic_bullet_count() - test.verify(not waitForObjectExists(names.o_disinfectChemical_confirmButton_TouchRect).enabled, "confirm button must not be active") - verify_right_navigation_for_chemical_disinfection(list_of_bullets) - test.verify(waitForObjectExists(names.o_disinfectChemical_confirmButton_TouchRect).enabled, "confirm button must be active") - verify_left_navigation_for_chemical_disinfection(list_of_bullets) - test.verify(not waitForObjectExists(names.o_disinfectChemical_confirmButton_TouchRect).enabled ,"confirm button must not be active") + +def verify_water_flush(): - for right_arrow in range(list_of_bullets-1): - mouseClick(waitForObject(names.o_disinfectChemical_rightImage_Image)) - test.log("user clicked on tight image arrow for the iteration -> "+str(right_arrow)) - mouseClick(waitForObject(names.o_disinfectChemical_confirmButton_TouchRect)) + test.startSection("Verification of Water Flush.") + hd_simulator.cmd_set_hd_operation_mode_data(HDOpModes.MODE_STAN.value,HDOpSubModes.STANDBY_WAIT_FOR_DISINFECT_STATE.value) + mouseClick(waitForObject(names.o_disinfectHome_TouchRect)) - verify_request_rejection_mode() + utility.verify_page_step_indicator_for_disinfect(DISINFECT_TREATMENT_OBJECT['Flush'],config.DISINFECT_TREATMENT_ID, 1, config.FLUSH_DISINFECT_TREATMENT_SCREENS) + + test.compare(waitForObjectExists(names.o_disinfectFlush_Water_Flush_Text).text, config.FLUSH_DISINFECT_TEXT, "Flush disinfect text should be visible") + test.compare(waitForObjectExists(names.o_disinfectFlush_nextStepsBullet_StepBullet).text, config.FLUSH_DISINFECT_TEXT, "Flush disinfect indicator should be visible") + test.compare(waitForObjectExists(names.o_disinfectFlush_headStepBullet_StepBullet).text, config.DISINFECT_TEXT, "Disinfection text should be visible") + + test.verify(waitForObjectExists(names.o_disinfectFlush_confirmButton_TouchRect).enabled, "confirm button must be active") + mouseClick(waitForObject(names.o_disinfectFlush_confirmButton_TouchRect)) + + verify_request_rejection_mode("Flush") verify_confirm_disinfect() test.endSection() - -def verify_water_flush(): - pass - def main(): utils.tstStart(__file__) startApplication(config.AUT_NAME) - #verify_disinfection_states() - verify_chemical_disinfect() - verify_heat_disinfect() - verify_water_flush() + #verify_chemical_disinfect() + #verify_heat_disinfect() + #verify_water_flush() + + verify_disinfection_states() - - """ hd_simulator.cmd_send_hd_disinfection_state(self, sub_mode: int, flush_mode: int, heat_mode: int,chemical_mode: int) hd_simulator.cmd_send_hd_disinfect_response(self, accepted: bool, reason: int)