Index: shared/scripts/configuration/config.py =================================================================== diff -u -r7882eef58dfd3755ab3a6f2709a6e81f8662a0a2 -r75b5f2a93fc13f944d268961901be981dec4bfbe --- shared/scripts/configuration/config.py (.../config.py) (revision 7882eef58dfd3755ab3a6f2709a6e81f8662a0a2) +++ shared/scripts/configuration/config.py (.../config.py) (revision 75b5f2a93fc13f944d268961901be981dec4bfbe) @@ -123,6 +123,20 @@ +############################################################################################### +VITALS_TITLE = "VITALS" +OUT_OF_RANGE_COLOR = "#c53b33" +IN_RANGE_COLOR = "#fcfcfc" +SYSTOLIC_LOWER_LIMIT = 60 +SYSTOLIC_UPPER_LIMIT = 250 +DIASTOLIC_LOWER_LIMIT = 40 +DIASTOLIC_UPPER_LIMIT = 200 +HEART_RATE_LOWER_LIMIT = 40 +HEART_RATE_UPPER_LIMIT = 180 +HEART_RATE_TITLE = "Heart Rate" +BLOOD_PRESSURE_TITLE = "Blood Pressure" +BLOOD_PRESSURE_UNIT = "mmHg" +HEART_RATE_UNIT = "BPM" @@ -131,4 +145,3 @@ - Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r7882eef58dfd3755ab3a6f2709a6e81f8662a0a2 -r75b5f2a93fc13f944d268961901be981dec4bfbe --- shared/scripts/configuration/utility.py (.../utility.py) (revision 7882eef58dfd3755ab3a6f2709a6e81f8662a0a2) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 75b5f2a93fc13f944d268961901be981dec4bfbe) @@ -150,3 +150,80 @@ 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.endSection() + + + + + + + + + + + + + + + + + + + + +############################################################################## +from configuration import config +from dialin.ui import utils +from builtins import int as pyInt +from datetime import datetime + +def get_current_date_and_time(): + + date_format='%Y/%b/%d - %H:%M' + date = datetime.now() + return str(date.strftime(date_format)) + + +def enter_keypad_value(entry): + """ + Method to enter user desired + value using keypad + @param entry: (str) User expected value + """ + test.startSection("Entering {}".format(entry)) + for value in entry: + value = pyInt(value) + key_val = squish.waitForObject(keypad_input(value)) + squish.mouseClick(key_val) + utils.waitForGUI(1) + test.endSection() + + +def erase_entered_value(input_field): + """ + Method to erase the entered value + @param input_field - (obj) object of input field + """ + test.startSection("Erasing value") + input_field= squish.waitForObject(input_field) + entered_value = str(input_field.text) + for value in entered_value: + utils.waitForGUI(1) + squish.mouseClick(squish.waitForObjectExists(names.o_back_space_key)) + + test.compare(str(input_field.text), "", "Input field should be empty") + test.endSection() + +def vitals_reading_obj(reading): + names.o_vitals_reading["text"] = reading + return names.o_vitals_reading + +def keypad_input(key_value): + names.o_keypad_input["text"] = key_value + return names.o_keypad_input + + + + + + + Index: shared/scripts/names.py =================================================================== diff -u -r7882eef58dfd3755ab3a6f2709a6e81f8662a0a2 -r75b5f2a93fc13f944d268961901be981dec4bfbe --- shared/scripts/names.py (.../names.py) (revision 7882eef58dfd3755ab3a6f2709a6e81f8662a0a2) +++ shared/scripts/names.py (.../names.py) (revision 75b5f2a93fc13f944d268961901be981dec4bfbe) @@ -92,21 +92,47 @@ o_PreTreatmentUltrafiltration_Indicators = {"container": o_PreTreatmentConsumblesStack_PreTreatmentUltrafiltration_PreTreatmentUltrafiltration, "id": "_nextStepsBullet", "type": "StepBullet", "unnamed": 1, "visible": True} o_PreTreatmentFlowBase_Indicators = {"container": o_PreTreatmentConsumblesStack_PreTreatmentBase_TreatmentFlowBase_2, "id": "_nextStepsBullet", "type": "StepBullet", "unnamed": 1, "visible": True} o_PreTreatmentUltrafiltration_NotificationBar_NotificationBar = {"container": o_PreTreatmentConsumblesStack_PreTreatmentUltrafiltration_PreTreatmentUltrafiltration, "objectName": "NotificationBar", "type": "NotificationBar", "visible": True} +o_PreTreatmentBase_input_TextInput_2 = {"container": o_PreTreatmentConsumblesStack_PreTreatmentBase_TreatmentFlowBase_2, "echoMode": 0, "id": "_input", "type": "TextInput", "unnamed": 1, "visible": True} -#o_swipeview_Item = {"container": o_PreTreatmentBase_swipeview_Swipeo_swipeview_Connect_arterial_and_venous_cartridge_lines_to_your_patient_access_lio_PreTreatmentBase_BP_HR_Text = {"container": o_PreTreatmentConsumblesStack_PreTreatmentBase_TreatmentFlowBase_2, "occurrence": 2, "text": "BP/HR", "type": "Text", "unnamed": 1, "visible": True} -nes_Text = {"container": o_PreTreatmentBase_swipeview_SwipeView, "text": "Connect arterial and venous cartridge lines to your patient access lines.", "type": "Text", "unnamed": 1, "visible": True} o_PreTreatmentBase_BP_HR_Text = {"container": o_PreTreatmentConsumblesStack_PreTreatmentBase_TreatmentFlowBase_2, "occurrence": 2, "text": "BP/HR", "type": "Text", "unnamed": 1, "visible": True} o_PreTreatmentBase_Blood_Pressure_Text = {"container": o_PreTreatmentConsumblesStack_PreTreatmentBase_TreatmentFlowBase_2, "text": "Blood Pressure", "type": "Text", "unnamed": 1, "visible": True} o_PreTreatmentBase_mmHg_Label = {"container": o_PreTreatmentConsumblesStack_PreTreatmentBase_TreatmentFlowBase_2, "text": "mmHg", "type": "Label", "unnamed": 1, "visible": True} o_PreTreatmentBase_Heart_Rate_Text = {"container": o_PreTreatmentConsumblesStack_PreTreatmentBase_TreatmentFlowBase_2, "text": "Heart Rate", "type": "Text", "unnamed": 1, "visible": True} o_PreTreatmentBase_BPM_Label = {"container": o_PreTreatmentConsumblesStack_PreTreatmentBase_TreatmentFlowBase_2, "text": "BPM", "type": "Label", "unnamed": 1, "visible": True} o_PreTreatmentBase_bloodPressureSystolic_TextEntry = {"container": o_PreTreatmentConsumblesStack_PreTreatmentBase_TreatmentFlowBase_2, "id": "_bloodPressureSystolic", "type": "TextEntry", "unnamed": 1, "visible": True} +#virtal keypad input field +o_keypad_input = {"container": o_Gui_MainView, "id":"keyText", "type": "Text", "unnamed": 1, "visible": True} +#virtal keypad back space key +#o_back_space_key = {"container": o_Gui_MainView, "id": "backspaceKeyIcon", "source": "qrc:/QtQuick/VirtualKeyboard/content/styles/default/images/backspace-868482.svg", "type": "Image", "unnamed": 1, "visible": True} -#o_pppppppp = {"container": o_PreTreatmentConsumblesStack_PreTreatmentBase_TreatmentFlowBase, "occurrence": 2, "type": "StepBullet", "unnamed": 1, "visible": True} +o_back_space_key = {"container": o_Gui_MainView, "id": "backspaceKeyBackground", "type": "Rectangle", "unnamed": 1, "visible": True} +####################################################### +#vitals +#vitals title text on main-treatment screen +o_vitals_title = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "VITALS", "type": "Text", "unnamed": 1, "visible": True} +#unit of measurement for blood pressure and heart rate +o_bp_uom = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "mmHg", "type": "Text", "unnamed": 1, "visible": True} +o_hr_uom = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "BPM", "type": "Text", "unnamed": 1, "visible": True} +#reading of vitals +o_vitals_reading = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "type": "Text", "unnamed": 1, "visible": True} +#vitals pop up confirm and close button +o_vitals_confrim_btn = {"container": o_treatmentStack_TreatmentStack, "text": "CONFIRM", "type": "Text", "unnamed": 1, "visible": True} +o_vitals_close_btn = {"container": o_treatmentStack_TreatmentStack, "id": "_image", "source": "qrc:/images/iClose", "type": "Image", "unnamed": 1, "visible": True} +#vitals title text vitals pop up +o_vitals_pop_up_title = {"container": o_treatmentStack_TreatmentStack, "text": "VITALS", "type": "Text", "unnamed": 1, "visible": True} +o_pop_up_bp_title = {"container": o_treatmentStack_TreatmentStack, "text": "Blood Pressure", "type": "Text", "unnamed": 1, "visible": True} +o_pop_up_heart_rate_title = {"container": o_treatmentStack_TreatmentStack, "text": "Heart Rate", "type": "Text", "unnamed": 1, "visible": True} +#unit of measurement for blood pressure and heart rate on pop up +o_pop_up_bp_uom = {"container": o_treatmentStack_TreatmentStack, "text": "mmHg", "type": "Label", "unnamed": 1, "visible": True} +o_pop_up_heart_rate_uom = {"container": o_treatmentStack_TreatmentStack, "text": "BPM", "type": "Label", "unnamed": 1, "visible": True} +#systolic, diastolic and heart rate input field +o_pop_up_systolic_input_field = {"container": o_treatmentStack_TreatmentStack, "echoMode": 0, "id": "_input", "type": "TextInput", "unnamed": 1, "visible": True} +o_pop_up_diastolic_input_field = {"container": o_treatmentStack_TreatmentStack, "echoMode": 0, "id": "_input", "occurrence": 2, "type": "TextInput", "unnamed": 1, "visible": True} +o_pop_up_heart_rate_input_field = {"backgroundcolor": "#254670", "container": o_treatmentStack_TreatmentStack, "echoMode": 0, "id": "_input", "occurrence": 3, "type": "TextInput", "unnamed": 1, "visible": True} Index: suite.conf =================================================================== diff -u -r7882eef58dfd3755ab3a6f2709a6e81f8662a0a2 -r75b5f2a93fc13f944d268961901be981dec4bfbe --- suite.conf (.../suite.conf) (revision 7882eef58dfd3755ab3a6f2709a6e81f8662a0a2) +++ suite.conf (.../suite.conf) (revision 75b5f2a93fc13f944d268961901be981dec4bfbe) @@ -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 Fisheye: Tag c6274593f3f5a607595b95f0243313a6cf32d599 refers to a dead (removed) revision in file `tst_case1/test.py'. Fisheye: No comparison available. Pass `N' to diff? Index: tst_pre_treatment_patient_connection/test.py =================================================================== diff -u -r7882eef58dfd3755ab3a6f2709a6e81f8662a0a2 -r75b5f2a93fc13f944d268961901be981dec4bfbe --- tst_pre_treatment_patient_connection/test.py (.../test.py) (revision 7882eef58dfd3755ab3a6f2709a6e81f8662a0a2) +++ tst_pre_treatment_patient_connection/test.py (.../test.py) (revision 75b5f2a93fc13f944d268961901be981dec4bfbe) @@ -78,8 +78,47 @@ test.compare(rejection_message.text, config.REJECTION_REASON[rejection], "expected rejection {msg} displayed".format(msg=config.REJECTION_REASON[rejection])) test.endSection() + + +def keypad_input(key_value): + """ + Method to enter values using applicatio UI keyboard + @param key_value: (str) User expected value + """ + if key_value is not None: + names.o_keypad_input["text"] = key_value + return names.o_keypad_input + else: + test.log("Invalid text for object.") + names.o_keypad_input["text"] = "Q" + + +def enter_keypad_value(entry): + """ + Method to enter user desired + value using keypad + @param entry: (str) User expected value + """ + test.startSection("Entering {}".format(entry)) + for value in entry: +# value = int(value) + mouseClick(waitForObject(keypad_input(value))) + test.endSection() + +def erase_entered_value(input_field): + """ + Method to erase the entered value + @param input_field - (obj) object of input field + """ + input_field = waitForObject(input_field).text + for value in input_field: + test.log(str(value)) + mouseClick(squish.waitForObjectExists(names.o_back_space_key)) + + test.compare(input_field, "", "Input field should be empty") + def verify_entered_valid_vital_entries_in_main_treatment_screen(sys_val, dia_val, heart_rate, save): """ method to enter systolic, diastolic and heart rate value and save or unsave it and verify @@ -91,26 +130,22 @@ """ test.startSection("Verify the entered systolic, diastolic and heart rate value updated in main-treatement screen") mouseClick(waitForObject(names.o_PreTreatmentBase_bloodPressureSystolic_TextEntry)) - erase_entered_value(waitForObject(names.o_PreTreatmentBase_bloodPressureSystolic_TextEntry)) - type(waitForObject(names.o_PreTreatmentBase_bloodPressureSystolic_TextEntry), sys_val) - test.compare(str(waitForObjectExists(names.o_PreTreatmentBase_bloodPressureSystolic_TextEntry).enabled, True, "Tutorial text should be enabled.")) - test.compare(str(waitForObjectExists(names.o_swipeview_tutorial_text).text, config.TUTORIAL_TEXT[screen_indicator], "Tutorial text should be {msg}".format(msg=config.TUTORIAL_TEXT[screen_indicator]))) - - - + erase_entered_value(names.o_PreTreatmentBase_input_TextInput_2) + enter_keypad_value(str(sys_val)) - verify_entered_value_in_pop_up(value=str(sys_val), input_field=systolic, - vital=SYSTOLIC_TEXT) - verify_color_of_entry(entry=sys_val, vital_parameter=SYSTOLIC_TEXT, - input_field=systolic) - diastolic = waitForObject(names.o_pop_up_diastolic_input_field) - mouseClick(diastolic) + test.verify(waitForObjectExists(names.o_PreTreatmentBase_bloodPressureSystolic_TextEntry).enabled, "systolic value should be enabled.") + test.compare(waitForObjectExists(names.o_PreTreatmentBase_bloodPressureSystolic_TextEntry).text, str(sys_val), "systolic value should be : "+str(sys_val)) + verify_color_of_entry(entry=sys_val, vital_parameter=SYSTOLIC_TEXT, input_field=waitForObject(names.o_PreTreatmentBase_input_TextInput_2)) + + + mouseClick(waitForObject(names.o_pop_up_diastolic_input_field)) erase_entered_value(diastolic) enter_keypad_value(str(dia_val)) verify_entered_value_in_pop_up(value=str(dia_val), input_field=diastolic, vital=DIASTOLIC_TEXT) verify_color_of_entry(entry=dia_val, vital_parameter=DIASTOLIC_TEXT, input_field=diastolic) + hr = waitForObject(names.o_pop_up_heart_rate_input_field) mouseClick(hr) erase_entered_value(hr) @@ -142,7 +177,7 @@ """ Method to verify the color of entry of systolic, diastolic and heart rate - @param entry: (int) user user entered value + @param entry: (int) user entered value @param vital_parameter - (str) parameter name under which user is entering value (sys/dia/heart rate) @param input_field - (obj) object of input field """ @@ -208,26 +243,7 @@ for instruction_screen in (screen_indicator): mouseClick(waitForObject(names.o_PreTreatmentBase_leftImage_Image)) - - -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