Index: shared/scripts/configuration/config.py =================================================================== diff -u -raa03be2cda4bdcfa89e3b771057109146b23292a -r63cac10e2deafc48f480d71773a4d67539c57738 --- shared/scripts/configuration/config.py (.../config.py) (revision aa03be2cda4bdcfa89e3b771057109146b23292a) +++ shared/scripts/configuration/config.py (.../config.py) (revision 63cac10e2deafc48f480d71773a4d67539c57738) @@ -116,3 +116,6 @@ NUM_OF_REQUEST_REJECT_REASONS = 43 +ACCEPTED = True +REJECTED = False + Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r0cc92d3b75bfb96dc4ecafd760a9ce15e455033b -r63cac10e2deafc48f480d71773a4d67539c57738 --- shared/scripts/configuration/utility.py (.../utility.py) (revision 0cc92d3b75bfb96dc4ecafd760a9ce15e455033b) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 63cac10e2deafc48f480d71773a4d67539c57738) @@ -108,3 +108,5 @@ raise LookupError("zone object is not in view to the user after " + \ "trying 100 times") + + Index: shared/scripts/names.py =================================================================== diff -u -rdd4aa7ac57cbf17bcf07f84af1c9efcae7afd718 -r63cac10e2deafc48f480d71773a4d67539c57738 --- shared/scripts/names.py (.../names.py) (revision dd4aa7ac57cbf17bcf07f84af1c9efcae7afd718) +++ shared/scripts/names.py (.../names.py) (revision 63cac10e2deafc48f480d71773a4d67539c57738) @@ -70,4 +70,7 @@ o_resumeButton_TouchRect = {"container": o_Overlay, "id": "_resumeButton", "type": "TouchRect", "unnamed": 1, "visible": True} o_editButton_TouchRect = {"container": o_Overlay, "id": "_editButton", "type": "TouchRect", "unnamed": 1, "visible": True} o_ultrafilteration_pause_btn = {"container": o_Overlay, "text": "PAUSE ULTRAFILTRATION", "type": "Text", "unnamed": 1, "visible": True} -o_ultrafilteration_resume_btn = {"container": o_Overlay, "text": "RESUME ULTRAFILTRATION", "type": "Text", "unnamed": 1, "visible": True} \ No newline at end of file +o_ultrafilteration_resume_btn = {"container": o_Overlay, "text": "RESUME ULTRAFILTRATION", "type": "Text", "unnamed": 1, "visible": True} +o_ultrafilteration_back_btn = {"container": o_Overlay, "text": "BACK", "type": "Text", "unnamed": 1, "visible": True} +o_ultrafilteration_texts ={"container": o_Overlay, "type": "Text", "unnamed": 1, "visible": True} +o_ultrafilteration_confirm_btn = {"container": o_Overlay, "text": "CONFIRM", "type": "Text", "unnamed": 1, "visible": True} Index: suite.conf =================================================================== diff -u -r653fa5203e3d66003e056f2c3447278bb4a0358c -r63cac10e2deafc48f480d71773a4d67539c57738 --- suite.conf (.../suite.conf) (revision 653fa5203e3d66003e056f2c3447278bb4a0358c) +++ suite.conf (.../suite.conf) (revision 63cac10e2deafc48f480d71773a4d67539c57738) @@ -1,6 +1,6 @@ AUT=denaliSquish LANGUAGE=Python OBJECTMAPSTYLE=script -TEST_CASES=tst_environment tst_post tst_standbymode tst_case1 tst_main_treatment_uf_adjustments tst_main_treatment_ultrafilteration +TEST_CASES=tst_environment tst_post tst_standbymode tst_case1 tst_main_treatment_uf_adjustments VERSION=3 WRAPPERS=Qt Index: tst_main_treatment_ultrafilteration/test.py =================================================================== diff -u -rdd4aa7ac57cbf17bcf07f84af1c9efcae7afd718 -r63cac10e2deafc48f480d71773a4d67539c57738 --- tst_main_treatment_ultrafilteration/test.py (.../test.py) (revision dd4aa7ac57cbf17bcf07f84af1c9efcae7afd718) +++ tst_main_treatment_ultrafilteration/test.py (.../test.py) (revision 63cac10e2deafc48f480d71773a4d67539c57738) @@ -25,6 +25,8 @@ hd_simulator = HDSimulator() +INCREASE_UF_RATE_TEXT = "Increase UF Rate" +INCREASE_TREATMENT_DURATION_TEXT = "Increase Treatment Duration" def verification_of_uf_from_main_treatment(): """ @@ -127,7 +129,12 @@ test.log("Clicking on 'Resume Ultrafilteration' button") mouseClick(waitForObjectExists(names.o_ultrafilteration_resume_btn)) - + hd_simulator.cmd_set_treatment_adjust_ultrafiltration_edit_response(accepted=config.ACCEPTED, reason=0, volume=100, + duration=100, duration_diff=10, + rate=1, rate_diff=1, rate_old=1) + verify_edit_response_messages(volume=100, duration=100, duration_diff=10, + rate=1, rate_diff=1, rate_old=1) + mouseClick(waitForObjectExists(names.o_ultrafilteration_back_btn)) mouseClick(names.o_editButton_TouchRect) test.compare(waitForObjectExists(names.o_treatmentHome_Ultrafiltration_Paused_Text).text, config.ULTRAFILTRATION_PAUSED_TEXT, "paused text should be "+str(config.ULTRAFILTRATION_PAUSED_TEXT)) @@ -178,8 +185,48 @@ test.compare(rejection_message.text, config.REJECTION_REASON[rejection], "expected rejection {msg} displayed".format(msg=config.REJECTION_REASON[rejection])) test.endSection() + +def expected_uf_texts(text): + names.o_ultrafilteration_texts["text"] = text + return names.o_ultrafilteration_texts - +def verify_edit_response_messages(volume, duration, duration_diff, + rate, rate_diff, rate_old): + """ + Method to verify the edit response message + pop up contents and select 'Increase UF Rate' + and click on confirm button + @param volume: (float) Ultrafiltration Volume + @param duration: (int) Treatment Duration + @param duration_diff: (int) Duration Difference + @param rate: (float) Ultrafiltration Rate + @param rate_diff: (float) Ultrafiltration Rate Difference + @param rate_old: (float) Ultrafiltration Rate Old + """ + test.startSection("Verify the edit response message pop up contents and select 'Increase UF Rate' and click on confirm button") + title = waitForObjectExists(expected_uf_texts(config.TITLE_TEXT)) + test.compare(title.text, config.TITLE_TEXT, "Edit response pop up message should be {}".format(config.TITLE_TEXT)) + edit_volume_message = "To confirm new UF Volume ({:.3f}),\nselect a treatment adjustment:".format(volume/1000) + expected_edit_volume_msg = waitForObjectExists(expected_uf_texts(edit_volume_message)) + test.compare(expected_edit_volume_msg.text, edit_volume_message, "Edit Volume title message should be {}".format(edit_volume_message)) + increase_uf_rate_text = waitForObjectExists(expected_uf_texts(INCREASE_UF_RATE_TEXT)) + test.compare(increase_uf_rate_text.text, INCREASE_UF_RATE_TEXT, "Increase UF rate box title should be {}".format(INCREASE_UF_RATE_TEXT)) + increase_treatment_duration_text = waitForObjectExists(expected_uf_texts(INCREASE_TREATMENT_DURATION_TEXT)) + test.compare(increase_treatment_duration_text.text, INCREASE_TREATMENT_DURATION_TEXT, "Increase treatment duration box title should be {}".format(INCREASE_TREATMENT_DURATION_TEXT)) + increase_uf_rate_msg = "The rate increases by {} mL/min,\nthe treatment duration remains the same.".format(rate) + increase_uf_rate_msg_text = waitForObjectExists(expected_uf_texts(increase_uf_rate_msg)) + test.compare(increase_uf_rate_msg_text.text, increase_uf_rate_msg, "Increase UF rate msg should be {}".format(increase_uf_rate_msg)) + increase_treatment_duration_msg = "The rate remains, the treatment\nduration increases by {} minutes.".format(duration_diff) + increase_treatment_duration_msg_text = waitForObjectExists(expected_uf_texts(increase_treatment_duration_msg)) + test.compare(increase_treatment_duration_msg_text.text, increase_treatment_duration_msg, "Increase treatment duration msg should be {}".format(increase_treatment_duration_msg)) + uf_rate_title_and_val = "UF Rate : {} mL/min".format(rate) + uf_rate_title_and_val_text = waitForObjectExists(expected_uf_texts(uf_rate_title_and_val)) + test.compare(uf_rate_title_and_val_text.text, uf_rate_title_and_val, "UF Rate title and value should be {}".format(uf_rate_title_and_val)) + test.log("Selecting Increase UF Rate") + mouseClick(increase_uf_rate_text) + mouseClick(waitForObjectExists(names.o_ultrafilteration_confirm_btn)) + test.endSection() + def main(): utils.tstStart(__file__) startApplication(config.AUT_NAME)