Index: config.xml =================================================================== diff -u -reabfecc1d8d205f4b8888b99158c54f5ac92ae4e -r9173ebd0962929fe8ab341b7f731d6adb39a0368 --- config.xml (.../config.xml) (revision eabfecc1d8d205f4b8888b99158c54f5ac92ae4e) +++ config.xml (.../config.xml) (revision 9173ebd0962929fe8ab341b7f731d6adb39a0368) @@ -4,8 +4,4 @@ -<<<<<<< HEAD - -======= ->>>>>>> create_custom_treatment Index: shared/scripts/configuration/config.py =================================================================== diff -u -r956fd22d63adc5ebecc6320221df8a60ce069a4a -r9173ebd0962929fe8ab341b7f731d6adb39a0368 --- shared/scripts/configuration/config.py (.../config.py) (revision 956fd22d63adc5ebecc6320221df8a60ce069a4a) +++ shared/scripts/configuration/config.py (.../config.py) (revision 9173ebd0962929fe8ab341b7f731d6adb39a0368) @@ -14,7 +14,9 @@ ############################################################################ import os +from configuration.strings import * + AUT_NAME = "denaliSquish" COMMON_PATH = os.environ['HOME']+"/Projects" @@ -29,6 +31,7 @@ COMPLETE_COLOR= '#4290ec' ENABLED_COLOR = '#fcfcfc' INCOMPLETE_COLOR = '#607a91' +OUT_OF_RANGE_COLOR = "#c53b33" #standby mode @@ -77,85 +80,23 @@ UF_MAXIMUM_SLIDER_WIDTH = 638.00 UF_VALID_RANGE = 700 TRAINING_INDICATOR_SCREEN = 4 -DIASTOLIC_TEXT = "diastolic" -SYSTOLIC_TEXT = "systolic" -OUT_OF_RANGE_COLOR = "#c53b33" -IN_RANGE_COLOR = "#fcfcfc" -HEART_RATE_TITLE = "Heart Rate" -BLOOD_PRESSURE_TITLE = "Blood Pressure" -BLOOD_PRESSURE_UNIT = "mmHg" -HEART_RATE_UNIT = "BPM" -PATIENT_CONNECTION_TEXT = "Patient Connection" -UF_VOLUME_TEXT = "Ultrafiltration Volume (L)" -UF_TITLE_TEXT = "Ultrafiltration Setup" -BP_HR_TEXT = "BP/HR" -SKIP_TEXT = "SKIP" -TUTORIAL_TEXT = { - 0 : "Wash your hands and establish vascular access per your clinic's instructions.", - 1 : "Pinch arterial clamp and venous clamp on located on the cartridge patient lines.", - 2 : "Remove arterial and venous shunt.", - 3 : "Connect arterial and venous cartridge lines to your patient access lines." -} +TREATMENT_ULTRAFILTERATION_TESTING_OPTION = { + "OPTION_1" : {"uf_maximum" : 800, "uf_minimum" : 0}, + "OPTION_2" : {"uf_maximum" : 500, "uf_minimum" : 0}, + "OPTION_3" : {"uf_maximum" : 550, "uf_minimum" : 0}, + "OPTION_4" : {"uf_maximum" : 300, "uf_minimum" : 0}, + "OPTION_5" : {"uf_maximum" : 280, "uf_minimum" : 0}, + "OPTION_6" : {"uf_maximum" : 765, "uf_minimum" : 0}, + "OPTION_7" : {"uf_maximum" : 680, "uf_minimum" : 0}, + "OPTION_8" : {"uf_maximum" : 1500, "uf_minimum" : 0}, + "OPTION_9" : {"uf_maximum" : 390, "uf_minimum" : 0}, + "OPTION_10" : {"uf_maximum" : 800, "uf_minimum" : 0}, + "OPTION_11" : {"uf_maximum" : 1000, "uf_minimum" : 0}, + "OPTION_12" : {"uf_maximum" : 1250, "uf_minimum" : 0}, + } -PRE_TREATMENT_SCREENS = { - 1 : "Create" , - 2 : "Sample" , - 3 : "Consumables" , - 4 : "Disposables" , - 5 : "Prime" , - 6 : "Ultrafiltration" , - 7 : "BP/HR" , - 8 : "Connection" , - 9 : "Start" -} -# 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_NO_NEW_TREATMENT_ALARM_TRIGGERED" , # Treatment cannot initiate if an alarm with no new treatment property has triggered before - 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 -} - - NUM_OF_REQUEST_REJECT_REASONS = 39 Index: shared/scripts/configuration/strings.py =================================================================== diff -u --- shared/scripts/configuration/strings.py (revision 0) +++ shared/scripts/configuration/strings.py (revision 9173ebd0962929fe8ab341b7f731d6adb39a0368) @@ -0,0 +1,102 @@ + +########################################################################### +# +# Copyright (c) 2019-2021 Diality Inc. - All Rights Reserved. +# +# 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 strings.py +# +# @author (last) LTTS +# @date (last) 18-Jan-2022 +# +############################################################################ + + +#standby mode +BLOOD_PRIMING_TEXT = "Blood Priming" +SALINE_UNIT = "mL" +BLOOD_PRIMING_DEFAULT_VALUE = "0 mL" + + +# pretreatment_patient_connection +DIASTOLIC_TEXT = "diastolic" +SYSTOLIC_TEXT = "systolic" +OUT_OF_RANGE_COLOR = "#c53b33" +IN_RANGE_COLOR = "#fcfcfc" +HEART_RATE_TITLE = "Heart Rate" +BLOOD_PRESSURE_TITLE = "Blood Pressure" +BLOOD_PRESSURE_UNIT = "mmHg" +HEART_RATE_UNIT = "BPM" +PATIENT_CONNECTION_TEXT = "Patient Connection" +UF_VOLUME_TEXT = "Ultrafiltration Volume (L)" +UF_TITLE_TEXT = "Ultrafiltration Setup" +BP_HR_TEXT = "BP/HR" +SKIP_TEXT = "SKIP" +TUTORIAL_TEXT = { + 0 : "Wash your hands and establish vascular access per your clinic's instructions.", + 1 : "Pinch arterial clamp and venous clamp on located on the cartridge patient lines.", + 2 : "Remove arterial and venous shunt.", + 3 : "Connect arterial and venous cartridge lines to your patient access lines." +} + +PRE_TREATMENT_SCREENS = { + 1 : "Create" , + 2 : "Sample" , + 3 : "Consumables" , + 4 : "Disposables" , + 5 : "Prime" , + 6 : "Ultrafiltration" , + 7 : "BP/HR" , + 8 : "Connection" , + 9 : "Start" +} + + +# 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_NO_NEW_TREATMENT_ALARM_TRIGGERED" , # Treatment cannot initiate if an alarm with no new treatment property has triggered before + 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 +} + + Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r956fd22d63adc5ebecc6320221df8a60ce069a4a -r9173ebd0962929fe8ab341b7f731d6adb39a0368 --- shared/scripts/configuration/utility.py (.../utility.py) (revision 956fd22d63adc5ebecc6320221df8a60ce069a4a) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 9173ebd0962929fe8ab341b7f731d6adb39a0368) @@ -12,15 +12,16 @@ # ############################################################################ - +import names import sys import test -import names import object import squish from configuration import config from builtins import int as pyInt +from builtins import str as pyStr + def start_application(app_name): """ @@ -152,14 +153,14 @@ test.endSection() -def training_screen_indicator_verification(current_indicator, training_items_object): +def instruction_screen_indicator_verification(current_indicator, training_items_object): """ Method to verify the pre treatment tutorial indicators on top of the screen which indicates the steps passed, current, remained] @param current_indicator :(int) Current pre-treatment tutorial indicator @param training_items_object :(dictionary) pre_treatment bullet object @return N/A """ - test.startSection("Method to verify the Page Step indicators from patient connection section") + test.startSection("Method to verify the Page Step indicators from training screen") for page in range(config.TRAINING_INDICATOR_SCREEN): occurrence_index = 10 + page #1-9 occurrence of object belongs to page indicators, 10 - 13 occurrence of object belongs to training indicators training_items_object["occurrence"] = occurrence_index @@ -187,3 +188,70 @@ test.endSection() + +def verify_color_of_entry(entry = 0, vital_parameter = None, input_field = None): + """ + Method to verify the color of entry of systolic, diastolic and heart rate + @param entry: (int) user entered value + @param vital_parameter - (str) parameter name under which user is entering value (sys/dia/heart rate) + @param input_field - (obj) object of input field + """ + test.startSection("Verify the color of {} value {}".format(vital_parameter, entry)) + input_field_color = input_field.color.name + entry = pyInt(entry) + if vital_parameter is config.SYSTOLIC_TEXT: + if (entry < config.SYSTOLIC_LOWER_LIMIT) or (entry > config.SYSTOLIC_UPPER_LIMIT): + test.compare(input_field_color, config.OUT_OF_RANGE_COLOR, "systolic value {} is out of range, systolic value should be in range of {} and {}".format(entry, config.SYSTOLIC_LOWER_LIMIT, config.SYSTOLIC_UPPER_LIMIT)) + elif (entry >= config.SYSTOLIC_LOWER_LIMIT) and (entry <= config.SYSTOLIC_UPPER_LIMIT): + test.compare(input_field_color, config.ENABLED_COLOR, "systolic value {} is in range of {} and {}".format(entry, config.SYSTOLIC_LOWER_LIMIT, config.SYSTOLIC_UPPER_LIMIT)) + elif vital_parameter is config.DIASTOLIC_TEXT: + if (entry < config.DIASTOLIC_LOWER_LIMIT) or (entry > config.DIASTOLIC_UPPER_LIMIT): + test.compare(input_field_color, config.OUT_OF_RANGE_COLOR, "diastolic value {} is out of range, diastolic value should be in range of {} and {}".format(entry, config.DIASTOLIC_LOWER_LIMIT, config.DIASTOLIC_UPPER_LIMIT)) + elif (entry >= config.DIASTOLIC_LOWER_LIMIT) and (entry <= config.DIASTOLIC_UPPER_LIMIT): + test.compare(input_field_color, config.ENABLED_COLOR, "diastolic value {} is in range of {} and {}".format(entry, config.DIASTOLIC_LOWER_LIMIT, config.DIASTOLIC_UPPER_LIMIT)) + elif vital_parameter is config.HEART_RATE_TITLE: + if (entry < config.HEART_RATE_LOWER_LIMIT) or (entry > config.HEART_RATE_UPPER_LIMIT): + test.compare(input_field_color, config.OUT_OF_RANGE_COLOR, "Heart Rate value {} is out of range, Heart Rate value should be in range of {} and {}".format(entry, config.HEART_RATE_LOWER_LIMIT, config.HEART_RATE_UPPER_LIMIT)) + elif (entry >= config.HEART_RATE_LOWER_LIMIT) and (entry <= config.HEART_RATE_UPPER_LIMIT): + test.compare(input_field_color,config.ENABLED_COLOR, "Heart Rate value {} is in range of {} and {}".format(entry, config.HEART_RATE_LOWER_LIMIT, config.HEART_RATE_UPPER_LIMIT)) + test.endSection() + + +def keypad_input(key_value): + """ + Method to enter values using application UI keyboard + @param key_value: (str) User expected value + """ + if key_value is not None: + names.o_keypad_input["text"] = key_value + return names.o_keypad_input + else: + test.log("Invalid text for object.") + names.o_keypad_input["text"] = None + + +def enter_keypad_value(entry): + """ + Method to enter user desired + value using keypad + @param entry: (str) User expected value + """ + test.startSection("Entering {}".format(entry)) + entry = pyStr(entry) #type casted into string format + for value in entry: + squish.mouseClick(squish.waitForObject(keypad_input(value))) + test.endSection() + + +def erase_entered_value(input_field): + """ + Method to erase the entered value + @param input_field - (obj) object of input field + """ + input_field = squish.waitForObject(input_field).text + for value in input_field: + squish.mouseClick(squish.waitForObjectExists(names.o_back_space_key)) + + test.log("user cleared pre-used value") + + Index: shared/scripts/names.py =================================================================== diff -u -r956fd22d63adc5ebecc6320221df8a60ce069a4a -r9173ebd0962929fe8ab341b7f731d6adb39a0368 --- shared/scripts/names.py (.../names.py) (revision 956fd22d63adc5ebecc6320221df8a60ce069a4a) +++ shared/scripts/names.py (.../names.py) (revision 9173ebd0962929fe8ab341b7f731d6adb39a0368) @@ -119,4 +119,8 @@ o_pop_up_systolic_input_field = {"container": o_treatmentStack_TreatmentStack, "echoMode": 0, "id": "_input", "type": "TextInput", "unnamed": 1, "visible": True} o_pop_up_diastolic_input_field = {"container": o_treatmentStack_TreatmentStack, "echoMode": 0, "id": "_input", "occurrence": 2, "type": "TextInput", "unnamed": 1, "visible": True} o_pop_up_heart_rate_input_field = {"backgroundcolor": "#254670", "container": o_treatmentStack_TreatmentStack, "echoMode": 0, "id": "_input", "occurrence": 3, "type": "TextInput", "unnamed": 1, "visible": True} +o_PreTreatmentBase_gridSteps_Grid = {"container": o_PreTreatmentConsumblesStack_PreTreatmentBase_TreatmentFlowBase_2, "id": "_gridSteps", "occurrence": 2, "type": "Grid", "unnamed": 1, "visible": True} +o_PreTreatmentBase_indicator_StepIndicator = {"container": o_PreTreatmentConsumblesStack_PreTreatmentBase_TreatmentFlowBase_2, "id": "_indicator", "type": "StepIndicator", "unnamed": 1, "visible": True} +o_PreTreatmentBase_headStepBullet_StepBullet = {"container": o_PreTreatmentConsumblesStack_PreTreatmentBase_TreatmentFlowBase_2, "id": "_headStepBullet", "occurrence": 2, "type": "StepBullet", "unnamed": 1, "visible": True} +o_PreTreatmentBase_gridStepsRest_Grid_2 = {"container": o_PreTreatmentConsumblesStack_PreTreatmentBase_TreatmentFlowBase_2, "id": "_gridStepsRest", "occurrence": 10, "type": "Grid", "unnamed": 1, "visible": True} Index: suite.conf =================================================================== diff -u -r75b5f2a93fc13f944d268961901be981dec4bfbe -r9173ebd0962929fe8ab341b7f731d6adb39a0368 --- suite.conf (.../suite.conf) (revision 75b5f2a93fc13f944d268961901be981dec4bfbe) +++ suite.conf (.../suite.conf) (revision 9173ebd0962929fe8ab341b7f731d6adb39a0368) @@ -1,4 +1,7 @@ -AUT=denaliSquish +AUT= +ENVVARS=envvars +HOOK_SUB_PROCESSES=false +IMPLICITAUTSTART=0 LANGUAGE=Python OBJECTMAPSTYLE=script TEST_CASES=tst_environment tst_post tst_standbymode tst_In_treatment tst_case1 Index: tst_pre_treatment_patient_connection/test.py =================================================================== diff -u -r956fd22d63adc5ebecc6320221df8a60ce069a4a -r9173ebd0962929fe8ab341b7f731d6adb39a0368 --- tst_pre_treatment_patient_connection/test.py (.../test.py) (revision 956fd22d63adc5ebecc6320221df8a60ce069a4a) +++ tst_pre_treatment_patient_connection/test.py (.../test.py) (revision 9173ebd0962929fe8ab341b7f731d6adb39a0368) @@ -18,7 +18,6 @@ from dialin.ui.hd_simulator import HDSimulator from dialin.ui import utils from configuration import config, utility -from builtins import int as pyInt from builtins import str as pyStr hd_simulator = HDSimulator() @@ -29,22 +28,6 @@ CONNECTION_PRE_TREATMENT_STEPS = 7 -TREATMENT_ULTRAFILTERATION_TESTING_OPTION = { - "OPTION_1" : {"uf_maximum" : 800, "uf_minimum" : 0}, - "OPTION_2" : {"uf_maximum" : 500, "uf_minimum" : 0}, - "OPTION_3" : {"uf_maximum" : 550, "uf_minimum" : 0}, - "OPTION_4" : {"uf_maximum" : 300, "uf_minimum" : 0}, - "OPTION_5" : {"uf_maximum" : 280, "uf_minimum" : 0}, - "OPTION_6" : {"uf_maximum" : 765, "uf_minimum" : 0}, - "OPTION_7" : {"uf_maximum" : 680, "uf_minimum" : 0}, - "OPTION_8" : {"uf_maximum" : 1500, "uf_minimum" : 0}, - "OPTION_9" : {"uf_maximum" : 390, "uf_minimum" : 0}, - "OPTION_10" : {"uf_maximum" : 800, "uf_minimum" : 0}, - "OPTION_11" : {"uf_maximum" : 1000, "uf_minimum" : 0}, - "OPTION_12" : {"uf_maximum" : 1250, "uf_minimum" : 0}, - } - - def test_rejection_message_patient_connection(accept_status): """ verification of rejection messages during patient connection. @@ -60,44 +43,6 @@ test.endSection() -def keypad_input(key_value): - """ - Method to enter values using application UI keyboard - @param key_value: (str) User expected value - """ - if key_value is not None: - names.o_keypad_input["text"] = key_value - return names.o_keypad_input - else: - test.log("Invalid text for object.") - names.o_keypad_input["text"] = None - - -def enter_keypad_value(entry): - """ - Method to enter user desired - value using keypad - @param entry: (str) User expected value - """ - test.startSection("Entering {}".format(entry)) - entry = pyStr(entry) #type casted into string format - for value in entry: - mouseClick(waitForObject(keypad_input(value))) - test.endSection() - - -def erase_entered_value(input_field): - """ - Method to erase the entered value - @param input_field - (obj) object of input field - """ - input_field = waitForObject(input_field).text - for value in input_field: - mouseClick(squish.waitForObjectExists(names.o_back_space_key)) - - test.log("user cleared pre-used value") - - def verify_entered_valid_vital_entries_in_main_treatment_screen(sys_val, dia_val, heart_rate): """ method to enter systolic, diastolic and heart rate value and save or unsave it and verify @@ -109,95 +54,77 @@ """ test.startSection("Verify the entered systolic, diastolic and heart rate value updated in main-treatement screen") mouseClick(waitForObject(names.o_PreTreatmentBase_bloodPressureSystolic_TextEntry)) - erase_entered_value(names.o_PreTreatmentBase_input_TextInput_2) - enter_keypad_value(sys_val) + utility.erase_entered_value(names.o_PreTreatmentBase_input_TextInput_2) + utility.enter_keypad_value(sys_val) test.verify(waitForObjectExists(names.o_PreTreatmentBase_bloodPressureSystolic_TextEntry).enabled, "systolic combo box should be enabled.") test.compare(waitForObjectExists(names.o_PreTreatmentBase_bloodPressureSystolic_TextEntry).text, str(sys_val), "systolic value should be : "+str(sys_val)) - verify_color_of_entry(entry = sys_val, vital_parameter = config.SYSTOLIC_TEXT, input_field = waitForObject(names.o_PreTreatmentBase_input_TextInput_2)) + utility.verify_color_of_entry(entry = sys_val, vital_parameter = config.SYSTOLIC_TEXT, input_field = waitForObject(names.o_PreTreatmentBase_input_TextInput_2)) mouseClick(waitForObject(names.o_PreTreatmentBase_input_TextInput_3)) - erase_entered_value(names.o_PreTreatmentBase_input_TextInput_3) - enter_keypad_value(dia_val) + utility.erase_entered_value(names.o_PreTreatmentBase_input_TextInput_3) + utility.enter_keypad_value(dia_val) test.verify(waitForObjectExists(names.o_PreTreatmentBase_bloodPressureDiastolic_TextEntry).enabled, "diastolic value should be enabled.") test.compare(waitForObjectExists(names.o_PreTreatmentBase_bloodPressureDiastolic_TextEntry).text, str(dia_val), "diastolic value should be : "+str(dia_val)) - verify_color_of_entry(entry = dia_val, vital_parameter = config.DIASTOLIC_TEXT, input_field = waitForObject(names.o_PreTreatmentBase_input_TextInput_3)) + utility.verify_color_of_entry(entry = dia_val, vital_parameter = config.DIASTOLIC_TEXT, input_field = waitForObject(names.o_PreTreatmentBase_input_TextInput_3)) mouseClick(waitForObject(names.o_PreTreatmentBase_input_TextInput_4)) - erase_entered_value(names.o_PreTreatmentBase_input_TextInput_4) - enter_keypad_value(heart_rate) + utility.erase_entered_value(names.o_PreTreatmentBase_input_TextInput_4) + utility.enter_keypad_value(heart_rate) test.verify(waitForObjectExists(names.o_PreTreatmentBase_heartRate_TextEntry).enabled, "diastolic value should be enabled.") test.compare(waitForObjectExists(names.o_PreTreatmentBase_heartRate_TextEntry).text, str(heart_rate), "diastolic value should be : "+str(dia_val)) - verify_color_of_entry(entry = heart_rate, vital_parameter = config.HEART_RATE_TITLE, input_field = waitForObject(names.o_PreTreatmentBase_input_TextInput_4)) + utility.verify_color_of_entry(entry = heart_rate, vital_parameter = config.HEART_RATE_TITLE, input_field = waitForObject(names.o_PreTreatmentBase_input_TextInput_4)) test.endSection() - - -def verify_color_of_entry(entry = 0, vital_parameter = None, input_field = None): - """ - Method to verify the color of entry of systolic, diastolic and heart rate - @param entry: (int) user entered value - @param vital_parameter - (str) parameter name under which user is entering value (sys/dia/heart rate) - @param input_field - (obj) object of input field - """ - test.startSection("Verify the color of {} value {}".format(vital_parameter, entry)) - input_field_color = input_field.color.name - entry = pyInt(entry) - if vital_parameter is config.SYSTOLIC_TEXT: - if (entry < config.SYSTOLIC_LOWER_LIMIT) or (entry > config.SYSTOLIC_UPPER_LIMIT): - test.compare(input_field_color, config.OUT_OF_RANGE_COLOR, "systolic value {} is out of range, systolic value should be in range of {} and {}".format(entry, config.SYSTOLIC_LOWER_LIMIT, config.SYSTOLIC_UPPER_LIMIT)) - elif (entry >= config.SYSTOLIC_LOWER_LIMIT) and (entry <= config.SYSTOLIC_UPPER_LIMIT): - test.compare(input_field_color, config.IN_RANGE_COLOR, "systolic value {} is in range of {} and {}".format(entry, config.SYSTOLIC_LOWER_LIMIT, config.SYSTOLIC_UPPER_LIMIT)) - elif vital_parameter is config.DIASTOLIC_TEXT: - if (entry < config.DIASTOLIC_LOWER_LIMIT) or (entry > config.DIASTOLIC_UPPER_LIMIT): - test.compare(input_field_color, config.OUT_OF_RANGE_COLOR, "diastolic value {} is out of range, diastolic value should be in range of {} and {}".format(entry, config.DIASTOLIC_LOWER_LIMIT, config.DIASTOLIC_UPPER_LIMIT)) - elif (entry >= config.DIASTOLIC_LOWER_LIMIT) and (entry <= config.DIASTOLIC_UPPER_LIMIT): - test.compare(input_field_color, config.IN_RANGE_COLOR, "diastolic value {} is in range of {} and {}".format(entry, config.DIASTOLIC_LOWER_LIMIT, config.DIASTOLIC_UPPER_LIMIT)) - elif vital_parameter is config.HEART_RATE_TITLE: - if (entry < config.HEART_RATE_LOWER_LIMIT) or (entry > config.HEART_RATE_UPPER_LIMIT): - test.compare(input_field_color, config.OUT_OF_RANGE_COLOR, "Heart Rate value {} is out of range, Heart Rate value should be in range of {} and {}".format(entry, config.HEART_RATE_LOWER_LIMIT, config.HEART_RATE_UPPER_LIMIT)) - elif (entry >= config.HEART_RATE_LOWER_LIMIT) and (entry <= config.HEART_RATE_UPPER_LIMIT): - test.compare(input_field_color,config.IN_RANGE_COLOR, "Heart Rate value {} is in range of {} and {}".format(entry, config.HEART_RATE_LOWER_LIMIT, config.HEART_RATE_UPPER_LIMIT)) - test.endSection() - + -def test_patient_connection_instruction_screen(screen_indicator): +def test_patient_connection_instruction_screen(): """ verification of patient connection instruction screen @param slider_value: (int) value of the slider to set. @return N/A """ - test.startSection("verification of instruction screen -> " + str(screen_indicator+1)) - #Forward navigation of tutorial pages - for instruction_screen in range(screen_indicator): - mouseClick(waitForObject(names.o_PreTreatmentBase_rightImage_Image)) + test.startSection("verification of instruction screen ") - test.compare(waitForObjectExists(names.o_PreTreatmentBase_Patient_Connection_Text).text, config.PATIENT_CONNECTION_TEXT, "Patient connection text should be {msg}".format(msg=config.PATIENT_CONNECTION_TEXT)) - test.compare(waitForObjectExists(names.o_swipeview_tutorial_text).enabled, True, "Tutorial text should be enabled.") - #FIXME : Tutorial texts have bug. avoiding verification till fix - utility.training_screen_indicator_verification(screen_indicator, names.o_PreTreatmentBase_Indicators) - if screen_indicator == 3: - test.verify(waitForObjectExists(names.o_PreTreatmentBase_Continue_Text).enabled, "continue button should be disabled") - else: - test.verify(not waitForObjectExists(names.o_PreTreatmentBase_Continue_Text).enabled, "continue button should be disabled") + #Method to get number of instruction screens for patient connection during run time. + childObjects = object.children(waitForObject(names.o_PreTreatmentBase_gridSteps_Grid)) + #Initializing instruction_screen as 0, and type casting instruction_screen as integer. + instruction_screen = 0 + for child in childObjects: + if str(child.id) != "_tailStepsRepeater": + instruction_screen = instruction_screen + 1 + - #Reverse navigation of tutorial pages - for instruction_screen in range(screen_indicator): - mouseClick(waitForObject(names.o_PreTreatmentBase_leftImage_Image)) + for screen_indicator in range(instruction_screen): + #Forward navigation of tutorial pages + for instruction_screen in range(screen_indicator): + mouseClick(waitForObject(names.o_PreTreatmentBase_rightImage_Image)) + test.compare(waitForObjectExists(names.o_PreTreatmentBase_Patient_Connection_Text).text, config.PATIENT_CONNECTION_TEXT, "Patient connection text should be {msg}".format(msg=config.PATIENT_CONNECTION_TEXT)) + test.compare(waitForObjectExists(names.o_swipeview_tutorial_text).enabled, True, "Tutorial text should be enabled.") + utility.instruction_screen_indicator_verification(screen_indicator, names.o_PreTreatmentBase_Indicators) + if screen_indicator == 3: + test.verify(waitForObjectExists(names.o_PreTreatmentBase_Continue_Text).enabled, "continue button should be disabled") + else: + test.verify(not waitForObjectExists(names.o_PreTreatmentBase_Continue_Text).enabled, "continue button should be disabled") + + #Reverse navigation of tutorial pages + for instruction_screen in range(screen_indicator): + mouseClick(waitForObject(names.o_PreTreatmentBase_leftImage_Image)) + test.endSection() -def drag_and_drop_ultrafilteration_slider(slider_value = 0, maximum_ultrafilteration = 0): +def drag_and_drop_ultrafiltration_slider(slider_value = 0, maximum_ultrafiltration = 0): """ - Tests to verify ultrafilteration slider range + Tests to verify ultrafiltration slider range @param slider_value: (int) value of the slider to set. """ - slider_buffer = (config.UF_MAXIMUM_SLIDER_WIDTH/(maximum_ultrafilteration/100)) * slider_value + slider_buffer = (config.UF_MAXIMUM_SLIDER_WIDTH/(maximum_ultrafiltration/100)) * slider_value slider_width = slider_buffer + config.UF_MINIMUM_SLIDER_WIDTH mouseClick(waitForObject(names.o_PreTreatmentUltrafiltration_volumeSlider_Slider), slider_width , 3, Qt.LeftButton) @@ -217,21 +144,20 @@ -def start_test_treatment_ultrafilteration(ultrafilteration_range): +def start_test_treatment_ultrafiltration(ultrafiltration_range): """ - Test slider movement of ultrafilteration volume. - @param ultrafilteration_range: (dictionary) uf minimum and uf maximum volume. + Test slider movement of ultrafiltration volume. + @param ultrafiltration_range: (dictionary) uf minimum and uf maximum volume. @return: N/A """ - test.startSection("verification of ultrafilteration slider hacing" +str(ultrafilteration_range)+ " adjustment") - min_uf = ultrafilteration_range["uf_minimum"] - max_uf = ultrafilteration_range["uf_maximum"] + test.startSection("verification of ultrafiltration slider hacing" +str(ultrafiltration_range)+ " adjustment") + min_uf = ultrafiltration_range["uf_minimum"] + max_uf = ultrafiltration_range["uf_maximum"] hd_simulator.cmd_set_treatment_parameter_ranges(0, 100, 0, max_uf, 0, 0) for uf_value in range(1, (max_uf//100)+1, 1): - drag_and_drop_ultrafilteration_slider(uf_value, max_uf) + drag_and_drop_ultrafiltration_slider(uf_value, max_uf) test.compare(utils.l2ml(waitForObjectExists(names.o_PreTreatmentUltrafiltration_volumeSlider_Slider).maximum), max_uf, "maximum uf value should be :" + str(max_uf)) - #FIXME: minimum value of the slider is unchanged based on simulator input test.compare(utils.l2ml(waitForObjectExists(names.o_PreTreatmentUltrafiltration_volumeSlider_Slider).minimum), min_uf, "minimum uf value should be :" + str(min_uf)) test.compare(waitForObjectExists(names.o_PreTreatmentUltrafiltration_Ultrafiltration_Volume_Text).text, config.UF_VOLUME_TEXT, "uf volume text should be " + config.UF_VOLUME_TEXT) test.compare(waitForObjectExists(names.o_PreTreatmentUltrafiltration_Ultrafiltration_Setup_Text).text, config.UF_TITLE_TEXT, "uf title text should be "+config.UF_TITLE_TEXT) @@ -303,16 +229,8 @@ utility.page_step_indicator_verification(UF_PRE_TREATMENT_STEPS, names.o_PreTreatmentUltrafiltration_Indicators) #verification of uf slider based on edge condition. - start_test_treatment_ultrafilteration(TREATMENT_ULTRAFILTERATION_TESTING_OPTION["OPTION_1"]) - start_test_treatment_ultrafilteration(TREATMENT_ULTRAFILTERATION_TESTING_OPTION["OPTION_2"]) - start_test_treatment_ultrafilteration(TREATMENT_ULTRAFILTERATION_TESTING_OPTION["OPTION_3"]) - start_test_treatment_ultrafilteration(TREATMENT_ULTRAFILTERATION_TESTING_OPTION["OPTION_4"]) - start_test_treatment_ultrafilteration(TREATMENT_ULTRAFILTERATION_TESTING_OPTION["OPTION_5"]) - start_test_treatment_ultrafilteration(TREATMENT_ULTRAFILTERATION_TESTING_OPTION["OPTION_6"]) - start_test_treatment_ultrafilteration(TREATMENT_ULTRAFILTERATION_TESTING_OPTION["OPTION_7"]) - start_test_treatment_ultrafilteration(TREATMENT_ULTRAFILTERATION_TESTING_OPTION["OPTION_8"]) - start_test_treatment_ultrafilteration(TREATMENT_ULTRAFILTERATION_TESTING_OPTION["OPTION_9"]) - start_test_treatment_ultrafilteration(TREATMENT_ULTRAFILTERATION_TESTING_OPTION["OPTION_10"]) + for ranges in config.TREATMENT_ULTRAFILTERATION_TESTING_OPTION: + start_test_treatment_ultrafiltration(config.TREATMENT_ULTRAFILTERATION_TESTING_OPTION[ranges]) #verification of rejection message test_rejection_message_patient_connection(accept_status = False) @@ -330,10 +248,7 @@ utility.page_step_indicator_verification(CONNECTION_PRE_TREATMENT_STEPS, names.o_PreTreatmentBase_nextStepsBullet_StepBullet) #verification of tutorial section - test_patient_connection_instruction_screen(screen_indicator = 0) - test_patient_connection_instruction_screen(screen_indicator = 1) - test_patient_connection_instruction_screen(screen_indicator = 2) - test_patient_connection_instruction_screen(screen_indicator = 3) + test_patient_connection_instruction_screen() utils.tstDone()