class CandidateSearchPage:
    __e_embrace_search_xpath = Locators.TITLE['title'].format('AdvancedSearch')
    __e_candidate_name_field_xpath = Locators.EMBRACE['candidate_name_search_field']
    __e_search_button_xpath = Locators.BUTTONS['button'].format(' Search')

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

    def advance_search(self):
        try:
            self.wait.embrace_loading()
            self.wait.web_element_wait_click(By.XPATH, self.__e_embrace_search_xpath, 'embrace_advance_search')
            return True
        except Exception as error:
            ui_logger.error(error)

    def candidate_name_field(self, candidate_name):
        try:
            self.wait.web_element_wait_send_keys(By.XPATH, self.__e_candidate_name_field_xpath, candidate_name,
                                                 'candidate_name_field')
            return True
        except Exception as error:
            ui_logger.error(error)

    def advance_search_button(self):
        try:
            self.wait.web_element_wait_click(By.XPATH, self.__e_search_button_xpath, 'advance_search_button')
            self.wait.embrace_loading()
            return True
        except Exception as error:
            ui_logger.error(error)
Example #2
0
class CandidatePage:
    __e_task_behalf_of_xpath = Locators.TITLE['title'].format(
        'Submit Tasks on Behalf of Candidate')
    __e_acceptance_name = Locators.EMBRACE['candidate_acceptance_yes']
    __e_submit_xpath = Locators.BUTTONS['button'].format('Submit')

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

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

    def candidate_acceptance_yes(self):
        try:
            time.sleep(1)
            self.wait.web_element_wait_click(By.NAME, self.__e_acceptance_name,
                                             'candidate_acceptance_yes')
            return True
        except Exception as error:
            ui_logger.error(error)

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

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

    def submit_task_notifier_dismiss(self):
        try:
            self.notifier.dismiss_message()
            time.sleep(0.5)
            return True
        except Exception as error:
            ui_logger.error(error)
Example #3
0
class Menu:
    __e_menu = Locators.MENU['menu']
    __e_menu_embrace = Locators.MENU['embrace']
    __e_embrace_candidate_xpath = Locators.EMBRACE['candidate_tab']

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

    def job_tab(self, job_menu_name, tab_title):
        try:
            self.wait.web_element_wait_click(
                By.XPATH, self.__e_menu.format(job_menu_name),
                'not_in_job_roles')
            self.wait.loading()
            assert self.tab_title.tab_title(
                tab_title) == tab_title, 'Webdriver is in wrong tab'
            return True
        except Exception as error:
            ui_logger.error(error)

    def requirement_tab(self, req_menu_name, tab_title):
        try:
            self.scroll.up(0, 50)
            self.wait.web_element_wait_click(
                By.XPATH, self.__e_menu.format(req_menu_name),
                'not_in_Requirements')
            self.wait.loading()
            assert self.tab_title.tab_title(
                tab_title) == tab_title, 'Webdriver is in wrong tab'
            return True
        except Exception as error:
            ui_logger.error(error)

    def assessment_tab(self, assess_menu_name, tab_title):
        try:
            self.wait.web_element_wait_click(
                By.XPATH, self.__e_menu.format(assess_menu_name),
                'not_in_assessments')
            self.wait.loading()
            assert self.tab_title.tab_title(
                tab_title) == tab_title, 'Webdriver is in wrong tab'
            return True
        except Exception as error:
            ui_logger.error(error)

    def event_tab(self, event_menu_name, tab_title):
        try:
            self.wait.web_element_wait_click(
                By.XPATH, self.__e_menu.format(event_menu_name),
                'not_in_Events')
            self.wait.loading()
            assert self.tab_title.tab_title(
                tab_title) == tab_title, 'Webdriver is in wrong tab'
            return True
        except Exception as error:
            ui_logger.error(error)

    def nominations_tab(self, nom_menu_name, tab_title):
        try:
            self.wait.web_element_wait_click(
                By.XPATH, self.__e_menu.format(nom_menu_name),
                'not_in_job_roles')
            assert self.tab_title.tab_title(
                tab_title) == tab_title, 'Webdriver is in wrong tab'
            time.sleep(2)
            return True
        except Exception as error:
            ui_logger.error(error)

    def more_tab(self, more_menu_name):
        try:
            self.wait.web_element_wait_click(
                By.XPATH, self.__e_menu.format(more_menu_name), 'not_in_More')
            return True
        except Exception as error:
            ui_logger.error(error)

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

    def embrace_candidate_tab(self):
        try:
            self.wait.embrace_loading()
            time.sleep(1)
            self.wait.web_element_wait_click(By.XPATH,
                                             self.__e_embrace_candidate_xpath,
                                             'not_in_Embrace_candidate_tab')
            return True
        except Exception as error:
            ui_logger.error(error)
