class AccountName:
    __e_account_name_settings_xpath = Locators.ACCOUNT['account_icon']
    __e_settings_id = Locators.ACCOUNT['settings']
    __e_anchor_tag = Locators.TAG['anchor']

    def __init__(self, driver):
        self.driver = driver
        self.wait = WebElementWait(self.driver)
        self.scroll = PageScroll(self.driver)

    def account_name_click(self):
        try:
            self.wait.web_element_wait_click(
                By.XPATH, self.__e_account_name_settings_xpath,
                'account_name_click')
            return True
        except Exception as error:
            ui_logger.error(error)

    def login_account_name_verification(self, user_name):
        try:
            self.wait.loading()
            assert self.wait.web_elements_wait_text(By.TAG_NAME, self.__e_anchor_tag, user_name) == user_name, \
                'Logged in different account please check the details'
            return True
        except Exception as error:
            ui_logger.error(error)

    def account_settings(self):
        try:
            self.wait.web_element_wait_click(By.ID, self.__e_settings_id,
                                             'account_settings')
            return True
        except Exception as error:
            ui_logger.error(error)
class AssessmentGetByName:

    __e_test_name_xpath = Locators.TITLE['title']

    def __init__(self, driver):
        self.driver = driver
        self.wait = WebElementWait(self.driver)

    def test_name_click(self, test_name):
        try:
            self.wait.web_element_wait_click(By.XPATH, self.__e_test_name_xpath.format(test_name),
                                             'test_name_click')
            print(f'Clicked on - {test_name}')
            return True
        except Exception as error:
            ui_logger.error(error)

    def assessment_name_validation(self, assessment_name):
        try:
            self.wait.web_element_wait_text(By.XPATH,
                                            self.__e_test_name_xpath.format(assessment_name),
                                            'Assessment_name_validation')
            print(f'Assessment Name - {self.wait.text_value}')
            self.wait.loading()
            time.sleep(0.3)
            return True
        except Exception as error:
            ui_logger.error(error)
Exemple #3
0
class RequirementGetByName:

    __e_name_xpath = Locators.TITLE['title']

    def __init__(self, driver):
        self.driver = driver
        self.wait = WebElementWait(self.driver)

    def req_name_click(self, req_name):
        try:
            self.wait.loading()
            self.wait.web_element_wait_click(
                By.XPATH, self.__e_name_xpath.format(req_name),
                'req_name_click')
            print('Requirement name - Clicked to open details screen')
            self.wait.loading()
            return True
        except Exception as error:
            ui_logger.error(error)

    def req_name_validation(self, req_name):
        try:
            self.wait.web_element_wait_text(
                By.XPATH, self.__e_name_xpath.format(req_name),
                'req_name_validation')
            print('Event Name -', self.wait.text_value)
            return True
        except Exception as error:
            ui_logger.error(error)
Exemple #4
0
class DuplicityCheck:

    __e_click_radio_css = Locators.BUTTONS['radio']

    def __init__(self, driver):
        self.driver = driver
        self.wait = WebElementWait(self.driver)
        self.notifier = Notifier(self.driver)

    def do_not_allow_duplicates(self, button_name):
        try:
            self.wait.web_elements_wait_click(By.CSS_SELECTOR, self.__e_click_radio_css, button_name)
            self.wait.loading()
            return True
        except Exception as error:
            ui_logger.error(error)

    def req_duplicity_notifier(self, message):
        try:
            self.notifier.glowing_messages(message)
            return True
        except Exception as error:
            ui_logger.error(error)

    def req_duplicity_notifier_dismiss(self):
        try:
            self.notifier.dismiss_message()
            return True
        except Exception as error:
            ui_logger.error(error)
Exemple #5
0
class Actions:
    __e_test_actions_xpath = Locators.ACTIONS['actions_click']
    __e_clone_test_id = Locators.ACTIONS['clone_assessment']

    def __init__(self, driver):
        self.driver = driver

        self.wait = WebElementWait(self.driver)
        self.scroll = PageScroll(self.driver)

    def assessment_actions_click(self):
        try:
            self.scroll.up(0, 50)
            self.wait.web_element_wait_click(By.XPATH,
                                             self.__e_test_actions_xpath,
                                             'assessment_actions_click')
            print('Assessment Actions - Clicked')
            return True
        except Exception as error:
            ui_logger.error(error)

    def clone_assessment(self):
        try:
            time.sleep(1)
            self.wait.web_element_wait_click(By.ID, self.__e_clone_test_id,
                                             'clone_assessment')
            self.wait.loading()
            print('Clone Assessment action - Clicked')
            return True
        except Exception as error:
            ui_logger.error(error)
