class SelectionProcessPage: __e_job_sp_xpath = Locators.PLACEHOLDER['place_holder'].format( 'Selection Process') __e_job_sp_save_xpath = Locators.BUTTONS['button'].format('Save') def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.notifier = Notifier(self.driver) def job_sp(self, selection_process): try: time.sleep(2) self.wait.web_element_wait_send_keys(By.XPATH, self.__e_job_sp_xpath, selection_process, 'Send_Selection_Process') self.wait.drop_down_selection() print(f'selected - {selection_process} selection process') return True except Exception as error: ui_logger.error(error) def job_sp_save(self): try: time.sleep(1) self.wait.web_element_wait_click(By.XPATH, self.__e_job_sp_save_xpath, 'Saved_Selection_Process') print('saved - selection process') return True except Exception as error: ui_logger.error(error) def job_sp_notifier(self, message): try: time.sleep(0.7) self.notifier.glowing_messages(message) self.notifier.dismiss_message() return True except Exception as error: ui_logger.error(error) def page_refresh(self): try: self.wait.refresh_page() print('Page - Refreshed') self.wait.loading() time.sleep(2) return True except Exception as error: ui_logger.error(error)
class CancelInterview: __e_select_reason_xpath = Locators.PLACEHOLDER['place_holder'].format('Reason') __e_reason_comment_xpath = Locators.PLACEHOLDER['all_place_holder'].format('Please provide the ' 'reason for cancellation') __e_save_reason_xpath = Locators.BUTTONS['button'].format('Save') __e_confirm_button_xpath = Locators.BUTTONS['button'].format('Confirm') def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.notifier = Notifier(self.driver) def cancel_interview_request_reason(self, reason): try: time.sleep(1.5) self.wait.web_element_wait_send_keys(By.XPATH, self.__e_select_reason_xpath, reason, 'cancel_interview_request') self.wait.drop_down_selection() print(f'Reason selected - {reason}') return True except Exception as error: ui_logger.error(error) def cancel_interview_request_comment(self, comment): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_reason_comment_xpath, comment, 'cancel_interview_request') print('Enter the comment for cancel request') return True except Exception as error: ui_logger.error(error) def cancel_interview_request_save(self): try: time.sleep(2) self.wait.web_element_wait_click(By.XPATH, self.__e_save_reason_xpath, 'cancel_interview_request_save') print('Cancel Request - Save') return True except Exception as error: ui_logger.error(error) def cancel_interview_request_confirm(self): try: time.sleep(5) self.wait.web_element_wait_click(By.XPATH, self.__e_confirm_button_xpath, 'cancel_interview_request_confirm') print('Cancel Interview - Confirm') return True except Exception as error: ui_logger.error(error) def change_status_notifier(self, message): try: time.sleep(1) self.notifier.glowing_messages(message) return True except Exception as error: ui_logger.error(error) def change_status_notifier_dismiss(self): try: self.notifier.dismiss_message() self.wait.loading() time.sleep(0.5) return True except Exception as error: ui_logger.error(error)
class NewFeedbackConfigPage: __e_new_form_stage_xpath = Locators.PLACEHOLDER['text_ph'].format( 'Interview Stages') __e_new_form_field_xpath = Locators.PLACEHOLDER['text_ph'].format( 'Name like.') __e_new_form_search_css = Locators.BUTTONS['new_form_search'] __e_new_use_form_xpath = Locators.BUTTONS['all_buttons'].format('Use') __e_new_for_edit_xpath = Locators.TITLE['title'].format( 'Edit Confiiguration') __e_overall_mandatory_xpath = Locators.JOB['feedback_overall_mandatory'] __e_reject_overall_xpath = Locators.JOB['reject_overall_mandatory'] __e_update_form_xpath = Locators.BUTTONS['btnActionClicked'].format( "'", 'update', "'") def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.notifier = Notifier(self.driver) def stage_selection(self, stage): try: time.sleep(1.5) self.wait.web_element_wait_send_keys(By.XPATH, self.__e_new_form_stage_xpath, stage, 'Send_Selection_Process') self.wait.drop_down_selection() print(f'selected - New - {stage}') return True except Exception as error: ui_logger.error(error) def form_search_filed_enter(self, form): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_new_form_field_xpath, form, 'form_search') print(f'Entered - New {form}') return True except Exception as error: ui_logger.error(error) def form_search(self): try: self.wait.web_element_wait_click(By.CSS_SELECTOR, self.__e_new_form_search_css, 'form_search') print('Feedback Form - Search') return True except Exception as error: ui_logger.error(error) def use_form(self): try: time.sleep(1) self.wait.web_element_wait_click(By.XPATH, self.__e_new_use_form_xpath, 'use_form') print('Feedback Form - Use') return True except Exception as error: ui_logger.error(error) def edit_form(self): try: time.sleep(1) self.wait.web_element_wait_click(By.XPATH, self.__e_new_for_edit_xpath, 'edit_form') print('Feedback Form - Edit') return True except Exception as error: ui_logger.error(error) def overall_mandatory(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_overall_mandatory_xpath, 'overall_mandatory') print('Overall feedback mandatory - On') return True except Exception as error: ui_logger.error(error) def reject_overall_mandatory(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_reject_overall_xpath, 'reject_overall_mandatory') print('Reject Overall feedback mandatory - On') return True except Exception as error: ui_logger.error(error) def update_feedback_form(self): try: time.sleep(0.5) self.wait.web_element_wait_click(By.XPATH, self.__e_update_form_xpath, 'update_feedback_form') print('Feedback Form - Save') time.sleep(0.5) return True except Exception as error: ui_logger.error(error) def job_new_form_notifier(self, message): try: time.sleep(0.4) self.notifier.glowing_messages(message) return True except Exception as error: ui_logger.error(error) def job_new_form_notifier_dismiss(self): try: self.notifier.dismiss_message() time.sleep(0.5) return True except Exception as error: ui_logger.error(error)
class EligibilityCriteriaPage: __e_job_config_btn_xpath = Locators.BUTTONS['btnActionClicked'].format("'", 'configureEC', "'") __e_ec_xpath = Locators.PLACEHOLDER['text_ph'].format('Select Eligibility Criteria') __e_positive_stage_xpath = Locators.PLACEHOLDER['text_ph'].format('Select Stage') __e_positive_status_xpath = Locators.PLACEHOLDER['text_ph'].format('Select status') __e_negative_stage_xpath = Locators.JOB['Ec_negative_stage'] __e_negative_status_xpath = Locators.JOB['Ec_negative_status'] __e_ec_save_xpath = Locators.BUTTONS['ec_save'] def __init__(self, driver): self.driver = driver self.wait = WebElementWait(self.driver) self.notifier = Notifier(self.driver) self.scroll = PageScroll(self.driver) def job_configure_button(self): try: self.wait.loading() self.scroll.down(0, -200) self.wait.web_element_wait_click(By.XPATH, self.__e_job_config_btn_xpath, 'job_configure_button') self.wait.loading() print('Job Configuration button - Clicked') return True except Exception as error: ui_logger.error(error) def job_ec_field(self, eligibility_criteria): try: time.sleep(1) self.wait.web_element_wait_send_keys(By.XPATH, self.__e_ec_xpath, eligibility_criteria, 'job_ec_field') self.wait.drop_down_selection() print('Job Eligibility Criteria - Entered') return True except Exception as error: ui_logger.error(error) def job_positive_stage_field(self, stage): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_positive_stage_xpath, stage, 'job_positive_stage_field') self.wait.drop_down_selection() print('Job Positive Stage - Entered') return True except Exception as error: ui_logger.error(error) def job_positive_status_field(self, status): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_positive_status_xpath, status, 'job_positive_status_field') self.wait.drop_down_selection() print('Job Positive Status - Entered') return True except Exception as error: ui_logger.error(error) def job_negative_stage_field(self, stage): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_negative_stage_xpath, stage, 'job_negative_stage_field') self.wait.drop_down_selection() print('Job Negative Stage - Entered') return True except Exception as error: ui_logger.error(error) def job_negative_status_field(self, status): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_negative_status_xpath, status, 'job_negative_status_field') self.wait.drop_down_selection() print('Job Negative Status - Entered') return True except Exception as error: ui_logger.error(error) def job_ec_save(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_ec_save_xpath, 'job_ec_save') print('Job Eligibility Criteria - Saved') return True except Exception as error: ui_logger.error(error) def job_ec_notifier(self, message): try: time.sleep(0.4) self.notifier.glowing_messages(message) return True except Exception as error: ui_logger.error(error) def job_ec_notifier_dismiss(self): try: self.notifier.dismiss_message() self.wait.loading() return True except Exception as error: ui_logger.error(error)
class RequirementCreationPage: """ ----------------- WEB ELEMENT REFERENCE CLASS PRIVATE VARIABLES TO EASY ACCESS ------>>>> """ __e_create = Locators.BUTTONS['create'] __e_req_name_xpath = Locators.PLACEHOLDER['place_holder'].format('Name') __e_req_job_xpath = Locators.TITLE['title'].format('Job Roles') __e_req_track_xpath = Locators.PLACEHOLDER['text_ph'].format('Hiring Type') __e_req_type_xpath = Locators.PLACEHOLDER['text_ph'].format('College Type') __e_req_create_xpath = Locators.BUTTONS['actionClicked'].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 requirement_name(self, name): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_req_name_xpath, name, 'requirement_name') print(f'Requirement name entered - {name}') return True except Exception as error: ui_logger.error(error) def requirement_job(self): try: time.sleep(2) self.wait.web_element_wait_click(By.XPATH, self.__e_req_job_xpath, 'requirement_job') time.sleep(0.5) return True except Exception as error: ui_logger.error(error) def requirement_hiring(self, track): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_req_track_xpath, track, 'requirement_hiring') self.wait.drop_down_selection() print(f'Requirement hiring track - {track}') return True except Exception as error: ui_logger.error(error) def requirement_type(self, college_type): try: self.wait.web_element_wait_send_keys(By.XPATH, self.__e_req_type_xpath, college_type, 'requirement_type') self.wait.drop_down_selection() print(f'Requirement college type - {college_type}') return True except Exception as error: ui_logger.error(error) def requirement_create(self): try: self.wait.web_element_wait_click(By.XPATH, self.__e_req_create_xpath, 'req_create_button') self.wait.loading() return True except Exception as error: ui_logger.error(error) def req_creation_notifier(self, message): try: time.sleep(0.4) self.notifier.glowing_messages(message) return True except Exception as error: ui_logger.error(error) def req_creation_notifier_dismiss(self): try: self.notifier.dismiss_message() time.sleep(0.5) self.wait.loading() 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)
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)
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 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 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 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)