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 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 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 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 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 EventApplicantActions: __e_status_change_id = Locators.ACTIONS['status_change'] __e_more_button_xpath = Locators.ACTIONS['app_more'] __e_app_action_xpath = Locators.BUTTONS['all_buttons'] __e_provide_feedback_id = Locators.ACTIONS['provide_feedback'] __e_cancel_request_id = Locators.ACTIONS['cancel_request'] __e_cancel_interview_id = Locators.ACTIONS['cancel_interview'] __e_unlock_feedback_id = Locators.ACTIONS['unlock_feedback'] def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.scroll = PageScroll(self.driver) """ ****--------------------- Event Applicant Action Functions ---------------------------------**** """ 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 more_action(self): try: self.scroll.up(0, 50) self.wait.web_element_wait_click(By.XPATH, self.__e_more_button_xpath, 'more_action') print('Clicked on - Applicant More actions') self.wait.loading() return True except Exception as error: ui_logger.error(error) def quick_interview_action(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_app_action_xpath.format('Quick Interview Schedule'), 'quick_interview_action') time.sleep(2) print('Quick Interview Action - Clicked') self.wait.loading() return True except Exception as error: ui_logger.error(error) """ ****--------------------- Event Interviews Applicant Action Functions ---------------------------------**** """ def provide_feedback_action(self): try: self.scroll.down(0, -50) self.wait.web_element_wait_click(By.ID, self.__e_provide_feedback_id, 'provide_feedback_action') time.sleep(2) print('Provide Feedback Action - Clicked') self.wait.loading() return True except Exception as error: ui_logger.error(error) def cancel_interview_request_action(self): try: self.scroll.down(0, -50) self.wait.web_element_wait_click(By.ID, self.__e_cancel_request_id, 'cancel_interview_request_action') time.sleep(2) print('Cancel Request Action - Clicked') self.wait.loading() return True except Exception as error: ui_logger.error(error) def cancel_interview_action(self): try: self.scroll.down(0, -50) self.wait.web_element_wait_click(By.ID, self.__e_cancel_interview_id, 'cancel_interview_action') time.sleep(2) print('Cancel Interview Action - Clicked') self.wait.loading() return True except Exception as error: ui_logger.error(error) def unlock_feedback_action(self): try: self.scroll.down(0, -50) self.wait.web_element_wait_click(By.ID, self.__e_unlock_feedback_id, 'unlock_feedback_action') print('Unlock Feedback Action - Clicked') return True except Exception as error: ui_logger.error(error)
class EventSubTabs: __e_event_config_xpath = Locators.SUB_MENU['configurations'] __e_event_owners_xpath = Locators.SUB_MENU['owners'] __e_event_tracking_xpath = Locators.SUB_MENU['event_tracking'] __e_cancel_request_xpath = Locators.SUB_MENU['cancel_request'] __e_manage_candidates = Locators.BUTTONS['all_buttons'].format( 'Manage Candidates') def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.scroll = PageScroll(self.driver) def event_configurations(self): try: self.scroll.up(0, -100) self.wait.web_element_wait_click(By.XPATH, self.__e_event_config_xpath, 'Event_configurations_tab') time.sleep(0.5) print('Event Configurations Tab - Landed') self.scroll.up(0, 200) return True except Exception as error: ui_logger.error(error) def event_owners(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_event_owners_xpath, 'Event_owners_tab') return True except Exception as error: ui_logger.error(error) def manage_candidates(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_manage_candidates, 'Manage_Candidates') return True except Exception as error: ui_logger.error(error) def tracking(self): try: self.scroll.up(0, -60) self.wait.web_element_wait_click(By.XPATH, self.__e_event_tracking_xpath, 'event_tracking') return True except Exception as error: ui_logger.error(error) def cancel_request_tab(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_cancel_request_xpath, 'cancel_request_tab') time.sleep(1) return True except Exception as error: ui_logger.error(error)
class EventNominationsPage: __e_nomination_tab_xpath = Locators.SUB_MENU['nominations'] __e_header_tag = Locators.TAG['h5'] __e_panel_xpath = Locators.NOMINATIONS['panel_select'] __e_check_xpath = Locators.CHECK_BOX['check_box'] __e_action_class = Locators.NOMINATIONS['actions'] __e_approve_xpath = Locators.NOMINATIONS['approve'] __e_sync_xpath = Locators.TITLE['title'].format( 'This will sync interviewers for whom you' ' have accepted nomination with the event owners') def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.scroll = PageScroll(self.driver) self.notifier = Notifier(self.driver) def nomination_tab(self): try: self.wait.loading() self.wait.web_element_wait_click(By.XPATH, self.__e_nomination_tab_xpath, 'nomination_tab') print('Interviewers nomination_tab - Clicked') return True except Exception as error: ui_logger.error(error) def header_check(self, header): try: self.wait.loading() assert self.wait.web_elements_wait_text(By.TAG_NAME, self.__e_header_tag, header) == header, \ 'no header found' return True except Exception as error: ui_logger.error(error) def panel_select(self, skill): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_panel_xpath, skill, 'panel_select') self.wait.loading() print(f'{skill} - skill selected to panel') return True except Exception as error: ui_logger.error(error) def select_applicants(self): try: time.sleep(1) self.wait.web_element_wait_click(By.XPATH, self.__e_check_xpath, 'select_applicants') print('select_applicants - Selected') return True except Exception as error: ui_logger.error(error) def recruiter_actions(self): try: self.wait.web_element_wait_click(By.CLASS_NAME, self.__e_action_class, 'recruiter_actions') print('recruiter_actions - Clicked') return True except Exception as error: ui_logger.error(error) def approve_by_recruiter(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_approve_xpath, 'recruiter_actions') self.wait.loading() print('recruiter_actions - Clicked') return True except Exception as error: ui_logger.error(error) def sync_interviewers(self): try: self.scroll.up(0, 90) time.sleep(1.5) self.wait.web_element_wait_click(By.XPATH, self.__e_sync_xpath, 'sync_interviewers') print('sync_interviewers - Synced') return True except Exception as error: ui_logger.error(error) def sync_notifier(self, message): try: self.notifier.glowing_messages(message) return True except Exception as error: ui_logger.error(error) def sync_notifier_dismiss(self): try: self.notifier.dismiss_message() return True except Exception as error: ui_logger.error(error)
class EventCancelRequest: __e_approve_xpath = Locators.TITLE['title'].format('Approve Request') __e_approve_tool_xpath = Locators.TITLE['tooltip'].format( "'", 'Approve Request', "'") __e_comment_xpath = Locators.EVENT['comment_cancel_request'] __e_confirm_xpath = Locators.BUTTONS['all_buttons'].format('OK') __e_ahead_xpath = Locators.BUTTONS['all_buttons'].format('GO AHED') __e_notifier = Locators.NOTIFIER['message'] def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.notifier = Notifier(self.driver) self.for_back = ForwardBackward(self.driver) self.scroll = PageScroll(self.driver) def accept_cancellation(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_approve_xpath, 'accept_cancellation') print('Approved - Cancel request from interviewer') return True except Exception as error: ui_logger.error(error) def cancel_request_comment(self, comment): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_comment_xpath, comment, 'cancel_request_comment') print(f'Entered - {comment}') return True except Exception as error: ui_logger.error(error) def confirm_request(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_confirm_xpath, 'confirm_request') self.wait.loading() return True except Exception as error: ui_logger.error(error) def go_ahead_with_lobby_screen(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_ahead_xpath, 'go_ahead_with_lobby_screen') print('Continue with Lobby -Screen') return True except Exception as error: ui_logger.error(error) def lobby_confirm_request(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_confirm_xpath, 'go_ahead_with_lobby_screen') print('Confirm Lobby - Cancel request by administrator') return True except Exception as error: ui_logger.error(error) def lobby_accept_cancellation(self): try: self.scroll.up(0, -50) self.wait.web_element_wait_click(By.XPATH, self.__e_approve_tool_xpath, 'accept_cancellation') print('Approved - Cancel request from interviewer') return True except Exception as error: ui_logger.error(error) def acceptance_notifier(self, message): try: self.notifier.glowing_messages(message) return True except Exception as error: ui_logger.error(error) def acceptance_notifier_dismiss(self): try: self.notifier.dismiss_message() time.sleep(1) self.for_back.browser_backward() self.wait.loading() time.sleep(0.5) return True except Exception as error: ui_logger.error(error)
class Login: """ ----------------- WEB ELEMENT REFERENCE CLASS PRIVATE VARIABLES TO EASY ACCESS ------>>>> """ __e_tenant_name = Locators.LOGIN['alias'] __e_next_button_css = Locators.LOGIN['next'] __e_login_name_l = Locators.LOGIN['login_name'] __e_password_xpath = Locators.LOGIN['password'] __e_login_button_css = Locators.LOGIN['login'] __e_anchor_tag = Locators.TAG['anchor'] __e_logout_id = Locators.LOGIN['logout'] __e_click_xpath = Locators.LOGIN['click_to_login'] def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.scroll = PageScroll(self.driver) def tenant(self, tenant_name): self.wait.web_element_wait_send_keys(By.NAME, self.__e_tenant_name, tenant_name, 'login_tenant_field') def next_button(self): self.wait.web_element_wait_click(By.CSS_SELECTOR, self.__e_next_button_css, 'login_next_button') def login_name(self, login_name): try: time.sleep(1.5) 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_css, '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) def login_account_click(self, user_name): try: self.wait.web_elements_wait_click(By.TAG_NAME, self.__e_anchor_tag, user_name) print(f'Current account name is - {user_name}') return True except Exception as error: ui_logger.error(error) def login_out(self): try: time.sleep(0.5) self.scroll.up(0, 60) time.sleep(0.5) self.wait.web_element_wait_click(By.ID, self.__e_logout_id, 'Logout from account') print('Logging Out - from application') return True except Exception as error: ui_logger.error(error) def click_here_to_login(self): try: time.sleep(2) self.wait.web_element_wait_click(By.XPATH, self.__e_click_xpath, 'Logout from account') print('Re-login - Clicked for login screen') return True except Exception as error: ui_logger.error(error)
class Menu: __e_menu = Locators.MENU['menu'] __e_menu_embrace = Locators.MENU['embrace'] __e_embrace_candidate_xpath = Locators.EMBRACE['candidate_tab'] 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 job_tab(self, job_menu_name, tab_title): try: self.wait.web_element_wait_click( By.XPATH, self.__e_menu.format(job_menu_name), 'not_in_job_roles') self.wait.loading() assert self.tab_title.tab_title( tab_title) == tab_title, 'Webdriver is in wrong tab' return True except Exception as error: ui_logger.error(error) def requirement_tab(self, req_menu_name, tab_title): try: self.scroll.up(0, 50) self.wait.web_element_wait_click( By.XPATH, self.__e_menu.format(req_menu_name), 'not_in_Requirements') self.wait.loading() assert self.tab_title.tab_title( tab_title) == tab_title, 'Webdriver is in wrong tab' return True except Exception as error: ui_logger.error(error) def assessment_tab(self, assess_menu_name, tab_title): try: self.wait.web_element_wait_click( By.XPATH, self.__e_menu.format(assess_menu_name), 'not_in_assessments') self.wait.loading() assert self.tab_title.tab_title( tab_title) == tab_title, 'Webdriver is in wrong tab' return True except Exception as error: ui_logger.error(error) def event_tab(self, event_menu_name, tab_title): try: self.wait.web_element_wait_click( By.XPATH, self.__e_menu.format(event_menu_name), 'not_in_Events') self.wait.loading() assert self.tab_title.tab_title( tab_title) == tab_title, 'Webdriver is in wrong tab' return True except Exception as error: ui_logger.error(error) def nominations_tab(self, nom_menu_name, tab_title): try: self.wait.web_element_wait_click( By.XPATH, self.__e_menu.format(nom_menu_name), 'not_in_job_roles') assert self.tab_title.tab_title( tab_title) == tab_title, 'Webdriver is in wrong tab' time.sleep(2) return True except Exception as error: ui_logger.error(error) def more_tab(self, more_menu_name): try: self.wait.web_element_wait_click( By.XPATH, self.__e_menu.format(more_menu_name), 'not_in_More') return True except Exception as error: ui_logger.error(error) def embrace_tab(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_menu_embrace, 'not_in_Embrace') return True except Exception as error: ui_logger.error(error) def embrace_candidate_tab(self): try: self.wait.embrace_loading() time.sleep(1) self.wait.web_element_wait_click(By.XPATH, self.__e_embrace_candidate_xpath, 'not_in_Embrace_candidate_tab') return True except Exception as error: ui_logger.error(error)
class EventMangeInterviewersPage: __e_add_criteria_xpath = Locators.BUTTONS['add_criteria'] __e_panel_entry_xpath = Locators.NOMINATIONS['panel_1'] __e_panel2_entry_xpath = Locators.NOMINATIONS['panel_2'] __e_skill1_search_xpath = Locators.BUTTONS['nomination_int_search'] __e_skill2_search_xpath = Locators.NOMINATIONS['search'] __e_skill1_required_int_xpath = Locators.NOMINATIONS['skill1_int'] __e_skill2_required_int_xpath = Locators.NOMINATIONS['skill2_int'] __e_skill1_required_nom_xpath = Locators.NOMINATIONS['skill1_nom'] __e_skill2_required_nom_xpath = Locators.NOMINATIONS['skill2_nom'] __e_send_mail_xpath = Locators.BUTTONS['nomination_mail'] __e_confirm_button_xpath = Locators.BUTTONS['all_buttons'].format('OK') def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.scroll = PageScroll(self.driver) self.notifier = Notifier(self.driver) def add_criteria(self): try: time.sleep(1.5) self.wait.web_element_wait_click(By.XPATH, self.__e_add_criteria_xpath, 'add_criteria') print('Add new criteria - Clicked') return True except Exception as error: ui_logger.error(error) def panel_skill1_select(self, panel): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_panel_entry_xpath, panel, 'panel_skill1_select') self.wait.drop_down_selection() print('Skill-1 to panel - Selected') return True except Exception as error: ui_logger.error(error) def panel_skill2_select(self, panel): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_panel2_entry_xpath, panel, 'panel_skill2_select') self.wait.drop_down_selection() print('Skill-2 to panel - Selected') return True except Exception as error: ui_logger.error(error) def search_skill1_interviewers(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_skill1_search_xpath, 'search_skill1_interviewers') print('Skill-1 interviewers - Searched') return True except Exception as error: ui_logger.error(error) def search_skill2_interviewers(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_skill2_search_xpath, 'search_skill2_interviewers') print('Skill-2 interviewers - Searched') return True except Exception as error: ui_logger.error(error) def skill1_required_interviewers(self, count): try: self.wait.clear(By.XPATH, self.__e_skill1_required_int_xpath, 'skill1_required_int') self.wait.web_element_wait_send_keys( By.XPATH, self.__e_skill1_required_int_xpath, count, 'search_skill2_interviewers') print('Skill-1 interviewers count - Entered') return True except Exception as error: ui_logger.error(error) def skill2_required_interviewers(self, count): try: self.wait.clear(By.XPATH, self.__e_skill2_required_int_xpath, 'skill2_required_int') self.wait.web_element_wait_send_keys( By.XPATH, self.__e_skill2_required_int_xpath, count, 'search_skill2_interviewers') print('Skill-2 interviewers count - Entered') return True except Exception as error: ui_logger.error(error) def skill1_required_nomination(self, count): try: self.wait.clear(By.XPATH, self.__e_skill1_required_nom_xpath, 'skill1_required_nomination') self.wait.web_element_wait_send_keys( By.XPATH, self.__e_skill1_required_nom_xpath, count, 'search_skill2_interviewers') print('Skill-1 nominations count - Entered') return True except Exception as error: ui_logger.error(error) def skill2_required_nomination(self, count): try: self.wait.clear(By.XPATH, self.__e_skill2_required_nom_xpath, 'skill2_required_nomination') self.wait.web_element_wait_send_keys( By.XPATH, self.__e_skill2_required_nom_xpath, count, 'search_skill2_interviewers') print('Skill-2 nominations count - Entered') return True except Exception as error: ui_logger.error(error) def send_mail_interviewers(self): try: time.sleep(1) self.wait.web_element_wait_click(By.XPATH, self.__e_send_mail_xpath, 'send_mail_interviewers') print('Send mail to interviewers - Sent') return True except Exception as error: ui_logger.error(error) def confirm_button(self): try: time.sleep(1) self.wait.web_element_wait_click(By.XPATH, self.__e_confirm_button_xpath, 'send_mail_interviewers') print('Ok confirmation - Confirmed') return True except Exception as error: ui_logger.error(error) def criteria_notifier(self, message): try: self.wait.loading() self.notifier.glowing_messages(message) return True except Exception as error: ui_logger.error(error) def criteria_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 Actions: __e_event_actions_xpath = Locators.ACTIONS['actions_click'] __e_event_candidates_id = Locators.ACTIONS['view_candidates'] __e_event_slot_id = Locators.ACTIONS['slot_config'] __e_event_lobby_id = Locators.ACTIONS['lobby'] __e_event_interview_lobby_id = Locators.ACTIONS['panel'] __e_event_upload_candidates_id = Locators.ACTIONS['upload_candidate'] __e_event_owners_id = Locators.ACTIONS['event_owners'] __e_event_live_int_id = Locators.ACTIONS['live_interviews'] __e_event_interviews_id = Locators.ACTIONS['event_interviews'] __e_manage_interviewers_id = Locators.ACTIONS['manage_interviewers'] def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.scroll = PageScroll(self.driver) def event_actions_click(self): try: self.scroll.up(0, 100) self.wait.web_element_wait_click(By.XPATH, self.__e_event_actions_xpath, 'Event_actions_click') print('Event Actions - Clicked') return True except Exception as error: ui_logger.error(error) def event_view_candidates(self): try: self.wait.web_element_wait_click(By.ID, self.__e_event_candidates_id, 'Event_candidates_action') self.wait.loading() print('Event View Applicant - Screen') return True except Exception as error: ui_logger.error(error) def event_slot_configuration(self): try: self.wait.web_element_wait_click(By.ID, self.__e_event_slot_id, 'Event_slot_config_action') self.wait.loading() print('Event slot configuration - Screen') return True except Exception as error: ui_logger.error(error) def event_lobby(self): try: self.wait.web_element_wait_click(By.ID, self.__e_event_lobby_id, 'View_Event_Lobby') self.wait.loading() print('View Event Lobby - Screen') return True except Exception as error: ui_logger.error(error) def interview_lobby_panel(self): try: self.wait.web_element_wait_click(By.ID, self.__e_event_interview_lobby_id, 'Interviewer_Lobby_panel') self.wait.loading() print('Event_interviewer_lobby - Screen') time.sleep(5) print('Event_interviewer_lobby - whiteScreen') return True except Exception as error: ui_logger.error(error) def event_upload_candidates(self): try: time.sleep(0.5) self.wait.web_element_wait_click( By.ID, self.__e_event_upload_candidates_id, 'event_upload_candidates') self.wait.loading() print('Event Upload Candidate - Screen') return True except Exception as error: ui_logger.error(error) def manage_event_owners(self): try: self.wait.web_element_wait_click(By.ID, self.__e_event_owners_id, 'manage_event_owners') self.wait.loading() print('Event Owners adding - Screen') return True except Exception as error: ui_logger.error(error) def live_interview_schedule(self): try: self.wait.web_element_wait_click(By.ID, self.__e_event_live_int_id, 'live_interview_schedule') self.wait.loading() print('Event live interview schedule - Screen') return True except Exception as error: ui_logger.error(error) def event_interviews(self): try: self.wait.web_element_wait_click(By.ID, self.__e_event_interviews_id, 'event_interviews') self.wait.loading() print('Event interviews - Screen') return True except Exception as error: ui_logger.error(error) def manage_interviewers(self): try: self.wait.web_element_wait_click(By.ID, self.__e_manage_interviewers_id, 'manage_interviewers') print('manage_interviewers - Screen') self.wait.loading() return True except Exception as error: ui_logger.error(error)
class LobbyPage: __e_create_button_xpath = Locators.BUTTONS['button'].format('Create Room') __e_room_name_xpath = Locators.PLACEHOLDER['text_ph'].format('Room Name') __e_interviewers_xpath = Locators.TITLE['title'].format( 'Select Interviewers') __e_participants_xpath = Locators.TITLE['title'].format( 'Select Participants') __e_search_xpath = Locators.TITLE['title'].format('Type here to search') __e_select_all_xpath = Locators.MULTI_SELECTIONS['moveAllItemsRight'] __e_done_button = Locators.BUTTONS['all_buttons'].format('Done') __e_created_room_xpath = Locators.BUTTONS['actionClicked'].format( "'", 'createRoom', "'") __e_active_room_xpath = Locators.EVENT_LOBBY['active'] __e_ok_button_xpath = Locators.BUTTONS['all_buttons'].format('OK') __e_un_assign_xpath = Locators.EVENT_LOBBY['un_assign'] __e_assign_room_xpath = Locators.EVENT_LOBBY['assign_room'] __e_room_name_field_xpath = Locators.PLACEHOLDER['text_ph'].format( 'Room Name') __e_room_search_filed_xpath = Locators.TITLE['title'].format('Select Room') __e_search_button_xpath = Locators.BUTTONS['button'].format('Search') __e_room_search_class = Locators.EVENT_LOBBY['room_search'] __e_assigning_room_xpath = Locators.BUTTONS['actionClicked'].format( "'", 'assignCandidateToRoom', "'") __e_candidate_info_xpath = Locators.TITLE['title'].format( 'View Candidate Info') def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.scroll = PageScroll(self.driver) self.message = Notifier(self.driver) self.sub_tab = EventSubTabs(self.driver) def create_room_button(self): try: self.scroll.up(0, 100) self.wait.web_element_wait_click(By.XPATH, self.__e_create_button_xpath, 'room_create_button') self.wait.loading() return True except Exception as error: ui_logger.error(error) def room_name(self, room_name): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_room_name_xpath, room_name, 'room_name_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_interviewers_xpath, 'Interviewers_field') return True except Exception as error: ui_logger.error(error) def select_participants(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_participants_xpath, 'Participants_field') return True except Exception as error: ui_logger.error(error) def search(self, key): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_search_xpath, key, 'Search_field') return True except Exception as error: ui_logger.error(error) def move_all(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_select_all_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, 'Done_button') return True except Exception as error: ui_logger.error(error) def created_button(self, message): try: time.sleep(1) self.wait.web_element_wait_click(By.XPATH, self.__e_created_room_xpath, 'room_created_button') self.wait.loading() self.message.glowing_messages(message) self.message.dismiss_message() return True except Exception as error: ui_logger.error(error) def active_room(self): try: time.sleep(0.5) self.wait.web_element_wait_click(By.XPATH, self.__e_active_room_xpath, 'room_created_button') return True except Exception as error: ui_logger.error(error) def ok_button(self, message): try: self.wait.web_element_wait_click(By.XPATH, self.__e_ok_button_xpath, 'room_created_button') time.sleep(0.5) self.message.glowing_messages(message) self.message.dismiss_message() return True except Exception as error: ui_logger.error(error) def un_assign_room(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_un_assign_xpath, 'Un_assign_from_room') return True except Exception as error: ui_logger.error(error) def ok_buttons(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_ok_button_xpath, 'un_assign_ok_buttons') time.sleep(1) return True except Exception as error: ui_logger.error(error) def assign_room_action(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_assign_room_xpath, 'assign_room_action') self.wait.loading() return True except Exception as error: ui_logger.error(error) def room_name_field(self, room_name): try: self.wait.web_element_wait_send_keys( By.XPATH, self.__e_room_name_field_xpath, room_name, 'room_name_field') self.wait.drop_down_selection() return True except Exception as error: ui_logger.error(error) def room_assigning_action(self): try: time.sleep(1) self.wait.web_element_wait_click(By.XPATH, self.__e_assigning_room_xpath, 'room_assign') self.wait.loading() return True except Exception as error: ui_logger.error(error) def room_search_filed(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_room_search_filed_xpath, 'room_search_filed') return True except Exception as error: ui_logger.error(error) def search_button(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_search_button_xpath, 'search_button') return True except Exception as error: ui_logger.error(error) def no_candidate_message(self, message): try: time.sleep(1) self.wait.web_element_wait_text(By.CLASS_NAME, self.__e_room_search_class, 'tag_room_search_candidate') if self.wait.text_value.strip() == message: print( f'No candidate tagged to room message - {self.wait.text_value}' ) self.driver.refresh() self.wait.loading() return True except Exception as error: ui_logger.error(error) def candidate_info(self, candidate_name): try: self.wait.web_element_wait_text(By.XPATH, self.__e_candidate_info_xpath, 'candidate_info') if self.wait.text_value == candidate_name: print(f'Candidate name - {self.wait.text_value}') return True except Exception as error: ui_logger.error(error)