class CandidateDetailsPage:
    __e_title_xpath = Locators.TITLE['title']
    __e_id_xpath = Locators.CANDIDATE['id']
    __e_candidate_float_action_class = Locators.ACTIONS['float_click_class']
    __e_manage_task_xpath = Locators.TITLE['title'].format('Manage Task')

    def __init__(self, driver):
        self.driver = driver
        self.wait = WebElementWait(self.driver)
        self.window = SwitchWindowClose(self.driver)

        self.candidate_id = ''

    def candidate_float_actions(self):
        try:
            self.wait.web_element_wait_click(
                By.CLASS_NAME, self.__e_candidate_float_action_class,
                'candidate_float_actions')
            print('Candidate details screen - floating action clicked')
            return True
        except Exception as error:
            ui_logger.error(error)

    def candidate_manage_task_action(self, window_index):
        try:
            time.sleep(1)
            self.wait.web_element_wait_click(By.XPATH,
                                             self.__e_manage_task_xpath,
                                             'candidate_manage_task_action')
            print('Candidate details screen - floating action - Manage Task')
            time.sleep(1)
            self.window.switch_to_window(window_index)
            self.wait.loading()
            return True
        except Exception as error:
            ui_logger.error(error)

    def candidate_status(self, changed_status):
        try:
            time.sleep(2)
            self.wait.loading()
            self.wait.web_element_wait_text(
                By.XPATH, self.__e_title_xpath.format(changed_status),
                f'Candidate_status_{changed_status}')
            if self.wait.text_value == changed_status:
                print(f'Candidate status changed - {self.wait.text_value}')
            return True
        except Exception as error:
            ui_logger.error(error)

    def candidate_id_copy(self):
        try:
            self.wait.web_element_wait_text(By.XPATH, self.__e_id_xpath,
                                            'candidate_id')
            self.candidate_id = self.wait.text_value
            print(f'candidate id - {self.candidate_id}')
            return True
        except Exception as error:
            ui_logger.error(error)
Exemple #7
0
class SelectionProcessPage:
    __e_job_sp_xpath = Locators.PLACEHOLDER['place_holder'].format(
        'Selection Process')
    __e_job_sp_save_xpath = Locators.BUTTONS['button'].format('Save')

    def __init__(self, driver):
        self.driver = driver
        self.wait = WebElementWait(self.driver)
        self.notifier = Notifier(self.driver)

    def job_sp(self, selection_process):
        try:
            time.sleep(2)
            self.wait.web_element_wait_send_keys(By.XPATH,
                                                 self.__e_job_sp_xpath,
                                                 selection_process,
                                                 'Send_Selection_Process')
            self.wait.drop_down_selection()
            print(f'selected - {selection_process} selection process')
            return True
        except Exception as error:
            ui_logger.error(error)

    def job_sp_save(self):
        try:
            time.sleep(1)
            self.wait.web_element_wait_click(By.XPATH,
                                             self.__e_job_sp_save_xpath,
                                             'Saved_Selection_Process')
            print('saved - selection process')
            return True
        except Exception as error:
            ui_logger.error(error)

    def job_sp_notifier(self, message):
        try:
            time.sleep(0.7)
            self.notifier.glowing_messages(message)
            self.notifier.dismiss_message()
            return True
        except Exception as error:
            ui_logger.error(error)

    def page_refresh(self):
        try:
            self.wait.refresh_page()
            print('Page - Refreshed')
            self.wait.loading()
            time.sleep(2)
            return True
        except Exception as error:
            ui_logger.error(error)
class Actions:
    __e_job_actions_xpath = Locators.ACTIONS['actions_click']
    __e_job_tag_sp_id = Locators.ACTIONS['selection_process']
    __e_job_feed_id = Locators.ACTIONS['feedback_form']
    __e_job_int_id = Locators.ACTIONS['tag_interviewers']

    def __init__(self, driver):
        self.driver = driver

        self.wait = WebElementWait(self.driver)
        self.scroll = PageScroll(self.driver)

    def job_actions_click(self):
        try:
            self.wait.loading()
            self.scroll.up(0, 100)
            time.sleep(1)
            self.wait.web_element_wait_click(By.XPATH,
                                             self.__e_job_actions_xpath,
                                             'Job_actions_click')
            print('Job Actions - Clicked')
            return True
        except Exception as error:
            ui_logger.error(error)

    def tag_selection_process(self):
        try:
            self.wait.web_element_wait_click(By.ID, self.__e_job_tag_sp_id,
                                             'tag_selection_process')
            self.wait.loading()
            print('Selection Process action - Clicked')
            return True
        except Exception as error:
            ui_logger.error(error)

    def job_feedback_form(self):
        try:
            self.wait.web_element_wait_click(By.ID, self.__e_job_feed_id,
                                             'job_feedback_form')
            self.wait.loading()
            print('Configured Feedback Form - Clicked')
            return True
        except Exception as error:
            ui_logger.error(error)

    def job_tag_interviewers(self):
        try:
            self.wait.web_element_wait_click(By.ID, self.__e_job_int_id,
                                             'job_tag_interviewers')
            print('Tag Interviewers to Job - Clicked')
            self.wait.loading()
            return True
        except Exception as error:
            ui_logger.error(error)
