Index: shared/scripts/configuration/config.py =================================================================== diff -u -r8a96eff7a1459811a63915da2ee65e907f11f0d5 -r433c0e7b21dd0f7df645e8a25c12b41abe004802 --- shared/scripts/configuration/config.py (.../config.py) (revision 8a96eff7a1459811a63915da2ee65e907f11f0d5) +++ shared/scripts/configuration/config.py (.../config.py) (revision 433c0e7b21dd0f7df645e8a25c12b41abe004802) @@ -27,6 +27,15 @@ "Magenta":"#fd28fd", "Orange": "#f2721c", "Peach":"#f1979a", "Red": "#c53b33", "Rose":"#fc178d", "Slate blue":"#7f7ffa", "Violet": "#6435c9", "White": "#ffffff", "Yellow": "#fcfc4d"} +#standby mode +GOODMORNING_START_TIME_SEC = 0 +GOODEVENING_START_TIME_SEC = 43200 +BLOOD_PRIMING_DEFAULT_VALUE = "0 mL" + +CURRENT_COLOR = '#000000' +COMPLETE_COLOR= '#4290ec' +ENABLED_COLOR = '#fcfcfc' +INCOMPLETE_COLOR = '#607a91' #patient id PATIENT_ID_COMBINATION = { "qwerty" : "qwerty", Index: shared/scripts/configuration/strings.py =================================================================== diff -u -r8a96eff7a1459811a63915da2ee65e907f11f0d5 -r433c0e7b21dd0f7df645e8a25c12b41abe004802 --- shared/scripts/configuration/strings.py (.../strings.py) (revision 8a96eff7a1459811a63915da2ee65e907f11f0d5) +++ shared/scripts/configuration/strings.py (.../strings.py) (revision 433c0e7b21dd0f7df645e8a25c12b41abe004802) @@ -15,3 +15,7 @@ # @date (last) 14-June-2022 # ############################################################################ + +#StandBy Mode +BLOOD_PRIMING_TEXT = "Blood Priming" +SALINE_UNIT = "mL" \ No newline at end of file Index: shared/scripts/configuration/utility.py =================================================================== diff -u -re3d34569087834bc6a6e1758480b425819d72408 -r433c0e7b21dd0f7df645e8a25c12b41abe004802 --- shared/scripts/configuration/utility.py (.../utility.py) (revision e3d34569087834bc6a6e1758480b425819d72408) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 433c0e7b21dd0f7df645e8a25c12b41abe004802) @@ -11,104 +11,3 @@ # @date (last) 15-Jan-2022 # ############################################################################ - - -import sys -import test -import squish -from configuration import config - -from builtins import int as pyInt -from builtins import str as pyStr -from builtins import float as pyFloat - - - -def start_application(app_name): - """ - Function to start application and verify application status [running] - If application does not start or running status is false, test stops - Argument: - @param app_name : (str) - Name of the application - @param app_executable : (str) - Actual application - @return: handle for the application if the application is in running state, - or error (exist the application) - """ - counter = 0 - while True: - try: - counter += 1 - test.log("Starting {}".format(app_name)) - squish.startApplication(app_name) - if counter == 1: - test.log(f"Application launched at the {counter}'st try.") - elif counter == 2: - test.log(f"Application launched at the {counter}'nd try.") - elif counter == 3: - test.log(f"Application launched at the {counter}'rd try.") - else: - test.log(f"Application launched at the {counter}'th try.") - break - except RuntimeError: - if counter == 1: - test.log(f"Application failed to launch after {counter} try - Please refer logs") - elif counter == 20: - test.log(f"Exiting after {counter} tries..") - sys.exit(1) - else: - test.log(f"Application failed to launch after {counter} tries - Please refer logs") - except: - logErrorDetails("Failed to start the application") - sys.exit(1) - - -def check_if_object_is_within_the_container(obj=None, container=None): - """ - check if an object is inside a container - @param obj - child UI object - @param container - container UI object - Return: boolean True/False - """ - container = squish.findObject(container) - containerPos = container.mapToGlobal(squish.QPoint(0, 0)) - container_x, container_y = pyInt(containerPos.x), pyInt(containerPos.y) - container_width, container_height = pyInt(container.width), pyInt(container.height) - - obj = squish.findObject(obj) - objPos = obj.mapToGlobal(squish.QPoint(0, 0)) - obj_x, obj_y = pyInt(objPos.x), pyInt(objPos.y) - obj_width, obj_height = pyInt(obj.width), pyInt(obj.height) - - if obj_x >= container_x and obj_y >= container_y: - if (obj_x + obj_width) <= (container_x + container_width) and (obj_y + obj_height) <= (container_y + container_height): - return True - - return False - - -def scroll_to_zone(zone=None, screen_object=None): - """ - scroll to the numeric if object is hidden - @param zone - UI object - @param screen_object - UI object - Return: boolean True/False - """ - counter = 0 - while counter <= 100: - try: - counter += 1 - squish.findObject(zone) - squish.snooze(0.5) - if check_if_object_is_within_the_container(obj=zone, container=screen_object): - return True - else: - raise RuntimeError - except RuntimeError: - ScreenObj = squish.waitForObject(screen_object) - screenHeight = pyInt(ScreenObj.height) - screenWidth = pyInt(ScreenObj.width) - squish.mouseWheel(ScreenObj, screenWidth-1000, - screenHeight-10, 0, -50, squish.Qt.NoModifier) - - raise LookupError("zone object is not in view to the user after " + \ - "trying 100 times") Index: tst_patient_id/test.py =================================================================== diff -u -rda46595d179733486cc338c18fc0df1f31eb7f0d -r433c0e7b21dd0f7df645e8a25c12b41abe004802 --- tst_patient_id/test.py (.../test.py) (revision da46595d179733486cc338c18fc0df1f31eb7f0d) +++ tst_patient_id/test.py (.../test.py) (revision 433c0e7b21dd0f7df645e8a25c12b41abe004802) @@ -18,15 +18,13 @@ import names from dialin.ui import utils from dialin.ui.hd_simulator import HDSimulator - from configuration import utility, config def keyboard_object_map_helper(text): """ - Method for setting custom object property's for keyboard keys - - @return: required object property's for keys + Method for setting custom object property's for keyboard keys + @return: required object property's for keys """ if text is not None: names.o_keboard_input["text"] = text @@ -38,9 +36,8 @@ def keyboard_switching_section(text): """ - Tests to automate keyboard based on user input - - @return: key text (text displayed on keyboard) + Tests to automate keyboard based on user input + @return: key text (text displayed on keyboard) """ keyboard_value = keyboard_object_map_helper(text) object_status = object.exists(keyboard_value) @@ -84,13 +81,10 @@ if object_status is True: return text - - def user_input_clear_option(): """ - Tests to clear retained patient id - - @return: N/A + Tests to clear retained patient id + @return: N/A """ patient_id_input = waitForObject(names.o_input_patient_id) patient_id = str(patient_id_input.text) @@ -101,11 +95,10 @@ patient_id_length = patient_id_length - 1 -def validation_of_valid_patient_id_through_keypad(expected_value, actual_value): +def verify_valid_patient_id_through_keypad(expected_value, actual_value): """ - Tests verifies valid patient id set through application keyboard setup . - - @return: N/A + Tests verifies valid patient id set through application keyboard setup . + @return: N/A """ patient_id_input = waitForObject(names.o_input_patient_id) mouseClick(patient_id_input) @@ -122,16 +115,15 @@ custom_treatment = waitForObject(names.o_custom_treatment) test.compare("Create a Custom Treatment", custom_treatment.text) - test.log("user successfully authenticated through patient id -> " + expected_value + "using keypad.") + test.log("User successfully authenticated through patient id -> " + expected_value + "using keypad.") mouseClick(waitForObject(names.o_create_back_button)) -def validation_of_valid_patient_id_through_user_input(expected_value, actual_value): +def verify_valid_patient_id_through_user_input(expected_value, actual_value): """ - Tests verifies valid patient id set through user's input. - - @return: N/A + Tests verifies valid patient id set through user's input. + @return: N/A """ patient_id_input = waitForObject(names.o_input_patient_id) mouseClick(waitForObject(patient_id_input)) @@ -144,39 +136,38 @@ custom_treatment = waitForObject(names.o_custom_treatment) test.compare("Create a Custom Treatment", custom_treatment.text) - test.log("user successfully authenticated through patient id ->"+ actual_value) + test.log("User successfully authenticated through patient id ->"+ actual_value) mouseClick(waitForObject(names.o_create_back_button)) def verify_confirm_button_based_on_patient_id(patient_id): """ - Tests verifies confirm button based on patient id. - @input : patient id to be set - @return: N/A + Tests verifies confirm button based on patient id. + @input : patient id to be set + @return: N/A """ utils.waitForGUI(1) if patient_id is None: mouseClick( waitForObject(names.o_input_patient_id)) type( waitForObject(names.o_input_patient_id), " ") confirm_button_status = findObject(names.o_confirm_button) if confirm_button_status.enabled == False: - test.passes("confirm button disabled without patient id") + test.passes("Confirm button disabled without patient id") else: - test.fail("confirm button enabled without patient id") + test.fail("Confirm button enabled without patient id") else: confirm_button_status = waitForObject(names.o_confirm_button) if confirm_button_status.enabled == True: - test.passes("confirm button enabled with patient id -> " + str(patient_id)) + test.passes("Confirm button enabled with patient id -> " + str(patient_id)) else: - test.fail("confirm button disabled with patient id -> " + str(patient_id)) + test.fail("Confirm button disabled with patient id -> " + str(patient_id)) -def validation_of_invalid_patient_id_through_user_input(expected_value): +def verify_invalid_patient_id_through_user_input(expected_value): """ - Tests verifies invalid patient id set through user's input. - - @return: N/A + Tests verifies invalid patient id set through user's input. + @return: N/A """ patient_id_input = waitForObject(names.o_input_patient_id) mouseClick(patient_id_input) @@ -201,9 +192,9 @@ mouseClick(waitForObject(names.o_input_patient_id)) for expected_patient_id, actual_patient_id in config.PATIENT_ID_COMBINATION.items(): - validation_of_valid_patient_id_through_keypad(expected_patient_id, actual_patient_id) + verify_valid_patient_id_through_keypad(expected_patient_id, actual_patient_id) mouseClick(waitForObject(names.o_PreTreatmentPatientid_back_button)) - validation_of_valid_patient_id_through_user_input(expected_patient_id, actual_patient_id) + verify_valid_patient_id_through_user_input(expected_patient_id, actual_patient_id) #verification of confirm button without giving patient id verify_confirm_button_based_on_patient_id(patient_id = None)