Index: shared/scripts/configuration/config.py =================================================================== diff -u -r1d3192e66bed27fb83cc86d4468bc5bdcc79647a -rfafc6e0cf130380ef845bd0519ef31049a3fbec4 --- shared/scripts/configuration/config.py (.../config.py) (revision 1d3192e66bed27fb83cc86d4468bc5bdcc79647a) +++ shared/scripts/configuration/config.py (.../config.py) (revision fafc6e0cf130380ef845bd0519ef31049a3fbec4) @@ -21,86 +21,13 @@ COMMON_PATH = os.environ['HOME']+"/Projects" +#Disinfection +DISINFECT_TREATMENT_ID = ["_headStepBullet","_nextStepsBullet"] -COLOR_CODES = {"Aqua": "#81ffff", "Blue": "#017dea", "Blue 2": "#1090d5", "Green": "#29fd2d", "Grey": "#d3d3d3", - "Lavender": "#db98f5", "Light Blue": "#acd7f1", "Light Teal": "#29f1da","Lime": "#b7fc36", - "Magenta":"#fd28fd", "Orange": "#f2721c", "Peach":"#f1979a", "Red": "#c53b33", "Rose":"#fc178d", - "Slate blue":"#7f7ffa", "Violet": "#6435c9", "White": "#ffffff", "Yellow": "#fcfc4d"} -BLOOD_PRIMING_TEXT = "Blood Priming" -SALINE_UNIT = "mL" -BLOOD_PRIMING_DEFAULT_VALUE = "0 mL" - - - -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"] -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 - -# dictionary of rejection reason from application source code. -# message location -> denali-> Headers-> common-> MsgDefs.h -REJECTION_REASON = { - 0: "REQUEST_REJECT_REASON_NONE", # Used when there is no rejection - 1: "REQUEST_REJECT_REASON_NOT_ALLOWED_IN_CURRENT_MODE", # Request is not allowed in the current operating mode - 2: "REQUEST_REJECT_REASON_TIMEOUT_WAITING_FOR_USER_CONFIRM", # Validated request was not confirmed by user in reasonable time - 3: "REQUEST_REJECT_REASON_NOT_IN_TREATMENT_MODE", # Request is not allowed if not in treatment mode - 4: "REQUEST_REJECT_REASON_INVALID_TREATMENT_STATE", # Request is not allowed in current treatment state - 5: "REQUEST_REJECT_REASON_TREATMENT_TOO_CLOSE_TO_FINISHED", # Request is not allowed so near end of treatment - 6: "REQUEST_REJECT_REASON_TREATMENT_TIME_OUT_OF_RANGE", # Treatment duration is out of range - 7: "REQUEST_REJECT_REASON_TREATMENT_TIME_LESS_THAN_CURRENT", # Treatment time change is less than currently elapsed treatment time - 8: "REQUEST_REJECT_REASON_BLOOD_FLOW_OUT_OF_RANGE", # Blood flow is out of range - 9: "REQUEST_REJECT_REASON_DIAL_FLOW_OUT_OF_RANGE", # Dialysate flow is out of range - 10: "REQUEST_REJECT_REASON_DIAL_VOLUME_OUT_OF_RANGE", # Dialysate flow rate or treatment duration causes dialysate volume to exceed limit - 11: "REQUEST_REJECT_REASON_UF_VOLUME_OUT_OF_RANGE", # Ultrafiltration volume is out of range - 12: "REQUEST_REJECT_REASON_UF_RATE_OUT_OF_RANGE", # Ultrafiltration rate is out of range - 13: "REQUEST_REJECT_REASON_TREATMENT_TIME_LESS_THAN_MINIMUM", # Treatment time change is less than minimum treatment time - 14: "REQUEST_REJECT_REASON_UF_NOT_IN_PROGESS", # Ultrafiltration is not currently in progress - 15: "REQUEST_REJECT_REASON_UF_NOT_PAUSED", # Ultrafiltration is not currently paused - 16: "REQUEST_REJECT_REASON_SALINE_BOLUS_IN_PROGRESS", # A saline bolus is in progress - 17: "REQUEST_REJECT_REASON_PARAM_OUT_OF_RANGE", # A treatment parameter is out of range - 18: "REQUEST_REJECT_REASON_HEPARIN_PRESTOP_EXCEEDS_DURATION", # The Heparin pre-stop setting is greater than the treatment duration - 19: "REQUEST_REJECT_REASON_ARTERIAL_PRESSURE_LOW_VS_HIGH", # Arterial pressure low and high alarm limits are not inconsistent - 20: "REQUEST_REJECT_REASON_VENOUS_PRESSURE_LOW_VS_HIGH", # Venous pressure low and high alarm limits are inconsistent - 21: "REQUEST_REJECT_REASON_SALINE_MAX_VOLUME_REACHED", # Saline bolus volume maximum has been reached - no more saline allowed - 22: "REQUEST_REJECT_REASON_SALINE_BOLUS_NOT_IN_PROGRESS", # A saline bolus is not in progress - 23: "REQUEST_REJECT_REASON_ACTION_DISABLED_IN_CURRENT_STATE", # Requested user action is disabled in current state - 24: "REQUEST_REJECT_REASON_ALARM_IS_ACTIVE", # Requested user action not allowed while alarm is active - 25: "REQUEST_REJECT_REASON_INVALID_COMMAND", # Requested user action invalid - 26: "REQUEST_REJECT_REASON_TREATMENT_IS_COMPLETED", # The treatment has been completed - 27: "REQUEST_REJECT_REASON_ADDL_RINSEBACK_MAX_VOLUME_REACHED", # Rinseback additional volume maximum has been reached - no more additional rinsebacks allowed - 28: "REQUEST_REJECT_REASON_UF_VOLUME_NOT_SET", # Ultrafiltration volume is not set yet - 29: "REQUEST_REJECT_REASON_NO_PATIENT_CONNECTION_CONFIRM", # The user has not confirmed patient connection - 30: "REQUEST_REJECT_REASON_HEPARIN_PAUSE_INVALID_IN_THIS_STATE", # Heparin cannot be paused if not currently deliverying Heparin - 31: "REQUEST_REJECT_REASON_HEPARIN_NOT_PAUSED", # Heparin cannot be resumed if not paused - 32: "REQUEST_REJECT_REASON_DG_COMM_LOST", # Treatment cannot initiate if DG comm is lost - 33: "REQUEST_REJECT_REASON_DRAIN_NOT_COMPLETE", # Post-treatment reservoirs drain not complete - 34: "REQUEST_REJECT_REASON_DG_NOT_IN_STANDBY_IDLE_STATE", # Treatment cannot initiate if DG is not in standby idle state - 35: "REQUEST_REJECT_REASON_INVALID_REQUEST_FORMAT", # Request message not formatted properly - 36: "REQUEST_REJECT_REASON_INVALID_DATE_OR_TIME", # Given date/time is invalid - 37: "REQUEST_REJECT_REASON_TREATMENT_IN_PROGRESS", # Treatment is in progress - 38: "REQUEST_REJECT_REASON_BATTERY_IS_NOT_CHARGED", # Battery does not have enough charge to start treatment - 39: "REQUEST_REJECT_REASON_RINSEBACK_NOT_COMPLETED", # Cannot move on to recirculate without completing full rinseback. - 40: "REQUEST_REJECT_REASON_RESERVOIR_ONE_IS_NOT_READY", # Reservoir one fill is not complete - 41: "REQUEST_REJECT_REASON_PUMP_TRACK_NOT_CLOSED", # Pump track is not ready / closed - 42: "REQUEST_REJECT_REASON_DOOR_NOT_CLOSED", # Door is not closed - 43: "REQUEST_REJECT_REASON_SYRINGE_NOT_PRESENT", # Syringe is not present - 44: "REQUEST_REJECT_REASON_DG_DIALYSATE_CAP_OPEN", # Dialysate cap open - 45: "REQUEST_REJECT_REASON_DG_CONCENTRATE_CAP_OPEN", # Concentrate cap open - 46: "NUM_OF_REQUEST_REJECT_REASONS" # Number of settings change reject codes -} - - Index: shared/scripts/configuration/strings.py =================================================================== diff -u -r9bdbb675a824033b1bac4864c32d83fe049d1ccb -rfafc6e0cf130380ef845bd0519ef31049a3fbec4 --- shared/scripts/configuration/strings.py (.../strings.py) (revision 9bdbb675a824033b1bac4864c32d83fe049d1ccb) +++ shared/scripts/configuration/strings.py (.../strings.py) (revision fafc6e0cf130380ef845bd0519ef31049a3fbec4) @@ -11,4 +11,71 @@ # @author (last) LTTS # @date (last) 18-Jan-2022 # -############################################################################ \ No newline at end of file +############################################################################ + + + + + +#Disinfection string constants +DISINFECT_TEXT = "Disinfection" +CHEMICAL_DISINFECT_TEXT = "Chemical Disinfect" +HEAT_DISINFECT_TEXT = "Heat Disinfect" +FLUSH_DISINFECT_TEXT = "Water Flush" + +HEAT_DISINFECT_TREATMENT_SCREENS = ["Disinfection", "Heat Disinfect"] +CHEMICAL_DISINFECT_TREATMENT_SCREENS = ["Disinfection", "Chemical Disinfect"] +FLUSH_DISINFECT_TREATMENT_SCREENS = ["Disinfection", "Water Flush"] + + +# dictionary of rejection reason from application source code. +# message location -> denali-> Headers-> common-> MsgDefs.h +REJECTION_REASON = { + 0: "REQUEST_REJECT_REASON_NONE", # Used when there is no rejection + 1: "REQUEST_REJECT_REASON_NOT_ALLOWED_IN_CURRENT_MODE", # Request is not allowed in the current operating mode + 2: "REQUEST_REJECT_REASON_TIMEOUT_WAITING_FOR_USER_CONFIRM", # Validated request was not confirmed by user in reasonable time + 3: "REQUEST_REJECT_REASON_NOT_IN_TREATMENT_MODE", # Request is not allowed if not in treatment mode + 4: "REQUEST_REJECT_REASON_INVALID_TREATMENT_STATE", # Request is not allowed in current treatment state + 5: "REQUEST_REJECT_REASON_TREATMENT_TOO_CLOSE_TO_FINISHED", # Request is not allowed so near end of treatment + 6: "REQUEST_REJECT_REASON_TREATMENT_TIME_OUT_OF_RANGE", # Treatment duration is out of range + 7: "REQUEST_REJECT_REASON_TREATMENT_TIME_LESS_THAN_CURRENT", # Treatment time change is less than currently elapsed treatment time + 8: "REQUEST_REJECT_REASON_BLOOD_FLOW_OUT_OF_RANGE", # Blood flow is out of range + 9: "REQUEST_REJECT_REASON_DIAL_FLOW_OUT_OF_RANGE", # Dialysate flow is out of range + 10: "REQUEST_REJECT_REASON_DIAL_VOLUME_OUT_OF_RANGE", # Dialysate flow rate or treatment duration causes dialysate volume to exceed limit + 11: "REQUEST_REJECT_REASON_UF_VOLUME_OUT_OF_RANGE", # Ultrafiltration volume is out of range + 12: "REQUEST_REJECT_REASON_UF_RATE_OUT_OF_RANGE", # Ultrafiltration rate is out of range + 13: "REQUEST_REJECT_REASON_TREATMENT_TIME_LESS_THAN_MINIMUM", # Treatment time change is less than minimum treatment time + 14: "REQUEST_REJECT_REASON_UF_NOT_IN_PROGESS", # Ultrafiltration is not currently in progress + 15: "REQUEST_REJECT_REASON_UF_NOT_PAUSED", # Ultrafiltration is not currently paused + 16: "REQUEST_REJECT_REASON_SALINE_BOLUS_IN_PROGRESS", # A saline bolus is in progress + 17: "REQUEST_REJECT_REASON_PARAM_OUT_OF_RANGE", # A treatment parameter is out of range + 18: "REQUEST_REJECT_REASON_HEPARIN_PRESTOP_EXCEEDS_DURATION", # The Heparin pre-stop setting is greater than the treatment duration + 19: "REQUEST_REJECT_REASON_ARTERIAL_PRESSURE_LOW_VS_HIGH", # Arterial pressure low and high alarm limits are not inconsistent + 20: "REQUEST_REJECT_REASON_VENOUS_PRESSURE_LOW_VS_HIGH", # Venous pressure low and high alarm limits are inconsistent + 21: "REQUEST_REJECT_REASON_SALINE_MAX_VOLUME_REACHED", # Saline bolus volume maximum has been reached - no more saline allowed + 22: "REQUEST_REJECT_REASON_SALINE_BOLUS_NOT_IN_PROGRESS", # A saline bolus is not in progress + 23: "REQUEST_REJECT_REASON_ACTION_DISABLED_IN_CURRENT_STATE", # Requested user action is disabled in current state + 24: "REQUEST_REJECT_REASON_ALARM_IS_ACTIVE", # Requested user action not allowed while alarm is active + 25: "REQUEST_REJECT_REASON_INVALID_COMMAND", # Requested user action invalid + 26: "REQUEST_REJECT_REASON_TREATMENT_IS_COMPLETED", # The treatment has been completed + 27: "REQUEST_REJECT_REASON_ADDL_RINSEBACK_MAX_VOLUME_REACHED", # Rinseback additional volume maximum has been reached - no more additional rinsebacks allowed + 28: "REQUEST_REJECT_REASON_UF_VOLUME_NOT_SET", # Ultrafiltration volume is not set yet + 29: "REQUEST_REJECT_REASON_NO_PATIENT_CONNECTION_CONFIRM", # The user has not confirmed patient connection + 30: "REQUEST_REJECT_REASON_HEPARIN_PAUSE_INVALID_IN_THIS_STATE", # Heparin cannot be paused if not currently deliverying Heparin + 31: "REQUEST_REJECT_REASON_HEPARIN_NOT_PAUSED", # Heparin cannot be resumed if not paused + 32: "REQUEST_REJECT_REASON_DG_COMM_LOST", # Treatment cannot initiate if DG comm is lost + 33: "REQUEST_REJECT_REASON_DRAIN_NOT_COMPLETE", # Post-treatment reservoirs drain not complete + 34: "REQUEST_REJECT_REASON_DG_NOT_IN_STANDBY_IDLE_STATE", # Treatment cannot initiate if DG is not in standby idle state + 35: "REQUEST_REJECT_REASON_INVALID_REQUEST_FORMAT", # Request message not formatted properly + 36: "REQUEST_REJECT_REASON_INVALID_DATE_OR_TIME", # Given date/time is invalid + 37: "REQUEST_REJECT_REASON_TREATMENT_IN_PROGRESS", # Treatment is in progress + 38: "REQUEST_REJECT_REASON_BATTERY_IS_NOT_CHARGED", # Battery does not have enough charge to start treatment + 39: "REQUEST_REJECT_REASON_RINSEBACK_NOT_COMPLETED", # Cannot move on to recirculate without completing full rinseback. + 40: "REQUEST_REJECT_REASON_RESERVOIR_ONE_IS_NOT_READY", # Reservoir one fill is not complete + 41: "REQUEST_REJECT_REASON_PUMP_TRACK_NOT_CLOSED", # Pump track is not ready / closed + 42: "REQUEST_REJECT_REASON_DOOR_NOT_CLOSED", # Door is not closed + 43: "REQUEST_REJECT_REASON_SYRINGE_NOT_PRESENT", # Syringe is not present + 44: "REQUEST_REJECT_REASON_DG_DIALYSATE_CAP_OPEN", # Dialysate cap open + 45: "REQUEST_REJECT_REASON_DG_CONCENTRATE_CAP_OPEN", # Concentrate cap open + 46: "NUM_OF_REQUEST_REJECT_REASONS" # Number of settings change reject codes +} Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r1d3192e66bed27fb83cc86d4468bc5bdcc79647a -rfafc6e0cf130380ef845bd0519ef31049a3fbec4 --- shared/scripts/configuration/utility.py (.../utility.py) (revision 1d3192e66bed27fb83cc86d4468bc5bdcc79647a) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision fafc6e0cf130380ef845bd0519ef31049a3fbec4) @@ -12,25 +12,19 @@ # ############################################################################ -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(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 + To set a custom object based on item from parameters + @param screen_obj (String): provides the custom container for the object + @param id (String): provides the custom id for the object @returns a real name object """ names.o_disinfect_dynamic_StepBullet["container"] = screen_obj @@ -41,7 +35,10 @@ 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 + @param screen_obj (Dict) : Parent objject of page step indicator. + @param treatment_id (List) : disinfection id's for disinfection types. + @param treatment_step (Int) : indicates the Current treatment step. + @param treatment_screens(List): Type of disinfection. """ test.startSection("verification of page step indicators") for page in range(len(treatment_screens)): @@ -76,17 +73,12 @@ 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 + To set a custom object based on item from parameters + @param screen_obj (String): provides the custom container for the object + @param text (String) : provides the custom text for the object @returns a real name object """ names.o_disinfect_dynamic_StepBullet_Text["container"] = screen_obj - names.o_disinfect_dynamic_StepBullet_Text["text"] = text + names.o_disinfect_dynamic_StepBullet_Text["text"] = text return names.o_disinfect_dynamic_StepBullet_Text - -def get_current_date_and_time(date_format='%Y/%b/%d - %H:%M'): - - date = datetime.now() - return str(date.strftime(date_format)) - Index: shared/scripts/names.py =================================================================== diff -u -r1d3192e66bed27fb83cc86d4468bc5bdcc79647a -rfafc6e0cf130380ef845bd0519ef31049a3fbec4 --- shared/scripts/names.py (.../names.py) (revision 1d3192e66bed27fb83cc86d4468bc5bdcc79647a) +++ shared/scripts/names.py (.../names.py) (revision fafc6e0cf130380ef845bd0519ef31049a3fbec4) @@ -109,17 +109,11 @@ 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} +o_disinfectHome_gridSteps_Grid = {"container": o_DisinfectStack_disinfectHome_TreatmentFlowBase, "id": "_gridSteps", "occurrence": 2, "type": "Grid", "unnamed": 1, "visible": True} +o_disinfectHome_leftImage_Image = {"container": o_DisinfectStack_disinfectHome_TreatmentFlowBase, "id": "_leftImage", "source": "qrc:/images/iArrowLeft", "type": "Image", "unnamed": 1, "visible": True} +o_disinfectHome_rightImage_Image = {"container": o_DisinfectStack_disinfectHome_TreatmentFlowBase, "id": "_rightImage", "source": "qrc:/images/iArrowRight", "type": "Image", "unnamed": 1, "visible": True} +o_disinfectHome_Disinfection_Text = {"container": o_DisinfectStack_disinfectHome_TreatmentFlowBase, "occurrence": 2, "text": "Disinfection", "type": "Text", "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 -r1d3192e66bed27fb83cc86d4468bc5bdcc79647a -rfafc6e0cf130380ef845bd0519ef31049a3fbec4 --- tst_disinfection/test.py (.../test.py) (revision 1d3192e66bed27fb83cc86d4468bc5bdcc79647a) +++ tst_disinfection/test.py (.../test.py) (revision fafc6e0cf130380ef845bd0519ef31049a3fbec4) @@ -1,16 +1,31 @@ -# -*- coding: utf-8 -*-" +# -*- coding: utf-8 -*- +## +# Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. +# copyright +# THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, +# IN PART OR IN WHOLE, +# WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. +# +# file tst_In_treatment +# date 2020/08/24 +# author Joseph Varghese +# +# NOTE: +# This test contradicts verification of Disinfection from Application UI +# section + 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 -from dateutil.tz._common import ZERO +from dialin.common.dg_defs import DGHeatDisinfectStates, DGChemicalDisinfectStates, DGFlushStates +from dialin.common.hd_defs import HDOpSubModes, HDOpModes + DISINFECT_TREATMENT_OBJECT = { "Chemical" : names.o_DisinfectStack_disinfectChemical_TreatmentFlowBase, "Heat" : names.o_DisinfectStack_disinfectHeat_TreatmentFlowBase, @@ -28,51 +43,53 @@ dg_simulator = DGSimulator() -def verify_right_navigation_for_chemical_disinfection(num_of_instructions): +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 + @ + """ 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") - child = object.children(waitForObject(names.o_disinfectChemical_gridSteps_Grid)) + test.verify(not object.exists(left_arrow_object), "The left navigation arrow should not be present on the first screen of instruction") + child = object.children(waitForObject(indicator_object)) for indicator in range(num_of_instructions): if child[indicator].id != "_tailStepsRepeater": - verify_bullet_navigation(num_of_instructions, indicator) - if not object.exists(names.o_disinfectChemical_rightImage_Image): + verify_bullet_navigation(num_of_instructions, indicator, indicator_object) + if not object.exists(right_arrow_object): test.log("The right navigation arrow should not be present on the last screen of instruction") break - mouseClick(waitForObject(names.o_disinfectChemical_rightImage_Image)) + mouseClick(waitForObject(right_arrow_object)) test.endSection() -def verify_left_navigation_for_chemical_disinfection(num_of_instructions): +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 """ test.startSection("Leftward instruction navigation") - 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.verify(not object.exists(right_arrow_object), "The right navigation arrow should not be present on the last screen of instruction") - child = object.children(waitForObject(names.o_disinfectChemical_gridSteps_Grid)) + child = object.children(waitForObject(indicator_object)) for indicator in range(num_of_instructions, -1, -1): if child[indicator].id != "_tailStepsRepeater": - verify_bullet_navigation(num_of_instructions, indicator) - if not object.exists(names.o_disinfectChemical_leftImage_Image): + verify_bullet_navigation(num_of_instructions, indicator, indicator_object) + if not object.exists(left_arrow_object): test.log("The left navigation arrow should not be present on the last screen of instruction") break - mouseClick(waitForObject(names.o_disinfectChemical_leftImage_Image)) + mouseClick(waitForObject(left_arrow_object)) test.endSection() -def verify_bullet_navigation(num_of_instructions, indicator): +def verify_bullet_navigation(num_of_instructions, indicator, indicator_object): """ This method verifies the properties of the bullets present in the instruction navigation screen """ test.startSection("Instruction bullet verification for screens " + str(indicator)) - child = object.children(waitForObject(names.o_disinfectChemical_gridSteps_Grid)) + child = object.children(waitForObject(indicator_object)) for instruction in range(num_of_instructions): if child[instruction].id == "_tailStepsRepeater": continue @@ -117,23 +134,30 @@ test.verify(standby_status.enabled, "Standby page should be displayed.") hd_simulator.cmd_send_hd_operation_mode(op_mode = 3, sub_mode = 2) + test.log("verification of instruction navigation from Disinfection.") + list_of_bullets = get_dynamic_bullet_count(names.o_disinfectHome_gridSteps_Grid) + 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): + hd_simulator.cmd_send_hd_disinfection_state(sub_mode = 1, flush_mode = 0, heat_mode = 0, chemical_mode = chemical_mode_state) + #verification of heat disinfection states + for heat_mode_state in range(DGHeatDisinfectStates.NUM_OF_DG_HEAT_DISINFECT_STATES.value): + hd_simulator.cmd_send_hd_disinfection_state(sub_mode = 1, flush_mode = 0, heat_mode = heat_mode_state, chemical_mode = 0) + #verification of flush disinfection states + for flush_mode_state in range(DGFlushStates.NUM_OF_DG_FLUSH_STATES.value): + hd_simulator.cmd_send_hd_disinfection_state(sub_mode = 1, flush_mode = flush_mode_state, heat_mode = 0, chemical_mode = chemical_mode_state) + + 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): - 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(): - chemical_disinfect_count = 0 - child = object.children(waitForObject(names.o_disinfectChemical_gridSteps_Grid)) + child = object.children(waitForObject(bullet_object)) for dynamic_indicator_count in range (len(child)): if child[dynamic_indicator_count].id != "_tailStepsRepeater": chemical_disinfect_count+=1 @@ -156,11 +180,11 @@ test.log("verification of instruction navigation from chemical disinfection.") - list_of_bullets = get_dynamic_bullet_count() + list_of_bullets = get_dynamic_bullet_count(names.o_disinfectChemical_gridSteps_Grid) 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) + verify_right_navigation_for_chemical_disinfection(list_of_bullets, names.o_disinfectChemical_gridSteps_Grid, names.o_disinfectChemical_leftImage_Image, names.o_disinfectChemical_rightImage_Image) test.verify(waitForObjectExists(names.o_disinfectChemical_confirmButton_TouchRect).enabled, "confirm button must be active") - verify_left_navigation_for_chemical_disinfection(list_of_bullets) + verify_left_navigation_for_chemical_disinfection(list_of_bullets, names.o_disinfectChemical_gridSteps_Grid, names.o_disinfectChemical_leftImage_Image, names.o_disinfectChemical_rightImage_Image) test.verify(not waitForObjectExists(names.o_disinfectChemical_confirmButton_TouchRect).enabled ,"confirm button must not be active") for right_arrow in range(list_of_bullets-1): @@ -223,41 +247,12 @@ utils.tstStart(__file__) startApplication(config.AUT_NAME) - #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) - 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) - - - - # 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) - - """ - utils.waitForGUI(2) - - utils.tstDone()