Exemple #9
0
class BucketSelectionPage:

    __e_bucket_xpath = Locators.BUCKET['event_interviews']

    def __init__(self, driver):
        self.driver = driver
        self.wait = WebElementWait(self.driver)
        self.new_tab = NewTab(self.driver)

    def bucket_select(self, bucket_name):
        try:
            self.wait.web_element_wait_send_keys(By.XPATH,
                                                 self.__e_bucket_xpath,
                                                 bucket_name, 'bucket_select')
            print(f'Chosen bucket is - {bucket_name}')
            self.wait.loading()
            return True
        except Exception as error:
            ui_logger.error(error)
Exemple #10
0
class JobGetByName:

    __e_job_name_xpath = Locators.TITLE['title']

    def __init__(self, driver):
        self.driver = driver
        self.wait = WebElementWait(self.driver)
        self.tab = Title(self.driver)
        self.window = SwitchWindowClose(self.driver)

    def job_tab_title(self, tab_title):
        try:
            self.tab.tab_title(tab_title)
            return True
        except Exception as error:
            ui_logger.error(error)

    def job_name_click(self, job_name):
        try:
            self.wait.web_element_wait_click(
                By.XPATH, self.__e_job_name_xpath.format(job_name),
                'job_name_click')
            time.sleep(0.5)
            self.driver.close()
            self.driver.switch_to.window(self.driver.window_handles[0])
            time.sleep(1.5)
            self.wait.loading()

            return True
        except Exception as error:
            ui_logger.error(error)

    def job_name_validation(self, job_name):
        try:
            self.wait.loading()
            self.wait.web_element_wait_text(
                By.XPATH, self.__e_job_name_xpath.format(job_name),
                'Job_name_validation')
            print('Job Name -', self.wait.text_value)
            return True
        except Exception as error:
            ui_logger.error(error)
class EventApplicant:

    __e_applicant_check_name = Locators.CHECKBOX['check']
    __e_status_change_id = Locators.ACTIONS['status_change']
    __e_applicant_name_xpath = Locators.TITLE['title']

    def __init__(self, driver):
        self.driver = driver
        self.wait = WebElementWait(self.driver)
        self.message = Notifier(self.driver)
        self.switch_window = SwitchWindowClose(self.driver)

    def select_applicant(self):
        try:
            self.wait.web_element_wait_click(By.NAME,
                                             self.__e_applicant_check_name,
                                             'Applicant_check_box')
            return True
        except Exception as error:
            ui_logger.error(error)

    def change_status_action(self):
        try:
            self.wait.web_element_wait_click(By.ID, self.__e_status_change_id,
                                             'Applicant_status_change')
            self.wait.loading()
            return True
        except Exception as error:
            ui_logger.error(error)

    def applicant_get_name(self, applicant_name, index_window):
        try:
            time.sleep(1)
            self.wait.web_element_wait_click(
                By.XPATH, self.__e_applicant_name_xpath.format(applicant_name),
                'Applicant_Get_By_Name')
            print('Clicked on applicant name')
            self.switch_window.switch_to_window(index_window)
            return True
        except Exception as error:
            ui_logger.error(error)
Exemple #12
0
class EventOwnersConfigPage:

    __e_owners_update_xpath = Locators.BUTTONS['button'].format('Update')

    def __init__(self, driver):
        self.driver = driver
        self.wait = WebElementWait(self.driver)
        self.scroll = PageScroll(self.driver)
        self.notifier = Notifier(self.driver)

    def event_owners_update(self):
        try:
            self.scroll.down(0, -50)
            time.sleep(0.5)
            self.wait.web_element_wait_click(By.XPATH,
                                             self.__e_owners_update_xpath,
                                             'event_owners_update')
            print('Event Owners update button - Clicked')
            time.sleep(1)
            self.wait.loading()
            self.scroll.up(0, 70)
            return True
        except Exception as error:
            ui_logger.error(error)

    def event_owners_notifier(self, message):
        try:
            self.notifier.glowing_messages(message)
            return True
        except Exception as error:
            ui_logger.error(error)

    def event_owners_notifier_dismiss(self):
        try:
            self.notifier.dismiss_message()
            self.wait.loading()
            self.scroll.up(0, 70)
            return True
        except Exception as error:
            ui_logger.error(error)
