Index: tst_TreatmentStatesData/test.py =================================================================== diff -u -r4aea809c4c3eaaeb674f79f550aff589e61d6739 -r2dc140932c71c9b21e2c60410ec0ca58e04d9771 --- tst_TreatmentStatesData/test.py (.../test.py) (revision 4aea809c4c3eaaeb674f79f550aff589e61d6739) +++ tst_TreatmentStatesData/test.py (.../test.py) (revision 2dc140932c71c9b21e2c60410ec0ca58e04d9771) @@ -19,45 +19,82 @@ import utils import denaliMessages - +class txStates: + # Saline states + SALINE_STOP_STATE = 0 + SALINE_START_STATE = 1 + + # UF states + # UI only cares about the actual state and _NOT could be any other state + UF_PAUSED_STATE_NOT = 0 + UF_PAUSED_STATE = 1 + + # Sub Mode + # UI only cares about the actual state and _NOT could be any other state + TREATMENT_STOP_STATE_NOT = 0 + TREATMENT_STOP_STATE = 2 + + def gotoScreenNtest_Contains_TreatmentStatesData(): - mouseClick(waitForObject(names.o_mainMenu_manager)) + mouseClick(waitForObject(names.o_treatmentHome_startTreatment)) test_values(0, 0, 0) def test_values(vSubMode, vUFState, vSalineState): - # there have been no UI object associated with these values yet. - # enable it when needed. - return None #test.compare(str(waitForObjectExists(names.o_settingsHome_TreatmentStatesData_SubMode ).text), "{:.0f}".format(vSubMode )) #test.compare(str(waitForObjectExists(names.o_settingsHome_TreatmentStatesData_UFState ).text), "{:.0f}".format(vUFState )) #test.compare(str(waitForObjectExists(names.o_settingsHome_TreatmentStatesData_SalineState ).text), "{:.0f}".format(vSalineState)) - + pass - def main(): utils.tstStart(__file__) - + secPause = 1 startApplication(names.AUT_NAME) utils.waitForGUI(1) gotoScreenNtest_Contains_TreatmentStatesData() utils.waitForGUI(1) - step = 10 - for i in range ( 10, 500, step): - denaliMessages.setTreatmentStatesData(i, i + step * 1, i + step * 2) - test_values (i, i + step * 1, i + step * 2) + # start + denaliMessages.setTreatmentStatesData(txStates.TREATMENT_STOP_STATE_NOT, txStates.UF_PAUSED_STATE_NOT, txStates.SALINE_STOP_STATE ) # 0 0 0 + test_values (txStates.TREATMENT_STOP_STATE_NOT, txStates.UF_PAUSED_STATE_NOT, txStates.SALINE_STOP_STATE ) # 0 0 0 + utils.waitForGUI(secPause) + + denaliMessages.setTreatmentStatesData(txStates.TREATMENT_STOP_STATE_NOT, txStates.UF_PAUSED_STATE_NOT, txStates.SALINE_START_STATE ) # 0 0 1 + test_values (txStates.TREATMENT_STOP_STATE_NOT, txStates.UF_PAUSED_STATE_NOT, txStates.SALINE_START_STATE ) # 0 0 1 + utils.waitForGUI(secPause) - denaliMessages.setTreatmentStatesData(100, 200, 300) - test_values (100, 200, 300) + denaliMessages.setTreatmentStatesData(txStates.TREATMENT_STOP_STATE_NOT, txStates.UF_PAUSED_STATE , txStates.SALINE_STOP_STATE ) # 0 1 0 + test_values (txStates.TREATMENT_STOP_STATE_NOT, txStates.UF_PAUSED_STATE , txStates.SALINE_STOP_STATE ) # 0 1 0 + utils.waitForGUI(secPause) - # Coverage - denaliMessages.setTreatmentStatesData(100, 200, 300) - test_values (100, 200, 300) + denaliMessages.setTreatmentStatesData(txStates.TREATMENT_STOP_STATE_NOT, txStates.UF_PAUSED_STATE_NOT, txStates.SALINE_START_STATE ) # 0 1 1 + test_values (txStates.TREATMENT_STOP_STATE_NOT, txStates.UF_PAUSED_STATE_NOT, txStates.SALINE_START_STATE ) # 0 1 1 + utils.waitForGUI(secPause) - denaliMessages.setTreatmentStatesData(0, 0, 0) - test_values (0, 0, 0) + denaliMessages.setTreatmentStatesData(txStates.TREATMENT_STOP_STATE , txStates.UF_PAUSED_STATE_NOT, txStates.SALINE_STOP_STATE ) # 1 0 0 + test_values (txStates.TREATMENT_STOP_STATE , txStates.UF_PAUSED_STATE_NOT, txStates.SALINE_STOP_STATE ) # 1 0 0 + utils.waitForGUI(secPause) + denaliMessages.setTreatmentStatesData(txStates.TREATMENT_STOP_STATE , txStates.UF_PAUSED_STATE_NOT, txStates.SALINE_START_STATE ) # 1 0 1 + test_values (txStates.TREATMENT_STOP_STATE , txStates.UF_PAUSED_STATE_NOT, txStates.SALINE_START_STATE ) # 1 0 1 + utils.waitForGUI(secPause) + + denaliMessages.setTreatmentStatesData(txStates.TREATMENT_STOP_STATE , txStates.UF_PAUSED_STATE , txStates.SALINE_STOP_STATE ) # 1 1 0 + test_values (txStates.TREATMENT_STOP_STATE , txStates.UF_PAUSED_STATE , txStates.SALINE_STOP_STATE ) # 1 1 0 + utils.waitForGUI(secPause) + + denaliMessages.setTreatmentStatesData(txStates.TREATMENT_STOP_STATE , txStates.UF_PAUSED_STATE , txStates.SALINE_START_STATE ) # 1 1 1 + test_values (txStates.TREATMENT_STOP_STATE , txStates.UF_PAUSED_STATE , txStates.SALINE_START_STATE ) # 1 1 1 + utils.waitForGUI(secPause) + + denaliMessages.setTreatmentStatesData(txStates.TREATMENT_STOP_STATE , txStates.UF_PAUSED_STATE , txStates.SALINE_START_STATE ) # 1 1 1 + test_values (txStates.TREATMENT_STOP_STATE , txStates.UF_PAUSED_STATE , txStates.SALINE_START_STATE ) # 1 1 1 + utils.waitForGUI(secPause) + + denaliMessages.setTreatmentStatesData(txStates.TREATMENT_STOP_STATE_NOT, txStates.UF_PAUSED_STATE_NOT, txStates.SALINE_STOP_STATE ) # 0 0 0 + test_values (txStates.TREATMENT_STOP_STATE_NOT, txStates.UF_PAUSED_STATE_NOT, txStates.SALINE_STOP_STATE ) # 0 0 0 + utils.waitForGUI(secPause) + utils.tstDone()