Index: suite_leahi/shared/scripts/names.py =================================================================== diff -u -r7f1494be6698015140f5cb32b60ae9f30f176497 -r846e5728f53a1183edfc8e506ffe2e28afea1103 --- suite_leahi/shared/scripts/names.py (.../names.py) (revision 7f1494be6698015140f5cb32b60ae9f30f176497) +++ suite_leahi/shared/scripts/names.py (.../names.py) (revision 846e5728f53a1183edfc8e506ffe2e28afea1103) @@ -27,18 +27,16 @@ o_PreTreatmentCreate_bloodFlowRate_LabelUnitContainer = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_bloodFlowRate", "type": "LabelUnitContainer", "unnamed": 1 } o_PreTreatmentCreate_bloodFlowRateControl_ValueAdjuster = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_bloodFlowRateControl", "type": "ValueAdjuster", "unnamed": 1 } o_PatientIDEntry_TextEntry = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_pretreatmentPatientIDEntry", "type": "TextEntry", "unnamed": 1 } -keyboard_input = {"container": o_Gui_MainView, "type": "Text", "unnamed": 1, "visible": True } o_PreTreatmentCreate_dialysateFlowRateControl_ValueAdjuster = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_dialysateFlowRateControl", "type": "ValueAdjuster", "unnamed": 1 } o_PreTreatmentCreate_durationControl_ValueAdjuster = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_durationControl", "type": "ValueAdjuster", "unnamed": 1 } o_PreTreatmentCreate_heparinBolusVolumeControl_ValueAdjuster = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_heparinBolusVolumeControl", "type": "ValueAdjuster", "unnamed": 1 } o_PreTreatmentCreate_heparinDispensingRateControl_ValueAdjuster = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_heparinDispensingRateControl", "type": "ValueAdjuster", "unnamed": 1 } -o_PreTreatmentCreate_heparinDispensingRate_LabelUnitContainer = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_heparinDispensingRate", "type": "LabelUnitContainer", "unnamed": 1, } +o_PreTreatmentCreate_heparinDispensingRate_LabelUnitContainer = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_heparinDispensingRate", "type": "LabelUnitContainer", "unnamed": 1, } o_PreTreatmentCreate_heparinDispensingRateControl_OffText = {"container": o_PreTreatmentCreate_heparinDispensingRateControl_ValueAdjuster, "type": "Text", "unnamed": 1 } o_PreTreatmentCreate_heparinStopTimeControl_ValueAdjuster = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_heparinStopTimeControl", "type": "ValueAdjuster", "unnamed": 1 } o_PreTreatmentCreate_dialysateTemperatureControl_ValueAdjuster = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_dialysateTemperatureControl", "type": "ValueAdjuster", "unnamed": 1 } o_PreTreatmentCreate_salineBolusVolumeControl_ValueAdjuster = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_salineBolusVolumeControl", "type": "ValueAdjuster", "unnamed": 1 } -o_PreTreatmentCreate_bpMeasurementIntervalControl_ValueAdjuster = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_bpMeasurementIntervalControl", "type": "ValueAdjuster", "unnamed": 1 } -o_PreTreatmentCreate_heparinBolusVolume_LabelUnitContainer = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_heparinBolusVolume", "type": "LabelUnitContainer", "unnamed": 1 } +o_PreTreatmentCreate_heparinBolusVolume_LabelUnitContainer = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_heparinBolusVolume", "type": "LabelUnitContainer", "unnamed": 1 } o_PreTreatmentCreate_heparinBolusVolume_Off_Text = {"container": o_PreTreatmentCreate_heparinBolusVolumeControl_ValueAdjuster, "type": "Text", "unnamed": 1 } o_PreTreatmentCreate_dialyzerTypeComboBox_BaseComboBox = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_dialyzerTypeComboBox", "type": "BaseComboBox", "unnamed": 1 } o_saveButton_TouchRect = {"container": o_Overlay, "id": "_saveButton", "type": "TouchRect", "unnamed": 1 } @@ -57,9 +55,6 @@ o_PreTreatmentCreate_dialyzerType_LabelUnitContainer = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_dialyzerType", "type": "LabelUnitContainer", "unnamed": 1 } o_PreTreatmentCreate_dialysateTemperature_LabelUnitContainer = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_dialysateTemperature", "type": "LabelUnitContainer", "unnamed": 1 } o_PreTreatmentCreate_salineBolusVolume_LabelUnitContainer = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_salineBolusVolume", "type": "LabelUnitContainer", "unnamed": 1 } -o_PreTreatmentCreate_bpMeasurementInterval_LabelUnitContainer = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_bpMeasurementInterval", "type": "LabelUnitContainer", "unnamed": 1 } -keyboard_switch = {"container": o_Gui_MainView, "id": "_shiftKeyIcon", "source": "qrc:/plugins/QtQuick/VirtualKeyboard/Styles/denali/images/iShiftNormal.svg", "type": "Image", "unnamed": 1 } -keyboard_switch2 = {"container": o_Gui_MainView, "id": "_shiftKeyIcon", "source": "qrc:/plugins/QtQuick/VirtualKeyboard/Styles/denali/images/iShiftActive.svg", "type": "Image", "unnamed": 1 } o_potassium_LabelUnitContainer = {"container": o_Overlay, "id": "_potassium", "type": "LabelUnitContainer", "unnamed": 1 } o_potassium_leftArrow_IconButton = {"container": o_potassium_LabelUnitContainer, "id": "_leftArrow", "type": "IconButton", "unnamed": 1 } o_calcium_LabelUnitContainer = {"container": o_Overlay, "id": "_calcium", "type": "LabelUnitContainer", "unnamed": 1 } @@ -73,4 +68,4 @@ o_PreTreatmentCreate_heprainStopTime_slider_Slider = {"container": o_PreTreatmentCreate_heparinStopTimeControl_ValueAdjuster, "id": "_slider", "type": "Slider", "unnamed": 1 } o_PreTreatmentCreate_dialysateTemperature_slider_Slider = {"container": o_PreTreatmentCreate_dialysateTemperatureControl_ValueAdjuster, "id": "_slider", "type": "Slider", "unnamed": 1 } o_PreTreatmentCreate_salineBolusVolume_slider_Slider = {"container": o_PreTreatmentCreate_salineBolusVolumeControl_ValueAdjuster, "id": "_slider", "type": "Slider", "unnamed": 1 } -o_PreTreatmentCreate_bpMeasurementInterval_slider_Slider = {"container": o_PreTreatmentCreate_bpMeasurementIntervalControl_ValueAdjuster, "id": "_slider", "type": "Slider", "unnamed": 1 } + Index: suite_leahi/tst_create_treatment/test.py =================================================================== diff -u -r2b2de3e46f857fbd47186f4b7f38f6955d2e61fc -r846e5728f53a1183edfc8e506ffe2e28afea1103 --- suite_leahi/tst_create_treatment/test.py (.../test.py) (revision 2b2de3e46f857fbd47186f4b7f38f6955d2e61fc) +++ suite_leahi/tst_create_treatment/test.py (.../test.py) (revision 846e5728f53a1183edfc8e506ffe2e28afea1103) @@ -98,111 +98,27 @@ "blood_pressure_measurement_interval" : [5, 5, 60], } -PATIENT_ID_COMBINATION = { - "qwertyuio-2345678901" : "qwertyuio-2345678901", - } - 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"] +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"] 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"] + "Dialyzer Type", "Dialysate Temperature"] 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 ] + names.o_PreTreatmentCreate_salineBolusVolume_LabelUnitContainer ] BUTTON_TYPE =["Select Rx","Edit Rx","Clear All"] -def keyboard_object_map_helper(text): - """ - Method for setting custom object property's for keyboard keys - @return: required object property's for keys - """ - if text is not None: - names.keyboard_input["text"] = text - return names.keyboard_input - else: - test.log("Invalid ",text," for object.") - names.o_keyboard_input["text"] = "Q" - -def keyboard_switching_section(text): - """ - Tests to automate keyboard based on user input - @return: key text (text displayed on keyboard) - """ - keyboard_value = keyboard_object_map_helper(text) - object_status = object.exists(keyboard_value) - if object_status is True: - return text - else: - #Tests to get status of keys in keyboard layout - object_status = object.exists(keyboard_object_map_helper(KEYBOARD_SWITCH[1])) - if object_status is True: - keyboard_value = keyboard_object_map_helper(KEYBOARD_SWITCH[1]) - utils.waitForGUI(.3) - mouseClick(waitForObject(keyboard_value)) - keyboard_value = keyboard_object_map_helper(text) - object_status = object.exists(keyboard_value) - if object_status is True: - return text - object_status = object.exists(keyboard_object_map_helper(KEYBOARD_SWITCH[0])) - if object_status is True: - keyboard_value = keyboard_object_map_helper(KEYBOARD_SWITCH[0]) - mouseClick(waitForObject(keyboard_value)) - keyboard_value = keyboard_object_map_helper(text) - object_status = object.exists(keyboard_value) - if object_status is True: - return text - object_status = object.exists(names.keyboard_switch2) - if object_status is True: - keyboard_value = waitForObject(names.keyboard_switch2) - mouseClick(keyboard_value) - text = text.lower() - keyboard_value = keyboard_object_map_helper(text) - object_status = object.exists(keyboard_value) - if object_status is True: - return text - object_status = object.exists(names.keyboard_switch) - if object_status is True: - keyboard_value = waitForObject(names.keyboard_switch) - mouseClick(keyboard_value) - text = text.lower() - keyboard_value = keyboard_object_map_helper(text) - object_status = object.exists(keyboard_value) - if object_status is True: - return text - - -def verify_valid_patient_id_through_keypad(expected_value, actual_value): - """ - Tests verifies valid patient id set through application keyboard setup . - @return: N/A - """ - patient_id_input = waitForObject(names.o_PatientIDEntry_TextEntry) - mouseClick(names.o_PatientIDEntry_TextEntry) - for text in expected_value: - keyword_state = keyboard_switching_section(text) - if keyword_state is not None: - keyboard_value = keyboard_object_map_helper(keyword_state) - mouseClick(waitForObject(keyboard_value)) - utils.waitForGUI(.2) - - test.compare(actual_value, (patient_id_input.text), "Patient id should be -> "+ str(actual_value)) - test.log("User successfully authenticated through patient id -> " + expected_value + "using keypad.") - - # mouseClick(waitForObject(names.o_create_back_button)) def get_bullet_object(screen_obj, num): """ To obtain a bullet object based on occurrence provided. @@ -347,13 +263,7 @@ for saline_bolus in CREATE_TREATMENT_PARAMETER_RANGE[SALINE_BOLUS_VOLUME]: set_value_based_on_target(names.o_PreTreatmentCreate_salineBolusVolumeControl_ValueAdjuster, saline_bolus) test.endSection() - - test.startSection("Verification of BP Measurement Interval") - test.compare(waitForObject(names.o_PreTreatmentCreate_bpMeasurementInterval_LabelUnitContainer).text, BLOOD_PRESSURE_MEASUREMENT_INTERVAL, "Parameter should be -> "+str(BLOOD_PRESSURE_MEASUREMENT_INTERVAL)) - for bp_measurement_interval in CREATE_TREATMENT_PARAMETER_RANGE[BLOOD_PRESSURE_MEASUREMENT_INTERVAL]: - set_value_based_on_target(names.o_PreTreatmentCreate_bpMeasurementIntervalControl_ValueAdjuster,bp_measurement_interval) - test.endSection() - + test.startSection("Verification of acid concentrate type") test.compare(waitForObject(names.o_PreTreatmentCreate_acidConcentrate_LabelUnitContainer).text, ACID_CONCENTRATE_TITLE, "Parameter should be -> "+str(ACID_CONCENTRATE_TITLE)) mouseClick(waitForObject(names.o_acidConcentrate_editbutton)) @@ -504,13 +414,7 @@ for saline_bolus in CREATE_TREATMENT_PARAMETER[SALINE_BOLUS_VOLUME]: set_value_based_on_target(names.o_PreTreatmentCreate_salineBolusVolumeControl_ValueAdjuster, saline_bolus) test.endSection() - - test.startSection("Verification of BP Measurement Interval") - test.compare(waitForObject(names.o_PreTreatmentCreate_bpMeasurementInterval_LabelUnitContainer).text, BLOOD_PRESSURE_MEASUREMENT_INTERVAL, "Parameter should be -> "+str(BLOOD_PRESSURE_MEASUREMENT_INTERVAL)) - for bp_measurement_interval in CREATE_TREATMENT_PARAMETER[BLOOD_PRESSURE_MEASUREMENT_INTERVAL]: - set_value_based_on_target(names.o_PreTreatmentCreate_bpMeasurementIntervalControl_ValueAdjuster,bp_measurement_interval) - test.endSection() - + td.td_operation_mode(TDOpModes.MODE_PRET.value, 0) test.endSection() @@ -714,6 +618,7 @@ test.startSection("Verifying slider functionality of custom treatment") td.td_operation_mode(TDOpModes.MODE_STAN.value) td.td_operation_mode(TDOpModes.MODE_TPAR.value, 0 ) + utils.waitForGUI(10) set_value_with_slider(names.o_PreTreatmentCreate_bloodFlowRateControl_ValueAdjuster,names.o_PreTreatmentCreate_bloodFlowRate_slider_Slider,BLOOD_FLOW_RATE) set_value_with_slider(names.o_PreTreatmentCreate_dialysateFlowRateControl_ValueAdjuster,names.o_PreTreatmentCreate_dialysateFlowRate_slider_Slider,DIALYSATE_FLOW_RATE) set_value_with_slider(names.o_PreTreatmentCreate_durationControl_ValueAdjuster,names.o_PreTreatmentCreate_duration_slider_Slider,DURATION) @@ -722,7 +627,7 @@ set_value_with_slider(names.o_PreTreatmentCreate_heparinStopTimeControl_ValueAdjuster,names.o_PreTreatmentCreate_heprainStopTime_slider_Slider,HEPARIN_STOP_TIME) set_value_with_slider(names.o_PreTreatmentCreate_dialysateTemperatureControl_ValueAdjuster,names.o_PreTreatmentCreate_dialysateTemperature_slider_Slider,DIALYSATE_TEMPERATURE) set_value_with_slider(names.o_PreTreatmentCreate_salineBolusVolumeControl_ValueAdjuster,names.o_PreTreatmentCreate_salineBolusVolume_slider_Slider,SALINE_BOLUS_VOLUME) - set_value_with_slider(names.o_PreTreatmentCreate_bpMeasurementIntervalControl_ValueAdjuster,names.o_PreTreatmentCreate_bpMeasurementInterval_slider_Slider,BLOOD_PRESSURE_MEASUREMENT_INTERVAL) + # set_value_with_slider(names.o_PreTreatmentCreate_bpMeasurementIntervalControl_ValueAdjuster,names.o_PreTreatmentCreate_bpMeasurementInterval_slider_Slider,BLOOD_PRESSURE_MEASUREMENT_INTERVAL) test.endSection() def main(): @@ -737,18 +642,18 @@ td.td_operation_mode(TDOpModes.MODE_TPAR.value, 0) 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.o_PatientIDEntry_TextEntry)) - - - for expected_patient_id, actual_patient_id in PATIENT_ID_COMBINATION.items(): - verify_valid_patient_id_through_keypad(expected_patient_id, actual_patient_id) + waitForObject(names.o_PatientIDEntry_TextEntry).text ="3456" verify_create_custom_treatment_parameter() test.endSection() test.startSection("Verify the validate function with out entering Patient ID") + td.td_operation_mode(TDOpModes.MODE_STAN.value) + # verify Standby screen + test.verify(waitForObjectExists(names.o_standByScreen_MainHome), "In Standby") + td.td_operation_mode(TDOpModes.MODE_TPAR.value, 0) verify_create_custom_treatment_parameter() test.endSection() @@ -761,4 +666,5 @@ verify_custom_treatment_record_rejected() - test.endSection() + utils.tstDone() +