Exemple #13
0
class EventGetByName:

    __e_click_name_xpath = Locators.TITLE['title'].format(
        'Click to view full details')
    __e_event_name_xpath = Locators.TITLE['title']

    def __init__(self, driver):
        self.driver = driver
        self.wait = WebElementWait(self.driver)

    def event_name_click(self):
        try:
            self.wait.loading()
            self.wait.web_element_wait_click(By.XPATH,
                                             self.__e_click_name_xpath,
                                             'Event_name_click')
            print('Event name - Clicked to open details screen')
            self.wait.loading()
            return True
        except Exception as error:
            ui_logger.error(error)

    def event_name_validation(self, event_name):
        try:
            time.sleep(3)
            self.wait.web_element_wait_text(
                By.XPATH, self.__e_event_name_xpath.format(event_name),
                'Event_name_validation')
            print('Event Name -', self.wait.text_value)
            self.wait.loading()
            return True
        except Exception as error:
            ui_logger.error(error)
class JobSubTabs:
    __e_job_config_xpath = Locators.SUB_MENU['job_configurations']
    __e_job_automations_xpath = Locators.SUB_MENU['automations']
    __e_job_owners_xpath = Locators.SUB_MENU['job_owners']

    def __init__(self, driver):
        self.driver = driver
        self.wait = WebElementWait(self.driver)

    def job_configurations(self):
        try:
            self.wait.web_element_wait_click(By.XPATH,
                                             self.__e_job_config_xpath,
                                             'job_configuration_tab')
            print('Job Configuration Tab - Clicked')
            return True
        except Exception as error:
            ui_logger.error(error)

    def job_automation(self):
        try:
            self.wait.web_element_wait_click(By.XPATH,
                                             self.__e_job_automations_xpath,
                                             'Job_Automations_tab')
            print('Job Automations Tab - Clicked')
            self.wait.loading()
            return True
        except Exception as error:
            ui_logger.error(error)

    def job_owners(self):
        try:
            self.wait.web_element_wait_click(By.XPATH,
                                             self.__e_job_owners_xpath,
                                             'job_owners')
            print('Job Owners Tab - Clicked')
            return True
        except Exception as error:
            ui_logger.error(error)
Exemple #15
0
class ChangeStatus:

    __e_stage_field_xpath = Locators.CHANGE_STATUS['stage']
    __e_status_field_xpath = Locators.CHANGE_STATUS['status']
    __e_comment_xpath = Locators.CHANGE_STATUS['comment']
    __e_button_xpath = Locators.BUTTONS['button'].format('Change')
    __e_select_int_xpath = Locators.TITLE['title'].format(
        'Select Interviewers')

    def __init__(self, driver):
        self.driver = driver
        self.wait = WebElementWait(self.driver)
        self.notifier = Notifier(self.driver)

    def applicant_stage(self, stage):
        try:
            time.sleep(2)
            self.wait.web_element_wait_send_keys(By.XPATH,
                                                 self.__e_stage_field_xpath,
                                                 stage,
                                                 'Applicant_stage_field')
            return True
        except Exception as error:
            ui_logger.error(error)

    def applicant_status(self, status):
        try:
            self.wait.web_element_wait_send_keys(By.XPATH,
                                                 self.__e_status_field_xpath,
                                                 status,
                                                 'Applicant_status_field')
            return True
        except Exception as error:
            ui_logger.error(error)

    def select_interviewers(self):
        try:
            self.wait.web_element_wait_click(By.XPATH,
                                             self.__e_select_int_xpath,
                                             'select_interviewers')
            print('Select Interviewers - Selected')
            time.sleep(2)
            return True
        except Exception as error:
            ui_logger.error(error)

    def comment(self, comment):
        try:
            self.wait.web_element_wait_send_keys(By.XPATH,
                                                 self.__e_comment_xpath,
                                                 comment,
                                                 'Applicant_comment_box')
            return True
        except Exception as error:
            ui_logger.error(error)

    def change_button(self):
        try:
            self.wait.web_element_wait_click(By.XPATH, self.__e_button_xpath,
                                             'Change_Button')
            print('MassInterview applicant status - Changed')
            self.wait.loading()
            return True
        except Exception as error:
            ui_logger.error(error)

    def change_status_notifier(self, message):
        try:
            time.sleep(1)
            self.notifier.glowing_messages(message)
            return True
        except Exception as error:
            ui_logger.error(error)

    def change_status_notifier_dismiss(self):
        try:
            self.notifier.dismiss_message()
            self.wait.loading()
            time.sleep(0.5)
            return True
        except Exception as error:
            ui_logger.error(error)
