class CandidateLoginMenus: __e_menu = Locators.MENU['menu'] def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.tab_title = appTitle.Title(self.driver) self.scroll = PageScroll(self.driver) def help_tab(self, menu_name): try: self.wait.web_element_wait_click(By.XPATH, self.__e_menu.format(menu_name), 'help_tab') print(f'Clicked on - {menu_name}') time.sleep(2) self.wait.refresh_page() self.wait.candidate_login_loading() return True except Exception as error: ui_logger.error(error) def my_task_tab(self, menu_name): try: self.wait.web_element_wait_click(By.XPATH, self.__e_menu.format(menu_name), 'my_task_tab') print(f'Clicked on - {menu_name}') return True except Exception as error: ui_logger.error(error)
class AccountName: __e_account_name_settings_xpath = Locators.ACCOUNT['account_icon'] __e_settings_id = Locators.ACCOUNT['settings'] __e_anchor_tag = Locators.TAG['anchor'] def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.scroll = PageScroll(self.driver) def account_name_click(self): try: self.wait.web_element_wait_click( By.XPATH, self.__e_account_name_settings_xpath, 'account_name_click') return True except Exception as error: ui_logger.error(error) def login_account_name_verification(self, user_name): try: self.wait.loading() assert self.wait.web_elements_wait_text(By.TAG_NAME, self.__e_anchor_tag, user_name) == user_name, \ 'Logged in different account please check the details' return True except Exception as error: ui_logger.error(error) def account_settings(self): try: self.wait.web_element_wait_click(By.ID, self.__e_settings_id, 'account_settings') return True except Exception as error: ui_logger.error(error)
class AssessmentGetByName: __e_test_name_xpath = Locators.TITLE['title'] def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) def test_name_click(self, test_name): try: self.wait.web_element_wait_click(By.XPATH, self.__e_test_name_xpath.format(test_name), 'test_name_click') print(f'Clicked on - {test_name}') return True except Exception as error: ui_logger.error(error) def assessment_name_validation(self, assessment_name): try: self.wait.web_element_wait_text(By.XPATH, self.__e_test_name_xpath.format(assessment_name), 'Assessment_name_validation') print(f'Assessment Name - {self.wait.text_value}') self.wait.loading() time.sleep(0.3) return True except Exception as error: ui_logger.error(error)
class EventGetByName: __e_click_name_xpath = Locators.TITLE['title'].format( 'Click to view full details') __e_event_name_xpath = Locators.TITLE['title'] def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) def event_name_click(self): try: self.wait.loading() self.wait.web_element_wait_click(By.XPATH, self.__e_click_name_xpath, 'Event_name_click') print('Event name - Clicked to open details screen') self.wait.loading() return True except Exception as error: ui_logger.error(error) def event_name_validation(self, event_name): try: time.sleep(3) self.wait.web_element_wait_text( By.XPATH, self.__e_event_name_xpath.format(event_name), 'Event_name_validation') print('Event Name -', self.wait.text_value) self.wait.loading() return True except Exception as error: ui_logger.error(error)
class Actions: __e_test_actions_xpath = Locators.ACTIONS['actions_click'] __e_clone_test_id = Locators.ACTIONS['clone_assessment'] def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.scroll = PageScroll(self.driver) def assessment_actions_click(self): try: self.scroll.up(0, 50) self.wait.web_element_wait_click(By.XPATH, self.__e_test_actions_xpath, 'assessment_actions_click') print('Assessment Actions - Clicked') return True except Exception as error: ui_logger.error(error) def clone_assessment(self): try: time.sleep(1) self.wait.web_element_wait_click(By.ID, self.__e_clone_test_id, 'clone_assessment') self.wait.loading() print('Clone Assessment action - Clicked') return True except Exception as error: ui_logger.error(error)
class RequirementGetByName: __e_name_xpath = Locators.TITLE['title'] def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) def req_name_click(self, req_name): try: self.wait.loading() self.wait.web_element_wait_click( By.XPATH, self.__e_name_xpath.format(req_name), 'req_name_click') print('Requirement name - Clicked to open details screen') self.wait.loading() return True except Exception as error: ui_logger.error(error) def req_name_validation(self, req_name): try: self.wait.web_element_wait_text( By.XPATH, self.__e_name_xpath.format(req_name), 'req_name_validation') print('Event Name -', self.wait.text_value) return True except Exception as error: ui_logger.error(error)
class InterviewModulePage: __e_interview_module_xpath = Locators.TITLE['title'].format('Interview Module') __e_new_form_xpath = Locators.ACCOUNT['new_form'] __e_click_radio_css = Locators.BUTTONS['radio'] def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.scroll = PageScroll(self.driver) self.notifier = Notifier(self.driver) def interview_module(self): try: self.scroll.down(0, -100) time.sleep(0.5) self.wait.web_element_wait_click(By.XPATH, self.__e_interview_module_xpath, 'interview_module') time.sleep(1) return True except Exception as error: ui_logger.error(error) def new_form_setting(self): try: self.scroll.down(0, -100) self.wait.web_element_wait_click(By.XPATH, self.__e_new_form_xpath, 'new_form_setting') return True except Exception as error: ui_logger.error(error) def enable_new_form(self): try: time.sleep(1) self.wait.web_elements_wait_multiple_click(By.CSS_SELECTOR, self.__e_click_radio_css, 'On') return True except Exception as error: ui_logger.error(error) def disable_new_form(self): try: time.sleep(1) self.wait.web_elements_wait_multiple_click(By.CSS_SELECTOR, self.__e_click_radio_css, 'Off') return True except Exception as error: ui_logger.error(error) def save_notifier(self, message): try: time.sleep(0.8) self.notifier.glowing_messages(message) return True except Exception as error: ui_logger.error(error) def notifier_dismiss(self): try: self.notifier.dismiss_message() time.sleep(0.5) return True except Exception as error: ui_logger.error(error)
class CandidateSearchPage: __e_embrace_search_xpath = Locators.TITLE['title'].format('AdvancedSearch') __e_candidate_name_field_xpath = Locators.EMBRACE['candidate_name_search_field'] __e_search_button_xpath = Locators.BUTTONS['button'].format(' Search') def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) def advance_search(self): try: self.wait.embrace_loading() self.wait.web_element_wait_click(By.XPATH, self.__e_embrace_search_xpath, 'embrace_advance_search') return True except Exception as error: ui_logger.error(error) def candidate_name_field(self, candidate_name): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_candidate_name_field_xpath, candidate_name, 'candidate_name_field') return True except Exception as error: ui_logger.error(error) def advance_search_button(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_search_button_xpath, 'advance_search_button') self.wait.embrace_loading() return True except Exception as error: ui_logger.error(error)
class CandidateDetailsPage: __e_title_xpath = Locators.TITLE['title'] __e_id_xpath = Locators.CANDIDATE['id'] __e_candidate_float_action_class = Locators.ACTIONS['float_click_class'] __e_manage_task_xpath = Locators.TITLE['title'].format('Manage Task') def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.window = SwitchWindowClose(self.driver) self.candidate_id = '' def candidate_float_actions(self): try: self.wait.web_element_wait_click( By.CLASS_NAME, self.__e_candidate_float_action_class, 'candidate_float_actions') print('Candidate details screen - floating action clicked') return True except Exception as error: ui_logger.error(error) def candidate_manage_task_action(self, window_index): try: time.sleep(1) self.wait.web_element_wait_click(By.XPATH, self.__e_manage_task_xpath, 'candidate_manage_task_action') print('Candidate details screen - floating action - Manage Task') time.sleep(1) self.window.switch_to_window(window_index) self.wait.loading() return True except Exception as error: ui_logger.error(error) def candidate_status(self, changed_status): try: time.sleep(2) self.wait.loading() self.wait.web_element_wait_text( By.XPATH, self.__e_title_xpath.format(changed_status), f'Candidate_status_{changed_status}') if self.wait.text_value == changed_status: print(f'Candidate status changed - {self.wait.text_value}') return True except Exception as error: ui_logger.error(error) def candidate_id_copy(self): try: self.wait.web_element_wait_text(By.XPATH, self.__e_id_xpath, 'candidate_id') self.candidate_id = self.wait.text_value print(f'candidate id - {self.candidate_id}') return True except Exception as error: ui_logger.error(error)
class SelectionProcessPage: __e_job_sp_xpath = Locators.PLACEHOLDER['place_holder'].format( 'Selection Process') __e_job_sp_save_xpath = Locators.BUTTONS['button'].format('Save') def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.notifier = Notifier(self.driver) def job_sp(self, selection_process): try: time.sleep(2) self.wait.web_element_wait_send_keys(By.XPATH, self.__e_job_sp_xpath, selection_process, 'Send_Selection_Process') self.wait.drop_down_selection() print(f'selected - {selection_process} selection process') return True except Exception as error: ui_logger.error(error) def job_sp_save(self): try: time.sleep(1) self.wait.web_element_wait_click(By.XPATH, self.__e_job_sp_save_xpath, 'Saved_Selection_Process') print('saved - selection process') return True except Exception as error: ui_logger.error(error) def job_sp_notifier(self, message): try: time.sleep(0.7) self.notifier.glowing_messages(message) self.notifier.dismiss_message() return True except Exception as error: ui_logger.error(error) def page_refresh(self): try: self.wait.refresh_page() print('Page - Refreshed') self.wait.loading() time.sleep(2) return True except Exception as error: ui_logger.error(error)
class Actions: __e_job_actions_xpath = Locators.ACTIONS['actions_click'] __e_job_tag_sp_id = Locators.ACTIONS['selection_process'] __e_job_feed_id = Locators.ACTIONS['feedback_form'] __e_job_int_id = Locators.ACTIONS['tag_interviewers'] def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.scroll = PageScroll(self.driver) def job_actions_click(self): try: self.wait.loading() self.scroll.up(0, 100) time.sleep(1) self.wait.web_element_wait_click(By.XPATH, self.__e_job_actions_xpath, 'Job_actions_click') print('Job Actions - Clicked') return True except Exception as error: ui_logger.error(error) def tag_selection_process(self): try: self.wait.web_element_wait_click(By.ID, self.__e_job_tag_sp_id, 'tag_selection_process') self.wait.loading() print('Selection Process action - Clicked') return True except Exception as error: ui_logger.error(error) def job_feedback_form(self): try: self.wait.web_element_wait_click(By.ID, self.__e_job_feed_id, 'job_feedback_form') self.wait.loading() print('Configured Feedback Form - Clicked') return True except Exception as error: ui_logger.error(error) def job_tag_interviewers(self): try: self.wait.web_element_wait_click(By.ID, self.__e_job_int_id, 'job_tag_interviewers') print('Tag Interviewers to Job - Clicked') self.wait.loading() return True except Exception as error: ui_logger.error(error)
class JobGetByName: __e_job_name_xpath = Locators.TITLE['title'] def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.tab = Title(self.driver) self.window = SwitchWindowClose(self.driver) def job_tab_title(self, tab_title): try: self.tab.tab_title(tab_title) return True except Exception as error: ui_logger.error(error) def job_name_click(self, job_name): try: self.wait.web_element_wait_click( By.XPATH, self.__e_job_name_xpath.format(job_name), 'job_name_click') time.sleep(0.5) self.driver.close() self.driver.switch_to.window(self.driver.window_handles[0]) time.sleep(1.5) self.wait.loading() return True except Exception as error: ui_logger.error(error) def job_name_validation(self, job_name): try: self.wait.loading() self.wait.web_element_wait_text( By.XPATH, self.__e_job_name_xpath.format(job_name), 'Job_name_validation') print('Job Name -', self.wait.text_value) return True except Exception as error: ui_logger.error(error)
class EventOwnersConfigPage: __e_owners_update_xpath = Locators.BUTTONS['button'].format('Update') def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.scroll = PageScroll(self.driver) self.notifier = Notifier(self.driver) def event_owners_update(self): try: self.scroll.down(0, -50) time.sleep(0.5) self.wait.web_element_wait_click(By.XPATH, self.__e_owners_update_xpath, 'event_owners_update') print('Event Owners update button - Clicked') time.sleep(1) self.wait.loading() self.scroll.up(0, 70) return True except Exception as error: ui_logger.error(error) def event_owners_notifier(self, message): try: self.notifier.glowing_messages(message) return True except Exception as error: ui_logger.error(error) def event_owners_notifier_dismiss(self): try: self.notifier.dismiss_message() self.wait.loading() self.scroll.up(0, 70) return True except Exception as error: ui_logger.error(error)
class EventNominationTabPage: __e_arrow_down_class = Locators.NOMINATIONS['dropdown'] __e_header_tag = Locators.TAG['h6'] __e_button_xpath = Locators.BUTTONS['button'].format('Confirm') __e_ok_xpath = Locators.BUTTONS['all_buttons'].format('OK') __e_draw_xpath = Locators.BUTTONS['button'].format('Withdraw nomination') def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.scroll = PageScroll(self.driver) self.notifier = Notifier(self.driver) self.button = 'Withdraw nomination' def event_row_arrow_down(self): try: self.wait.web_element_wait_click(By.CLASS_NAME, self.__e_arrow_down_class, 'nomination_tab') print('Interviewers nomination_tab - Clicked') return True except Exception as error: ui_logger.error(error) def nomination_job_validation(self, job_name): try: assert self.wait.web_elements_wait_text(By.TAG_NAME, self.__e_header_tag, job_name) == job_name, \ 'Arrow down for wrong job role' return True except Exception as error: ui_logger.error(error) def confirm_interviewer_nomination(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_button_xpath, 'confirm_interviewer_nomination') print('confirm_interviewer_nomination - Clicked') return True except Exception as error: ui_logger.error(error) def ok_confirm(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_ok_xpath, 'ok_confirm') print('ok_confirm - Clicked') return True except Exception as error: ui_logger.error(error) def nomination_accept_validation(self): try: assert self.wait.web_elements_wait_text(By.XPATH, self.__e_draw_xpath, self.button) == self.button, \ 'Not confirmed YET' return True except Exception as error: ui_logger.error(error)
class MultiSelectValues: __e_search_xpath = Locators.TITLE['title'].format('Type here to search') __e_select_search_item_xpath = Locators.MULTI_SELECTIONS['moveAllItemsRight'] __e_done_button_xpath = Locators.BUTTONS['done'] def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) def search(self, search_value): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_search_xpath, search_value, 'Multi_value_search') return True except Exception as error: ui_logger.error(error) def search_clear(self): try: self.wait.clear(By.XPATH, self.__e_search_xpath, 'search_clear') return True except Exception as error: ui_logger.error(error) def move_all_items(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_select_search_item_xpath, 'Move_all_items') return True except Exception as error: ui_logger.error(error) def done(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_done_button_xpath, 'Done_button') return True except Exception as error: ui_logger.error(error)
class Notifier: e_notifier = Locators.NOTIFIER['message'] e_dismiss = Locators.NOTIFIER['dismiss'] def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) def glowing_messages(self, ui_message): self.wait.web_element_wait_text(By.CLASS_NAME, self.e_notifier, 'Glowing_message') message = self.wait.text_value if message == ui_message: print( '**-------->>> Message/UI notifier validated successfully - {}' .format(message)) else: print('Message/UI notifier validation failed - {} <<<---------**'. format(message)) def dismiss_message(self): self.wait.web_element_wait_click(By.CLASS_NAME, self.e_dismiss, 'Dismiss_message') print('***---------->>> Notifier closed')
class EventConfiguration: __e_click_radio_css = Locators.BUTTONS['radio'] __e_user_id_xpath = Locators.TITLE['title'].format('Current Status') __e_search_user_xpath = Locators.TITLE['title'].format('Type here to search') __e_select_search_item_xpath = Locators.MULTI_SELECTIONS['moveAllItemsRight'] __e_done_button_xpath = Locators.BUTTONS['done'] __e_save_button_xpath = Locators.BUTTONS['button'].format('save') def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.notifier = Notifier(self.driver) def on_off_buttons(self, button_name): try: time.sleep(1) self.wait.web_elements_wait_multiple_click(By.CSS_SELECTOR, self.__e_click_radio_css, button_name) return True except Exception as error: ui_logger.error(error) def user_id_chat(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_user_id_xpath, 'chat_user_filed_click') return True except Exception as error: ui_logger.error(error) def search_user_chat(self, user_name): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_search_user_xpath, user_name, 'search_chat_user') self.wait.web_element_wait_click(By.XPATH, self.__e_select_search_item_xpath, 'Move_all_items') self.wait.web_element_wait_click(By.XPATH, self.__e_done_button_xpath, 'Done_button') return True except Exception as error: ui_logger.error(error) def enable_disable_button(self, button_name): try: self.wait.web_elements_wait_click(By.CSS_SELECTOR, self.__e_click_radio_css, button_name) return True except Exception as error: ui_logger.error(error) def save_buttons(self, button_name, message): try: self.wait.web_elements_wait_multiple_click(By.XPATH, self.__e_save_button_xpath, button_name) self.notifier.glowing_messages(message) self.notifier.dismiss_message() return True except Exception as error: ui_logger.error(error)
class CandidatePage: __e_task_behalf_of_xpath = Locators.TITLE['title'].format( 'Submit Tasks on Behalf of Candidate') __e_acceptance_name = Locators.EMBRACE['candidate_acceptance_yes'] __e_submit_xpath = Locators.BUTTONS['button'].format('Submit') def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.notifier = Notifier(self.driver) def behalf_of_submit_task(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_task_behalf_of_xpath, 'behalf_of_submit_task') return True except Exception as error: ui_logger.error(error) def candidate_acceptance_yes(self): try: time.sleep(1) self.wait.web_element_wait_click(By.NAME, self.__e_acceptance_name, 'candidate_acceptance_yes') return True except Exception as error: ui_logger.error(error) def submit_task(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_submit_xpath, 'submit_task') return True except Exception as error: ui_logger.error(error) def submit_task_notifier(self, message): try: self.wait.embrace_loading() self.notifier.glowing_messages(message) return True except Exception as error: ui_logger.error(error) def submit_task_notifier_dismiss(self): try: self.notifier.dismiss_message() time.sleep(0.5) return True except Exception as error: ui_logger.error(error)
class EventApplicant: __e_applicant_check_name = Locators.CHECKBOX['check'] __e_status_change_id = Locators.ACTIONS['status_change'] __e_applicant_name_xpath = Locators.TITLE['title'] def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.message = Notifier(self.driver) self.switch_window = SwitchWindowClose(self.driver) def select_applicant(self): try: self.wait.web_element_wait_click(By.NAME, self.__e_applicant_check_name, 'Applicant_check_box') return True except Exception as error: ui_logger.error(error) def change_status_action(self): try: self.wait.web_element_wait_click(By.ID, self.__e_status_change_id, 'Applicant_status_change') self.wait.loading() return True except Exception as error: ui_logger.error(error) def applicant_get_name(self, applicant_name, index_window): try: time.sleep(1) self.wait.web_element_wait_click( By.XPATH, self.__e_applicant_name_xpath.format(applicant_name), 'Applicant_Get_By_Name') print('Clicked on applicant name') self.switch_window.switch_to_window(index_window) return True except Exception as error: ui_logger.error(error)
class RequirementSubTabs: __e_req_config_xpath = Locators.SUB_MENU['req_configurations'] __e_req_duplicity_xpath = Locators.SUB_MENU['req_duplicity'] __e_req_query_xpath = Locators.SUB_MENU['req_query'] def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.scroll = PageScroll(self.driver) def requirement_configurations(self): try: self.scroll.up(0, 50) self.wait.web_element_wait_click(By.XPATH, self.__e_req_config_xpath, 'job_configuration_tab') print('Job Configuration Tab - Clicked') return True except Exception as error: ui_logger.error(error) def requirement_duplicity(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_req_duplicity_xpath, 'requirement_duplicity') print('Requirement Duplicity check - On') return True except Exception as error: ui_logger.error(error) def requirement_query(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_req_query_xpath, 'requirement_query') print('Requirement Query Configuration tab - Clicked') return True except Exception as error: ui_logger.error(error)
class JobSubTabs: __e_job_config_xpath = Locators.SUB_MENU['job_configurations'] __e_job_automations_xpath = Locators.SUB_MENU['automations'] __e_job_owners_xpath = Locators.SUB_MENU['job_owners'] def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) def job_configurations(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_job_config_xpath, 'job_configuration_tab') print('Job Configuration Tab - Clicked') return True except Exception as error: ui_logger.error(error) def job_automation(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_job_automations_xpath, 'Job_Automations_tab') print('Job Automations Tab - Clicked') self.wait.loading() return True except Exception as error: ui_logger.error(error) def job_owners(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_job_owners_xpath, 'job_owners') print('Job Owners Tab - Clicked') return True except Exception as error: ui_logger.error(error)
class CloneAssessmentPage: """ ----------------- WEB ELEMENT REFERENCE CLASS PRIVATE VARIABLES TO EASY ACCESS ------>>>> """ __e_new_test_field_name = Locators.SEARCH['test_name'] __e_test_from_date_xpath = Locators.PLACEHOLDER['place_holder'].format( 'From') __e_test_to_date_xpath = Locators.PLACEHOLDER['place_holder'].format('To') __e_clone_button_xpath = Locators.BUTTONS['button'].format('Clone') def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.notifier = Notifier(self.driver) def new_test_name(self, new_test_name): try: time.sleep(0.7) self.wait.web_element_wait_send_keys(By.NAME, self.__e_new_test_field_name, new_test_name, 'new_test_name') print(f'New test name {new_test_name} - Entered') return True except Exception as error: ui_logger.error(error) def test_from_date(self, from_date): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_test_from_date_xpath, from_date, 'new_test_name') print(f'New test from {from_date} - Entered') return True except Exception as error: ui_logger.error(error) def test_to_date(self, to_date): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_test_to_date_xpath, to_date, 'new_test_name') print(f'New test from {to_date} - Entered') return True except Exception as error: ui_logger.error(error) def clone_test_button(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_clone_button_xpath, 'requirement_name') print('Clone Assessment Button - Clicked') return True except Exception as error: ui_logger.error(error) def clone_assessment_notifier(self, message): try: time.sleep(0.4) self.notifier.glowing_messages(message) return True except Exception as error: ui_logger.error(error) def clone_assessment_notifier_dismiss(self): try: self.notifier.dismiss_message() time.sleep(0.5) return True except Exception as error: ui_logger.error(error)
class CancelInterview: __e_select_reason_xpath = Locators.PLACEHOLDER['place_holder'].format('Reason') __e_reason_comment_xpath = Locators.PLACEHOLDER['all_place_holder'].format('Please provide the ' 'reason for cancellation') __e_save_reason_xpath = Locators.BUTTONS['button'].format('Save') __e_confirm_button_xpath = Locators.BUTTONS['button'].format('Confirm') def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.notifier = Notifier(self.driver) def cancel_interview_request_reason(self, reason): try: time.sleep(1.5) self.wait.web_element_wait_send_keys(By.XPATH, self.__e_select_reason_xpath, reason, 'cancel_interview_request') self.wait.drop_down_selection() print(f'Reason selected - {reason}') return True except Exception as error: ui_logger.error(error) def cancel_interview_request_comment(self, comment): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_reason_comment_xpath, comment, 'cancel_interview_request') print('Enter the comment for cancel request') return True except Exception as error: ui_logger.error(error) def cancel_interview_request_save(self): try: time.sleep(2) self.wait.web_element_wait_click(By.XPATH, self.__e_save_reason_xpath, 'cancel_interview_request_save') print('Cancel Request - Save') return True except Exception as error: ui_logger.error(error) def cancel_interview_request_confirm(self): try: time.sleep(5) self.wait.web_element_wait_click(By.XPATH, self.__e_confirm_button_xpath, 'cancel_interview_request_confirm') print('Cancel Interview - Confirm') return True except Exception as error: ui_logger.error(error) def change_status_notifier(self, message): try: time.sleep(1) self.notifier.glowing_messages(message) return True except Exception as error: ui_logger.error(error) def change_status_notifier_dismiss(self): try: self.notifier.dismiss_message() self.wait.loading() time.sleep(0.5) return True except Exception as error: ui_logger.error(error)
class RequirementHelpDeskConfig: __e_default_category_xpath = Locators.TITLE['title'].format( 'Query Category') __e_job_category_xpath = Locators.HELPDESK['job_category'] __e_event_category_xpath = Locators.HELPDESK['event_category'] __e_user_xpath = Locators.TITLE['title'].format('Users') __e_job_user_xpath = Locators.HELPDESK['job_user'] __e_event_user_xpath = Locators.HELPDESK['event_user'] __e_sla_xpath = Locators.PLACEHOLDER['num'] __e_jobs_xpath = Locators.TITLE['title'].format('Jobs') __e_event_job_xpath = Locators.HELPDESK['event_job'] __e_job_sla_xpath = Locators.HELPDESK['job_sla'] __e_event_xpath = Locators.TITLE['title'].format('Events') __e_event_sla_xpath = Locators.HELPDESK['event_sla'] __e_save_button_xpath = Locators.BUTTONS['button'].format('Save') def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.scroll = PageScroll(self.driver) self.notifier = Notifier(self.driver) def default_category(self): try: self.wait.loading() self.wait.web_element_wait_click(By.XPATH, self.__e_default_category_xpath, 'default_category') print('default_category - Clicked') return True except Exception as error: ui_logger.error(error) def job_category(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_job_category_xpath, 'job_category') print('job_category - Clicked') return True except Exception as error: ui_logger.error(error) def event_category(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_event_category_xpath, 'event_category') print('event_category - Clicked') return True except Exception as error: ui_logger.error(error) def category_user_selection(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_user_xpath, 'category_user_selection') print('category_user_selection - Clicked') return True except Exception as error: ui_logger.error(error) def job_user_selection(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_job_user_xpath, 'job_user_selection') print('job_user_selection - Clicked') return True except Exception as error: ui_logger.error(error) def event_user_selection(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_event_user_xpath, 'event_user_selection') print('event_user_selection - Clicked') return True except Exception as error: ui_logger.error(error) def category_sla_hour_selection(self, hours): try: self.wait.web_element_wait_send_keys( By.XPATH, self.__e_sla_xpath, hours, 'category_sla_hour_selection') print('category_sla_hour_selection - Entered') return True except Exception as error: ui_logger.error(error) def job_sla_hour_selection(self, hours): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_job_sla_xpath, hours, 'job_sla_hour_selection') print('job_sla_hour_selection - Entered') return True except Exception as error: ui_logger.error(error) def event_sla_hour_selection(self, hours): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_event_sla_xpath, hours, 'event_sla_hour_selection') print('event_sla_hour_selection - Entered') return True except Exception as error: ui_logger.error(error) def category_job_selection(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_jobs_xpath, 'category_job_selection') print('category_job_selection - Clicked') return True except Exception as error: ui_logger.error(error) def event_job_selection(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_event_job_xpath, 'event_job_selection') print('event_job_selection - Clicked') return True except Exception as error: ui_logger.error(error) def category_event_selection(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_event_xpath, 'category_event_selection') print('category_event_selection - Clicked') return True except Exception as error: ui_logger.error(error) def save_help_desk_config(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_save_button_xpath, 'save_help_desk_config') print('save_help_desk_config - Clicked') return True except Exception as error: ui_logger.error(error) def config_notifier(self, message): try: time.sleep(0.7) self.notifier.glowing_messages(message) return True except Exception as error: ui_logger.error(error) def config_notifier_dismiss(self): try: self.notifier.dismiss_message() time.sleep(0.9) return True except Exception as error: ui_logger.error(error)
class ChangeStatus: __e_stage_field_xpath = Locators.CHANGE_STATUS['stage'] __e_status_field_xpath = Locators.CHANGE_STATUS['status'] __e_comment_xpath = Locators.CHANGE_STATUS['comment'] __e_button_xpath = Locators.BUTTONS['button'].format('Change') __e_select_int_xpath = Locators.TITLE['title'].format( 'Select Interviewers') def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.notifier = Notifier(self.driver) def applicant_stage(self, stage): try: time.sleep(2) self.wait.web_element_wait_send_keys(By.XPATH, self.__e_stage_field_xpath, stage, 'Applicant_stage_field') return True except Exception as error: ui_logger.error(error) def applicant_status(self, status): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_status_field_xpath, status, 'Applicant_status_field') return True except Exception as error: ui_logger.error(error) def select_interviewers(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_select_int_xpath, 'select_interviewers') print('Select Interviewers - Selected') time.sleep(2) return True except Exception as error: ui_logger.error(error) def comment(self, comment): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_comment_xpath, comment, 'Applicant_comment_box') return True except Exception as error: ui_logger.error(error) def change_button(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_button_xpath, 'Change_Button') print('MassInterview applicant status - Changed') self.wait.loading() return True except Exception as error: ui_logger.error(error) def change_status_notifier(self, message): try: time.sleep(1) self.notifier.glowing_messages(message) return True except Exception as error: ui_logger.error(error) def change_status_notifier_dismiss(self): try: self.notifier.dismiss_message() self.wait.loading() time.sleep(0.5) return True except Exception as error: ui_logger.error(error)
class JobAutomations: __e_registration_stage_xpath = Locators.JOB['registration_hop'] __e_eligibility_stage_xpath = Locators.JOB['eligibility_hop'] __e_offer_stage_xpath = Locators.JOB['offer_stage'] __e_hopping_stage_xpath = Locators.JOB['hop_stage_field'] __e_hopping_status_xpath = Locators.JOB['hop_status_field'] __e_toggle_buttons_css = Locators.JOB['toggle_buttons'] __e_save_xpath = Locators.BUTTONS['button'].format('Save') def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.scroll = PageScroll(self.driver) self.notifier = Notifier(self.driver) def registration_stage(self): try: time.sleep(0.6) self.wait.web_element_wait_click(By.XPATH, self.__e_registration_stage_xpath, 'registration_stage') print('Clicked - On registration stage') return True except Exception as error: ui_logger.error(error) def eligibility_stage(self): try: time.sleep(0.6) self.wait.web_element_wait_click(By.XPATH, self.__e_eligibility_stage_xpath, 'eligibility_stage') print('Clicked - On eligibility stage') return True except Exception as error: ui_logger.error(error) def offer_stage(self): try: time.sleep(0.6) self.scroll.down(0, -300) self.wait.web_element_wait_click(By.XPATH, self.__e_offer_stage_xpath, 'offer_stage') print('Clicked - On offer stage') return True except Exception as error: ui_logger.error(error) def hop_stage(self, stage): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_hopping_stage_xpath, stage, 'hop_stage') print('Select - Hopping stage') return True except Exception as error: ui_logger.error(error) def hop_status(self, status): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_hopping_status_xpath, status, 'hop_status') print('Select - Hopping status') return True except Exception as error: ui_logger.error(error) def all_round_button_on(self): try: time.sleep(0.5) self.scroll.up(0, 100) self.wait.web_elements_wait_multiple_click( By.CSS_SELECTOR, self.__e_toggle_buttons_css, '') print('Auto Tag to test - ON') print('Eligibility Criteria - ON') print('Self Schedule - ON') return True except Exception as error: ui_logger.error(error) def automation_save(self): try: time.sleep(0.5) self.scroll.down(0, -300) self.wait.web_element_wait_click(By.XPATH, self.__e_save_xpath, 'automation_save') print('Job Automation Configuration - Save') return True except Exception as error: ui_logger.error(error) def job_automation_save_notifier(self, message): try: time.sleep(0.7) self.notifier.glowing_messages(message) return True except Exception as error: ui_logger.error(error) def job_automations_notifier_dismiss(self): try: self.notifier.dismiss_message() return True except Exception as error: ui_logger.error(error)
class Search: __e_search_id = Locators.SEARCH['advance_search'] __e_Name_name = Locators.SEARCH['Name'] __e_name_name = Locators.SEARCH['name'] __e_test_name = Locators.SEARCH['test_name'] __e_candidate_name = Locators.SEARCH['candidate_name'] __e_search_btn_xpath = Locators.BUTTONS['button'].format('Search') __e_manage_search_css = Locators.SEARCH['manage_candidate_search'] __e_clear_id = Locators.SEARCH['clear'] def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.tab = Menu(self.driver) self.tab_title = appTitle.Title(self.driver) self.page_scroll = PageScroll.PageScroll(self.driver) def advance_search(self): try: self.page_scroll.down(0, -200) self.wait.web_element_wait_click(By.ID, self.__e_search_id, 'advance_search') return True except Exception as error: ui_logger.error(error) def name_field(self, search_key): try: self.wait.web_element_wait_send_keys(By.NAME, self.__e_Name_name, search_key, 'search_name_field') return True except Exception as error: ui_logger.error(error) def name_field_applicant(self, search_key): try: self.wait.web_element_wait_send_keys( By.NAME, self.__e_name_name, search_key, 'search_applicant_name_field') return True except Exception as error: ui_logger.error(error) def candidate_name_field(self, search_key): try: self.wait.web_element_wait_send_keys( By.NAME, self.__e_candidate_name, search_key, 'search_applicant_name_field') return True except Exception as error: ui_logger.error(error) def test_name_search_field(self, search_key): try: time.sleep(1) self.wait.web_element_wait_send_keys(By.NAME, self.__e_test_name, search_key, 'test_name_search_field') print('Test name - Entered') return True except Exception as error: ui_logger.error(error) def search_button(self): try: time.sleep(1) self.page_scroll.up(0, 170) self.wait.web_element_wait_click(By.XPATH, self.__e_search_btn_xpath, 'search_button') self.wait.loading() return True except Exception as error: ui_logger.error(error) def applicant_search_button(self): try: time.sleep(1) self.page_scroll.up(0, 260) self.wait.web_element_wait_click(By.XPATH, self.__e_search_btn_xpath, 'search_button') self.wait.loading() return True except Exception as error: ui_logger.error(error) def manage_candidate_search(self): try: self.wait.web_element_wait_click(By.CSS_SELECTOR, self.__e_manage_search_css, 'advance_search') return True except Exception as error: ui_logger.error(error) def clear_search(self): try: time.sleep(0.5) self.wait.web_element_wait_click(By.ID, self.__e_clear_id, 'advance_search') return True except Exception as error: ui_logger.error(error) def job_search_button(self): try: time.sleep(1) self.wait.web_element_wait_click(By.XPATH, self.__e_search_btn_xpath, 'search_button') print('Job name - Searched') return True except Exception as error: ui_logger.error(error)
class CandidateLogin: """ ----------------- WEB ELEMENT REFERENCE CLASS PRIVATE VARIABLES TO EASY ACCESS ------>>>> """ __e_tenant_name = Locators.LOGIN['alias'] __e_login_name_l = Locators.LOGIN['c_user_name'] __e_password_xpath = Locators.LOGIN['password'] __e_login_button_class = Locators.LOGIN['login'] __e_anchor_tag = Locators.TAG['anchor'] def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.scroll = PageScroll(self.driver) self.new_tab = NewTab(self.driver) def candidate_login_url(self, server): if server == 'amsin': self.new_tab.open_in_same_tab( 0, ReadConfigFile.ReadConfig.get_qa_candidate_url()) return True elif server == 'ams': self.new_tab.open_in_same_tab( 0, ReadConfigFile.ReadConfig.get_production_candidate_url()) return True elif server == 'beta': self.new_tab.open_in_same_tab( 0, ReadConfigFile.ReadConfig.get_beta_candidate_url()) return True elif server == 'stage': self.new_tab.open_in_same_tab( 0, ReadConfigFile.ReadConfig.get_stage_candidate_url()) return True elif server == 'india': self.new_tab.open_in_same_tab( 0, ReadConfigFile.ReadConfig.get_indiaams_candidate_url()) return True def login_name(self, login_name): try: time.sleep(3) self.wait.web_element_wait_send_keys(By.NAME, self.__e_login_name_l, login_name, 'login_name_field') return True except Exception as error: ui_logger.error(error) def password(self, password): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_password_xpath, password, 'login_password_field') return True except Exception as error: ui_logger.error(error) def login_button(self): try: self.wait.web_element_wait_click(By.CLASS_NAME, self.__e_login_button_class, 'login_button') return True except Exception as error: ui_logger.error(error) def login_account_name_verification(self, user_name): try: self.wait.loading() assert self.wait.web_elements_wait_text(By.TAG_NAME, self.__e_anchor_tag, user_name) == user_name, \ 'Logged in different account please check the details' return True except Exception as error: ui_logger.error(error)
class EligibilityCriteriaPage: __e_job_config_btn_xpath = Locators.BUTTONS['btnActionClicked'].format("'", 'configureEC', "'") __e_ec_xpath = Locators.PLACEHOLDER['text_ph'].format('Select Eligibility Criteria') __e_positive_stage_xpath = Locators.PLACEHOLDER['text_ph'].format('Select Stage') __e_positive_status_xpath = Locators.PLACEHOLDER['text_ph'].format('Select status') __e_negative_stage_xpath = Locators.JOB['Ec_negative_stage'] __e_negative_status_xpath = Locators.JOB['Ec_negative_status'] __e_ec_save_xpath = Locators.BUTTONS['ec_save'] def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.notifier = Notifier(self.driver) self.scroll = PageScroll(self.driver) def job_configure_button(self): try: self.wait.loading() self.scroll.down(0, -200) self.wait.web_element_wait_click(By.XPATH, self.__e_job_config_btn_xpath, 'job_configure_button') self.wait.loading() print('Job Configuration button - Clicked') return True except Exception as error: ui_logger.error(error) def job_ec_field(self, eligibility_criteria): try: time.sleep(1) self.wait.web_element_wait_send_keys(By.XPATH, self.__e_ec_xpath, eligibility_criteria, 'job_ec_field') self.wait.drop_down_selection() print('Job Eligibility Criteria - Entered') return True except Exception as error: ui_logger.error(error) def job_positive_stage_field(self, stage): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_positive_stage_xpath, stage, 'job_positive_stage_field') self.wait.drop_down_selection() print('Job Positive Stage - Entered') return True except Exception as error: ui_logger.error(error) def job_positive_status_field(self, status): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_positive_status_xpath, status, 'job_positive_status_field') self.wait.drop_down_selection() print('Job Positive Status - Entered') return True except Exception as error: ui_logger.error(error) def job_negative_stage_field(self, stage): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_negative_stage_xpath, stage, 'job_negative_stage_field') self.wait.drop_down_selection() print('Job Negative Stage - Entered') return True except Exception as error: ui_logger.error(error) def job_negative_status_field(self, status): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_negative_status_xpath, status, 'job_negative_status_field') self.wait.drop_down_selection() print('Job Negative Status - Entered') return True except Exception as error: ui_logger.error(error) def job_ec_save(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_ec_save_xpath, 'job_ec_save') print('Job Eligibility Criteria - Saved') return True except Exception as error: ui_logger.error(error) def job_ec_notifier(self, message): try: time.sleep(0.4) self.notifier.glowing_messages(message) return True except Exception as error: ui_logger.error(error) def job_ec_notifier_dismiss(self): try: self.notifier.dismiss_message() self.wait.loading() return True except Exception as error: ui_logger.error(error)
class NewFeedbackConfigPage: __e_new_form_stage_xpath = Locators.PLACEHOLDER['text_ph'].format( 'Interview Stages') __e_new_form_field_xpath = Locators.PLACEHOLDER['text_ph'].format( 'Name like.') __e_new_form_search_css = Locators.BUTTONS['new_form_search'] __e_new_use_form_xpath = Locators.BUTTONS['all_buttons'].format('Use') __e_new_for_edit_xpath = Locators.TITLE['title'].format( 'Edit Confiiguration') __e_overall_mandatory_xpath = Locators.JOB['feedback_overall_mandatory'] __e_reject_overall_xpath = Locators.JOB['reject_overall_mandatory'] __e_update_form_xpath = Locators.BUTTONS['btnActionClicked'].format( "'", 'update', "'") def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.notifier = Notifier(self.driver) def stage_selection(self, stage): try: time.sleep(1.5) self.wait.web_element_wait_send_keys(By.XPATH, self.__e_new_form_stage_xpath, stage, 'Send_Selection_Process') self.wait.drop_down_selection() print(f'selected - New - {stage}') return True except Exception as error: ui_logger.error(error) def form_search_filed_enter(self, form): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_new_form_field_xpath, form, 'form_search') print(f'Entered - New {form}') return True except Exception as error: ui_logger.error(error) def form_search(self): try: self.wait.web_element_wait_click(By.CSS_SELECTOR, self.__e_new_form_search_css, 'form_search') print('Feedback Form - Search') return True except Exception as error: ui_logger.error(error) def use_form(self): try: time.sleep(1) self.wait.web_element_wait_click(By.XPATH, self.__e_new_use_form_xpath, 'use_form') print('Feedback Form - Use') return True except Exception as error: ui_logger.error(error) def edit_form(self): try: time.sleep(1) self.wait.web_element_wait_click(By.XPATH, self.__e_new_for_edit_xpath, 'edit_form') print('Feedback Form - Edit') return True except Exception as error: ui_logger.error(error) def overall_mandatory(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_overall_mandatory_xpath, 'overall_mandatory') print('Overall feedback mandatory - On') return True except Exception as error: ui_logger.error(error) def reject_overall_mandatory(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_reject_overall_xpath, 'reject_overall_mandatory') print('Reject Overall feedback mandatory - On') return True except Exception as error: ui_logger.error(error) def update_feedback_form(self): try: time.sleep(0.5) self.wait.web_element_wait_click(By.XPATH, self.__e_update_form_xpath, 'update_feedback_form') print('Feedback Form - Save') time.sleep(0.5) return True except Exception as error: ui_logger.error(error) def job_new_form_notifier(self, message): try: time.sleep(0.4) self.notifier.glowing_messages(message) return True except Exception as error: ui_logger.error(error) def job_new_form_notifier_dismiss(self): try: self.notifier.dismiss_message() time.sleep(0.5) return True except Exception as error: ui_logger.error(error)