Index: tst_disinfection/test.py =================================================================== diff -u -rfafc6e0cf130380ef845bd0519ef31049a3fbec4 -ra53831cea0eb42896e18bba5fd32e47c667e4c61 --- tst_disinfection/test.py (.../test.py) (revision fafc6e0cf130380ef845bd0519ef31049a3fbec4) +++ tst_disinfection/test.py (.../test.py) (revision a53831cea0eb42896e18bba5fd32e47c667e4c61) @@ -15,7 +15,6 @@ # This test contradicts verification of Disinfection from Application UI # section - import names from dialin.ui import utils from dialin.ui.hd_simulator import HDSimulator @@ -30,24 +29,25 @@ "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, indicator_object, left_arrow_object, right_arrow_object): """ 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 - @ - + @param num_of_instructions (Int): Number of training screen - (it is dynamically figuring from Application) + @param indicator_object (Dict): page step indicator object + @param left_arrow_object (Dict): Object of left arrow from disinfection type + @param right_arrow_object (Dict): Object of right arrow from disinfection type + @returns : None """ test.startSection("Rightward navigation") test.verify(not object.exists(left_arrow_object), "The left navigation arrow should not be present on the first screen of instruction") @@ -67,7 +67,12 @@ def verify_left_navigation_for_chemical_disinfection(num_of_instructions, indicator_object, left_arrow_object, right_arrow_object): """ The method is used to verify the functionality of the left arrow in the instruction navigation, as well as the visibility of the two arrows - """ + @param num_of_instructions (Int): Number of training screen - (it is dynamically figuring from Application) + @param indicator_object (Dict): page step indicator object + @param left_arrow_object (Dict): Object of left arrow from disinfection type + @param right_arrow_object (Dict): Object of right arrow from disinfection type + @returns : None + """ test.startSection("Leftward instruction navigation") test.verify(not object.exists(right_arrow_object), "The right navigation arrow should not be present on the last screen of instruction") @@ -86,7 +91,11 @@ def verify_bullet_navigation(num_of_instructions, indicator, indicator_object): """ - This method verifies the properties of the bullets present in the instruction navigation screen + This method verifies the properties of the bullets present in the instruction navigation screen. + @param num_of_instructions (Int): Number of training screen - (it is dynamically figuring from Application) + @param indicator_object (Dict): page step indicator(bullet) object + @param indicator (Int): Current position index of indicator + @returns : None """ test.startSection("Instruction bullet verification for screens " + str(indicator)) child = object.children(waitForObject(indicator_object)) @@ -108,11 +117,14 @@ def verify_request_rejection_mode(item): """ - Method to verify rejection mode of create custom treatment + Method to verify rejection mode of create custom treatment. + @param item (String): Disinfection type -(Flush,Heat or Chemical) + @return: None """ 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) + utils.waitForGUI(0.1) 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() @@ -121,13 +133,19 @@ def verify_confirm_disinfect(): """ Method to accept treatment response. + @param : None + @return: None """ - test.startSection("Section to accept treatment response") + test.log("Section to accept treatment response") hd_simulator.cmd_send_hd_disinfect_response(accepted = 1, reason = 0) - test.endSection() + def verify_disinfection_states(): - + """ + Method to verify Disinfection Home page. This test covers the disinfection states. + @param : None + @return: None + """ 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) @@ -139,7 +157,6 @@ verify_right_navigation_for_chemical_disinfection(list_of_bullets, names.o_disinfectHome_gridSteps_Grid, names.o_disinfectHome_leftImage_Image, names.o_disinfectHome_rightImage_Image) verify_left_navigation_for_chemical_disinfection(list_of_bullets, names.o_disinfectHome_gridSteps_Grid, names.o_disinfectHome_leftImage_Image, names.o_disinfectHome_rightImage_Image) - #NB: Disinfection states are yet to be added - Future development #verification of chemical disinfection states for chemical_mode_state in range(DGChemicalDisinfectStates.NUM_OF_DG_CHEM_DISINFECT_STATES.value): @@ -154,8 +171,13 @@ test.compare(waitForObjectExists(names.o_disinfectHome_Disinfection_Text).text, config.DISINFECT_TEXT, "Disinfection text is verified !") test.endSection() + def get_dynamic_bullet_count(bullet_object): - + """ + Method to get indicator count dynamically from application. + @param bullet_object (Dict): Object of disinfection type. + @return chemical_disinfect_count (Int): Number of page step indicator. + """ chemical_disinfect_count = 0 child = object.children(waitForObject(bullet_object)) for dynamic_indicator_count in range (len(child)): @@ -166,7 +188,11 @@ def verify_chemical_disinfect(): - + """ + Method to verify Chemical Disinfect from Disinfection. + @param : None + @return: None + """ test.startSection("Verification of chemical disinfection.") 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)) @@ -201,7 +227,11 @@ def verify_heat_disinfect(): - + """ + Method to verify Heat Disinfect from Disinfection. + @param : None + @return: None + """ test.startSection("Verification of heat disinfection.") 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)) @@ -223,7 +253,11 @@ def verify_water_flush(): - + """ + Method to verify water Flush from Disinfection. + @param : None + @return: None + """ 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)) @@ -242,6 +276,7 @@ test.endSection() + def main(): utils.tstStart(__file__) @@ -255,5 +290,3 @@ utils.tstDone() - -