class EventSlot: __e_current_status_xpath = Locators.TITLE['title'].format('Current Status') __e_search_status_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_slot_number_xpath = Locators.PLACEHOLDER['num_ph'].format( 'No. Of Slots') __e_go_button_xpath = Locators.BUTTONS['button'].format('Go') __e_date_field_xpath = Locators.PLACEHOLDER['place_holder'].format( 'From Date') __e_time_field_xpath = Locators.PLACEHOLDER['place_holder'].format( 'From Time') __e_count_field_xpath = Locators.PLACEHOLDER['num_ph'].format('Count') __e_assign_button_xpath = Locators.EVENT_LOBBY['assign_slot'] __e_ok_button_xpath = Locators.BUTTONS['all_buttons'].format('OK') __e_cancel_button_xpath = Locators.BUTTONS['all_buttons'].format('CANCEL') __e_candidate_id_xpath = Locators.PLACEHOLDER['place_holder'].format( 'Candidate Id(s) (Eg: 1234, 2312,...)') __e_search_button_xpath = Locators.BUTTONS['button'].format(' Search') __e_login_link_xpath = Locators.TITLE['title'].format( 'View Interview Lobby Link') __e_header_tag = Locators.TAG['h4'] __e_anchor_tag = Locators.TAG['anchor'] __e_href_tag = Locators.TAG['href'] def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.page_scroll = PageScroll.PageScroll(self.driver) self.candidate_login_link = '' def current_applicant_status_choose(self): try: self.wait.loading() self.wait.web_element_wait_click( By.XPATH, self.__e_current_status_xpath, 'Slot_applicant_current_status_click') return True except Exception as error: ui_logger.error(error) def search_status_select(self, stage_status): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_search_status_xpath, stage_status, 'Entered_status') 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 slot_number(self, number_of_slots): try: time.sleep(1) self.wait.web_element_wait_send_keys(By.XPATH, self.__e_slot_number_xpath, number_of_slots, 'Entered_status') return True except Exception as error: ui_logger.error(error) def go_button(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_go_button_xpath, 'Go_button') return True except Exception as error: ui_logger.error(error) def date_field(self, date): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_date_field_xpath, date, 'date_field') return True except Exception as error: ui_logger.error(error) def time_field(self, clock): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_time_field_xpath, clock, 'time_field') return True except Exception as error: ui_logger.error(error) def count_field(self, count): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_count_field_xpath, count, 'count_field') return True except Exception as error: ui_logger.error(error) def clear_time_field(self): try: self.wait.clear(By.XPATH, self.__e_time_field_xpath, 'clear_time_field') return True except Exception as error: ui_logger.error(error) def assign_slot_button(self): try: self.wait.loading() self.wait.web_element_wait_click(By.XPATH, self.__e_assign_button_xpath, 'assign_slot_button') return True except Exception as error: ui_logger.error(error) def ok_button(self): try: self.wait.loading() self.wait.web_element_wait_click(By.XPATH, self.__e_ok_button_xpath, 'ok_button') return True except Exception as error: ui_logger.error(error) def search_id(self, candidate_id): try: self.wait.loading() self.wait.web_element_wait_send_keys(By.XPATH, self.__e_candidate_id_xpath, candidate_id, 'candidate_id_field') 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 login_link_action(self): try: time.sleep(1) self.page_scroll.down(0, -100) self.wait.web_element_wait_click(By.XPATH, self.__e_login_link_xpath, 'Copy_login_link_action') return True except Exception as error: ui_logger.error(error) def copy_candidate_login_link(self, candidate_id): try: time.sleep(2) self.wait.web_element_wait_click(By.TAG_NAME, self.__e_header_tag, 'Link_Block') time.sleep(1.5) self.wait.web_elements_wait(By.TAG_NAME, self.__e_anchor_tag) lists = self.wait.perform for i in lists: if i.get_attribute(self.__e_href_tag) is not None: if candidate_id in i.get_attribute(self.__e_href_tag): self.candidate_login_link = i.get_attribute( self.__e_href_tag) print( f'candidate login link - {self.candidate_login_link}' ) return True except Exception as error: ui_logger.error(error) def cancel_button(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_cancel_button_xpath, 'link_cancel_button') return True except Exception as error: ui_logger.error(error)
def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.new_tab = NewTab(self.driver)
def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.notifier = Notifier(self.driver)
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)
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)
def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.scroll = PageScroll(self.driver)
class EventUploadCandidate: __e_upload_xpath = Locators.ATTACHMENT['file'] __e_next_button_xpath = Locators.BUTTONS['button'].format('Next') __e_declare_xpath = Locators.CHECKBOX['type'] __e_signature_xpath = Locators.CANDIDATE['upload_signature'] __e_agree_xpath = Locators.BUTTONS['button'].format('I Agree') __e_edit_info_xpath = Locators.TITLE['title'].format('Edit') __e_name_xpath = Locators.CANDIDATE['name_field'] __e_email_xpath = Locators.CANDIDATE['email_field'] __e_usn_xpath = Locators.CANDIDATE['usn_field'] __e_save_button_xpath = Locators.CANDIDATE['save_info'] __e_save_candidate_xpath = Locators.CANDIDATE['save'] __e_upload_count_css = Locators.CANDIDATE['Upload_count'] __e_close_button_xpath = Locators.BUTTONS['button'].format('Close') __e_close_main_xpath = Locators.BUTTONS['close'] __e_confirm_close_main_xpath = Locators.BUTTONS['all_buttons'].format('OK') def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.notifier = Notifier(self.driver) self.scroll = PageScroll(self.driver) def upload_file(self, upload_file): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_upload_xpath, upload_file, 'upload_file') print('Candidate excel sheet - Uploading') self.wait.uploading() return True except Exception as error: ui_logger.error(error) def next_button(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_next_button_xpath, 'upload_file') print('Candidate scree next button - Clicked') self.wait.loading() return True except Exception as error: ui_logger.error(error) def declare_check(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_declare_xpath, 'declare_check') print('Declare Check - Clicked') return True except Exception as error: ui_logger.error(error) def signature_entry(self): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_signature_xpath, 'VinodKumar', 'signature_entry') print('Signature Entry - Signed') return True except Exception as error: ui_logger.error(error) def agreed_button(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_agree_xpath, 'agreed_button') print('Agreed Button - Clicked') return True except Exception as error: ui_logger.error(error) def edit_excel_information(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_edit_info_xpath, 'edit_excel_information') print('Edit Information button - Clicked') return True except Exception as error: ui_logger.error(error) def name_edit(self, candidate_name): try: self.wait.clear(By.XPATH, self.__e_name_xpath, 'Name_field_clear') self.wait.web_element_wait_send_keys(By.XPATH, self.__e_name_xpath, candidate_name, 'name_edit') print('Name information - Changed') return True except Exception as error: ui_logger.error(error) def email_edit(self, candidate_email): try: self.wait.clear(By.XPATH, self.__e_email_xpath, 'Name_field_clear') self.wait.web_element_wait_send_keys(By.XPATH, self.__e_email_xpath, candidate_email, 'email_edit') print('Email information - Changed') return True except Exception as error: ui_logger.error(error) def usn_edit(self, usn_email): try: self.wait.clear(By.XPATH, self.__e_usn_xpath, 'Name_field_clear') self.wait.web_element_wait_send_keys(By.XPATH, self.__e_usn_xpath, usn_email, 'email_edit') print('Usn information - Changed') return True except Exception as error: ui_logger.error(error) def save_info(self): try: self.scroll.down(0, -50) self.wait.web_element_wait_click(By.XPATH, self.__e_save_button_xpath, 'save_info') print('Save information - Saved') return True except Exception as error: ui_logger.error(error) def save_candidate(self): try: time.sleep(1) self.wait.web_element_wait_click(By.XPATH, self.__e_save_candidate_xpath, 'save_candidate') print('Save Candidate - Saved') return True except Exception as error: ui_logger.error(error) def success_upload(self, message): try: time.sleep(3) self.wait.web_element_wait_text(By.CSS_SELECTOR, self.__e_upload_count_css, 'success_upload') if self.wait.text_value.strip() == message: print(f'Success {self.wait.text_value.strip()} - Count') return True except Exception as error: ui_logger.error(error) def close_candidate_screen(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_close_button_xpath, 'close_candidate_screen') print('Close Candidate Screen - Closed') return True except Exception as error: ui_logger.error(error) def close_main_screen(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_close_main_xpath, 'close_main_screen') print('Close Main Screen - Closed') return True except Exception as error: ui_logger.error(error) def confirm_close_main_screen(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_confirm_close_main_xpath, 'confirm_close_main_screen') print('Confirm Close Main Screen - Closed') self.wait.loading() return True except Exception as error: ui_logger.error(error)
class EventTestConfigPage: __e_event_test_config_btn_xpath = Locators.BUTTONS[ 'btnActionClicked'].format("'", 'configure', "'") __e_job_name_xpath = Locators.PLACEHOLDER['text_ph'].format('Job Role') __e_stage_xpath = Locators.PLACEHOLDER['text_ph'].format('Stage') __e_test_xpath = Locators.PLACEHOLDER['text_ph'].format('Test') __e_test_active_css = Locators.BUTTONS['radio'] __e_test_save_xpath = Locators.BUTTONS['button'].format('Save') __e_test_config_cancel_xpath = Locators.BUTTONS['all_buttons'].format( 'CANCEL') def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.notifier = Notifier(self.driver) def event_test_configure_button(self): try: self.wait.web_element_wait_click( By.XPATH, self.__e_event_test_config_btn_xpath, 'event_test_configure_button') print('Event Test Configuration button - Clicked') self.wait.loading() return True except Exception as error: ui_logger.error(error) def test_job_name_field(self, job_name): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_job_name_xpath, job_name, 'test_job_name_field') self.wait.drop_down_selection() print(f'Test Configuration Job Name - {job_name} - Entered') return True except Exception as error: ui_logger.error(error) def test_stage_name_field(self, stage_name): try: time.sleep(0.8) self.wait.web_element_wait_send_keys(By.XPATH, self.__e_stage_xpath, stage_name, 'test_job_name_field') self.wait.drop_down_selection() print(f'Test Configuration stage Name - {stage_name} - Entered') return True except Exception as error: ui_logger.error(error) def test_test_name_field(self, test_name): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_test_xpath, test_name, 'test_job_name_field') self.wait.drop_down_selection() print( f'Test Configuration Assessment Name - {test_name} - Entered') return True except Exception as error: ui_logger.error(error) def test_active_enable(self): try: time.sleep(0.6) button = ' On' self.wait.web_elements_wait_multiple_click( By.CSS_SELECTOR, self.__e_test_active_css, button) print(f'Event Ec - {button} - Selected') return True except Exception as error: ui_logger.error(error) def event_test_configure_save(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_test_save_xpath, 'event_test_configure_save') print('Event Test Configuration Save - Clicked') self.wait.loading() return True except Exception as error: ui_logger.error(error) def test_tag_notifier(self, message): try: time.sleep(0.7) self.notifier.glowing_messages(message) return True except Exception as error: ui_logger.error(error) def test_tag_notifier_dismiss(self): try: self.notifier.dismiss_message() time.sleep(0.7) return True except Exception as error: ui_logger.error(error) def cancel_test_extra_config(self): try: self.wait.loading() self.wait.web_element_wait_click(By.XPATH, self.__e_test_config_cancel_xpath, 'cancel_test_extra_config') return True except Exception as error: ui_logger.error(error)
class InterviewFeedback: __e_provide_select_drop_css = Locators.FEEDBACK['new_form_drop_down'] __e_provide_comment_xpath = Locators.PLACEHOLDER['all_place_holder'].format('Enter text here') __e_provide_overall_xpath = Locators.FEEDBACK['overall'] __e_decision_button_xpath = Locators.BUTTONS['all_buttons'] __e_feedback_submit_xpath = Locators.BUTTONS['button'].format('Submit Feedback') __e_agree_xpath = Locators.BUTTONS['button'].format('Agree and Submit') __e_save_draft_xpath = Locators.BUTTONS['button'].format('Save as Draft') def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.notifier = Notifier(self.driver) def feedback_select_drop_down(self, value): try: time.sleep(5) self.wait.loading() self.wait.web_elements_wait_send_keys(By.XPATH, self.__e_provide_select_drop_css, value) print(f'Selected Rating - {value}') return True except Exception as error: ui_logger.error(error) def feedback_comments(self, comment): try: time.sleep(0.5) self.wait.web_elements_wait_send_keys(By.XPATH, self.__e_provide_comment_xpath, comment) print(f'Given Comment - {comment}') return True except Exception as error: ui_logger.error(error) def feedback_decision(self, decision): try: self.wait.web_elements_wait_click(By.XPATH, self.__e_decision_button_xpath.format(decision), decision) print(f'Selected Decision - {decision}') return True except Exception as error: ui_logger.error(error) def overall_comment(self, comment): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_provide_overall_xpath, comment, 'overall_comment') print(f'Given Overall Comment - {comment}') return True except Exception as error: ui_logger.error(error) def save_draft_new_feedback(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_save_draft_xpath, 'submit_feedback_button') print('Save Draft - Submitted') self.wait.loading() return True except Exception as error: ui_logger.error(error) def submit_feedback(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_feedback_submit_xpath, 'submit_feedback_button') print('Feedback - Submitted') return True except Exception as error: ui_logger.error(error) def agree_and_submit(self): try: time.sleep(0.7) self.wait.web_element_wait_click(By.XPATH, self.__e_agree_xpath, 'feedback_form_validation') print('Agree and submit - Submitted') time.sleep(1) return True except Exception as error: ui_logger.error(error) def save_draft_notifier(self, message): try: self.notifier.glowing_messages(message) return True except Exception as error: ui_logger.error(error) def save_draft_notifier_dismiss(self): try: self.notifier.dismiss_message() return True except Exception as error: ui_logger.error(error)
class UnlockFeedback: __e_select_int_xpath = Locators.CHECKBOX['all'] __e_unlock_btn_xpath = Locators.BUTTONS['actionClicked'].format( "'", 'unlockFeedback', "'") __e_unlock_comment_xpath = Locators.EVENT['comment_cancel_request'] __e_ok_button_xpath = Locators.BUTTONS['all_buttons'].format('OK') __e_close_button_xpath = Locators.BUTTONS['button'].format('Close') def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.notifier = Notifier(self.driver) self.scroll = PageScroll(self.driver) def select_all_interviewers(self): try: time.sleep(1) self.wait.web_element_wait_click(By.XPATH, self.__e_select_int_xpath, 'select_all_interviewers') print('Selection Interviewer for - Unlock') return True except Exception as error: ui_logger.error(error) def unlock_button(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_unlock_btn_xpath, 'unlock_button') print('Unlocking button - Clicked') return True except Exception as error: ui_logger.error(error) def unlock_request_comment(self, comment): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_unlock_comment_xpath, comment, 'unlock_request_comment') print('Enter the comment for Unlock request') return True except Exception as error: ui_logger.error(error) def ok_button(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_ok_button_xpath, 'ok_button') self.wait.loading() return True except Exception as error: ui_logger.error(error) def close_button(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_close_button_xpath, 'close_button') self.wait.loading() return True except Exception as error: ui_logger.error(error) def unlock_status_notifier(self, message): try: self.notifier.glowing_messages(message) return True except Exception as error: ui_logger.error(error) def unlock_status_notifier_dismiss(self): try: self.notifier.dismiss_message() time.sleep(0.5) 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 CandidateQueryReplyPage: __e_search_xpath = Locators.PLACEHOLDER['place_holder'].format('Find') __e_subject_xpath = Locators.TITLE['title'] __e_reply_message_xpath = Locators.PLACEHOLDER['all_place_holder'].format( 'Your message here...') __e_mark_close_xpath = Locators.BUTTONS['button'].format('Mark as Closed') __e_ok_xpath = Locators.BUTTONS['button'].format('OK') __e_reply_button_xpath = Locators.TITLE['title'].format('Reply') __e_status_bucket_xpath = Locators.QUERY['status_bucket'] def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.notifier = Notifier(self.driver) def search_candidate_query(self, candidate_name): try: self.wait.embrace_loading() self.wait.clear(By.XPATH, self.__e_search_xpath, 'more_queries') self.wait.web_element_wait_send_keys(By.XPATH, self.__e_search_xpath, candidate_name, 'more_queries') print('Searching for proper record') return True except Exception as error: ui_logger.error(error) def select_proper_query_based_on_subject(self, subject): try: time.sleep(1) self.wait.web_element_wait_click( By.XPATH, self.__e_subject_xpath.format(subject), 'select_proper_query_based_on_subject') self.wait.embrace_loading() print('Proper block based on proper subject - Selected') return True except Exception as error: ui_logger.error(error) def reply_message_entry(self, message): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_reply_message_xpath, message, 'reply_message_entry') print('reply_message_entry - Entered') return True except Exception as error: ui_logger.error(error) def reply_to_query(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_reply_button_xpath, 'reply_to_query') print('reply_to_query - Clicked') time.sleep(0.5) return True except Exception as error: ui_logger.error(error) def in_progress_tab(self): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_status_bucket_xpath, 'In Progress', 'in_progress_tab') self.wait.embrace_loading() print('in_progress_tab - Selected') return True except Exception as error: ui_logger.error(error) def mark_as_closed(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_mark_close_xpath, 'mark_as_closed') print('mark_as_closed - Clicked') return True except Exception as error: ui_logger.error(error) def confirm_button(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_ok_xpath, 'confirm_button') print('confirm_button - Clicked') return True except Exception as error: ui_logger.error(error)
class EmbraceLogin: """ ----------------- WEB ELEMENT REFERENCE CLASS PRIVATE VARIABLES TO EASY ACCESS ------>>>> """ __e_login_name = Locators.LOGIN['c_user_name'] __e_password_xpath = Locators.LOGIN['password'] __e_login_button_xpath = Locators.LOGIN['e_login'] __e_login_verify_name = 'headerNameText' def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.scroll = PageScroll(self.driver) self.new_tab = NewTab(self.driver) def embrace_url(self, server): if server == 'amsin': self.new_tab.open_in_same_tab(0, ReadConfigFile.ReadConfig.get_qa_embrace_url()) return True elif server == 'ams': self.new_tab.open_in_same_tab(0, ReadConfigFile.ReadConfig.get_production_embrace_url()) return True elif server == 'beta': self.new_tab.open_in_same_tab(0, ReadConfigFile.ReadConfig.get_beta_embrace_url()) return True elif server == 'stage': self.new_tab.open_in_same_tab(0, ReadConfigFile.ReadConfig.get_stage_embrace_url()) return True elif server == 'india': self.new_tab.open_in_same_tab(0, ReadConfigFile.ReadConfig.get_indiaams_embrace_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, 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.XPATH, self.__e_login_button_xpath, 'login_button') return True except Exception as error: ui_logger.error(error) def login_account_name_verification(self, user_name): try: self.wait.embrace_loading() time.sleep(1) assert self.wait.web_elements_wait_text(By.CLASS_NAME, self.__e_login_verify_name, user_name) == \ user_name, 'Logged in different account please check the details' print(f'{user_name} logged in successfully') 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)
def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver)
def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.tab = Title(self.driver) self.window = SwitchWindowClose(self.driver)
class InterviewerLobbyPage: __e_select_candidate_xpath = Locators.BUTTONS['button'].format('Select Candidate') __e_provide_feedback_xpath = Locators.BUTTONS['actionClicked'].format("'", 'provideFeedBack', "'") __e_invite_video_xpath = Locators.BUTTONS['actionClicked'].format("'", 'markAsCurrentCandidate', "'") __e_invite_check_xpath = Locators.CHECK_BOX['check_box'] __e_proceed_xpath = Locators.BUTTONS['button'].format('Proceed To Interview') __e_finish_interview_xpath = Locators.BUTTONS['button'].format('Interview is Finished') __e_full_finish_interview_xpath = Locators.INTERVIEWER_LOBBY['finish_interview'] def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) def select_candidate(self): try: self.wait.loading() self.wait.web_element_wait_click(By.XPATH, self.__e_select_candidate_xpath, 'select_candidate') print('Selected New candidate into - Queue') return True except Exception as error: ui_logger.error(error) def provide_feedback(self): try: self.wait.loading() self.wait.web_element_wait_click(By.XPATH, self.__e_provide_feedback_xpath, 'provide_feedback') return True except Exception as error: ui_logger.error(error) def invite_video_button(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_invite_video_xpath, 'invite_video_button') return True except Exception as error: ui_logger.error(error) def check_box(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_invite_check_xpath, 'invite_check_box') return True except Exception as error: ui_logger.error(error) def proceed_video_link(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_proceed_xpath, 'proceed_video_link') time.sleep(1) print('Open Video Interview Link - screen') return True except Exception as error: ui_logger.error(error) def finish_interview(self): try: time.sleep(0.5) self.wait.web_element_wait_click(By.XPATH, self.__e_finish_interview_xpath, 'finish_interview') print('Finish Interview - Clicked') return True except Exception as error: ui_logger.error(error) def full_finish_interview(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_full_finish_interview_xpath, 'full_finish_interview') print('Full Finish Interview - Clicked') return True except Exception as error: ui_logger.error(error)
class LoginPage: __e_candidate_id_xpath = Locators.PLACEHOLDER['text_ph'].format( 'Enter Candidate Id') __e_enter_button_xpath = Locators.BUTTONS['button'].format( 'Enter the room') __e_candidate_name_xpath = Locators.CANDIDATE_LOBBY_LOGIN['candidate_name'] __e_almost_message_css = Locators.CANDIDATE_LOBBY_LOGIN['almost-message'] __e_queued_message_xpath = Locators.CANDIDATE_LOBBY_LOGIN['queued-message'] __e_finish_message_xpath = Locators.CANDIDATE_LOBBY_LOGIN[ 'finished-message'] __e_your_message_xpath = Locators.CANDIDATE_LOBBY_LOGIN['your-message'] def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.new_tab = NewTab(self.driver) def open_link(self, link_to_login): try: self.new_tab.open_new_tab(1, link_to_login) return True except Exception as error: ui_logger.error(error) def login_screen(self, candidate_id): try: self.wait.loading() time.sleep(2) self.wait.web_element_wait_send_keys(By.XPATH, self.__e_candidate_id_xpath, candidate_id, 'candidate_login_screen') return True except Exception as error: ui_logger.error(error) def enter_to_room(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_enter_button_xpath, 'enter_to_room_button') self.wait.loading() return True except Exception as error: ui_logger.error(error) def candidate_name_validate(self, candidate_name): try: time.sleep(1) self.wait.web_element_wait_text( By.XPATH, self.__e_candidate_name_xpath.format(candidate_name), 'candidate_name_validation_lobby') if self.wait.text_value in self.wait.text_value: print(f'Lobby Candidate name - {self.wait.text_value}') return True except Exception as error: ui_logger.error(error) def almost_message(self, message): try: self.wait.web_element_wait_text(By.CSS_SELECTOR, self.__e_almost_message_css, 'almost_message') if self.wait.text_value == message: print(f'Candidate Lobby - {self.wait.text_value}') return True except Exception as error: ui_logger.error(error) def queued_message(self, message): try: self.wait.web_element_wait_text(By.XPATH, self.__e_queued_message_xpath, 'queued_message') if self.wait.text_value == message: print(f'Candidate Lobby - {self.wait.text_value}') return True except Exception as error: ui_logger.error(error) def it_is_your_message(self, message): try: self.wait.web_element_wait_text(By.XPATH, self.__e_your_message_xpath, 'it_is_your_message') if self.wait.text_value == message: print(f'Candidate Lobby - {self.wait.text_value}') return True except Exception as error: ui_logger.error(error) def finish_interview_message(self, message): try: self.wait.web_element_wait_text(By.XPATH, self.__e_finish_message_xpath, 'finish_interview_message') if self.wait.text_value == message: print(f'Candidate Lobby - {self.wait.text_value}') 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 EventCreation: __e_new_event_xpath = Locators.BUTTONS['create'] __e_event_name_xpath = Locators.PLACEHOLDER['text_ph'].format('Name') __e_event_req_name_xpath = Locators.PLACEHOLDER['text_ph'].format( 'Requirement') __e_event_job_xpath = Locators.TITLE['title'].format('Job Roles') __e_event_slot_xpath = Locators.PLACEHOLDER['text_ph'].format('Slot') __e_event_from_date_xpath = Locators.PLACEHOLDER['place_holder'].format( 'From') __e_event_to_date_xpath = Locators.PLACEHOLDER['place_holder'].format('To') __e_event_report_date_xpath = Locators.PLACEHOLDER['place_holder'].format( 'Reporting Date') __e_event_manager_xpath = Locators.PLACEHOLDER['place_holder'].format( 'Event Manager') __e_event_college_xpath = Locators.PLACEHOLDER['place_holder'].format( 'College') __e_event_ec_css = Locators.BUTTONS['radio'] __e_event_create_xpath = Locators.BUTTONS['actionClicked'].format( "'", 'create', "'") def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.notifier = Notifier(self.driver) self.scroll = PageScroll(self.driver) def new_event_button(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_new_event_xpath, 'new_event_button') print('New event creation button - Clicked') self.wait.loading() return True except Exception as error: ui_logger.error(error) def event_name_field(self, event_name): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_event_name_xpath, event_name, 'event_name_field') print(f'New event name - {event_name} - Entered') return True except Exception as error: ui_logger.error(error) def event_req_field(self, req_name): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_event_req_name_xpath, req_name, 'event_req_field') time.sleep(1) self.wait.drop_down_selection() self.wait.loading() print(f'New event req name - {req_name} - Entered') return True except Exception as error: ui_logger.error(error) def event_job_field(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_event_job_xpath, 'event_job_field') print('Event job field - Clicked') return True except Exception as error: ui_logger.error(error) def event_slot_field(self, slot): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_event_slot_xpath, slot, 'event_slot_field') self.wait.drop_down_selection() print(f'New event slot - {slot} - Entered') return True except Exception as error: ui_logger.error(error) def event_from_date(self, from_date): try: self.wait.web_element_wait_send_keys( By.XPATH, self.__e_event_from_date_xpath, from_date, 'event_from_date') print(f'New Event from date - {from_date} - Entered') return True except Exception as error: ui_logger.error(error) def event_to_date(self, to_date): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_event_to_date_xpath, to_date, 'event_to_date') print(f'New Event to date - {to_date} - Entered') return True except Exception as error: ui_logger.error(error) def event_report_date(self, report_date): try: self.wait.web_element_wait_send_keys( By.XPATH, self.__e_event_report_date_xpath, report_date, 'event_to_date') print(f'New Event reporting date - {report_date} - Entered') return True except Exception as error: ui_logger.error(error) def event_manager_field(self, event_manager): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_event_manager_xpath, event_manager, 'event_manager_field') self.wait.drop_down_selection() print(f'Event manager name - {event_manager} - Entered') return True except Exception as error: ui_logger.error(error) def event_college_field(self, college): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_event_college_xpath, college, 'event_college_field') self.wait.drop_down_selection() print(f'Event college name - {college} - Entered') self.wait.loading() return True except Exception as error: ui_logger.error(error) def event_ec_enable(self): try: self.scroll.down(0, -50) time.sleep(0.6) button = ' Enable' self.wait.web_elements_wait_multiple_click(By.CSS_SELECTOR, self.__e_event_ec_css, button) print(f'Event Ec - {button} - Selected') return True except Exception as error: ui_logger.error(error) def event_create_button(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_event_create_xpath, 'event_create_button') self.wait.drop_down_selection() print('Event Create button - Clicked') return True except Exception as error: ui_logger.error(error) def event_create_notifier(self, message): try: time.sleep(0.7) self.notifier.glowing_messages(message) return True except Exception as error: ui_logger.error(error) def event_create_notifier_dismiss(self): try: self.notifier.dismiss_message() time.sleep(0.9) self.wait.loading() 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 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 LiveIntSchedulePage: __e_live_stage_xpath = Locators.LIVE_INTERVIEW['stage_selection'] __e_live_app_xpath = Locators.PLACEHOLDER['text_ph'].format( 'Candidate Name') __e_live_search_app_xpath = Locators.LIVE_INTERVIEW['app_search'] __e_live_clear_search_app_xpath = Locators.LIVE_INTERVIEW['clear_search'] __e_check_xpath = Locators.CHECKBOX['type'] __e_validate_class = Locators.LIVE_INTERVIEW['int_screen'] __e_select_int_xpath = Locators.LIVE_INTERVIEW['select_int'] __e_live_schedule_select_xpath = Locators.BUTTONS['button'].format( 'Schedule Selected') __e_live_schedule_xpath = Locators.BUTTONS['button'].format(' Schedule') __e_arrow_down_class = Locators.LIVE_INTERVIEW['arrow_down'] __e_feedback_action_xpath = Locators.LIVE_INTERVIEW['feedback_button'] def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.notifier = Notifier(self.driver) self.switch_window = SwitchWindowClose(self.driver) def stage_selection(self, stage_name): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_live_stage_xpath, stage_name, 'job_int_panel') print(f'{stage_name} - Selected from available stages') self.wait.loading() return True except Exception as error: ui_logger.error(error) def applicant_name_filed(self, applicant_name): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_live_app_xpath, applicant_name, 'applicant_name_filed') print(f'Applicant name {applicant_name} - Entered') self.wait.loading() return True except Exception as error: ui_logger.error(error) def schedule_applicant_search(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_live_search_app_xpath, 'schedule_applicant_search') print('schedule applicant - searched') self.wait.loading() return True except Exception as error: ui_logger.error(error) def clear_applicant_search(self): try: time.sleep(0.7) self.wait.web_element_wait_click( By.XPATH, self.__e_live_clear_search_app_xpath, 'clear_applicant_search') print('clear applicant - searched') self.wait.loading() return True except Exception as error: ui_logger.error(error) def select_live_applicant(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_check_xpath, 'Applicant_check_box') print('Applicant got - selected') return True except Exception as error: ui_logger.error(error) def schedule_select(self): try: time.sleep(2) self.wait.web_element_wait_click( By.XPATH, self.__e_live_schedule_select_xpath, 'schedule_select') self.wait.loading() print('schedule_select button - selected') return True except Exception as error: ui_logger.error(error) def validate_interviewers_screen(self, screen_name): try: time.sleep(0.5) self.wait.web_element_wait_text(By.CLASS_NAME, self.__e_validate_class, 'validate_interviewers_screen') if screen_name in self.wait.text_value.strip(): print(f'Screen name {screen_name} - validating') return True except Exception as error: ui_logger.error(error) def select_interviewers(self): try: time.sleep(1) self.wait.web_elements_wait_click(By.XPATH, self.__e_select_int_xpath, '') print('select_interviewers - selected') return True except Exception as error: ui_logger.error(error) def live_schedule(self): try: time.sleep(0.5) self.wait.web_element_wait_click(By.XPATH, self.__e_live_schedule_xpath, 'live_schedule') self.wait.loading() print('Live schedule - selected') return True except Exception as error: ui_logger.error(error) def live_schedule_notifier(self, message): try: time.sleep(0.7) self.notifier.glowing_messages(message) return True except Exception as error: ui_logger.error(error) def live_schedule_notifier_dismiss(self): try: self.notifier.dismiss_message() time.sleep(0.9) self.wait.loading() return True except Exception as error: ui_logger.error(error) def arrow_down_for_feedback(self): try: time.sleep(0.5) self.wait.web_element_wait_click(By.CLASS_NAME, self.__e_arrow_down_class, 'arrow_down_for_feedback') self.wait.loading() print('Arrow down for feedback- Clicked') return True except Exception as error: ui_logger.error(error) def feedback_provide_action(self): try: time.sleep(1) self.wait.web_element_wait_click(By.XPATH, self.__e_feedback_action_xpath, 'feedback_provide_action') print('Provide feedback Action - Clicked') return True except Exception as error: ui_logger.error(error)
class QuickIntSchedulePage: __e_live_stage_xpath = Locators.LIVE_INTERVIEW['stage_selection'] __e_interviewer_select_xpath = Locators.TITLE['title'].format( 'Interviewers') __e_interview_round_xpath = Locators.PLACEHOLDER['text_ph'].format( 'Select Interview Round') __e_comment_xpath = Locators.PLACEHOLDER['all_place_holder'].format( 'Your Comments') __e_schedule_xpath = Locators.BUTTONS['actionClicked'].format( "'", 'scheduleInterview', "'") def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.notifier = Notifier(self.driver) def select_interviewers_field(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_interviewer_select_xpath, 'select_interviewers') print('Select interviewers - Clicked') return True except Exception as error: ui_logger.error(error) def select_interviewer_round(self, stage_name): try: self.wait.web_element_wait_send_keys( By.XPATH, self.__e_interview_round_xpath, stage_name, 'select_interviewers') self.wait.drop_down_selection() print(f'Select stage {stage_name} - Selected') return True except Exception as error: ui_logger.error(error) def quick_comment(self, comment): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_comment_xpath, comment, 'quick_comment') self.wait.drop_down_selection() print(f'Quick interview {comment} - Entered') return True except Exception as error: ui_logger.error(error) def schedule_quick_interview(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_schedule_xpath, 'Quick_schedule_interview') print('Quick interview - Scheduled') self.wait.loading() return True except Exception as error: ui_logger.error(error) def quick_schedule_notifier(self, message): try: time.sleep(0.5) self.notifier.glowing_messages(message) return True except Exception as error: ui_logger.error(error) def quick_schedule_notifier_dismiss(self): try: self.notifier.dismiss_message() time.sleep(0.9) self.wait.loading() return True except Exception as error: ui_logger.error(error)
def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.message = Notifier(self.driver) self.switch_window = SwitchWindowClose(self.driver)
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 JobCreationPage: """ ----------------- WEB ELEMENT REFERENCE CLASS PRIVATE VARIABLES TO EASY ACCESS ------>>>> """ __e_create = Locators.BUTTONS['create'] __e_job_names = Locators.JOB['job_name'] __e_anchor_tag = Locators.TAG['anchor'] __e_file_path = Locators.ATTACHMENT['file'] __e_description = Locators.JOB['description'] __e_location = Locators.PLACEHOLDER['text_ph'].format('Location') __e_hm = Locators.PLACEHOLDER['text_ph'].format('Hiring Manager') __e_bu = Locators.PLACEHOLDER['text_ph'].format('Business Unit') __e_openings = Locators.JOB['openings'] __e_male = Locators.PLACEHOLDER['num_ph'].format('Male') __e_female = Locators.PLACEHOLDER['num_ph'].format('Female') __e_job_create = Locators.BUTTONS['button'].format('Create') def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.notifier = Notifier(self.driver) def create_button(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_create, 'Job Create Button') print('***--------->>> Clicked on job created button') self.wait.loading() return True except Exception as error: ui_logger.error(error) def job_name(self, name): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_job_names, name, 'Job_name_field') return True except Exception as error: ui_logger.error(error) def job_attachment(self, file_path): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_file_path, file_path, 'Job_attachment') time.sleep(0.5) self.wait.uploading() return True except Exception as error: ui_logger.error(error) def job_attachment_notifier(self, message): try: self.notifier.glowing_messages(message) self.notifier.dismiss_message() return True except Exception as error: ui_logger.error(error) def job_description(self, description): self.wait.web_element_wait_send_keys(By.XPATH, self.__e_description, description, 'Job_description') self.wait.drop_down_selection() return True def job_location(self, location): self.wait.web_element_wait_send_keys(By.XPATH, self.__e_location, location, 'Job_location_field') self.wait.drop_down_selection() return True def job_hiring_manager(self, hm): self.wait.web_element_wait_send_keys(By.XPATH, self.__e_hm, hm, 'job_hm_field') self.wait.drop_down_selection() return True def job_business_unit(self, bu): self.wait.web_element_wait_send_keys(By.XPATH, self.__e_bu, bu, 'Job_bu_field') self.wait.drop_down_selection() return True def job_openings(self, openings): self.wait.clear(By.NAME, self.__e_openings, 'Job_openings_field') self.wait.web_element_wait_send_keys(By.NAME, self.__e_openings, openings, 'Job_openings_field') return True def job_male_diversity(self, male_diversity): self.wait.clear(By.XPATH, self.__e_male, 'Job_male_field') self.wait.web_element_wait_send_keys(By.XPATH, self.__e_male, male_diversity, 'Job_male_field') return True def job_female_diversity(self, female_diversity): self.wait.clear(By.XPATH, self.__e_female, 'Job_female_field') self.wait.web_element_wait_send_keys(By.XPATH, self.__e_female, female_diversity, 'Job_female_field') return True def job_create(self): self.wait.web_element_wait_click(By.XPATH, self.__e_job_create, 'Job_create_button') self.wait.loading() return True def job_create_notifier(self, message): try: self.notifier.glowing_messages(message) return True except Exception as error: ui_logger.error(error) def job_create_notifier_dismiss(self): try: self.notifier.dismiss_message() self.wait.loading() time.sleep(0.2) self.wait.loading() return True except Exception as error: ui_logger.error(error)
def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.tab_title = appTitle.Title(self.driver) self.scroll = PageScroll(self.driver)
class TagInterviewersPage: __e_job_interviewers_xpath = Locators.JOB['int_panel'] __e_job_int_add_class = Locators.JOB['panel_int_add'] __e_job_int_save_xpath = Locators.BUTTONS['button'].format('Save') __e_job_tag_total_int_css = Locators.JOB['total_owners'] def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.notifier = Notifier(self.driver) def job_int_panel(self, value): try: self.wait.web_element_wait_send_keys( By.XPATH, self.__e_job_interviewers_xpath, value, 'job_int_panel') print(f'{value} - Selected from job interviewers panel') self.wait.loading() return True except Exception as error: ui_logger.error(error) def job_int_add(self): try: time.sleep(0.5) self.wait.web_element_wait_click(By.CLASS_NAME, self.__e_job_int_add_class, 'job_int_add') print('saved - selection process') return True except Exception as error: ui_logger.error(error) def job_int_save(self): try: time.sleep(0.5) self.wait.web_element_wait_click(By.XPATH, self.__e_job_int_save_xpath, 'job_int_save') print('saved - job interviewers') self.wait.loading() return True except Exception as error: ui_logger.error(error) def job_tag_int_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_tag_int_notifier_dismiss(self): try: self.notifier.dismiss_message() return True except Exception as error: ui_logger.error(error) def total_tag_interviewers(self, number_of_tag_ints): try: self.wait.loading() self.wait.web_element_wait_text(By.CSS_SELECTOR, self.__e_job_tag_total_int_css, 'total_tag_interviewers') if str(number_of_tag_ints) in self.wait.text_value: print(f'Total tagged Interviewers - {number_of_tag_ints}') return True except Exception as error: ui_logger.error(error)
def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.page_scroll = PageScroll.PageScroll(self.driver) self.candidate_login_link = ''