Index: shared/scripts/configuration/strings.py =================================================================== diff -u -rb6887f320c7cda9c70b8f47cb44ebe6fc0c892f0 -rcea724e0b33dcd446f230ab23d6aa3729e6f86fd --- shared/scripts/configuration/strings.py (.../strings.py) (revision b6887f320c7cda9c70b8f47cb44ebe6fc0c892f0) +++ shared/scripts/configuration/strings.py (.../strings.py) (revision cea724e0b33dcd446f230ab23d6aa3729e6f86fd) @@ -19,19 +19,8 @@ SALINE_UNIT = "mL" BLOOD_PRIMING_DEFAULT_VALUE = "0 mL" +PRE_TREATMENT_SCREENS = ["Create" , "Sample" , "Consumables" , "Disposables" , "Prime" , "Ultrafiltration" , "BP/HR" , "Connection" , "Start"] -PRE_TREATMENT_SCREENS = { - 1 : "Create" , - 2 : "Sample" , - 3 : "Consumables" , - 4 : "Disposables" , - 5 : "Prime" , - 6 : "Ultrafiltration" , - 7 : "BP/HR" , - 8 : "Connection" , - 9 : "Start" -} - # dictionary of rejection reason from application source code. # message location -> denali-> Headers-> common-> MsgDefs.h REJECTION_REASON = { Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r6bb28dbaadabd61c0ecff12d6a365184a982a5e5 -rcea724e0b33dcd446f230ab23d6aa3729e6f86fd --- shared/scripts/configuration/utility.py (.../utility.py) (revision 6bb28dbaadabd61c0ecff12d6a365184a982a5e5) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision cea724e0b33dcd446f230ab23d6aa3729e6f86fd) @@ -78,44 +78,44 @@ "trying 100 times") -def verify_page_step_indicator(pre_treatment_step, pre_treatment_items_object): - """ - Method to verify the Page Step indicators 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 bullet object - @return N/A - """ - test.startSection("Method to verify the Page Step indicators") - for page in range(1, len(config.PRE_TREATMENT_SCREENS)): - pre_treatment_items_object["occurrence"] = page - bullet_children = object.children(squish.waitForObject(pre_treatment_items_object)) +def verify_page_step_indicator(screen_obj, pre_treatment_step): + """ + 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 : indicates the Current pre-treatment step + """ + test.startSection("verification of page step indicators") + for page in range(len(config.PRE_TREATMENT_SCREENS)): + bullet_children = object.children(squish.waitForObjectExists(get_bullet_object(screen_obj, page))) bullet_circle_color = bullet_children[0].color.name bullet_border_color = bullet_children[0].border.color.name - step_title = bullet_children[2] - #To verify the step indicators of the completed pre treatment screens + step_title = squish.waitForObjectExists(get_text_object(screen_obj, config.PRE_TREATMENT_SCREENS[page])) + if page < pre_treatment_step: - test.verify(squish.waitForObjectExists(pre_treatment_items_object).complete, str(config.PRE_TREATMENT_SCREENS[page]+" complete attribute should be True")) - test.verify(not squish.waitForObjectExists(pre_treatment_items_object).current, str(config.PRE_TREATMENT_SCREENS[page]+" current attribute should be false")) - test.compare(bullet_circle_color, config.COMPLETE_COLOR, str(config.PRE_TREATMENT_SCREENS[page]+" bullet color hex should be "+str(config.COMPLETE_COLOR))) - test.compare(bullet_border_color, config.COMPLETE_COLOR, str(config.PRE_TREATMENT_SCREENS[page]+" bullet border color hex should be "+str(config.COMPLETE_COLOR))) - test.compare(step_title.color.name, config.ENABLED_COLOR, str(config.PRE_TREATMENT_SCREENS[page]+" title color hex should be "+str(config.ENABLED_COLOR))) - #To verify the step indicators of the current pre treatment screen + test.log("To verify the step indicator of the completed pre-treatment screen " + config.PRE_TREATMENT_SCREENS[page]) + test.verify(squish.waitForObjectExists(get_bullet_object(screen_obj, page)).complete) + test.verify(not squish.waitForObjectExists(get_bullet_object(screen_obj, page)).current) + test.compare(bullet_circle_color, config.COMPLETE_COLOR, " the bullet color must be " + str(config.COMPLETE_COLOR)) + test.compare(bullet_border_color, config.COMPLETE_COLOR," the bullet border color must be " + str(config.COMPLETE_COLOR)) + test.compare(step_title.color.name, config.ENABLED_COLOR, " the text color must be " + str(config.ENABLED_COLOR)) + elif page == pre_treatment_step: - test.verify(squish.waitForObjectExists(pre_treatment_items_object).current, str(config.PRE_TREATMENT_SCREENS[page]+" complete attribute should be True")) - test.verify(not squish.waitForObjectExists(pre_treatment_items_object).complete, str(config.PRE_TREATMENT_SCREENS[page]+" current attribute should be false")) - test.compare(bullet_circle_color,config.CURRENT_COLOR, str(config.PRE_TREATMENT_SCREENS[page]+" bullet color hex should be "+str(config.CURRENT_COLOR))) - test.compare(bullet_border_color,config.COMPLETE_COLOR, str(config.PRE_TREATMENT_SCREENS[page]+" bullet border color hex should be "+str(config.COMPLETE_COLOR))) - test.compare(step_title.color.name,config.ENABLED_COLOR, str(config.PRE_TREATMENT_SCREENS[page]+" title color hex should be "+str(config.ENABLED_COLOR))) - test.verify(step_title.font.bold, str(config.PRE_TREATMENT_SCREENS[page]+" title font bold should be "+str(config.ENABLED_COLOR))) - #To verify the step indicators of the remaining pre-treatment screens + test.log("To verify the step indicators of the current pre-treatment screen " + config.PRE_TREATMENT_SCREENS[page]) + test.verify(squish.waitForObjectExists(get_bullet_object(screen_obj, page)).current) + test.verify(not squish.waitForObjectExists(get_bullet_object(screen_obj, page)).complete) + test.compare(bullet_circle_color,config.CURRENT_COLOR," the bullet color must be " + str(config.CURRENT_COLOR)) + test.compare(bullet_border_color,config.COMPLETE_COLOR, " the bullet border color must be " + str(config.COMPLETE_COLOR)) + test.compare(step_title.color.name,config.ENABLED_COLOR, " the text color must be " + str(config.ENABLED_COLOR)) + test.verify(step_title.font.bold, " the current text must be in bold") + else: - test.verify(not squish.waitForObjectExists(pre_treatment_items_object).current, str(config.PRE_TREATMENT_SCREENS[page]+" complete attribute should be false")) - test.verify(not squish.waitForObjectExists(pre_treatment_items_object).complete, str(config.PRE_TREATMENT_SCREENS[page]+" current attribute should be false")) - test.compare(step_title.color.name,config.INCOMPLETE_COLOR, str(config.PRE_TREATMENT_SCREENS[page]+" title color hex should be "+str(config.INCOMPLETE_COLOR))) - test.compare(bullet_circle_color,config.CURRENT_COLOR, str(config.PRE_TREATMENT_SCREENS[page]+" bullet circle color hex should be "+str(config.CURRENT_COLOR))) - test.compare(bullet_border_color,config.INCOMPLETE_COLOR, str(config.PRE_TREATMENT_SCREENS[page]+" bullet border color hex should be "+str(config.INCOMPLETE_COLOR))) + test.log("To verify the step indicators of the remaining pre-treatment screen " + config.PRE_TREATMENT_SCREENS[page]) + test.verify(not squish.waitForObjectExists(get_bullet_object(screen_obj, page)).current,) + test.verify(not squish.waitForObjectExists(get_bullet_object(screen_obj, page)).complete,) + test.compare(step_title.color.name,config.INCOMPLETE_COLOR, " the text color must be " + str(config.INCOMPLETE_COLOR)) + test.compare(bullet_circle_color,config.CURRENT_COLOR," the bullet color must be " + str(config.CURRENT_COLOR)) + test.compare(bullet_border_color,config.INCOMPLETE_COLOR, " the bullet border color must be " + str(config.INCOMPLETE_COLOR)) + test.endSection() - test.endSection() #Methods for create custom treatment @@ -326,3 +326,25 @@ "Actual Arterial range maximum value: {} is equal to Expected value: {}".format(arterial_max, art_high)) test.endSection() +def get_text_object(screen_obj, txt): + """ + To obtain a text object based on text provided + @param screen_obj: provides the container on which the txt must be present + @returns a real name object + """ + names.o_text_object["container"] = screen_obj + names.o_text_object["text"] = txt + return names.o_text_object + + +def get_bullet_object(screen_obj, num): + """ + To obtain a bullet object based on occurrence provided. + @param screen_obj: provides the container on which the bullet must be present + @param num: provides the occurrence value + @returns a real name object + """ + names.o_bullet_object["container"] = screen_obj + names.o_bullet_object["occurrence"] = num + 1 + return names.o_bullet_object + Index: shared/scripts/names.py =================================================================== diff -u -r7f5d92792f49814d405ae6266af82b19cd999d4b -rcea724e0b33dcd446f230ab23d6aa3729e6f86fd --- shared/scripts/names.py (.../names.py) (revision 7f5d92792f49814d405ae6266af82b19cd999d4b) +++ shared/scripts/names.py (.../names.py) (revision cea724e0b33dcd446f230ab23d6aa3729e6f86fd) @@ -9,6 +9,7 @@ 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} o_PreTreatmentCreateStack_PreTreatmentCreateStack = {"container": o_Gui_MainView, "objectName": "_PreTreatmentCreateStack", "type": "PreTreatmentCreateStack", "visible": True} +o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate = {"container": o_PreTreatmentCreateStack_PreTreatmentCreateStack, "objectName": "_PreTreatmentCreate", "type": "PreTreatmentCreate", "visible": True} o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase = {"container": o_PreTreatmentCreateStack_PreTreatmentCreateStack, "objectName": "_PreTreatmentBase", "type": "TreatmentFlowBase", "visible": True} o_PreTreatmentBase_titleBar_StepNavigationTitleBar = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "gradient": 0, "id": "_titleBar", "type": "StepNavigationTitleBar", "unnamed": 1, "visible": True} o_titleBar_Rectangle = {"container": o_Overlay, "gradient": 0, "id": "_titleBar", "type": "Rectangle", "unnamed": 1, "visible": True} @@ -28,8 +29,6 @@ #create_custom treatment testcase -text_object = {"type": "Text", "unnamed": 1, "visible": True} -bullet_object = {"type": "StepBullet", "unnamed": 1, "visible": True} o_PreTreatmentBase_confirmButton_TouchRect = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "text": "CONFIRM", "type": "Text", "unnamed": 1, "visible": True} o_PreTreatmentCreate_bloodFlowRate_SliderCreateTreatment = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_bloodFlowRate", "type": "SliderCreateTreatment", "visible": True} o_PreTreatmentBase_confirmButton_TouchRect_2 = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "objectName": "_confirmButton", "type": "TouchRect", "visible": True} @@ -110,3 +109,5 @@ o_PreTreatmentBase_Patient_ID_Text = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "text": "Patient ID", "type": "Text", "unnamed": 1, "visible": True} o_PreTreatmentCreate_PRESCRIPTION_Text = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "text": "PRESCRIPTION", "type": "Text", "unnamed": 1, "visible": True} o_PreTreatmentCreate_OPERATING_PARAMETERS_Text = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "text": "OPERATING PARAMETERS", "type": "Text", "unnamed": 1, "visible": True} +o_text_object = {"type": "Text", "unnamed": 1, "visible": True} +o_bullet_object = {"type": "StepBullet", "unnamed": 1, "visible": True} \ No newline at end of file Index: tst_create_custom_treatment/test.py =================================================================== diff -u -rb6887f320c7cda9c70b8f47cb44ebe6fc0c892f0 -rcea724e0b33dcd446f230ab23d6aa3729e6f86fd --- tst_create_custom_treatment/test.py (.../test.py) (revision b6887f320c7cda9c70b8f47cb44ebe6fc0c892f0) +++ tst_create_custom_treatment/test.py (.../test.py) (revision cea724e0b33dcd446f230ab23d6aa3729e6f86fd) @@ -594,16 +594,18 @@ hd_simulator.cmd_send_hd_operation_mode(4, 0) + utils.waitForGUI(0.3) test.log("Verification of page step indicator from patient id page") - utility.verify_page_step_indicator(PRE_TREATMENT_STEP, names.o_PreTreatmentBase_nextStepsBullet_StepBullet) + utility.verify_page_step_indicator(names.o_PreTreatmentCreateStack_PreTreatmentCreateStack, PRE_TREATMENT_STEP) mouseClick(waitForObject(names.o_input_patient_id)) type(waitForObject(names.o_input_patient_id), config.PATIENT_ID) test.compare(waitForObject(names.o_PreTreatmentBase_Patient_ID_Text).text, config.PATIENT_ID_TEXT, "Title text should be -> "+str(config.PATIENT_ID_TEXT)) mouseClick(waitForObject(names.o_confirm_button)) test.log("Verification of page step indicator from create custom treatment page") - utility.verify_page_step_indicator(PRE_TREATMENT_STEP, names.o_PreTreatmentCreate_nextStepsBullet_StepBullet) + utils.waitForGUI(0.3) + utility.verify_page_step_indicator(names.o_PreTreatmentCreateStack_PreTreatmentCreateStack, PRE_TREATMENT_STEP) verify_create_custom_treatment_parameter()