Esempio n. 1
0
class CrpoAdminLogin:
    def __init__(self, driver, index, version):
        self.driver = driver
        self.login = Login(self.driver)
        self.search = AdvanceSearchPage.Search(self.driver)
        self.getby = EventGetByNamePage.EventGetByName(self.driver)
        self.menu = Menu(self.driver)
        self.event_action = EventActionsPage.Actions(self.driver)
        self.bucket = BucketSelectionPage(self.driver)
        self.applicant_grid = EventApplicant(self.driver)
        self.applicant_action = EventApplicantActions(self.driver)
        self.unlock = UnlockFeedback(self.driver)
        """
        ----------------- EXCEL READ AND TO ASSIGN VALUES TO RESPECTIVE INIT VARIABLES ------>>>>
        """
        excel = excelRead.ExcelRead()
        excel.read(inputFile.INPUT_PATH['interview_lobby'], index=index)
        xl = excel.excel_dict
        self.xl_account_name = xl['account_name'][0]
        self.xl_int2_name = xl['int2_name'][0]
        self.xl_event = xl['event_name'][0].format(version)
        self.xl_menu = xl['menu'][0]
        self.xl_title = xl['tab_title'][0]

        login_excel = excelRead.ExcelRead()
        login_excel.read(inputFile.INPUT_PATH['login_excel'], index=index)
        xl = login_excel.excel_dict
        self.xl_name = xl['c_login_name'][0]
        self.xl_pwd = xl['c_password'][0]

        unlock_excel = excelRead.ExcelRead()
        unlock_excel.read(inputFile.INPUT_PATH['feedback'], index=index)
        xl = unlock_excel.excel_dict
        self.xl_bucket = xl['completed_bucket'][0]
        self.xl_unlock_comment = xl['unlock_comment'][0]
        self.xl_unlock_message = xl['unlock_message'][0]

        self.admin_collection = []
        self.unlock_collection = []

    def admin_login(self):
        self.admin_collection = []
        __list = [
            self.login.login_account_click(self.xl_int2_name),
            self.login.login_out(),
            self.login.click_here_to_login(),
            self.login.login_name(self.xl_name),
            self.login.password(self.xl_pwd),
            self.login.login_button(),
            self.login.login_account_name_verification(self.xl_account_name),
            self.menu.event_tab(self.xl_menu, self.xl_title),
            self.search.advance_search(),
            self.search.name_field(self.xl_event),
            self.search.search_button(),
            self.getby.event_name_click(),
            self.getby.event_name_validation(self.xl_event),
        ]
        for func in __list:
            if func:
                self.admin_collection.append(func)
            else:
                self.admin_collection.append(func)

    def admin_unlock(self):
        self.unlock_collection = []
        __list = [
            self.event_action.event_actions_click(),
            self.event_action.event_interviews(),
            self.bucket.bucket_select(self.xl_bucket),
            self.applicant_grid.select_applicant(),
            self.applicant_action.unlock_feedback_action(),
            self.unlock.select_all_interviewers(),
            self.unlock.unlock_button(),
            self.unlock.unlock_request_comment(self.xl_unlock_comment),
            self.unlock.ok_button(),
            self.unlock.unlock_status_notifier(self.xl_unlock_message),
            self.unlock.unlock_status_notifier_dismiss(),
            self.unlock.close_button()
        ]
        for func in __list:
            if func:
                self.unlock_collection.append(func)
            else:
                self.unlock_collection.append(func)
