def setUpClass(cls) -> None: cls.url = MAIN_URL_HOME cls.driver = WebDriver(CHROME_DRIVER_LOCATION) cls.driver.get(cls.url) cls.driver.maximize_window() data_signin = { "email": VALID_PRO_VIEW_USERNAME, "password": VALID_PRO_VIEW_PASSWORD, } signin_helper(cls.driver, data_signin) time.sleep(DELAY_SHORT)
def test_job_detail__when__professional_signed_in__view_recent_jobs__should_pss(self): driver = self.driver driver.get(MAIN_URL_HOME) data = { "email": VALID_PRO_VIEW_USERNAME, "password": VALID_PRO_VIEW_PASSWORD, } signin_helper(driver, data) time.sleep(DELAY_SHORT) job_list = job_list_with_signin_helper(driver, COMPANY_URL) signout_helper(driver) if job_list != COMPANY_EXAMPLE_VIEW_RECENT_JOBS_WITH_SIGNIN: self.fail() time.sleep(1)
def test__favorite_job_apply__when_profile_is_not_complete__should_pass( self): data = {"user": "******", "pass": "******", "value": "20"} incomplete_ok_value = 'Please complete your profile with necessary and authentic information.' driver = self.driver driver.get(MAIN_URL_HOME) time.sleep(DELAY_SHORT) data_signin = { "email": VALID_PRO_VIEW_USERNAME, "password": VALID_PRO_VIEW_PASSWORD, } signin_helper(driver, data_signin) time.sleep(DELAY_SHORT) favorite_btn = driver.find_element_by_link_text('Favorite Jobs') favorite_btn.click() time.sleep(DELAY_SHORT) time.sleep(1) job_button_list = driver.find_elements_by_class_name('buttons') for job in job_button_list: try: apply = job.find_element_by_class_name('apply').text if apply == 'Applied': time.sleep(1) elif apply == 'Apply': try: apply_btn = job.find_element_by_class_name('apply') time.sleep(1) apply_btn.click() time.sleep(DELAY_SHORT) driver.switch_to.frame( driver.find_element_by_tag_name('iframe')) time.sleep(3) apply_note = driver.find_element_by_id('tinymce') apply_note.send_keys(APPLY_NOTE) time.sleep(1) driver.switch_to.default_content() time.sleep(1) apply_now_btn = driver.find_element_by_xpath( '//*[@id="apply-form"]/button') time.sleep(DELAY_SHORT) apply_now_btn.click() time.sleep(DELAY_SHORT) time.sleep(DELAY_SHORT) time.sleep(DELAY_SHORT) time.sleep(DELAY_SHORT) time.sleep(DELAY_SHORT) incomplete_ok = driver.find_element_by_id( 'swal2-content').text if incomplete_ok != incomplete_ok_value: self.fail() break except: self.fail() break except: self.fail() time.sleep(DELAY_SHORT) admin_setting_completenss_helper(driver, data)