def test_Add_Job_Title(self): try: logger_obj.info("test_1Add_Job_Title called") driver = self.driver job_mgmt = Job_utility(driver) job_mgmt.navigate_jobTitles() list_titles_before_add = job_mgmt.get_job_title_list() job_mgmt.add_job_title(utils.job_title_cto, utils.job_spec_cto, utils.job_description_cto, utils.job_notes_cto) list_titles_after_add = job_mgmt.get_job_title_list() if int(len(list_titles_after_add)) > int( len(list_titles_before_add) ) and utils.job_title_cto in list_titles_after_add: print(utils.job_title_cto + " added Successfully") else: print("Failed to add " + utils.job_title_cto) except Exception as e: logger_obj.exception("File Name : {current_py_file_name} ".format( current_py_file_name=os.path.basename(__file__)), exc_info=False) logger_obj.exception("Error : ", exc_info=False) logger_obj.exception("Type --> " + type(e).__name__, exc_info=False) logger_obj.exception("Details --> " + str(e), exc_info=False) ExceptionUtility.call_exception_utility(exit_code=1)
def test_Add_Job_Categories(self): try: logger_obj.info("7Add_Job_Categories called") driver = self.driver job_mgmt = Job_utility(driver) job_mgmt.login_jobCategories() job_mgmt.add_jobCategories(utils.job_category_it_professional) except Exception as e: logger_obj.exception("File Name : {current_py_file_name} ".format( current_py_file_name=os.path.basename(__file__)), exc_info=False) logger_obj.exception("Error : ", exc_info=False) logger_obj.exception("Type --> " + type(e).__name__, exc_info=False) logger_obj.exception("Details --> " + str(e), exc_info=False) ExceptionUtility.call_exception_utility(exit_code=1)
def test_Add_Employment_status(self): try: logger_obj.info("test_5Add_Employment_status called") driver = self.driver job_mgmt = Job_utility(driver) job_mgmt.login_employmentStatus() job_mgmt.add_empStatus(utils.emp_status_name) except Exception as e: logger_obj.exception("File Name : {current_py_file_name} ".format( current_py_file_name=os.path.basename(__file__)), exc_info=False) logger_obj.exception("Error : ", exc_info=False) logger_obj.exception("Type --> " + type(e).__name__, exc_info=False) logger_obj.exception("Details --> " + str(e), exc_info=False) ExceptionUtility.call_exception_utility(exit_code=1)
def test_Add_PayGrade(self): try: logger_obj.info("test_3Add_PayGrade called") driver = self.driver job_mgmt = Job_utility(driver) job_mgmt.login_payGrades() job_mgmt.add_payGrades(utils.pay_grade_level, utils.pay_currency, utils.min_salary, utils.max_salary) except Exception as e: logger_obj.exception("File Name : {current_py_file_name} ".format( current_py_file_name=os.path.basename(__file__)), exc_info=False) logger_obj.exception("Error : ", exc_info=False) logger_obj.exception("Type --> " + type(e).__name__, exc_info=False) logger_obj.exception("Details --> " + str(e), exc_info=False) ExceptionUtility.call_exception_utility(exit_code=1)
def test_Edit_Work_Shifts(self): try: logger_obj.info("test_10Edit_Work_Shifts called") driver = self.driver job_mgmt = Job_utility(driver) job_mgmt.login_workShifts() job_mgmt.edit_work_shift_details(utils.shift_name, utils.shift_name_to_edit) except Exception as e: logger_obj.exception("File Name : {current_py_file_name} ".format( current_py_file_name=os.path.basename(__file__)), exc_info=False) logger_obj.exception("Error : ", exc_info=False) logger_obj.exception("Type --> " + type(e).__name__, exc_info=False) logger_obj.exception("Details --> " + str(e), exc_info=False) ExceptionUtility.call_exception_utility(exit_code=1)
def test_Edit_Job_Title(self): try: logger_obj.info("test_2Edit_Job_Title called") driver = self.driver job_mgmt = Job_utility(driver) job_mgmt.navigate_jobTitles() edited = job_mgmt.edit_job_title(utils.job_title_cto, utils.job_description_cto, utils.job_notes_cto) if edited is True: print(utils.job_title_cto + " edited successfully") else: print("Failed to edit " + utils.job_title_cto) except Exception as e: logger_obj.exception("File Name : {current_py_file_name} ".format( current_py_file_name=os.path.basename(__file__)), exc_info=False) logger_obj.exception("Error : ", exc_info=False) logger_obj.exception("Type --> " + type(e).__name__, exc_info=False) logger_obj.exception("Details --> " + str(e), exc_info=False) ExceptionUtility.call_exception_utility(exit_code=1)
def test_click_users(self): try: logger_obj.info("test_click_users called") driver = self.driver user_mgmt = User_management_utility(driver) user_mgmt.navigate_Users() user_mgmt.Collapse_System_users_Tab() users_list = user_mgmt.get_list_Users() print(users_list) print("User to Delete :", users_list[1]) user_mgmt.select_user(users_list[1]) #user_mgmt.delete_user(users_list[1],"Y") #self.assertFalse(user_mgmt.select_user(users_list[1]) == False, users_list[2] + " failed to delete") except Exception as e: logger_obj.exception("File Name : {current_py_file_name} ".format( current_py_file_name=os.path.basename(__file__)), exc_info=False) logger_obj.exception("Error : ", exc_info=False) logger_obj.exception("Type --> " + type(e).__name__, exc_info=False) logger_obj.exception("Details --> " + str(e), exc_info=False) ExceptionUtility.call_exception_utility(exit_code=1)
def call_exception_utility(exit_code): try: if exit_code == 1: # To generate IBE Sanity Summary File. absolute_path_summary_file = Path( os.getcwd()) / "ActivitySummary.txt" with open(absolute_path_summary_file, 'w') as SummaryFile: # 1 --> PASS and 0 --> FAIL SummaryFile.write("0") # input("Press Enter to continue...") if exit_code != 0: exit(1) except Exception as e: logger_obj.exception("File Name : {current_py_file_name} ".format( current_py_file_name=os.path.basename(__file__)), exc_info=False) logger_obj.exception("Error : ", exc_info=False) logger_obj.exception("Type --> " + type(e).__name__, exc_info=False) logger_obj.exception("Details --> " + str(e), exc_info=False) exit(1)