class CrpoInt2Feedback:
    def __init__(self, driver, index, version):
        self.driver = driver
        self.live = LiveIntSchedulePage(self.driver)
        self.feedback = InterviewFeedback(self.driver)
        self.new_tab = SwitchWindow.SwitchWindowClose(self.driver)
        self.event_action = EventActionsPage.Actions(self.driver)
        self.search = Search(self.driver)
        self.applicant_grid = EventApplicant(self.driver)
        self.applicant_action = EventApplicantActions(self.driver)
        self.bucket = BucketSelectionPage(self.driver)
        """
        ----------------- EXCEL READ AND TO ASSIGN VALUES TO RESPECTIVE INIT VARIABLES ------>>>>
        """
        status_excel = excelRead.ExcelRead()
        status_excel.read(inputFile.INPUT_PATH['event_status_change'],
                          index=index)
        xl = status_excel.excel_dict
        self.xl_event_name = xl['event_name'][0].format(version)
        self.xl_live_stage = xl['live_stage'][0]

        feed_excel = excelRead.ExcelRead()
        feed_excel.read(inputFile.INPUT_PATH['feedback'], index=index)
        xl = feed_excel.excel_dict
        self.xl_candidate_name = xl['event_name'][0].format(version)
        self.xl_shortlist_decision = xl['shortlist'][0]
        self.xl_rating = xl['rating'][0]
        self.xl_comment = xl['quick_comment'][0]
        self.xl_overall = xl['quick_overall'][0]
        self.xl_bucket = xl['partial_bucket'][0]

        self.int2_feedback_collection = []
        self.pf2_collection = []
        self.partial_collection = []

    def quick_interview2_feedback(self):
        self.int2_feedback_collection = []
        __list = [
            self.event_action.event_actions_click(),
            self.event_action.event_interviews(),
            self.search.advance_search(),
            self.search.candidate_name_field(self.xl_event_name),
            self.search.search_button(),
            self.applicant_grid.select_applicant(),
            self.applicant_action.provide_feedback_action(),
            self.new_tab.switch_to_window(1)
        ]
        for func in __list:
            if func:
                self.int2_feedback_collection.append(func)
            else:
                self.int2_feedback_collection.append(func)

    def int2_partial_submission(self):
        self.partial_collection = []
        __list = [
            self.feedback.feedback_decision(self.xl_shortlist_decision),
            self.feedback.feedback_select_drop_down(self.xl_rating),
            self.feedback.feedback_comments(self.xl_comment),
            self.feedback.overall_comment(self.xl_overall),
            self.feedback.partial_submission(),
            self.feedback.agree_and_submit(),
            self.new_tab.window_close(),
            self.new_tab.switch_to_window(0),
        ]
        for func in __list:
            if func:
                self.partial_collection.append(func)
            else:
                self.partial_collection.append(func)

    def int2_provide_feedback(self):
        self.pf2_collection = []
        __list = [
            self.bucket.bucket_select(self.xl_bucket),
            self.applicant_grid.select_applicant(),
            self.applicant_action.provide_feedback_action(),
            self.new_tab.switch_to_window(1),
            self.feedback.submit_feedback(),
            self.feedback.agree_and_submit(),
            self.feedback.agree_and_submit(),
            self.new_tab.window_close(),
            self.new_tab.switch_to_window(0),
        ]
        for func in __list:
            if func:
                self.pf2_collection.append(func)
            else:
                self.pf2_collection.append(func)
class CrpoInt1Feedback:
    def __init__(self, driver, index, version):
        self.driver = driver
        self.feedback = InterviewFeedback(self.driver)
        self.new_tab = SwitchWindow.SwitchWindowClose(self.driver)
        self.search = Search(self.driver)
        self.applicant_grid = EventApplicant(self.driver)
        self.applicant_action = EventApplicantActions(self.driver)
        self.bucket = BucketSelectionPage(self.driver)
        """
        ----------------- EXCEL READ AND TO ASSIGN VALUES TO RESPECTIVE INIT VARIABLES ------>>>>
        """
        feed_excel = excelRead.ExcelRead()
        feed_excel.read(inputFile.INPUT_PATH['feedback'], index=index)
        xl = feed_excel.excel_dict
        self.xl_bucket = xl['completed_bucket'][0]
        self.xl_candidate_name = xl['event_name'][0].format(version)
        self.xl_pending_decision = xl['pending'][0]
        self.xl_shortlist_decision = xl['shortlist'][0]
        self.xl_rating = xl['rating'][0]
        self.xl_rating1 = xl['rating1'][0]
        self.xl_comment = xl['unlock_comment'][0]
        self.xl_overall = xl['unlock_overall'][0]

        self.int1_feedback_collection = []
        self.pf1_collection = []
        self.update_f_d_collection = []
        self.completed_bucket_collection = []

    def completed_bucket(self):
        self.completed_bucket_collection = []
        __list = [self.bucket.bucket_select(self.xl_bucket)]
        for func in __list:
            if func:
                self.completed_bucket_collection.append(func)
            else:
                self.completed_bucket_collection.append(func)

    def interview1_feedback(self):
        self.int1_feedback_collection = []
        __list = [
            self.search.advance_search(),
            self.search.candidate_name_field(self.xl_candidate_name),
            self.search.search_button(),
            self.applicant_grid.select_applicant(),
            self.applicant_action.provide_feedback_action(),
            self.new_tab.switch_to_window(1)
        ]
        for func in __list:
            if func:
                self.int1_feedback_collection.append(func)
            else:
                self.int1_feedback_collection.append(func)

    def int1_provide_feedback(self):
        self.pf1_collection = []
        __list = [
            self.feedback.feedback_decision(self.xl_pending_decision),
            self.feedback.feedback_select_drop_down(self.xl_rating),
            self.feedback.feedback_comments(self.xl_comment),
            self.feedback.overall_comment(self.xl_overall),
            self.feedback.submit_feedback(),
            self.feedback.agree_and_submit(),
            self.feedback.agree_and_submit(),
            self.new_tab.switch_to_window(0),
        ]
        for func in __list:
            if func:
                self.pf1_collection.append(func)
            else:
                self.pf1_collection.append(func)

    def int1_update_feedback_decision(self):
        self.update_f_d_collection = []
        __list = [
            self.feedback.feedback_decision(self.xl_shortlist_decision),
            self.feedback.feedback_select_drop_down(self.xl_rating1),
            self.feedback.feedback_comments(self.xl_comment),
            self.feedback.overall_comment(self.xl_overall),
            self.feedback.update_feedback(),
            self.feedback.agree_and_submit(),
            self.feedback.agree_and_submit(),
            self.new_tab.switch_to_window(0),
        ]
        for func in __list:
            if func:
                self.update_f_d_collection.append(func)
            else:
                self.update_f_d_collection.append(func)