class Search:
    __e_search_id = Locators.SEARCH['advance_search']
    __e_Name_name = Locators.SEARCH['Name']
    __e_name_name = Locators.SEARCH['name']
    __e_test_name = Locators.SEARCH['test_name']
    __e_candidate_name = Locators.SEARCH['candidate_name']
    __e_search_btn_xpath = Locators.BUTTONS['button'].format('Search')
    __e_manage_search_css = Locators.SEARCH['manage_candidate_search']
    __e_clear_id = Locators.SEARCH['clear']

    def __init__(self, driver):
        self.driver = driver
        self.wait = WebElementWait(self.driver)
        self.tab = Menu(self.driver)
        self.tab_title = appTitle.Title(self.driver)
        self.page_scroll = PageScroll.PageScroll(self.driver)

    def advance_search(self):
        try:
            self.page_scroll.down(0, -200)
            self.wait.web_element_wait_click(By.ID, self.__e_search_id,
                                             'advance_search')
            return True
        except Exception as error:
            ui_logger.error(error)

    def name_field(self, search_key):
        try:
            self.wait.web_element_wait_send_keys(By.NAME, self.__e_Name_name,
                                                 search_key,
                                                 'search_name_field')
            return True
        except Exception as error:
            ui_logger.error(error)

    def name_field_applicant(self, search_key):
        try:
            self.wait.web_element_wait_send_keys(
                By.NAME, self.__e_name_name, search_key,
                'search_applicant_name_field')
            return True
        except Exception as error:
            ui_logger.error(error)

    def candidate_name_field(self, search_key):
        try:
            self.wait.web_element_wait_send_keys(
                By.NAME, self.__e_candidate_name, search_key,
                'search_applicant_name_field')
            return True
        except Exception as error:
            ui_logger.error(error)

    def test_name_search_field(self, search_key):
        try:
            time.sleep(1)
            self.wait.web_element_wait_send_keys(By.NAME, self.__e_test_name,
                                                 search_key,
                                                 'test_name_search_field')
            print('Test name - Entered')
            return True
        except Exception as error:
            ui_logger.error(error)

    def search_button(self):
        try:
            time.sleep(1)
            self.page_scroll.up(0, 170)
            self.wait.web_element_wait_click(By.XPATH,
                                             self.__e_search_btn_xpath,
                                             'search_button')
            self.wait.loading()
            return True
        except Exception as error:
            ui_logger.error(error)

    def applicant_search_button(self):
        try:
            time.sleep(1)
            self.page_scroll.up(0, 260)
            self.wait.web_element_wait_click(By.XPATH,
                                             self.__e_search_btn_xpath,
                                             'search_button')
            self.wait.loading()
            return True
        except Exception as error:
            ui_logger.error(error)

    def manage_candidate_search(self):
        try:
            self.wait.web_element_wait_click(By.CSS_SELECTOR,
                                             self.__e_manage_search_css,
                                             'advance_search')
            return True
        except Exception as error:
            ui_logger.error(error)

    def clear_search(self):
        try:
            time.sleep(0.5)
            self.wait.web_element_wait_click(By.ID, self.__e_clear_id,
                                             'advance_search')
            return True
        except Exception as error:
            ui_logger.error(error)

    def job_search_button(self):
        try:
            time.sleep(1)
            self.wait.web_element_wait_click(By.XPATH,
                                             self.__e_search_btn_xpath,
                                             'search_button')
            print('Job name - Searched')
            return True
        except Exception as error:
            ui_logger.error(error)
