Index: suite_leahi/tst_create_treatment/test.py =================================================================== diff -u -rfc2ce7fc0911c43127dd55ce45f305618ca8ffc9 -r393a84695cb4efd5f77675bbb6aadac0711bb18c --- suite_leahi/tst_create_treatment/test.py (.../test.py) (revision fc2ce7fc0911c43127dd55ce45f305618ca8ffc9) +++ suite_leahi/tst_create_treatment/test.py (.../test.py) (revision 393a84695cb4efd5f77675bbb6aadac0711bb18c) @@ -27,7 +27,7 @@ PRE_TREATMENT_STEP = 0 PRE_TREATMENT_SCREENS = ["Create" , "Sample" , "Consumables" , "Disposables" , "Prime" , "BP/HR" , "Ultrafiltration" , "Connection" , "Start"] COMPLETE_COLOR = '#4696f7' -ENABLED_COLOR = '#fcfcfc' +CURRENT_COLOR = '#000000' PRESCRIPTION_TITLE = "Prescription" BLOOD_FLOW_RATE = "Blood Flow Rate" DIALYSATE_FLOW_RATE = "Dialysate Flow Rate" @@ -59,15 +59,15 @@ "Rinseback Flow Rate" : [75], } CREATE_TREATMENT_PARAMETER_RANGE = { - "Blood Flow Rate" : [50.0,500.0], - "Dialysate Flow Rate" : [50.0,600.0], - "Duration" : [60.0,480.0], - "Heparin Bolus Volume" : [0.2,2.0], - "Heparin Dispensing Rate" : [0.2,1.0], + "Blood Flow Rate" : [50.0,270.0,500.0], + "Dialysate Flow Rate" : [50.0,325.0,600.0], + "Duration" : [60.0,270.0,480.0], + "Heparin Bolus Volume" : [0.2,1.0,2.0], + "Heparin Dispensing Rate" : [0.2,0.5,1.0], "Heparin Stop Time" : [60.0,480.0], - "Saline Bolus Volume" : [100,300], - "Dialysate Temperature" : [35.0, 38.0], - "BP Measurement Interval" : [5,60], + "Saline Bolus Volume" : [100,200,300], + "Dialysate Temperature" : [35.0, 37.5,38.0], + "BP Measurement Interval" : [5,30,60], } @@ -79,26 +79,32 @@ "username" : "username", "sA@MpLE#123" : "sAMpLE123", "A@BH&321" : "ABH321", - "5432@qwerty" : "5432qwerty" + "5432@qwerty" : "5432qwerty", + "abcd-SAMPLe" : "abcd-SAMPLe" } COLOR_CODES = "#ffa500" -DIALYZER_TYPE = ["Diacap Pro 13H", "Diacap Pro 16H", "Diacap Pro 19H", "Optiflux F160NRe", "Optiflux F180NRe", "Optiflux F200NRe","Optiflux F250NRe"] -KEYBOARD_SWITCH = ["ABC", "&123"] -ACID_CONCENTRATE = ["0.0 K, 0.00 Ca, 1 Mg", "3.0 K, 2.5 Ca, 1 Mg","2.0 K, 2.5 Ca, 1 Mg","1.0 K, 2.5 Ca, 1 Mg"] -CREATE_TREATMENT_PARAMETERS = ["Blood Flow Rate", "Dialysate Flow Rate", "Duration","Heparin Dispensing Rate", - "Heparin Bolus Volume","Heparin Stop Time", "Saline Bolus", "Dialysate Temperature", - "Blood Pressure Measurement Interval"] +DIALYZER_TYPE = ["Diacap Pro 13H", "Diacap Pro 16H", "Diacap Pro 19H", "Optiflux F160NRe", "Optiflux F180NRe", "Optiflux F200NRe","Optiflux F250NRe"] +KEYBOARD_SWITCH = ["ABC", "&123"] +ACID_CONCENTRATE = ["0.0 K, 0.00 Ca, 1 Mg", "3.0 K, 2.5 Ca, 1 Mg","2.0 K, 2.5 Ca, 1 Mg","1.0 K, 2.5 Ca, 1 Mg"] +CREATE_TREATMENT_PARAMETERS = ["Blood Flow Rate", "Dialysate Flow Rate", + "Duration", "Heparin Bolus Volume", + "Heparin Dispensing Rate", "Heparin Stop Time", + "Acid Concentrate", "Bicarbonate Concentrate", + "Dialyzer Type", "Dialysate Temperature", + "Saline Bolus Volume", "BP Measurement Interval"] -CREATE_TREATEMENT_OBJ =[names.o_PreTreatmentCreate_bloodFlowRate_LabelUnitContainer ,names.o_PreTreatmentCreate_dialysateFlowRate_LabelUnitContainer, - names.o_PreTreatmentCreate_duration_LabelUnitContainer ,names.o_PreTreatmentCreate_heparinBolusVolume_LabelUnitContainer, - names.o_PreTreatmentCreate_heparinDispensingRate_LabelUnitContainer ,names.o_PreTreatmentCreate_heparinStopTime_LabelUnitContainer, - names.o_PreTreatmentCreate_acidConcentrate_LabelUnitContainer ,names.o_PreTreatmentCreate_bicarbonateConcentrate_LabelUnitContainer, - names.o_PreTreatmentCreate_dialyzerType_LabelUnitContainer ,names.o_PreTreatmentCreate_dialysateTemperature_LabelUnitContainer, - names.o_PreTreatmentCreate_salineBolusVolume_LabelUnitContainer ,names.o_PreTreatmentCreate_bpMeasurementInterval_LabelUnitContainer ] +CREATE_TREATEMENT_OBJ =[names.o_PreTreatmentCreate_bloodFlowRate_LabelUnitContainer ,names.o_PreTreatmentCreate_dialysateFlowRate_LabelUnitContainer, + names.o_PreTreatmentCreate_duration_LabelUnitContainer ,names.o_PreTreatmentCreate_heparinBolusVolume_LabelUnitContainer, + names.o_PreTreatmentCreate_heparinDispensingRate_LabelUnitContainer ,names.o_PreTreatmentCreate_heparinStopTime_LabelUnitContainer, + names.o_PreTreatmentCreate_acidConcentrate_LabelUnitContainer ,names.o_PreTreatmentCreate_bicarbonateConcentrate_LabelUnitContainer, + names.o_PreTreatmentCreate_dialyzerType_LabelUnitContainer ,names.o_PreTreatmentCreate_dialysateTemperature_LabelUnitContainer, + names.o_PreTreatmentCreate_salineBolusVolume_LabelUnitContainer ,names.o_PreTreatmentCreate_bpMeasurementInterval_LabelUnitContainer ] + + def keyboard_object_map_helper(text): """ Method for setting custom object property's for keyboard keys @@ -189,6 +195,16 @@ names.o_bullet_object["occurrence"] = num + 1 return names.o_bullet_object +def get_text_object(screen_obj, txt): + """ + To obtain a text object based on text provided + @param screen_obj: provides the container on which the txt must be present + @returns a real name object + """ + names.o_text_object["container"] = screen_obj + names.o_text_object["text"] = txt + return names.o_text_object + def verify_page_step_indicator(screen_obj, 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] @@ -210,7 +226,7 @@ #To verify the step indicators of the current treatment screen elif page == treatment_step: test.compare(bullet_border_color, COMPLETE_COLOR) - test.compare(step_title.color.name, ENABLED_COLOR) + # test.compare(step_title.color.name, ENABLED_COLOR) #To verify the step indicators of the remaining treatment screens else: test.verify(not squish.waitForObjectExists(get_bullet_object(screen_obj, page)).complete) @@ -256,15 +272,15 @@ test.startSection("Verification of heparin dispensing rate values") test.compare(waitForObject(names.o_PreTreatmentCreate_Heparin_Dispensing_Rate_Text).text, HEPARIN_DISPENSING_RATE, "Parameter should be -> "+str(HEPARIN_DISPENSING_RATE)) mouseClick(waitForObject(names.o_PreTreatmentCreate_heparinDispensingRateControl_ValueAdjuster)) - test.compare(OFF_TEXT, waitForObject(names.PreTreatmentCreate_heparinDispensingRateControl_OffText).text, "OFF text should be enabled") + test.compare(OFF_TEXT, waitForObject(names.o_PreTreatmentCreate_heparinDispensingRateControl_OffText).text, "OFF text should be enabled") # test.compare(OFF_TEXT, waitForObject(names.PreTreatmentCreate_heparinStopTime_OffText).text, "OFF text should be enabled for heparin stop values") for heparin_dispensing_rate in CREATE_TREATMENT_PARAMETER_RANGE[HEPARIN_DISPENSING_RATE]: set_value_based_on_target(names.o_PreTreatmentCreate_heparinDispensingRateControl_ValueAdjuster, heparin_dispensing_rate) test.endSection() test.startSection("Verification of heparin stop time values") set_value_based_on_target(names.o_PreTreatmentCreate_heparinDispensingRateControl_ValueAdjuster, "0.2") - set_value_based_on_target(names.o_PreTreatmentCreate_durationControl_ValueAdjuster, "60") + set_value_based_on_target(names.o_PreTreatmentCreate_durationControl_ValueAdjuster, "480") test.compare(waitForObject(names.o_PreTreatmentCreate_Heparin_Stop_Time_Text).text, HEPARIN_STOP_TIME, "Parameter should be -> "+str(HEPARIN_STOP_TIME)) for heparin_stop_time in CREATE_TREATMENT_PARAMETER_RANGE[HEPARIN_STOP_TIME]: set_value_based_on_target(names.o_PreTreatmentCreate_heparinStopTimeControl_ValueAdjuster, heparin_stop_time) @@ -541,12 +557,14 @@ test.log(f"✅ Target value reached: {current_value}") + + def set_parameter_type(text,obj): """ Method to set object property based on text @param text : (string) treatment parameter text """ - names.o_operating_parameters["text"] = text + obj["text"] = text return obj def verify_custom_treatment_record_rejected(): @@ -579,10 +597,12 @@ ) for expected_treatment_title,object in zip(CREATE_TREATMENT_PARAMETERS,CREATE_TREATEMENT_OBJ): + parameter_object = set_parameter_type(text = expected_treatment_title,obj =object) parameter_text = waitForObject(parameter_object) parameter_text_color = parameter_text.border.color.name test.compare(COLOR_CODES, parameter_text_color, "parameter color should be ' \red for' " + expected_treatment_title +" , if the confirmation get rejected !") + test.endSection() def main(): @@ -595,8 +615,9 @@ test.verify(waitForObjectExists(names.standByScreen_MainHome), "In Standby") td.td_operation_mode(TDOpModes.MODE_TPAR.value, 0 ) - test.compare(waitForObject(names.o_PreTreatmentCreate_Prescription_Text).text, PRESCRIPTION_TITLE, "Title text should be -> "+str(PRESCRIPTION_TITLE)) + test.startSection("Verfiy the treatement parameter validation") + test.compare(waitForObject(names.o_PreTreatmentCreate_Prescription_Text).text, PRESCRIPTION_TITLE, "Title text should be -> "+str(PRESCRIPTION_TITLE)) verify_page_step_indicator(screen_obj=names.o_PreTreatmentCreate_gridSteps_Grid, treatment_step=PRE_TREATMENT_STEP, treatment_screens=PRE_TREATMENT_SCREENS) test.log("Verify the Patient ID field") mouseClick(waitForObject(names.PatientIDEntry_TextEntry)) @@ -608,4 +629,5 @@ verfiy_clearall_Button() verify_custom_treatment_record_rejected() - + + test.endSection()