Index: shared/scripts/configuration/config.py =================================================================== diff -u -r12616c1433e07f9fad99a5a5cf5243cf5b38d7a5 -r601e6a8d7aab96143cd363a40088eefc29439672 --- shared/scripts/configuration/config.py (.../config.py) (revision 12616c1433e07f9fad99a5a5cf5243cf5b38d7a5) +++ shared/scripts/configuration/config.py (.../config.py) (revision 601e6a8d7aab96143cd363a40088eefc29439672) @@ -37,7 +37,7 @@ ALARMS_CONF_LOCATION = "".join([str(HOME_DIR_PATH),'/Projects/application/resources/settings/Alarms/Alarms.conf']) ALARM_MAPPING_CSV_FILE_LOCATION = "".join([str(HOME_DIR_PATH)+'/Projects/denali/AlarmMapping.csv']) ALARM_MAPPING_CSV_DIR_LOCATION = "".join([str(HOME_DIR_PATH)+'/Projects/denali/']) - +APPLICATION_FOLDER_LOCATION = "".join([str(HOME_DIR_PATH)+'/Projects/']) NUM_OF_ALARM_PRIORITIES = 4 # Total number of alarm priorities Index: shared/scripts/configuration/utility.py =================================================================== diff -u -rce5a0db0c7033fbf15d8725a4e9973372a611c92 -r601e6a8d7aab96143cd363a40088eefc29439672 --- shared/scripts/configuration/utility.py (.../utility.py) (revision ce5a0db0c7033fbf15d8725a4e9973372a611c92) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 601e6a8d7aab96143cd363a40088eefc29439672) @@ -17,8 +17,10 @@ import names import squish import test - +import os +import shutil from builtins import int as pyInt +from dialin.ui import utils from configuration import config from dialin.ui.hd_simulator import HDSimulator @@ -123,6 +125,39 @@ raise LookupError("zone object is not in view to the user after " + \ "trying 100 times") + +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)) + Index: tst_ui_alarms_list/test.py =================================================================== diff -u -rd60eae936a349fdd5ff5636b381aebd5df58e501 -r601e6a8d7aab96143cd363a40088eefc29439672 --- tst_ui_alarms_list/test.py (.../test.py) (revision d60eae936a349fdd5ff5636b381aebd5df58e501) +++ tst_ui_alarms_list/test.py (.../test.py) (revision 601e6a8d7aab96143cd363a40088eefc29439672) @@ -439,22 +439,35 @@ os.chdir(current_work_dir) test.log(str(os.getcwd())) +def verify_missing_path(): + """ + This method is used to execute the alarms while respective files is not present. + """ + try: + utility.rename_file(config.APPLICATION_FOLDER_LOCATION,"application") + utils.waitForGUI(0.2) + generate_alarm_ids(accept=config.ACCEPTED, reason_id=0) + except: + test.log(str("Error occured while generating alarms")) + finally: + utility.rename_old_name(config.APPLICATION_FOLDER_LOCATION,"application") + def main(): verify_alarmMapping_csv() utils.tstStart(__file__) startApplication(config.AUT_NAME+ " -q") - + generate_alarm_ids(accept=config.ACCEPTED, reason_id=0) - + utils.waitForGUI(1) verify_alarm_msg_for_undefined_alarm_id() - + utils.waitForGUI(1) verify_alarm_dialogue_is_displayed(id=1000, state=AlarmPriorities.ALARM_PRIORITY_MEDIUM.value) - + verify_missing_path() utils.tstDone()