Exemple #17
0
class CandidateLogin:
    """
    ----------------- WEB ELEMENT REFERENCE CLASS PRIVATE VARIABLES TO EASY ACCESS ------>>>>
    """
    __e_tenant_name = Locators.LOGIN['alias']
    __e_login_name_l = Locators.LOGIN['c_user_name']
    __e_password_xpath = Locators.LOGIN['password']
    __e_login_button_class = Locators.LOGIN['login']
    __e_anchor_tag = Locators.TAG['anchor']

    def __init__(self, driver):
        self.driver = driver
        self.wait = WebElementWait(self.driver)
        self.scroll = PageScroll(self.driver)
        self.new_tab = NewTab(self.driver)

    def candidate_login_url(self, server):
        if server == 'amsin':
            self.new_tab.open_in_same_tab(
                0, ReadConfigFile.ReadConfig.get_qa_candidate_url())
            return True
        elif server == 'ams':
            self.new_tab.open_in_same_tab(
                0, ReadConfigFile.ReadConfig.get_production_candidate_url())
            return True
        elif server == 'beta':
            self.new_tab.open_in_same_tab(
                0, ReadConfigFile.ReadConfig.get_beta_candidate_url())
            return True
        elif server == 'stage':
            self.new_tab.open_in_same_tab(
                0, ReadConfigFile.ReadConfig.get_stage_candidate_url())
            return True
        elif server == 'india':
            self.new_tab.open_in_same_tab(
                0, ReadConfigFile.ReadConfig.get_indiaams_candidate_url())
            return True

    def login_name(self, login_name):
        try:
            time.sleep(3)
            self.wait.web_element_wait_send_keys(By.NAME,
                                                 self.__e_login_name_l,
                                                 login_name,
                                                 'login_name_field')
            return True
        except Exception as error:
            ui_logger.error(error)

    def password(self, password):
        try:
            self.wait.web_element_wait_send_keys(By.XPATH,
                                                 self.__e_password_xpath,
                                                 password,
                                                 'login_password_field')
            return True
        except Exception as error:
            ui_logger.error(error)

    def login_button(self):
        try:
            self.wait.web_element_wait_click(By.CLASS_NAME,
                                             self.__e_login_button_class,
                                             'login_button')
            return True
        except Exception as error:
            ui_logger.error(error)

    def login_account_name_verification(self, user_name):
        try:
            self.wait.loading()
            assert self.wait.web_elements_wait_text(By.TAG_NAME, self.__e_anchor_tag, user_name) == user_name, \
                'Logged in different account please check the details'
            return True
        except Exception as error:
            ui_logger.error(error)
