Index: shared/scripts/configuration/config.py =================================================================== diff -u -r0cc92d3b75bfb96dc4ecafd760a9ce15e455033b -r147d2efb04f320c335f5b1b570b97ed0c11c60e4 --- shared/scripts/configuration/config.py (.../config.py) (revision 0cc92d3b75bfb96dc4ecafd760a9ce15e455033b) +++ shared/scripts/configuration/config.py (.../config.py) (revision 147d2efb04f320c335f5b1b570b97ed0c11c60e4) @@ -32,3 +32,6 @@ BLOOD_PRIMING_TEXT = "Blood Priming" SALINE_UNIT = "mL" BLOOD_PRIMING_DEFAULT_VALUE = "0 mL" + +#Time_Duration +PAUSED_TEXT = "Treatment Paused" Index: shared/scripts/names.py =================================================================== diff -u -r0cc92d3b75bfb96dc4ecafd760a9ce15e455033b -r147d2efb04f320c335f5b1b570b97ed0c11c60e4 --- shared/scripts/names.py (.../names.py) (revision 0cc92d3b75bfb96dc4ecafd760a9ce15e455033b) +++ shared/scripts/names.py (.../names.py) (revision 147d2efb04f320c335f5b1b570b97ed0c11c60e4) @@ -48,6 +48,13 @@ o_cumulative_fluid_text = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "Cumulative Delivered", "type": "Text", "unnamed": 1, "visible": True} +#main treatment time duration +o_QQuickView = { "type": "QQuickView"} +o_treatmentHome = {"container": o_QQuickView , "id": "_treatmentHome" , "type": "TreatmentHome", "unnamed": 1, "visible": True} +o_Treatment_Paused = {"container": o_treatmentHome, "text": "Treatment Paused", "type": "Text", "unnamed": 1, "visible": True} +o_treatmentStart_shape_Shape = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "id": "_shape", "type": "Shape", "unnamed": 1, "visible": True} + + Index: tst_time_duration/test.py =================================================================== diff -u --- tst_time_duration/test.py (revision 0) +++ tst_time_duration/test.py (revision 147d2efb04f320c335f5b1b570b97ed0c11c60e4) @@ -0,0 +1,99 @@ +# -*- coding: utf-8 -*-" +# Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. +# copyright +# THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, +# IN PART OR IN WHOLE, +# WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. +# +# file tst_time_duration +# @author (last) Amol Shinde +# @date (last) 28-02-2022 + + +import names +from dialin.ui import utils +from dialin.ui.hd_simulator import HDSimulator +from configuration import config + +hd_simulator = HDSimulator() + +def start_treatment_time_verification(vTotal): + """ + Method to verify Actual time in seconds to Time appear on UI Screen in seconds. + Also it compare the Progress bar value in seconds + @param vTotal: (int) Total time in seconds ##as per behrouz comment @param vTotal - (int) Total time in seconds + """ + + for i in range(0,vTotal+1): + + hd_simulator.cmd_set_treatment_time(vTotal, i, vTotal - i) + test.compare(waitForObjectExists(names.o_treatmentStart_shape_Shape).parent.parent.parent.parent.progressValue, i, "progress value should be {}".format(i)) + test.compare(waitForObjectExists(names.o_treatmentStart_shape_Shape).parent.parent.parent.parent.timeTextValue, vTotal - i, "Expected Time on UI should be in seconds{}".format(vTotal - i)) + + +def reset_treatment_time_verification(vTotal): + """ + Method to reset and verify Actual time in seconds + to Maximum & Minimum values on UI screen in seconds + @param vTotal: (int) Total time in seconds + """ + + hd_simulator.cmd_set_treatment_time(vTotal, 0, vTotal) + test.compare(waitForObjectExists(names.o_treatmentStart_shape_Shape).parent.parent.parent.parent.maximum, vTotal, "Reset maximum value and compare it expected value{}".format(vTotal)) + test.compare(waitForObjectExists(names.o_treatmentStart_shape_Shape).parent.parent.parent.parent.minimum, 0, "Reset minimun value and compare it expected value{}".format(0)) + +def verify_pause_treatment_text(): + """ + Method to redirect Time remaining to Pause Treatment state + and verify Pause Treatment Text on UI Screen + """ + test.log("Verifying the text 'Treatment Paused'") + test.compare(str(waitForObjectExists(names.o_Treatment_Paused).text), config.PAUSED_TEXT, "Verified Paused state in Main treatment's remain time section") + utils.waitForGUI(2) + +def treatment_time_verification(total): + test.startSection("Verify the seconds values inside Progress bar and on timer 'Time in seconds'") + reset_treatment_time_verification(total) + start_treatment_time_verification(total) + reset_treatment_time_verification(total) + test.endSection() + +def main(): + utils.tstStart(__file__) + startApplication(config.AUT_NAME) + + #navigate to dialysis state + hd_simulator.cmd_set_treatment_states_data(sub_mode= 2, uf_state= 0, saline_state=0, heparin_state= 0, + rinseback_state= 0, recirculate_state= 0, blood_prime_state= 0, + treatment_end_state=0, treatment_stop_state= 0) + + + hd_simulator.cmd_send_uf_treatment_response(accepted = 1, reason = 0, volume = 0.300) + utils.waitForGUI(2) + + hd_simulator.cmd_set_treatment_start_state() + + #Start treatment time verification + treatment_time_verification(total=300) + + #Give treatment stop response to pause remain time + hd_simulator.cmd_set_treatment_states_data(sub_mode= 0, uf_state= 0, saline_state=0, heparin_state= 0, + rinseback_state= 0, recirculate_state= 0, blood_prime_state= 0, + treatment_end_state=0, treatment_stop_state= 1) + #verify treatment pause state + verify_pause_treatment_text() + utils.waitForGUI(2) + + #Send treatment start response after pause state + hd_simulator.cmd_set_treatment_states_data(sub_mode= 2, uf_state= 0, saline_state=0, heparin_state= 0, + rinseback_state= 0, recirculate_state= 0, blood_prime_state= 0, + treatment_end_state=0, treatment_stop_state= 0) + + utils.waitForGUI(2) + #verify_pause_treatment_text(accepted=False, reason=2, volume=0.300 ) + + + #Again start treatment for time verification + treatment_time_verification(60) + + utils.tstDone() \ No newline at end of file