Index: suite_leahi/tst_create_treatment/test.py =================================================================== diff -u -r0917bcb39a7346b452e56e961d19c928a71ef608 -rf110ca9e178cb56b02ed6329dc7c98e579998fba --- suite_leahi/tst_create_treatment/test.py (.../test.py) (revision 0917bcb39a7346b452e56e961d19c928a71ef608) +++ suite_leahi/tst_create_treatment/test.py (.../test.py) (revision f110ca9e178cb56b02ed6329dc7c98e579998fba) @@ -84,7 +84,6 @@ } - CREATE_TREATMENT_SLIDER_VALUES = { "Blood Flow Rate" : [60, 10, 500], "Dialysate Flow Rate" : [50, 10, 600], @@ -99,6 +98,8 @@ } COLOR_CODES = "#ffa500" +VALIDATE = "VALIDATE" +CONFIRM = "CONFIRM" DIALYZER_TYPE = ["Diacap Pro 13H","Diacap Pro 16H", "Diacap Pro 19H", "Optiflux F160NRe", "Optiflux F180NRe", "Optiflux F200NRe","Optiflux F250NRe"] ACID_CONCENTRATE = ["2.0 K, 2.00 Ca, 1 Mg", "1.0 K, 2.50 Ca, 1 Mg","2.0 K, 2.50 Ca, 1 Mg","3.0 K, 2.50 Ca, 1 Mg"] @@ -148,8 +149,7 @@ test.verify(not squish.waitForObjectExists(utility.get_bullet_object(screen_obj, page)).complete) test.compare(bullet_circle_color, CURRENT_COLOR) test.endSection() - - + def verify_create_custom_treatment_parameter(): """ Method to set create custom treatment slider value based on slider buffer @@ -208,10 +208,13 @@ utility.click_left_until_off(names.o_PreTreatmentCreate_heparinDispensingRateControl_ValueAdjuster) test.compare(waitForObjectExists(names.o_PreTreatmentCreate_heparinStopTime_OFF_Text).text,"OFF") - # # 3. Change Heparin Dispensising Rate from OFF to 0.2 -> Verify Heparin Stop Time "active" property is set to off + # 3. Change Heparin Dispensising Rate from OFF to 0.2 -> Verify Heparin Stop Time "active" property is set to off utility.set_value_based_on_target(o_PreTreatmentCreate_heparinDispensingRateControl_ValueAdjuster, 0.2) test.compare(waitForObjectExists(names.o_PreTreatmentCreate_heparinStopTime_OFF_Text).text,"-- --") - # # 4. When Duration is set to a value -> Verify the max Heparin Stop Time is the Duration value that is set + heprain_Stop_time = waitForObject(names.o_PreTreatmentCreate_heparinStopTimeControl_ValueAdjuster) + test.compare(heprain_Stop_time.isActive,False, "Heprain stop time active property is set to False") + + # 4. When Duration is set to a value -> Verify the max Heparin Stop Time is the Duration value that is set utility.set_value_based_on_target(names.o_PreTreatmentCreate_durationControl_ValueAdjuster, 90) utility.set_value_based_on_target(names.o_PreTreatmentCreate_heparinStopTimeControl_ValueAdjuster, 90) test.compare(waitForObjectExists(names.o_PreTreatmentCreate_heparinStopTimeControl_ValueAdjuster).value,90.0) @@ -271,12 +274,11 @@ test.compare(waitForObject(names.o_PreTreatmentCreate_dialyzerTypeComboBox_BaseComboBox).currentText, DIALYZER_TYPE[5], "Dialyzer type value should be :"+str(DIALYZER_TYPE[5])) utility.select_different_dropdown(names.o_PreTreatmentCreate_dialyzerTypeComboBox_BaseComboBox,DIALYZER_TYPE,6) test.compare(waitForObject(names.o_PreTreatmentCreate_dialyzerTypeComboBox_BaseComboBox).currentText, DIALYZER_TYPE[6], "Dialyzer type value should be :"+str(DIALYZER_TYPE[6])) - test.endSection() utility.select_different_dropdown(names.o_PreTreatment_vitalsCombobox_BaseCombobox,VITALS,2) utility.select_different_dropdown(names.o_PreTreatmentCreate_bicarbonateConcentrateComboBox_BaseComboBox,BICARBONATE,0) - test.verify(waitForObjectExists(names.o_PreTreatmentCreate_qrCode_Image), "QR Code is visible") + #Verify all the parameters are populated test.compare(waitForObject(names.o_PreTreatmentCreate_bloodFlowRateControl_ValueAdjuster).value, 500) test.compare(waitForObject(names.o_PreTreatmentCreate_dialysateFlowRateControl_ValueAdjuster).value, 600) @@ -288,10 +290,12 @@ test.compare(waitForObject(names.o_PreTreatmentCreate_dialysateTemperatureControl_ValueAdjuster).value, 38.0) test.compare(waitForObject(names.o_PreTreatmentCreate_salineBolusVolumeControl_ValueAdjuster).value, 300) - - confirmButton = waitForObject(names.o_PreTreatmentButton) - test.compare(confirmButton.enabled, True, "Confirm button is enabled") - mouseClick(waitForObject(confirmButton)) + validateButton = waitForObject(names.o_PreTreatmentButton) + #Check the button text + validateText = waitForObject(utility.button_text_obj(VALIDATE)) + test.compare(validateText.text, VALIDATE, "Button text should be"+str(VALIDATE)) + test.compare(validateButton.enabled, True, "Validate button is enabled") + mouseClick(waitForObject(validateButton)) td.td_Treatment_Parameters_Validation( vAccepted = 1, vBloodFlowRateRejectReason = 0, vDialysateFlowRateRejectReason = 0, @@ -313,6 +317,13 @@ vHeparinDispensingRateRejectReason = 0, vHeparinBolusVolumeRejectReason = 0 ) + test.compare(waitForObjectExists(names.o_PreTreatmentCreate_qrCode_Image).visible, True,"QR Code is visible") + #Check the confirm button text and perform the mouse click + confirmButton = waitForObject(names.o_PreTreatmentButton) + confirmText = waitForObject(utility.button_text_obj(CONFIRM)) + test.compare(confirmText.text, CONFIRM, "Button text should be"+str(CONFIRM)) + test.compare(confirmButton.enabled, True, "Confirm button is enabled") + mouseClick(waitForObject(confirmButton)) td.td_operation_mode(TDOpModes.MODE_PRET.value, 0) test.endSection() @@ -371,7 +382,6 @@ utility.set_value_based_on_target(names.o_PreTreatmentCreate_heparinBolusVolumeControl_ValueAdjuster, heparin_bolus_volume) test.endSection() - test.startSection("Verification of heparin dispensing rate values") test.compare(waitForObject(names.o_PreTreatmentCreate_heparinDispensingRate_LabelUnitContainer).text, HEPARIN_DISPENSING_RATE, "Parameter should be -> "+str(HEPARIN_DISPENSING_RATE)) mouseClick(waitForObject(names.o_PreTreatmentCreate_heparinDispensingRateControl_ValueAdjuster)) @@ -468,7 +478,7 @@ for expected_treatment_title,object in zip(CREATE_TREATMENT_PARAMETERS,CREATE_TREATEMENT_OBJ): - parameter_object = utility.set_property_text(text = expected_treatment_title,obj =object) + parameter_object = utility.set_Object_Text(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 !")