class 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 RequirementHelpDeskConfig:

    __e_default_category_xpath = Locators.TITLE['title'].format(
        'Query Category')
    __e_job_category_xpath = Locators.HELPDESK['job_category']
    __e_event_category_xpath = Locators.HELPDESK['event_category']
    __e_user_xpath = Locators.TITLE['title'].format('Users')
    __e_job_user_xpath = Locators.HELPDESK['job_user']
    __e_event_user_xpath = Locators.HELPDESK['event_user']
    __e_sla_xpath = Locators.PLACEHOLDER['num']
    __e_jobs_xpath = Locators.TITLE['title'].format('Jobs')
    __e_event_job_xpath = Locators.HELPDESK['event_job']
    __e_job_sla_xpath = Locators.HELPDESK['job_sla']
    __e_event_xpath = Locators.TITLE['title'].format('Events')
    __e_event_sla_xpath = Locators.HELPDESK['event_sla']
    __e_save_button_xpath = Locators.BUTTONS['button'].format('Save')

    def __init__(self, driver):
        self.driver = driver
        self.wait = WebElementWait(self.driver)
        self.scroll = PageScroll(self.driver)
        self.notifier = Notifier(self.driver)

    def default_category(self):
        try:
            self.wait.loading()
            self.wait.web_element_wait_click(By.XPATH,
                                             self.__e_default_category_xpath,
                                             'default_category')
            print('default_category - Clicked')
            return True
        except Exception as error:
            ui_logger.error(error)

    def job_category(self):
        try:
            self.wait.web_element_wait_click(By.XPATH,
                                             self.__e_job_category_xpath,
                                             'job_category')
            print('job_category - Clicked')
            return True
        except Exception as error:
            ui_logger.error(error)

    def event_category(self):
        try:
            self.wait.web_element_wait_click(By.XPATH,
                                             self.__e_event_category_xpath,
                                             'event_category')
            print('event_category - Clicked')
            return True
        except Exception as error:
            ui_logger.error(error)

    def category_user_selection(self):
        try:
            self.wait.web_element_wait_click(By.XPATH, self.__e_user_xpath,
                                             'category_user_selection')
            print('category_user_selection - Clicked')
            return True
        except Exception as error:
            ui_logger.error(error)

    def job_user_selection(self):
        try:
            self.wait.web_element_wait_click(By.XPATH, self.__e_job_user_xpath,
                                             'job_user_selection')
            print('job_user_selection - Clicked')
            return True
        except Exception as error:
            ui_logger.error(error)

    def event_user_selection(self):
        try:
            self.wait.web_element_wait_click(By.XPATH,
                                             self.__e_event_user_xpath,
                                             'event_user_selection')
            print('event_user_selection - Clicked')
            return True
        except Exception as error:
            ui_logger.error(error)

    def category_sla_hour_selection(self, hours):
        try:
            self.wait.web_element_wait_send_keys(
                By.XPATH, self.__e_sla_xpath, hours,
                'category_sla_hour_selection')
            print('category_sla_hour_selection - Entered')
            return True
        except Exception as error:
            ui_logger.error(error)

    def job_sla_hour_selection(self, hours):
        try:
            self.wait.web_element_wait_send_keys(By.XPATH,
                                                 self.__e_job_sla_xpath, hours,
                                                 'job_sla_hour_selection')
            print('job_sla_hour_selection - Entered')
            return True
        except Exception as error:
            ui_logger.error(error)

    def event_sla_hour_selection(self, hours):
        try:
            self.wait.web_element_wait_send_keys(By.XPATH,
                                                 self.__e_event_sla_xpath,
                                                 hours,
                                                 'event_sla_hour_selection')
            print('event_sla_hour_selection - Entered')
            return True
        except Exception as error:
            ui_logger.error(error)

    def category_job_selection(self):
        try:
            self.wait.web_element_wait_click(By.XPATH, self.__e_jobs_xpath,
                                             'category_job_selection')
            print('category_job_selection - Clicked')
            return True
        except Exception as error:
            ui_logger.error(error)

    def event_job_selection(self):
        try:
            self.wait.web_element_wait_click(By.XPATH,
                                             self.__e_event_job_xpath,
                                             'event_job_selection')
            print('event_job_selection - Clicked')
            return True
        except Exception as error:
            ui_logger.error(error)

    def category_event_selection(self):
        try:
            self.wait.web_element_wait_click(By.XPATH, self.__e_event_xpath,
                                             'category_event_selection')
            print('category_event_selection - Clicked')
            return True
        except Exception as error:
            ui_logger.error(error)

    def save_help_desk_config(self):
        try:
            self.wait.web_element_wait_click(By.XPATH,
                                             self.__e_save_button_xpath,
                                             'save_help_desk_config')
            print('save_help_desk_config - Clicked')
            return True
        except Exception as error:
            ui_logger.error(error)

    def config_notifier(self, message):
        try:
            time.sleep(0.7)
            self.notifier.glowing_messages(message)
            return True
        except Exception as error:
            ui_logger.error(error)

    def config_notifier_dismiss(self):
        try:
            self.notifier.dismiss_message()
            time.sleep(0.9)
            return True
        except Exception as error:
            ui_logger.error(error)
class EventNominationsPage:
    __e_nomination_tab_xpath = Locators.SUB_MENU['nominations']
    __e_header_tag = Locators.TAG['h5']
    __e_panel_xpath = Locators.NOMINATIONS['panel_select']
    __e_check_xpath = Locators.CHECK_BOX['check_box']
    __e_action_class = Locators.NOMINATIONS['actions']
    __e_approve_xpath = Locators.NOMINATIONS['approve']
    __e_sync_xpath = Locators.TITLE['title'].format(
        'This will sync interviewers for whom you'
        ' have accepted nomination with the event owners')

    def __init__(self, driver):
        self.driver = driver
        self.wait = WebElementWait(self.driver)
        self.scroll = PageScroll(self.driver)
        self.notifier = Notifier(self.driver)

    def nomination_tab(self):
        try:
            self.wait.loading()
            self.wait.web_element_wait_click(By.XPATH,
                                             self.__e_nomination_tab_xpath,
                                             'nomination_tab')
            print('Interviewers nomination_tab - Clicked')
            return True
        except Exception as error:
            ui_logger.error(error)

    def header_check(self, header):
        try:
            self.wait.loading()
            assert self.wait.web_elements_wait_text(By.TAG_NAME, self.__e_header_tag, header) == header, \
                'no header found'
            return True
        except Exception as error:
            ui_logger.error(error)

    def panel_select(self, skill):
        try:
            self.wait.web_element_wait_send_keys(By.XPATH,
                                                 self.__e_panel_xpath, skill,
                                                 'panel_select')
            self.wait.loading()
            print(f'{skill} - skill selected to panel')
            return True
        except Exception as error:
            ui_logger.error(error)

    def select_applicants(self):
        try:
            time.sleep(1)
            self.wait.web_element_wait_click(By.XPATH, self.__e_check_xpath,
                                             'select_applicants')
            print('select_applicants - Selected')
            return True
        except Exception as error:
            ui_logger.error(error)

    def recruiter_actions(self):
        try:
            self.wait.web_element_wait_click(By.CLASS_NAME,
                                             self.__e_action_class,
                                             'recruiter_actions')
            print('recruiter_actions - Clicked')
            return True
        except Exception as error:
            ui_logger.error(error)

    def approve_by_recruiter(self):
        try:
            self.wait.web_element_wait_click(By.XPATH, self.__e_approve_xpath,
                                             'recruiter_actions')
            self.wait.loading()
            print('recruiter_actions - Clicked')
            return True
        except Exception as error:
            ui_logger.error(error)

    def sync_interviewers(self):
        try:
            self.scroll.up(0, 90)
            time.sleep(1.5)
            self.wait.web_element_wait_click(By.XPATH, self.__e_sync_xpath,
                                             'sync_interviewers')
            print('sync_interviewers - Synced')
            return True
        except Exception as error:
            ui_logger.error(error)

    def sync_notifier(self, message):
        try:
            self.notifier.glowing_messages(message)
            return True
        except Exception as error:
            ui_logger.error(error)

    def sync_notifier_dismiss(self):
        try:
            self.notifier.dismiss_message()
            return True
        except Exception as error:
            ui_logger.error(error)
