Index: suite_leahi/tst_solution_infusion/test.py =================================================================== diff -u -r88cc7fe95f2dccaf433dae76aa929a4568795102 -r9e9fb3fcb3825db1635bd4be27e49c5e0d354b8a --- suite_leahi/tst_solution_infusion/test.py (.../test.py) (revision 88cc7fe95f2dccaf433dae76aa929a4568795102) +++ suite_leahi/tst_solution_infusion/test.py (.../test.py) (revision 9e9fb3fcb3825db1635bd4be27e49c5e0d354b8a) @@ -3,7 +3,7 @@ # Python import os import can - +from configuration import config # plugin specific from leahi_dialin.common.msg_defs import MsgIds, MsgFieldPositions from leahi_dialin.protocols import CAN @@ -17,7 +17,7 @@ import names -salineBolusStartState = "-1" +salineBolusStartState = None def main(): td_interface = TD_Messaging() @@ -32,7 +32,7 @@ message_id, handle_solution_infusion_request) - + startApplication("leahi") test.log("Starting leahi") @@ -59,11 +59,11 @@ # verify saline text salineTextObj = waitForObject(names.salineDeliveredText) - test.compare(salineTextObj.text, "Total Saline Delivered", "Testing 'Total Saline Delivered' text") + test.compare(salineTextObj.text, config.TOTAL_FLUID_DELIVERED, "Testing 'Total Saline Delivered' text") # verify send start bolus req message mouseClick(waitForObject(names.startFluidButton)) - test.verify(waitFor("'salineBolusStartState == 1'", 5000), "Testing UI -> TD message start bolus") + test.verify(waitFor(lambda: salineBolusStartState == 1, 5000), "Testing UI -> TD message start bolus") # change state to in progress td_interface.td_tx_state( @@ -84,7 +84,7 @@ test.compare(treatmentSaline.isStarted, True, "Testing vTDTreatmentStates.sbRunning") # verify text - test.compare(salineTextObj.text, "Delivering Saline", "Testing Saline Description text") + test.compare(salineTextObj.text, config.DELIVERING_FLUID, "Testing Saline Description text") # verify saline data bolusValueInTest = 75 @@ -105,7 +105,7 @@ # verify send stop bolus req message mouseClick(waitForObject(names.startFluidButton)) - test.verify(waitFor("'salineBolusStartState == 0'", 5000), "Testing UI -> TD message stop bolus") + test.verify(waitFor(lambda: salineBolusStartState == 0, 5000), "Testing UI -> TD message stop bolus") # change state to idle td_interface.td_tx_state( @@ -134,9 +134,5 @@ index = MsgFieldPositions.START_POS_FIELD_1 state,index = conversions.bytearray_to_integer( message, index) global salineBolusStartState - salineBolusStartState = str(state) - - - - - \ No newline at end of file + salineBolusStartState = state + \ No newline at end of file