Index: shared/scripts/configuration/config.py =================================================================== diff -u -r4ed4c2250cb188ddd5984fea7910d6c9fecaab82 -r9adc943bb139152cea73c31b2d508b2cea3d6ec5 --- shared/scripts/configuration/config.py (.../config.py) (revision 4ed4c2250cb188ddd5984fea7910d6c9fecaab82) +++ shared/scripts/configuration/config.py (.../config.py) (revision 9adc943bb139152cea73c31b2d508b2cea3d6ec5) @@ -25,10 +25,9 @@ "Slate blue":"#7f7ffa", "Violet": "#6435c9", "White": "#ffffff", "Yellow": "#fcfc4d"} #Service password loction -CONFIG_PATH = Path(os.getcwd()) -HOME_DIR_PATH = CONFIG_PATH.parent.parent.parent +HOME_DIR_PATH = "/home/denali" SERVICE_CONF_LOCATION ="".join([str(HOME_DIR_PATH),'/Projects/application/resources/settings/Settings/System.conf']) - +APPLICATION_FOLDER_LOCATION = "".join([str(HOME_DIR_PATH)+'/Projects/']) #standby mode GOODMORNING_START_TIME_SEC = 0 GOODEVENING_START_TIME_SEC = 43200 @@ -46,10 +45,10 @@ PASSWORD = 123 #wifi screen -IP_ADDRESS = {"valid" : "192.168.1.1","invalid" : "192.168.1"} -GATEWAY = {"valid" : "255.255.255.0", "invalid" : "255.255.255"} -SUBNET_MASK = {"valid" : "255.255.255.0", "invalid" : "255.255.255"} -DNS = {"valid" : "0.0.0.0", "invalid" : "255.255.255"} +IP_ADDRESS = {"valid" : "192.168.1.1","invalid" : "1.2.2.3"} +GATEWAY = {"valid" : "255.255.255.0", "invalid" : "1.2.3.4"} +SUBNET_MASK = {"valid" : "255.255.255.0", "invalid" : "3.4.2.1"} +DNS = {"valid" : "0.0.0.0", "invalid" : "3.2.1.3"} #dg cleaning WATER_FLUSH_TIME_HOUR = {"valid" : "23","invalid" : "24"} Index: shared/scripts/configuration/utility.py =================================================================== diff -u -rab623514918cd48e531391afbc5a9c365e00a109 -r9adc943bb139152cea73c31b2d508b2cea3d6ec5 --- shared/scripts/configuration/utility.py (.../utility.py) (revision ab623514918cd48e531391afbc5a9c365e00a109) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 9adc943bb139152cea73c31b2d508b2cea3d6ec5) @@ -11,8 +11,10 @@ # @date (last) 15-Jan-2022 # ############################################################################ +import os import names import squish +import shutil import test import csv from dialin.ui import utils @@ -89,4 +91,74 @@ key_val = squish.waitForObject(keyboard_input(value)) squish.mouseClick(key_val) utils.waitForGUI(0.1) - test.endSection() \ No newline at end of file + test.endSection() + + + +def rename_file(path,filename): + """ + This method Rename the original folder name to dummy name. + """ + folder_path = os.listdir(path) + for files in folder_path: + if files == filename+"_1": + if os.path.exists(path+filename+"_1"): + shutil.rmtree(path+filename+"_1") + test.log(str(filename+" name changed to "+files)) + if files == filename: + if os.path.exists(path+filename): + utils.waitForGUI(1) + os.rename(path+filename,path+filename+"_1") + test.log(str(files+" name changed to "+filename+"_1")) + +def rename_old_name(path,filename): + """ + This method Rename the dummy name to original folder name . + """ + folder_path = os.listdir(path) + for files in folder_path: + if files == filename: + if os.path.exists(path+filename): + shutil.rmtree(path+filename) + test.log(str(files+"_1 name changed to "+filename)) + utils.waitForGUI(5) + if files != filename: + if (files == filename+"_1"): + os.rename(path+files,path+filename) + test.log(str(files+" name changed to "+filename)) + +def scroll_to_zone(zone=None, screen_object=None, direction = None): + """ + scroll to the to the value if object is hidden + @param value - (obj) value object + @param container - (obj) Container of the value + @return boolean true and 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.findObject(screen_object) + screenHeight = pyInt(ScreenObj.height) + screenWidth = pyInt(ScreenObj.width) + if direction is None: + squish.mouseWheel(ScreenObj, (screenWidth-100), 107, 0, -(screenHeight-460), squish.Qt.NoModifier) + else: + squish.mouseWheel(ScreenObj, (screenWidth-100), -(screenHeight-700), 0, 200, squish.Qt.NoModifier) + + raise LookupError("zone object is not in view to the user after trying 100 times") + + + + + + + + \ No newline at end of file Index: shared/scripts/names.py =================================================================== diff -u -rb1802548b7756d3ca7689a0125c89127be8e373a -r9adc943bb139152cea73c31b2d508b2cea3d6ec5 --- shared/scripts/names.py (.../names.py) (revision b1802548b7756d3ca7689a0125c89127be8e373a) +++ shared/scripts/names.py (.../names.py) (revision 9adc943bb139152cea73c31b2d508b2cea3d6ec5) @@ -120,6 +120,8 @@ o_show_password = {"container": o_userConfirmation_UserConfirmation, "id": "_showPassword", "source": "qrc:/images/iEye", "type": "Image", "unnamed": 1, "visible": True} o_switch_keyboard_to_keypad = {"container": o_Gui_MainView, "text": "&123", "type": "Text", "unnamed": 1, "visible": True} o_keyboard_object = {"container": o_Gui_MainView, "type": "Text", "unnamed": 1, "visible": True} +o_SettingsBase_ScrollBar = {"container": o_SettingsBase_SettingsBase, "type": "ScrollBar", "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 @@ -141,7 +143,12 @@ o_SettingsBase_mouseArea_MouseArea = {"container": o_SettingsBase_SettingsWiFi, "id": "_mouseArea", "type": "MouseArea", "unnamed": 1, "visible": True} o_SettingsBase_Scan_Finished_Text = {"container": o_SettingsBase_SettingsWiFi, "text": "Scan Finished", "type": "Text", "unnamed": 1, "visible": True} o_SettingsBase_mouseArea_MouseArea_3 = {"container": o_SettingsBase_SettingsWiFi, "id": "_mouseArea", "occurrence": 2, "type": "MouseArea", "unnamed": 1, "visible": True} +o_bluetooth_cuff_button_rect ={"container": o_SettingsHome_SettingsHome_2, "id": "_mouseArea", "occurrence": 4, "type": "MouseArea", "unnamed": 1, "visible": True} #Manager o_manager_Text = {"container": o_Gui_MainView, "text": "Manager", "type": "Text", "unnamed": 1, "visible": True} o_treatment_management = {"container": o_Gui_MainView, "text": "Treatment Management", "type": "Text", "unnamed": 1, "visible": True} + + + + Index: tst_settings_information/test.py =================================================================== diff -u -r5d66024fa1c6079e344883fa1726b3228ec6cf16 -r9adc943bb139152cea73c31b2d508b2cea3d6ec5 --- tst_settings_information/test.py (.../test.py) (revision 5d66024fa1c6079e344883fa1726b3228ec6cf16) +++ tst_settings_information/test.py (.../test.py) (revision 9adc943bb139152cea73c31b2d508b2cea3d6ec5) @@ -338,7 +338,7 @@ Method to verify "Wi-Fi" screen """ test.startSection("Verifying Wi-Fi setting") - utils.waitForGUI(0.2) + utils.waitForGUI(0.5) mouseClick(waitForObjectExists(names.o_SettingsHome_wifi_Text)) test.compare(waitForObjectExists(names.o_SettingsBase_Wi_Fi_Text).text, config.WIFI_TITLE_TEXT,"Wi-Fi Title must be {}".format(config.WIFI_TITLE_TEXT)) test.compare(waitForObjectExists(names.o_SettingsBase_IP_Address_Text).text, config.IP_ADDRESS_TEXT,"IP Address Text must be {}".format(config.IP_ADDRESS_TEXT)) @@ -383,6 +383,8 @@ key_val = squish.waitForObject(utility.keyboard_input(value)) squish.mouseClick(key_val) utils.waitForGUI(0.1) + type(waitForObject(param), "") + utils.waitForGUI(0.1) test.endSection() @@ -439,18 +441,24 @@ Method to verify "Bluetooth Cuff" screen """ test.startSection("Verifying Bluetooth Cuff Setting") - utils.waitForGUI(0.2) + utils.waitForGUI(0.5) mouseClick(waitForObjectExists(names.o_SettingsHome_mouseArea_MouseArea)) test.compare(waitForObjectExists(names.o_SettingsBase_Bluetooth_Cuff_Text).text, config.BLUETOOTH_CUFF_TITLE_TEXT,"Bluetooth Cuff Title must be {}".format(config.BLUETOOTH_CUFF_TITLE_TEXT)) test.compare(waitForObjectExists(names.o_SettingsBase_Devices_Label).text, config.DEVICES_TEXT,"Devices must be {}".format(config.DEVICES_TEXT)) test.compare(waitForObjectExists(names.o_SettingsBase_SCAN_Text_2).text, config.SCAN_TEXT,"SCAN Text must be {}".format(config.SCAN_TEXT)) test.compare(waitForObjectExists(names.o_back_button).text, config.BACK_BUTTON_TEXT,"BACK Button Text must be {}".format(config.BACK_BUTTON_TEXT)) + utility.scroll_to_zone(zone=names.o_SettingsBase_ScrollBar, screen_object=names.o_SettingsBase_ScrollBar, direction = None) + utils.waitForGUI(1) + utility.scroll_to_zone(zone=names.o_SettingsBase_ScrollBar, screen_object=names.o_SettingsBase_ScrollBar, direction = "Top") + utils.waitForGUI(1) mouseClick(waitForObjectExists(names.o_SettingsBase_mouseArea_MouseArea_4)) utils.waitForGUI(1) test.compare(waitForObjectExists(names.o_SettingsBase_bluetooth_cuff_notification_text_one).text, config.BLUETOOTH_CUFF_NOTIFICATION_MESSAGE_TEXT,"Notification Message Text must be {}".format(config.BLUETOOTH_CUFF_NOTIFICATION_MESSAGE_TEXT)) + doubleClick(waitForObjectExists(names.o_SettingsBase_mouseArea_MouseArea_4)) + utils.waitForGUI(1) mouseClick(waitForObjectExists(names.o_SettingsBase_mouseArea_MouseArea_2)) + utils.waitForGUI(1) test.endSection() - def verify_water_flush_heat_disinfection_dg_cleaning_setting(parameter): """ @@ -571,14 +579,43 @@ mouseClick(waitForObjectExists(names.o_service_back_btn)) utils.waitForGUI(1) test.endSection() + +def verify_missing_path(): + try: + utility.rename_file(config.APPLICATION_FOLDER_LOCATION,"application") + utils.waitForGUI(0.2) + test.log("Navigating to 'Volume and Brightness' screen") + mouseClick(waitForObjectExists(settings_text_obj(config.VOLUME_AND_BRIGHTNESS_TEXT))) + utils.waitForGUI(0.5) + mouseClick(waitForObjectExists(service_date_obj(config.BACK_TEXT))) + utils.waitForGUI(0.5) + test.log("Navigating to 'wifi' screen") + mouseClick(waitForObjectExists(names.o_SettingsHome_wifi_Text)) + utils.waitForGUI(0.5) + mouseClick(waitForObjectExists(names.o_SettingsBase_mouseArea_MouseArea_3)) + utils.waitForGUI(0.5) + mouseClick(waitForObjectExists(names.o_SettingsBase_mouseArea_MouseArea)) + test.log("Navigating to 'Bluetooth cuff' screen") + utils.waitForGUI(0.5) + mouseClick(waitForObjectExists(names.o_bluetooth_cuff_button_rect)) + utils.waitForGUI(0.5) + mouseClick(waitForObjectExists(names.o_SettingsBase_mouseArea_MouseArea_4)) + utils.waitForGUI(0.5) + mouseClick(waitForObjectExists(names.o_SettingsBase_mouseArea_MouseArea_2)) + + except: + test.log(str("Failed to verify missing path scenario")) + finally: + utility.rename_old_name(config.APPLICATION_FOLDER_LOCATION,"application") + def main(): utils.tstStart(__file__) startApplication(config.AUT_NAME) navigate_to_settings_screen() - + verify_settings_parameters() verify_parameters_under_information() verify_hd_and_dg_versions(hd_major=10, hd_minor=20, hd_micro=30, hd_build=4000, hd_fpga_id=50, @@ -604,31 +641,32 @@ hd_serial="HD09876543210987", dg_major=100, dg_minor=95, dg_micro=105, dg_build=1000, dg_fpga_id=124, dg_fpga_major=75, dg_fpga_minor=65, dg_fpga_lab=125, dg_compatibility_rev=4000, dg_serial="DG9876543210987") - + utils.waitForGUI(0.5) verify_service_date(hd_day=DAY_3, hd_month=MONTH_NOVEMBER, hd_year=YEAR_2022, hd_interval_days=INTERVAL_DAYS_2_YEARS, dg_day=DAY_25, dg_month=MONTH_JAN, dg_year=YEAR_1977, dg_interval_days=INTERVAL_DAYS_1_YEARS) - + utils.waitForGUI(0.5) verify_service_date(hd_day=DAY_25, hd_month=MONTH_JAN, hd_year=YEAR_1977, hd_interval_days=INTERVAL_DAYS_1_YEARS, dg_day=DAY_12, dg_month=MONTH_APRIL, dg_year=YEAR_2001, dg_interval_days=INTERVAL_DAYS_6_MONTHS) - + utils.waitForGUI(0.5) verify_service_date(hd_day=DAY_12, hd_month=MONTH_APRIL, hd_year=YEAR_2001, hd_interval_days=INTERVAL_DAYS_6_MONTHS, dg_day=DAY_30, dg_month=MONTH_AUGUST, dg_year=YEAR_2045, dg_interval_days=INTERVAL_DAYS_10_MONTHS) - + utils.waitForGUI(0.5) verify_service_date(hd_day=DAY_30, hd_month=MONTH_AUGUST, hd_year=YEAR_2045, hd_interval_days=INTERVAL_DAYS_10_MONTHS, dg_day=DAY_3, dg_month=MONTH_NOVEMBER, dg_year=YEAR_2022, dg_interval_days=INTERVAL_DAYS_2_YEARS) - + test.log("Navigating to 'Settings' screen") mouseClick(waitForObjectExists(service_date_obj(config.BACK_TEXT))) utils.waitForGUI(0.5) test.log("Navigating to 'Volume and Brightness' screen") mouseClick(waitForObjectExists(settings_text_obj(config.VOLUME_AND_BRIGHTNESS_TEXT))) verify_volume_and_brightness_section() verify_alarm_volume() - + verify_wifi_setting() verify_bluetooth_cuff_setting() verify_dg_cleaning_setting() verify_service_password_screen() + verify_missing_path() utils.tstDone() \ No newline at end of file