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)