Index: suite_leahi/tst_heparin/test.py =================================================================== diff -u -r01e0f75ccca2d523d85d1898b3356bfebe2e8415 -rfb27385d1c510f6d3b433ace7e2f2e7d5dda4012 --- suite_leahi/tst_heparin/test.py (.../test.py) (revision 01e0f75ccca2d523d85d1898b3356bfebe2e8415) +++ suite_leahi/tst_heparin/test.py (.../test.py) (revision fb27385d1c510f6d3b433ace7e2f2e7d5dda4012) @@ -14,30 +14,14 @@ import names from leahi_dialin.ui import utils -from configuration import utility +from configuration import utility,config,navigation from configuration import config from leahi_dialin.ui.td_messaging import TD_Messaging from leahi_dialin.common.ui_defs import TXStates from leahi_dialin.common.td_defs import TDOpModes,TDTreatmentStates td =TD_Messaging() -heparin_off = { "Heparin Type" :"OFF", - "Dispensing Rate" :"OFF", - "Bolus Volume" :"OFF", - "Stop Time" :"OFF"} - -heparin_values = { "Heparin Type" :"Unfractionated 1,000", - "Dispensing Rate" :"0.5", - "Bolus Volume" :"0.4", - "Stop Time" :"60"} - -PAUSE = 'Pause' -ACTIVE = 'Active' -RESUME = 'Resume' -COMPLETE = 'Complete' -HEPARIN = "Heparin" - def verify_heparin_precription_parameters(heparin_value): test.startSection("Verify prescription rx parameters in heparin page") column = waitForObject(names.o_treatmentHeparin_Prescription_Column) @@ -94,7 +78,7 @@ def verify_create_treatment_parameters_Heparin_OFF(): test.startSection("Pre treatment parameters") - utility.navigation_titleBar("Rx") + navigation.navigation_pageIndicator_step(config.CREATERX) mouseClick(waitForObject(names.o_PreTreatmentCreate_pretreatmentPatientIDEntry_TextEntry)) waitForObject(names.o_PreTreatmentCreate_pretreatmentPatientIDEntry_TextEntry).text ="abcd" utility.set_value_based_on_target(names.o_PreTreatmentCreate_bloodFlowRateControl_ValueAdjuster, 50) @@ -104,11 +88,11 @@ mouseClick(names.o_PreTreatmentCreate_heparinDispensingRateControl_ValueAdjuster) utility.set_value_based_on_target(names.o_PreTreatmentCreate_dialysateTemperatureControl_ValueAdjuster,37.5) utility.set_value_based_on_target(names.o_PreTreatmentCreate_salineBolusVolumeControl_ValueAdjuster, 100) - utility.select_different_dropdown(names.o_PreTreatmentCreate_acidConcentrateComboBox_BaseComboBox,utility.ACID_CONCENTRATE,2) - utility.select_different_dropdown(names.o_PreTreatmentCreate_dialyzerTypeComboBox_BaseComboBox,utility.DIALYZER_TYPE,2) - utility.select_different_dropdown(names.o_PreTreatment_vitalsCombobox_BaseCombobox,utility.VITALS,1) - utility.select_different_dropdown(names.o_PreTreatmentCreate_bicarbonateConcentrateComboBox_BaseComboBox,utility.BICARBONATE,0) - Validatebutton = utility.setObjectText(names.o_preTreatmentStack_Text, "VALIDATE") + utility.select_different_dropdown(names.o_PreTreatmentCreate_acidConcentrateComboBox_BaseComboBox,config.ACID_CONCENTRATE,2) + utility.select_different_dropdown(names.o_PreTreatmentCreate_dialyzerTypeComboBox_BaseComboBox,config.DIALYZER_TYPE,2) + utility.select_different_dropdown(names.o_PreTreatment_vitalsCombobox_BaseCombobox,config.VITALS,1) + utility.select_different_dropdown(names.o_PreTreatmentCreate_bicarbonateConcentrateComboBox_BaseComboBox,config.BICARBONATE,0) + Validatebutton = utility.setObjectText(names.o_preTreatmentStack_Text, config.VALIDATE) mouseClick(waitForObject(Validatebutton)) td.td_Treatment_Parameters_Validation( vAccepted = 1, vBloodFlowRateRejectReason = 0, @@ -126,13 +110,13 @@ vArterialPressureLimitWindowRejectReason = 0, vVenousPressureLimitWindowRejectReason = 0, vVenousPressureLimitAsymtrcRejectReason = 0, - vTransmembranePressureLimitWindowRejectReason = 0, + vTransmembranePressureLimitWindowRejectReason= 0, vDialysateTempRejectReason = 0, vHeparinDispensingRateRejectReason = 0, vHeparinBolusVolumeRejectReason = 0 ) - confirmButton = utility.setObjectText(names.o_preTreatmentStack_Text, "CONFIRM") + confirmButton = utility.setObjectText(names.o_preTreatmentStack_Text, config.CONFIRM) mouseClick(waitForObject(confirmButton)) test.endSection() @@ -148,10 +132,10 @@ verify_create_treatment_parameters_Heparin_OFF() change_treatmentstates(TDTreatmentStates.TREATMENT_PAUSED_STATE.value) change_treatmentstates(TDTreatmentStates.TREATMENT_DIALYSIS_STATE.value) - waitForObject(names.o_listView_Item) - heparin = utility.setObjectText(text=HEPARIN, obj=names.o_listView_Item) + waitForObject(names.o_listView_Item,1000) + heparin = utility.setObjectText(text=config.HEPARIN, obj=names.o_listView_Item) mouseClick(waitForObject(heparin)) - verify_heparin_precription_parameters(heparin_off) + verify_heparin_precription_parameters(config.heparin_off) test.endSection() test.startSection("Verify prescription rx parameters in heparin page") @@ -162,10 +146,10 @@ utility.verify_create_treatment_parameters() change_treatmentstates(TDTreatmentStates.TREATMENT_PAUSED_STATE.value) change_treatmentstates(TDTreatmentStates.TREATMENT_DIALYSIS_STATE.value) - waitForObject(names.o_listView_Item) - heparin = utility.setObjectText(text=HEPARIN, obj=names.o_listView_Item) + waitForObject(names.o_listView_Item,1000) + heparin = utility.setObjectText(text=config.HEPARIN, obj=names.o_listView_Item) mouseClick(waitForObject(heparin)) - verify_heparin_precription_parameters(heparin_values) + verify_heparin_precription_parameters(config.heparin_values) test.endSection() test.startSection("Verify the Heparin states") @@ -174,13 +158,13 @@ time_remaining = 2646 ) - verify_status_heparinStates(4,PAUSE,ACTIVE) + verify_status_heparinStates(4,config.PAUSE,config.ACTIVE) pauseButton = waitForObject(names.o_treatmentHeparin_heparinButton_TouchRect) pauseText = utility.findObjectById(pauseButton, "_text") mouseClick(pauseText) - verify_status_heparinStates(2,RESUME,PAUSE) + verify_status_heparinStates(2,config.RESUME,config.PAUSE) td.td_tx_state(TDTreatmentStates.TREATMENT_DIALYSIS_STATE.value, 0 , @@ -195,7 +179,7 @@ ) status = waitForObject(names.o_treatmentHeparin_status_Rectangle) statustext = utility.findObjectById(status,'_statusText') - test.compare(COMPLETE, statustext.text,"Status text should be ->"+str(COMPLETE)) + test.compare(config.COMPLETE, statustext.text,"Status text should be ->"+str(config.COMPLETE)) test.endSection() utils.tstDone()