Index: shared/scripts/configuration/config.py =================================================================== diff -u -r0cc92d3b75bfb96dc4ecafd760a9ce15e455033b -r3cdfabd1b4528506c3dc52e1557711fd4b72c999 --- shared/scripts/configuration/config.py (.../config.py) (revision 0cc92d3b75bfb96dc4ecafd760a9ce15e455033b) +++ shared/scripts/configuration/config.py (.../config.py) (revision 3cdfabd1b4528506c3dc52e1557711fd4b72c999) @@ -25,10 +25,25 @@ "Magenta":"#fd28fd", "Orange": "#f2721c", "Peach":"#f1979a", "Red": "#c53b33", "Rose":"#fc178d", "Slate blue":"#7f7ffa", "Violet": "#6435c9", "White": "#ffffff", "Yellow": "#fcfc4d"} +CURRENT_COLOR = '#000000' +COMPLETE_COLOR= '#4290ec' +ENABLED_COLOR = '#fcfcfc' +INCOMPLETE_COLOR = '#607a91' + + #standby mode GOODMORNING_START_TIME_SEC = 0 GOODEVENING_START_TIME_SEC = 43200 - BLOOD_PRIMING_TEXT = "Blood Priming" SALINE_UNIT = "mL" BLOOD_PRIMING_DEFAULT_VALUE = "0 mL" + + + +# tst_pretreatment_screens +PRE_TREATMENT_SCREENS = ["Create" , "Sample" , "Consumables" , "Disposables" , "Prime" , "Ultrafiltration" , "BP/HR" , "Connection" , "Start"] +UF_MINIMUM_SLIDER_WIDTH = -2 +UF_MAXIMUM_SLIDER_WIDTH = 638.00 + + + Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r0cc92d3b75bfb96dc4ecafd760a9ce15e455033b -r3cdfabd1b4528506c3dc52e1557711fd4b72c999 --- shared/scripts/configuration/utility.py (.../utility.py) (revision 0cc92d3b75bfb96dc4ecafd760a9ce15e455033b) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 3cdfabd1b4528506c3dc52e1557711fd4b72c999) @@ -15,6 +15,8 @@ import sys import test +import names +import object import squish from configuration import config from builtins import int as pyInt @@ -108,3 +110,41 @@ raise LookupError("zone object is not in view to the user after " + \ "trying 100 times") + + + +def page_step_indicator_verification(pre_treatment_step, pre_treatment_items_object): + """ + Method to verify the Page Step indicators [the object on top of the screen which indicates the steps passed, current, remained] + @param pre_treatment_step :(int) indicates the Current pre-treatment step + @param pre_treatment_items_object :(dictionary) pre_treatment + @return N/A + """ + for page in range(len(config.PRE_TREATMENT_SCREENS)): + bullet_children = object.children(squish.waitForObjectExists(pre_treatment_items_object)) + bullet_circle_color = bullet_children[0].color.name #waitForObjectExsits need to be checked. + bullet_border_color = bullet_children[0].border.color.name + step_title = squish.waitForObjectExists(names.text_object(config.PRE_TREATMENT_SCREENS[page])) + #To verify the step indicators of the completed pre treatment screens + if page < pre_treatment_step: + test.verify(squish.waitForObjectExists(names.bullet_object(page)).complete) + test.verify(not squish.waitForObjectExists(names.bullet_object(page)).current) + test.compare(bullet_circle_color, config.COMPLETE_COLOR) + test.compare(bullet_border_color,config.COMPLETE_COLOR) #config.PRETREATMENT_INDICATOR[1] + test.compare(step_title.color.name,config.ENABLED_COLOR) + #To verify the step indicators of the current pre treatment screen + elif page == pre_treatment_step: + test.verify(squish.waitForObjectExists(names.bullet_object(page)).current,) + test.verify(not squish.waitForObjectExists(names.bullet_object(page)).complete) + test.compare(bullet_circle_color,config.CURRENT_COLOR) + test.compare(bullet_border_color,config.COMPLETE_COLOR) + test.compare(step_title.color.name,config.ENABLED_COLOR) + test.verify(step_title.font.bold) + #To verify the step indicators of the remaining pre-treatment screens + else: + test.verify(not squish.waitForObjectExists(names.bullet_object(page)).current,) + test.verify(not squish.waitForObjectExists(names.bullet_object(page)).complete,) + test.compare(step_title.color.name,config.INCOMPLETE_COLOR) + test.compare(bullet_circle_color,config.CURRENT_COLOR) + test.compare(bullet_border_color,config.INCOMPLETE_COLOR) + Index: shared/scripts/names.py =================================================================== diff -u -r0cc92d3b75bfb96dc4ecafd760a9ce15e455033b -r3cdfabd1b4528506c3dc52e1557711fd4b72c999 --- shared/scripts/names.py (.../names.py) (revision 0cc92d3b75bfb96dc4ecafd760a9ce15e455033b) +++ shared/scripts/names.py (.../names.py) (revision 3cdfabd1b4528506c3dc52e1557711fd4b72c999) @@ -3,6 +3,24 @@ from objectmaphelper import * +def text_object(txt): + return {"container": o_PreTreatmentConsumblesStack_PreTreatmentBase_TreatmentFlowBase, "text": txt, "type": "Text", "unnamed": 1, "visible": True} + + #{"container": o_PreTreatmentConsumblesStack_PreTreatmentUltrafiltration_PreTreatmentUltrafiltration, "occurrence": 5, "type": "StepBullet", "unnamed": 1, "visible": True} + #{"container": o_PreTreatmentPrimeStack_PreTreatmentBase_TreatmentFlowBase, "id": "_nextStepsBullet", "occurrence": 4, "type": "StepBullet", "unnamed": 1, "visible": True} + +def bullet_object(num): + return {"container": o_PreTreatmentConsumblesStack_PreTreatmentBase_TreatmentFlowBase, "occurrence": num + 1, "type": "StepBullet", "unnamed": 1, "visible": True} +# {"container": o_PreTreatmentSampleStack_PreTreatmentBase_TreatmentFlowBase, "id": "_gridStepsRest", "occurrence": 2, "type": "Grid", "unnamed": 1, "visible": True} + + #{"container": o_PreTreatmentSampleStack_PreTreatmentBase_TreatmentFlowBase, "id": "_nextStepsBullet", "type": "StepBullet", "unnamed": 1, "visible": True} + +#ultrafilteration_text = {"container": o_PreTreatmentPrimeStack_PreTreatmentBase_TreatmentFlowBase, "id": "_nextStepsBullet", "occurrence": 4, "type": "StepBullet", "unnamed": 1, "visible": True} + + + + + o_Gui_MainView = {"type": "Gui::MainView", "unnamed": 1, "visible": True} o_Overlay = {"container": o_Gui_MainView, "type": "Overlay", "unnamed": 1, "visible": True} o_borderRect_Rectangle = {"container": o_Overlay, "gradient": 0, "id": "_borderRect", "type": "Rectangle", "unnamed": 1, "visible": True} @@ -46,8 +64,38 @@ o_uf_close_button = {"container": o_Overlay, "id": "_image", "source": "qrc:/images/iClose", "type": "Image", "unnamed": 1, "visible": True} o_fluid_text = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "Volume Delivered", "type": "Text", "unnamed": 1, "visible": True} o_cumulative_fluid_text = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "Cumulative Delivered", "type": "Text", "unnamed": 1, "visible": True} +o_PreTreatmentStack_PreTreatmentStack = {"container": o_Gui_MainView, "objectName": "_PreTreatmentStack", "type": "PreTreatmentStack", "visible": True} +o_PreTreatmentStack_PreTreatmentConsumblesStack_PreTreatmentConnectionStack = {"container": o_PreTreatmentStack_PreTreatmentStack, "objectName": "_PreTreatmentConsumblesStack", "type": "PreTreatmentConnectionStack", "visible": True} +o_PreTreatmentConsumblesStack_PreTreatmentUltrafiltration_PreTreatmentUltrafiltration = {"container": o_PreTreatmentStack_PreTreatmentConsumblesStack_PreTreatmentConnectionStack, "objectName": "_PreTreatmentUltrafiltration", "type": "PreTreatmentUltrafiltration", "visible": True} +o_PreTreatmentStack_PreTreatmentStack = {"container": o_Gui_MainView, "objectName": "_PreTreatmentStack", "type": "PreTreatmentStack", "visible": True} +o_PreTreatmentStack_PreTreatmentConsumblesStack_PreTreatmentConsumablesStack = {"container": o_PreTreatmentStack_PreTreatmentStack, "objectName": "_PreTreatmentConsumblesStack", "type": "PreTreatmentConsumablesStack", "visible": True} +o_PreTreatmentConsumblesStack_PreTreatmentBase_TreatmentFlowBase = {"container": o_PreTreatmentStack_PreTreatmentConsumblesStack_PreTreatmentConsumablesStack, "objectName": "_PreTreatmentBase", "type": "TreatmentFlowBase", "visible": True} +o_PreTreatmentStack_PreTreatmentConsumblesStack_PreTreatmentConnectionStack = {"container": o_PreTreatmentStack_PreTreatmentStack, "objectName": "_PreTreatmentConsumblesStack", "type": "PreTreatmentConnectionStack", "visible": True} +o_PreTreatmentConsumblesStack_PreTreatmentUltrafiltration_PreTreatmentUltrafiltration = {"container": o_PreTreatmentStack_PreTreatmentConsumblesStack_PreTreatmentConnectionStack, "objectName": "_PreTreatmentUltrafiltration", "type": "PreTreatmentUltrafiltration", "visible": True} +o_PreTreatmentStack_PreTreatmentPrimeStack_PreTreatmentPrimeStack = {"container": o_PreTreatmentStack_PreTreatmentStack, "objectName": "_PreTreatmentPrimeStack", "type": "PreTreatmentPrimeStack", "visible": True} +o_PreTreatmentPrimeStack_PreTreatmentBase_TreatmentFlowBase = {"container": o_PreTreatmentStack_PreTreatmentPrimeStack_PreTreatmentPrimeStack, "objectName": "_PreTreatmentBase", "type": "TreatmentFlowBase", "visible": True} +o_PreTreatmentStack_PreTreatmentSampleStack_PreTreatmentWaterSampleStack = {"container": o_PreTreatmentStack_PreTreatmentStack, "objectName": "_PreTreatmentSampleStack", "type": "PreTreatmentWaterSampleStack", "visible": True} +o_PreTreatmentSampleStack_PreTreatmentBase_TreatmentFlowBase = {"container": o_PreTreatmentStack_PreTreatmentSampleStack_PreTreatmentWaterSampleStack, "objectName": "_PreTreatmentBase", "type": "TreatmentFlowBase", "visible": True} +o_PreTreatmentUltrafiltration_volumeSlider_Slider = {"container": o_PreTreatmentConsumblesStack_PreTreatmentUltrafiltration_PreTreatmentUltrafiltration, "objectName": "_volumeSlider", "type": "Slider", "visible": True} +#o_pppppppp = {"container": o_PreTreatmentConsumblesStack_PreTreatmentBase_TreatmentFlowBase, "occurrence": 2, "type": "StepBullet", "unnamed": 1, "visible": True} + + + + + + + + + + + + + + + + Index: suite.conf =================================================================== diff -u -r8df6f936193bbd9127d3ec940562e62db0060bcb -r3cdfabd1b4528506c3dc52e1557711fd4b72c999 --- suite.conf (.../suite.conf) (revision 8df6f936193bbd9127d3ec940562e62db0060bcb) +++ suite.conf (.../suite.conf) (revision 3cdfabd1b4528506c3dc52e1557711fd4b72c999) @@ -1,6 +1,6 @@ AUT=denaliSquish LANGUAGE=Python OBJECTMAPSTYLE=script -TEST_CASES=tst_environment tst_post tst_standbymode tst_In_treatment +TEST_CASES=tst_environment tst_post tst_standbymode tst_In_treatment tst_case1 VERSION=3 WRAPPERS=Qt Index: tst_pre_treatment_patient_connection/test.py =================================================================== diff -u --- tst_pre_treatment_patient_connection/test.py (revision 0) +++ tst_pre_treatment_patient_connection/test.py (revision 3cdfabd1b4528506c3dc52e1557711fd4b72c999) @@ -0,0 +1,136 @@ +# -*- coding: utf-8 -*- + + + +import names +from dialin.ui.hd_simulator import HDSimulator +from dialin.ui.dg_simulator import DGSimulator +from dialin.ui import utils +from configuration import config, utility + +hd_simulator = HDSimulator() +dg_simulator = DGSimulator() + + +pre_treatment_step = 5 + + +TREATMENT_ULTRAFILTERATION_TESTING_OPTION = { + "OPTION_1" : {"uf_maximum" : 800, "uf_minimum" : 0}, + "OPTION_2" : {"uf_maximum" : 500, "uf_minimum" : 0}, + "OPTION_3" : {"uf_maximum" : 550, "uf_minimum" : 0}, + "OPTION_4" : {"uf_maximum" : 300, "uf_minimum" : 0}, + "OPTION_5" : {"uf_maximum" : 280, "uf_minimum" : 0}, + "OPTION_6" : {"uf_maximum" : 765, "uf_minimum" : 500}, + "OPTION_7" : {"uf_maximum" : 680, "uf_minimum" : 450}, + "OPTION_8" : {"uf_maximum" : 480, "uf_minimum" : 380}, + "OPTION_9" : {"uf_maximum" : 390, "uf_minimum" : 675}, + "OPTION_10" : {"uf_maximum" : 290, "uf_minimum" : 125}, + } + + +def verify_filter_flush_text(): + """ + Verify Filter Flush Text on UI Screen + """ + test.log("Verifying the text 'Filter Flush'") + test.compare(str(waitForObjectExists(names.o_PreTreatmentBase_Filter_Flush_Text).text),FILTER_FLUSH_TEXT, "Verified Filter Flush text") + test.compare(str(waitForObjectExists(names.o_PreTreatmentBase_Create_Text).text),CREATE, "Verified Create text") + test.compare(str(waitForObjectExists(names.o_PreTreatmentBase_Sample_Text).text),SAMPLE, "Verified Sample text") + test.compare(str(waitForObjectExists(names.o_PreTreatmentBase_Consumables_Text).text),CONSUMABLES, "Verified Consumables text") + test.compare(str(waitForObjectExists(names.o_PreTreatmentBase_Disposables_Text).text),DISPOSABLES, "Verified Disposables text") + test.compare(str(waitForObjectExists(names.o_PreTreatmentBase_Prime_Text).text),PRIME, "Verified PRIME text") + test.compare(str(waitForObjectExists(names.o_PreTreatmentBase_Ultrafiltration_Text).text),ULTRAFILTERATION, "Verified Ultrafilteration text") + test.compare(str(waitForObjectExists(names.o_PreTreatmentBase_BP_HR_Text).text),BP_HR, "Verified BP/HR text") + test.compare(str(waitForObjectExists(names.o_PreTreatmentBase_Connection_Text).text),CONNECTION, "Verified Connection text") + test.compare(str(waitForObjectExists(names.o_PreTreatmentBase_Start_Text).text),START, "Verified Start text") + + +def drag_and_drop_ultrafilteration_slider(slider_value = 0, maximum_ultrafilteration = 0): + """ + Tests to verify ultrafilteration slider range + @param slider_value: (int) value of the slider to set. + """ + slider_buffer = (config.UF_MAXIMUM_SLIDER_WIDTH/(maximum_ultrafilteration/100)) * slider_value + slider_width = slider_buffer + config.UF_MINIMUM_SLIDER_WIDTH + mouseClick(waitForObject(names.o_PreTreatmentUltrafiltration_volumeSlider_Slider), slider_width , 3, Qt.LeftButton) + + test.compare(waitForObject(names.o_PreTreatmentUltrafiltration_volumeSlider_Slider).value , (slider_value/10), "user adjusted slider value to -> "+ str(slider_value)) + + + +def navigate_patient_connection(): + """ + Method to navigate to sub mode under pre-treatment screen + @param mode - (int) pre treatment state + """ + hd_simulator.cmd_set_hd_operation_mode_data(5,0) + hd_simulator.cmd_send_pre_treatment_state_data(sub_mode=8, water_sample_state=0, + consumables_self_test_state=0,no_cartridge_self_test_state=0, + installation_state=0, dry_self_test_state=0, prime_state=0, + recirculate_state=0, patient_connection_state=1) + + + +def start_test_treatment_ultrafilteration(ultrafilteration_range): + """ + Test slider movement of ultrafilteration volume. + @param ultrafilteration_range: (dictionary) uf minimum and uf maximum volume. + @return: N/A + """ + min_uf = ultrafilteration_range["uf_minimum"] + max_uf = ultrafilteration_range["uf_maximum"] + hd_simulator.cmd_set_treatment_parameter_ranges(0, 100, min_uf, max_uf, 0, 0) + for uf_value in range(1, (max_uf//100)+1, 1): + drag_and_drop_ultrafilteration_slider(uf_value, max_uf) + # test.compare(utils.l2ml(waitForObjectExists(names.o_treatmentStart_ultrafiltrationTouchArea_TreatmentUltrafiltration).value), uf_value, "uf set value should be :" + str(uf_value)) + + test.compare(utils.l2ml(waitForObjectExists(names.o_volumeSlider_slider).maximum), max_uf, "maximum uf value should be :" + str(max_uf)) + test.compare(utils.l2ml(waitForObjectExists(names.o_volumeSlider_slider).minimum), min_uf, "minimum uf value should be :" + str(min_uf)) + + + +def verification_Bullets_text(): + test.verify((names.o_PreTreatmentBase_headStepBullet_StepBullet).visible, "Verify headstep bullet") + test.verify((names.o_PreTreatmentBase_indicator_StepIndicator).enable, "Verified indicator") + +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_send_pre_treatment_disposables_prime_progress_data(0,vTotal) + test.compare(waitForObjectExists(names.Time_text).parent.maximum, vTotal, "Reset maximum value and compare it expected value{}".format(vTotal)) + test.compare(waitForObjectExists(names.Time_text).parent.minimum, 0, "Reset minimun value and compare it expected value{}".format(0)) + + +def main(): + utils.tstStart(__file__) + startApplication(config.AUT_NAME) + + utils.waitForGUI(2) + + navigate_patient_connection() + + #utility.page_step_indicator_verification(pre_treatment_step, names.ultrafilteration_text) + + start_test_treatment_ultrafilteration(TREATMENT_ULTRAFILTERATION_TESTING_OPTION["OPTION_1"]) + start_test_treatment_ultrafilteration(TREATMENT_ULTRAFILTERATION_TESTING_OPTION["OPTION_2"]) + start_test_treatment_ultrafilteration(TREATMENT_ULTRAFILTERATION_TESTING_OPTION["OPTION_3"]) + start_test_treatment_ultrafilteration(TREATMENT_ULTRAFILTERATION_TESTING_OPTION["OPTION_4"]) + start_test_treatment_ultrafilteration(TREATMENT_ULTRAFILTERATION_TESTING_OPTION["OPTION_5"]) + start_test_treatment_ultrafilteration(TREATMENT_ULTRAFILTERATION_TESTING_OPTION["OPTION_6"]) + start_test_treatment_ultrafilteration(TREATMENT_ULTRAFILTERATION_TESTING_OPTION["OPTION_7"]) + start_test_treatment_ultrafilteration(TREATMENT_ULTRAFILTERATION_TESTING_OPTION["OPTION_8"]) + start_test_treatment_ultrafilteration(TREATMENT_ULTRAFILTERATION_TESTING_OPTION["OPTION_9"]) + start_test_treatment_ultrafilteration(TREATMENT_ULTRAFILTERATION_TESTING_OPTION["OPTION_10"]) + + + utils.waitForGUI(3) + + utils.tstDone() + + + \ No newline at end of file