class 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 EventApplicantActions:

    __e_status_change_id = Locators.ACTIONS['status_change']
    __e_more_button_xpath = Locators.ACTIONS['app_more']
    __e_app_action_xpath = Locators.BUTTONS['all_buttons']
    __e_provide_feedback_id = Locators.ACTIONS['provide_feedback']
    __e_cancel_request_id = Locators.ACTIONS['cancel_request']
    __e_cancel_interview_id = Locators.ACTIONS['cancel_interview']
    __e_unlock_feedback_id = Locators.ACTIONS['unlock_feedback']

    def __init__(self, driver):
        self.driver = driver
        self.wait = WebElementWait(self.driver)
        self.scroll = PageScroll(self.driver)
    """
     ****--------------------- Event Applicant Action Functions ---------------------------------****
    """
    def change_status_action(self):
        try:
            self.wait.web_element_wait_click(By.ID, self.__e_status_change_id, 'Applicant_status_change')
            self.wait.loading()
            return True
        except Exception as error:
            ui_logger.error(error)

    def more_action(self):
        try:
            self.scroll.up(0, 50)
            self.wait.web_element_wait_click(By.XPATH, self.__e_more_button_xpath, 'more_action')
            print('Clicked on - Applicant More actions')
            self.wait.loading()
            return True
        except Exception as error:
            ui_logger.error(error)

    def quick_interview_action(self):
        try:
            self.wait.web_element_wait_click(By.XPATH,
                                             self.__e_app_action_xpath.format('Quick Interview Schedule'),
                                             'quick_interview_action')
            time.sleep(2)
            print('Quick Interview Action - Clicked')
            self.wait.loading()
            return True
        except Exception as error:
            ui_logger.error(error)

    """
     ****--------------------- Event Interviews Applicant Action Functions ---------------------------------****
    """
    def provide_feedback_action(self):
        try:
            self.scroll.down(0, -50)
            self.wait.web_element_wait_click(By.ID, self.__e_provide_feedback_id, 'provide_feedback_action')
            time.sleep(2)
            print('Provide Feedback Action - Clicked')
            self.wait.loading()
            return True
        except Exception as error:
            ui_logger.error(error)

    def cancel_interview_request_action(self):
        try:
            self.scroll.down(0, -50)
            self.wait.web_element_wait_click(By.ID, self.__e_cancel_request_id, 'cancel_interview_request_action')
            time.sleep(2)
            print('Cancel Request Action - Clicked')
            self.wait.loading()
            return True
        except Exception as error:
            ui_logger.error(error)

    def cancel_interview_action(self):
        try:
            self.scroll.down(0, -50)
            self.wait.web_element_wait_click(By.ID, self.__e_cancel_interview_id, 'cancel_interview_action')
            time.sleep(2)
            print('Cancel Interview Action - Clicked')
            self.wait.loading()
            return True
        except Exception as error:
            ui_logger.error(error)

    def unlock_feedback_action(self):
        try:
            self.scroll.down(0, -50)
            self.wait.web_element_wait_click(By.ID, self.__e_unlock_feedback_id, 'unlock_feedback_action')
            print('Unlock Feedback Action - Clicked')
            return True
        except Exception as error:
            ui_logger.error(error)
Exemple #23
0
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)
Exemple #24
0
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 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)
Exemple #26
0
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 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)
Exemple #28
0
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 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)
Exemple #30
0
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)