Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r3a3129a66d9d1382afc332bc1a14eaaf0d98a62d -r2d0ac4cb02178ab7da2e01f75087f4d87599cce9 --- shared/scripts/configuration/utility.py (.../utility.py) (revision 3a3129a66d9d1382afc332bc1a14eaaf0d98a62d) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 2d0ac4cb02178ab7da2e01f75087f4d87599cce9) @@ -72,6 +72,6 @@ "trying 100 times") -def convert_seconds_into_min_and_sec(seconds): - min_and_sec = time.strftime("%M:%S", time.gmtime(seconds)) +def convert_seconds_into_min_and_sec(seconds, format="%M:%S"): + min_and_sec = time.strftime(format, time.gmtime(seconds)) return min_and_sec Index: shared/scripts/names.py =================================================================== diff -u -r3a3129a66d9d1382afc332bc1a14eaaf0d98a62d -r2d0ac4cb02178ab7da2e01f75087f4d87599cce9 --- shared/scripts/names.py (.../names.py) (revision 3a3129a66d9d1382afc332bc1a14eaaf0d98a62d) +++ shared/scripts/names.py (.../names.py) (revision 2d0ac4cb02178ab7da2e01f75087f4d87599cce9) @@ -3,8 +3,19 @@ from objectmaphelper import * -o_Gui_MainView = {"type": "Gui::MainView", "unnamed": 1, "visible": True} -o_Overlay = {"container": o_Gui_MainView, "type": "Overlay", "unnamed": 1, "visible": True} +# Top Parents +o_QQuickView = { "type": "QQuickView"} +o_Overlay = {"container": o_QQuickView, "type": "Overlay"} +o_Gui_MainView = { "type": "Gui::MainView" } + + +# Modal Dialog +o_modalDialog = {"container": o_Overlay , "id": "_backgroundRect", "type": "Rectangle", "unnamed": 1, "visible": True} +o_treatmentHome = {"container": o_QQuickView , "id": "_treatmentHome" , "type": "TreatmentHome", "unnamed": 1, "visible": True} +o_treatmentHome_backgroung = {"container": o_treatmentHome, "id": "_backgroundRect" , "type": "Rectangle" , "unnamed": 1, "visible": True} +o_treatmentHome_startTreatment = {"container": o_treatmentHome, "id": "_startTreatmentRect" , "type": "TouchRect" , "unnamed": 1, "visible": True} +o_treatmentHome_createTreatment = {"container": o_treatmentHome, "id": "_createTreatmentRect", "type": "TouchRect" , "unnamed": 1, "visible": True} + o_borderRect_Rectangle = {"container": o_Overlay, "gradient": 0, "id": "_borderRect", "type": "Rectangle", "unnamed": 1, "visible": True} o_minimizeButton_UpDownButton = {"container": o_Overlay, "gradient": 0, "id": "_minimizeButton", "type": "UpDownButton", "unnamed": 1, "visible": True} o_shape_Shape = {"container": o_Gui_MainView, "id": "_shape", "type": "Shape", "unnamed": 1, "visible": True} @@ -49,8 +60,6 @@ #main treatment time duration -o_QQuickView = { "type": "QQuickView"} -o_Gui_MainView = {"type": "Gui::MainView", "unnamed": 1, "visible": True} o_pop_screen = {"container": o_Overlay, "type": "PopupItem", "unnamed": 1, "visible": True} 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} Index: tst_time_duration/test.py =================================================================== diff -u -r3a3129a66d9d1382afc332bc1a14eaaf0d98a62d -r2d0ac4cb02178ab7da2e01f75087f4d87599cce9 --- tst_time_duration/test.py (.../test.py) (revision 3a3129a66d9d1382afc332bc1a14eaaf0d98a62d) +++ tst_time_duration/test.py (.../test.py) (revision 2d0ac4cb02178ab7da2e01f75087f4d87599cce9) @@ -57,9 +57,10 @@ mouseClick(waitForObject(names.o_treatmentHome_Time_Remaining_Text)) def close_time_duration_pop_up(): - mouseClick(waitForObjectExists(names.o_confirm_button)) - test.log("Confirm button is clicked") + test.log("Closing time duration pop up") + mouseClick(waitForObjectExists(names.o_pop_up_close_button)) + def reset_treatment_time_verification(vTotal): """ Method to reset and verify Actual time in seconds @@ -72,13 +73,20 @@ test.compare(waitForObjectExists(names.o_treatment_duration).minimum, 0, "Reset minimum value and compare it expected value {}".format(0)) def verify_time_remaining_start_time_and_pop_up_slider_val(vTotal): + """ + Method to verify the time remaining and + time duration pop up slider values are equal + """ + test.startSection("Verify Time remaining and pop up slider cal") hd_simulator.cmd_set_treatment_time(vTotal, 0, vTotal) - current_time = utility.convert_seconds_into_min_and_sec(vTotal) + waitForGUI(1) + current_time = utility.convert_seconds_into_min_and_sec(vTotal, "%H:%M") open_time_duration_pop_up() current_slider_val = get_slider_time_obj() test.compare(current_slider_val.time, current_time, "Time remaining and pop up slider value should be {}".format(vTotal)) close_time_duration_pop_up() - + test.endSection() + def verify_pause_treatment_text(): """ Method to verify 'Treatment Paused' text is displayed @@ -107,10 +115,15 @@ else: totaltime_list.append(id) id_count += 1 - test.log(str(totaltime_list)) return totaltime_list + def verify_pop_up(): + """ + Method to pass slider value and and verify the same + on time duration pop screen + """ + test.startSection("Verify the slider values") open_time_duration_pop_up() #FIXME: If we not use specified value then it will take minimum one and maximum 8 hours. start_treatment_time_verification(60) @@ -120,7 +133,9 @@ min_dialysate_flow_rate = 0, max_dialysate_flow_rate = 0) waitForGUI(0.1) hd_simulator.cmd_send_treatment_adjust_duration_response(True, 0, 100, 60) - close_time_duration_pop_up() + mouseClick(waitForObjectExists(names.o_confirm_button)) + test.log("Confirm button is clicked") + test.endSection() def main(): utils.tstStart(__file__) @@ -132,11 +147,11 @@ treatment_end_state=0, treatment_stop_state= 0, dialysis_state=0) snooze(1) verify_pop_up() - + #Calculating total seconds into minutes and passing to treatment time verification total_time_list = total_time() for value in total_time_list: - verify_time_remaining_start_time_and_pop_up_slider_val(value) + verify_time_remaining_start_time_and_pop_up_slider_val(value*60) treatment_time_verification(value*60) #Give treatment stop response to pause remain time