Index: tst_TreatmentStatesData/test.py =================================================================== diff -u -r2dc140932c71c9b21e2c60410ec0ca58e04d9771 -r9304d64222c02f0dc812ff86dc945c8deba46440 --- tst_TreatmentStatesData/test.py (.../test.py) (revision 2dc140932c71c9b21e2c60410ec0ca58e04d9771) +++ tst_TreatmentStatesData/test.py (.../test.py) (revision 9304d64222c02f0dc812ff86dc945c8deba46440) @@ -21,18 +21,19 @@ class txStates: # Saline states - SALINE_STOP_STATE = 0 - SALINE_START_STATE = 1 + SALINE_STOP_STATE = 0 + SALINE_START_STATE = 1 + SALINE_DISABLE_STATE = 2 # 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 + 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 + TREATMENT_DIALYSIS_STATE_NOT = 0 + TREATMENT_DIALYSIS_STATE = 1 def gotoScreenNtest_Contains_TreatmentStatesData(): @@ -41,60 +42,114 @@ def test_values(vSubMode, vUFState, vSalineState): - #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 + # these test cases are not always dependending to each other + if (vSubMode == txStates.TREATMENT_DIALYSIS_STATE_NOT): + test.compare( waitForObjectExists(names.o_treatmentStart_treatmentTime_section ).visible, True ) + test.compare( waitForObjectExists(names.o_treatmentStart_treatmentTime_arrowImage ).visible, True ) + test.compare( waitForObjectExists(names.o_treatmentStart_treatmentTime_second ).visible, True ) + test.compare( findObject (names.o_treatmentStart_treatmentTime_notification ).visible, False) + + if (vSubMode == txStates.TREATMENT_DIALYSIS_STATE ): + test.compare( waitForObjectExists(names.o_treatmentStart_treatmentTime_section ).visible, True ) + test.compare( findObject (names.o_treatmentStart_treatmentTime_arrowImage ).visible, False) + test.compare( findObject (names.o_treatmentStart_treatmentTime_second ).visible, False) + test.compare( waitForObjectExists(names.o_treatmentStart_treatmentTime_notification ).visible, True ) + test.compare(str(waitForObjectExists(names.o_treatmentStart_treatmentTime_notification ).text ), "Treatment Paused") + + if (vUFState == txStates.UF_PAUSED_STATE_NOT ): + test.compare( waitForObjectExists(names.o_treatmentStart_ultrafiltration_notification ).visible , False) + test.compare(str(waitForObjectExists(names.o_treatmentStart_ultrafiltration_notification ).text ) , "" ) + + if (vUFState == txStates.UF_PAUSED_STATE ): + test.compare( waitForObjectExists(names.o_treatmentStart_ultrafiltration_notification ).visible , True) + test.compare(str(waitForObjectExists(names.o_treatmentStart_ultrafiltration_notification ).text ) , "Ultrafiltration Paused" ) + + if (vSalineState == txStates.SALINE_DISABLE_STATE ): + test.compare( waitForObjectExists(names.o_treatmentStart_SalineSection ).isTouchable, False) + test.compare(str(waitForObjectExists(names.o_treatmentStart_SalineStart ).text.text), "START BOLUS") + test.compare(str(waitForObjectExists(names.o_treatmentStart_SalineNotification ).text ), "Maximum cumulative saline bolus volume delivered") + test.compare( waitForObjectExists(names.o_treatmentStart_SalineNotification ).visible, True) + print(7) + # in all the other cases it should be enabled + test.compare(waitForObjectExists(names.o_treatmentStart_SalineStart).text.enabled, vSalineState != txStates.SALINE_DISABLE_STATE) + + + if (vSalineState == txStates.SALINE_STOP_STATE ): + test.compare( waitForObjectExists(names.o_treatmentStart_ultrafiltration_section ).isTouchable, True ) + mouseClick ( waitForObject (names.o_treatmentStart_ultrafiltration_section)) + test.compare( findObject (names.o_treatmentAdjustmentUltrafiltrationStart_Screen ).visible , True ) + mouseClick ( waitForObject (names.o_closeButton)) + + if (vSalineState == txStates.SALINE_START_STATE ): + test.compare( waitForObjectExists(names.o_treatmentStart_ultrafiltration_section ).isTouchable, False ) + + def main(): utils.tstStart(__file__) - secPause = 1 + secPause = 0.5 startApplication(names.AUT_NAME) utils.waitForGUI(1) gotoScreenNtest_Contains_TreatmentStatesData() utils.waitForGUI(1) # 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 + denaliMessages.setTreatmentStatesData(txStates.TREATMENT_DIALYSIS_STATE_NOT, txStates.UF_PAUSED_STATE_NOT, txStates.SALINE_STOP_STATE ) # 0 0 0 + test_values (txStates.TREATMENT_DIALYSIS_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 + denaliMessages.setTreatmentStatesData(txStates.TREATMENT_DIALYSIS_STATE_NOT, txStates.UF_PAUSED_STATE_NOT, txStates.SALINE_START_STATE ) # 0 0 1 + test_values (txStates.TREATMENT_DIALYSIS_STATE_NOT, txStates.UF_PAUSED_STATE_NOT, txStates.SALINE_START_STATE ) # 0 0 1 utils.waitForGUI(secPause) - 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 + denaliMessages.setTreatmentStatesData(txStates.TREATMENT_DIALYSIS_STATE_NOT, txStates.UF_PAUSED_STATE_NOT, txStates.SALINE_DISABLE_STATE) # 0 0 2 + test_values (txStates.TREATMENT_DIALYSIS_STATE_NOT, txStates.UF_PAUSED_STATE_NOT, txStates.SALINE_DISABLE_STATE) # 0 0 2 + utils.waitForGUI(secPause) + + denaliMessages.setTreatmentStatesData(txStates.TREATMENT_DIALYSIS_STATE_NOT, txStates.UF_PAUSED_STATE , txStates.SALINE_STOP_STATE ) # 0 1 0 + test_values (txStates.TREATMENT_DIALYSIS_STATE_NOT, txStates.UF_PAUSED_STATE , txStates.SALINE_STOP_STATE ) # 0 1 0 + utils.waitForGUI(secPause) + + denaliMessages.setTreatmentStatesData(txStates.TREATMENT_DIALYSIS_STATE_NOT, txStates.UF_PAUSED_STATE_NOT, txStates.SALINE_START_STATE ) # 0 1 1 + test_values (txStates.TREATMENT_DIALYSIS_STATE_NOT, txStates.UF_PAUSED_STATE_NOT, txStates.SALINE_START_STATE ) # 0 1 1 + utils.waitForGUI(secPause) + + denaliMessages.setTreatmentStatesData(txStates.TREATMENT_DIALYSIS_STATE_NOT, txStates.UF_PAUSED_STATE_NOT, txStates.SALINE_DISABLE_STATE) # 0 1 2 + test_values (txStates.TREATMENT_DIALYSIS_STATE_NOT, txStates.UF_PAUSED_STATE_NOT, txStates.SALINE_DISABLE_STATE) # 0 1 2 + utils.waitForGUI(secPause) + + denaliMessages.setTreatmentStatesData(txStates.TREATMENT_DIALYSIS_STATE , txStates.UF_PAUSED_STATE_NOT, txStates.SALINE_STOP_STATE ) # 1 0 0 + test_values (txStates.TREATMENT_DIALYSIS_STATE , txStates.UF_PAUSED_STATE_NOT, txStates.SALINE_STOP_STATE ) # 1 0 0 + utils.waitForGUI(secPause) + + denaliMessages.setTreatmentStatesData(txStates.TREATMENT_DIALYSIS_STATE , txStates.UF_PAUSED_STATE_NOT, txStates.SALINE_START_STATE ) # 1 0 1 + test_values (txStates.TREATMENT_DIALYSIS_STATE , txStates.UF_PAUSED_STATE_NOT, txStates.SALINE_START_STATE ) # 1 0 1 + utils.waitForGUI(secPause) + + denaliMessages.setTreatmentStatesData(txStates.TREATMENT_DIALYSIS_STATE , txStates.UF_PAUSED_STATE_NOT, txStates.SALINE_DISABLE_STATE) # 1 0 2 + test_values (txStates.TREATMENT_DIALYSIS_STATE , txStates.UF_PAUSED_STATE_NOT, txStates.SALINE_DISABLE_STATE) # 1 0 2 + utils.waitForGUI(secPause) + + denaliMessages.setTreatmentStatesData(txStates.TREATMENT_DIALYSIS_STATE , txStates.UF_PAUSED_STATE , txStates.SALINE_STOP_STATE ) # 1 1 0 + test_values (txStates.TREATMENT_DIALYSIS_STATE , txStates.UF_PAUSED_STATE , txStates.SALINE_STOP_STATE ) # 1 1 0 + utils.waitForGUI(secPause) + + denaliMessages.setTreatmentStatesData(txStates.TREATMENT_DIALYSIS_STATE , txStates.UF_PAUSED_STATE , txStates.SALINE_START_STATE ) # 1 1 1 + test_values (txStates.TREATMENT_DIALYSIS_STATE , txStates.UF_PAUSED_STATE , txStates.SALINE_START_STATE ) # 1 1 1 + utils.waitForGUI(secPause) + + denaliMessages.setTreatmentStatesData(txStates.TREATMENT_DIALYSIS_STATE , txStates.UF_PAUSED_STATE , txStates.SALINE_DISABLE_STATE) # 1 1 2 + test_values (txStates.TREATMENT_DIALYSIS_STATE , txStates.UF_PAUSED_STATE , txStates.SALINE_DISABLE_STATE) # 1 1 2 + utils.waitForGUI(secPause) + + denaliMessages.setTreatmentStatesData(txStates.TREATMENT_DIALYSIS_STATE , txStates.UF_PAUSED_STATE , txStates.SALINE_DISABLE_STATE) # 1 1 2 + test_values (txStates.TREATMENT_DIALYSIS_STATE , txStates.UF_PAUSED_STATE , txStates.SALINE_DISABLE_STATE) # 1 1 2 + utils.waitForGUI(secPause) + + denaliMessages.setTreatmentStatesData(txStates.TREATMENT_DIALYSIS_STATE_NOT, txStates.UF_PAUSED_STATE_NOT, txStates.SALINE_STOP_STATE ) # 0 0 0 + test_values (txStates.TREATMENT_DIALYSIS_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 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(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()