Example #4
0
class CandidateQueryReplyPage:
    __e_search_xpath = Locators.PLACEHOLDER['place_holder'].format('Find')
    __e_subject_xpath = Locators.TITLE['title']
    __e_reply_message_xpath = Locators.PLACEHOLDER['all_place_holder'].format(
        'Your message here...')
    __e_mark_close_xpath = Locators.BUTTONS['button'].format('Mark as Closed')
    __e_ok_xpath = Locators.BUTTONS['button'].format('OK')
    __e_reply_button_xpath = Locators.TITLE['title'].format('Reply')
    __e_status_bucket_xpath = Locators.QUERY['status_bucket']

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

    def search_candidate_query(self, candidate_name):
        try:
            self.wait.embrace_loading()
            self.wait.clear(By.XPATH, self.__e_search_xpath, 'more_queries')
            self.wait.web_element_wait_send_keys(By.XPATH,
                                                 self.__e_search_xpath,
                                                 candidate_name,
                                                 'more_queries')
            print('Searching for proper record')
            return True
        except Exception as error:
            ui_logger.error(error)

    def select_proper_query_based_on_subject(self, subject):
        try:
            time.sleep(1)
            self.wait.web_element_wait_click(
                By.XPATH, self.__e_subject_xpath.format(subject),
                'select_proper_query_based_on_subject')
            self.wait.embrace_loading()
            print('Proper block based on proper subject - Selected')
            return True
        except Exception as error:
            ui_logger.error(error)

    def reply_message_entry(self, message):
        try:
            self.wait.web_element_wait_send_keys(By.XPATH,
                                                 self.__e_reply_message_xpath,
                                                 message,
                                                 'reply_message_entry')
            print('reply_message_entry - Entered')
            return True
        except Exception as error:
            ui_logger.error(error)

    def reply_to_query(self):
        try:
            self.wait.web_element_wait_click(By.XPATH,
                                             self.__e_reply_button_xpath,
                                             'reply_to_query')
            print('reply_to_query - Clicked')
            time.sleep(0.5)
            return True
        except Exception as error:
            ui_logger.error(error)

    def in_progress_tab(self):
        try:
            self.wait.web_element_wait_send_keys(By.XPATH,
                                                 self.__e_status_bucket_xpath,
                                                 'In Progress',
                                                 'in_progress_tab')
            self.wait.embrace_loading()
            print('in_progress_tab - Selected')
            return True
        except Exception as error:
            ui_logger.error(error)

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

    def confirm_button(self):
        try:
            self.wait.web_element_wait_click(By.XPATH, self.__e_ok_xpath,
                                             'confirm_button')
            print('confirm_button - Clicked')
            return True
        except Exception as error:
            ui_logger.error(error)
class EmbraceLogin:
    """
    ----------------- WEB ELEMENT REFERENCE CLASS PRIVATE VARIABLES TO EASY ACCESS ------>>>>
    """
    __e_login_name = Locators.LOGIN['c_user_name']
    __e_password_xpath = Locators.LOGIN['password']
    __e_login_button_xpath = Locators.LOGIN['e_login']
    __e_login_verify_name = 'headerNameText'

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

    def embrace_url(self, server):
        if server == 'amsin':
            self.new_tab.open_in_same_tab(0, ReadConfigFile.ReadConfig.get_qa_embrace_url())
            return True
        elif server == 'ams':
            self.new_tab.open_in_same_tab(0, ReadConfigFile.ReadConfig.get_production_embrace_url())
            return True
        elif server == 'beta':
            self.new_tab.open_in_same_tab(0, ReadConfigFile.ReadConfig.get_beta_embrace_url())
            return True
        elif server == 'stage':
            self.new_tab.open_in_same_tab(0, ReadConfigFile.ReadConfig.get_stage_embrace_url())
            return True
        elif server == 'india':
            self.new_tab.open_in_same_tab(0, ReadConfigFile.ReadConfig.get_indiaams_embrace_url())
            return True

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

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

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

    def login_account_name_verification(self, user_name):
        try:
            self.wait.embrace_loading()
            time.sleep(1)
            assert self.wait.web_elements_wait_text(By.CLASS_NAME, self.__e_login_verify_name, user_name) == \
                   user_name, 'Logged in different account please check the details'
            print(f'{user_name} logged in successfully')
            return True
        except Exception as error:
            ui_logger.error(error)