# -*- coding: utf-8 -*-" import names from dialin.ui import utils from dialin.ui.hd_simulator import HDSimulator from dialin.ui.dg_simulator import DGSimulator from configuration import config from configuration import utility from dialin.utils.conversions import integer_to_bytearray, float_to_bytearray, short_to_bytearray, unsigned_integer_to_bytearray, integer_to_bit_array, unsigned_short_to_bytearray, unsigned_byte_to_bytearray, unsigned_byte_to_bytearray from dialin.common.hd_defs import HDOpModes, HDOpSubModes hd_simulator = HDSimulator() dg_simulator = DGSimulator() def verify_right_navigation_for_chemical_disinfection(): """ 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 """ test.startSection("Rightward navigation") test.verify(not object.exists(names.o_disinfectChemical_leftImage_Image), "The left navigation arrow should not be present on the first screen of instruction") for indicator in range(1,num_of_instructions + 1): verify_bullet_navigation(indicator) if indicator != num_of_instructions: mouseClick(waitForObject(names.o_disinfectChemical_rightImage_Image)) test.verify(not object.exists(names.o_disinfectChemical_rightImage_Image), "The right navigation arrow should not be present on the last screen of instruction") test.endSection() def verify_left_navigation_for_chemical_disinfection(): """ 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 """ test.startSection("Leftward instruction navigation") test.verify(not object.exists(names.o_PreTreatmentBase_rightImage_Image), "The right navigation arrow should not be present on the last screen of instruction") for indicator in range(num_of_instructions, 0, -1): verify_bullet_navigation(indicator) if indicator != 1: mouseClick(waitForObject(names.o_PreTreatmentBase_leftImage_Image)) test.verify(not object.exists(names.o_PreTreatmentBase_leftImage_Image), "The left navigation arrow should not be present on the first screen of instruction") 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) def verify_chemical_disinfect(): hd_simulator.cmd_set_hd_operation_mode_data(HDOpModes.MODE_STAN.value,HDOpSubModes.STANDBY_WAIT_FOR_DISINFECT_STATE.value) mouseclick(names.o_disinfectHome_Chemical_Disinfect) test.compare(waitForObjectExists(names.o_disinfectChemical_Chemical_Disinfect_Text).text, config.CHEMICAL_DISINFECT_TEXT, "Chemical disinfect text should be visible") # hd_simulator.cmd_send_hd_disinfect_response(accepted = True, reason =1) payload = integer_to_bytearray(1) payload += unsigned_integer_to_bytearray(4) hd_simulator.cmd_send_hd_general_response(message_id=155, accepted=1, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) snooze(5) hd_simulator.cmd_send_hd_disinfection_state(sub_mode = 0, flush_mode = 0, heat_mode = 0, chemical_mode = 1) snooze(5) dg_simulator.cmd_send_dg_disinfect_progress_time_flush(total = 120, countdown = 45) test.log("User navigated to chemical disinfect section") def verify_heat_disinfect(): pass 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() """ 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) hd_simulator.cmd_send_hd_disinfect_chemical_confirm(self, accepted: bool, reason: int) dg_simulator.cmd_send_dg_disinfect_progress_time_flush(self, total: int, countdown: int) dg_simulator.cmd_send_dg_disinfect_progress_time_heat(self, total: int, countdown: int) """ utils.waitForGUI(2) utils.tstDone()