def test_apply_degree_null(self): self.apply_info_job('李大大', Phone.create_phone(), '北京', '', '财务专业', '某公司', '网发测试', '1000', '李大大', Phone.create_phone(), CardUrl.APPLY_JOB_URL) sleep(1) text = self.driver.find_element_by_class_name('a_msg').text self.assertIn('请填写完所有必填项', text)
def test_apply_degree_more(self): self.apply_info_job( '神仙姐姐', Phone.create_phone(), '北京', '上海华师大1上海华师大2上海华师大3上海华师大4上海华师大5上海华师大6上海华师大7上海华师大8上海华师大9上海华师大10', '财务专业', '某公司', '网发测试', '1000', '李大大', Phone.create_phone(), CardUrl.APPLY_JOB_URL) text = self.driver.find_element_by_xpath('//*[@id="mid"]/div/i').text self.assertIn('填报成功,感谢您的配合', text)
def test_fast_card(self): url = 'https://test.xliane.com/html2/webapp/fast-issue-con/parnter.html?id=1cdced2a92f841c38792060bbf516c60' CardApplicationBasicInfo(self.driver).open_login( "元哥", CreateIDCardTest.CreateIDCard(), Phone.create_phone(), url) CardApplicationDetailInfo(self.driver).login("上海蓝天科技有限公司", "021", "6951691", "浦东新区来安路500号", "业务部", "120", "广兰路200号") CardApplicationOtherInfo(self.driver).login("皮卡丘", Phone.create_phone(), "*****@*****.**") sleep(5)
def test_apply_job(self): self.apply_info_job('测试姓名', Phone.create_phone(), '北京', '某某大学', '财务专业', '某公司', '网发测试', '1000', '李大大', '13000000000', CardUrl.APPLY_JOB_URL) text = self.driver.find_element_by_xpath('//*[@id="mid"]/div/i').text sleep(1) self.assertIn('填报成功,感谢您的配合', text)
def test_interact_permission(self): self.login(Phone.create_phone(), 4484040029, CardUrl.INTERACT_QR_CODE_TPLUS_QUERY_LOGIN_URL) interact_error_hint_loc = (By.XPATH, '//*[@id="app"]/div/div[3]/div/p[2]') operator = LoginOperator(self.driver) self.assertIn("无权查询", operator.get_text(interact_error_hint_loc))
def test_car_payment(self): CarPaymentBasicInfo(self.driver).open_login( "李大亿", CreateIDCardTest.CreateIDCard(), "110", "10", CardUrl.CAR_PAYMENT_URL) CarPaymentPersonalInfo(self.driver).login("上海科技馆有限公司", 110) CarPaymentApplyInfo(self.driver).login(Phone.create_phone())
def test_login_english_name(self): self.login("jingj", Phone.create_phone(), CardUrl.CUSTOMER_RECO_LOGIN_URL, '1001') sleep(2) self.assertIn("姓名为空或格式不正确", self.get_sms_error_text()) image_util.insert_img(self.driver, "user_name_miss3.png") print('用户名为拼音,提示姓名为空或格式不正确') sleep(1)
def test_login_org_null(self): self.login("李芽", Phone.create_phone(), CardUrl.CUSTOMER_RECO_LOGIN_URL) sleep(3) message = self.driver.find_element_by_xpath( '//p[@id="copyright"]').text self.assertIn(u'©本服务由兴业银行信用卡中心提供', message) image_util.insert_img(self.driver, "user_pawd_true2.png") sleep(1)
def test_login_customer_miss(self): self.basic_info_page("测试书记", "110101198701045257", Phone.create_phone(), CardUrl.CARD_APPLICATION_BASIC_INFO_URL) base_info_label = self.driver.find_element_by_xpath( '/html/body/div[2]/div/div[1]/div[1]/label') self.assertTrue(base_info_label is not None) self.assertEqual(base_info_label.text, '单位名称') sleep(3)
def test_apply_phone_less(self): self.apply_info_job('李大大', '1200000000', '北京', '某某大学', '财务专业', '某公司', '网发测试', '1000', '李大大', Phone.create_phone(), CardUrl.APPLY_JOB_URL) text = self.driver.find_element_by_class_name('a_msg').text self.assertIn('请正确填写', text)
def test_apply_degree_english(self): self.apply_info_job('李大大', Phone.create_phone(), '北京', 'wuhandaxue', '财务专业', '某公司', '网发测试', '1000', '李大大', Phone.create_phone(), CardUrl.APPLY_JOB_URL) text = self.driver.find_element_by_xpath('//*[@id="mid"]/div/i').text self.assertIn('填报成功,感谢您的配合', text)
def test_recommend_username_null(self): self.apply_info_job('姚大牙', Phone.create_phone(), '北京', '某某大学', '财务专业', '某公司', '网发测试', '1000', '', Phone.create_phone(), CardUrl.APPLY_JOB_URL) text = self.driver.find_element_by_xpath('//*[@id="mid"]/div/i').text self.assertIn('填报成功,感谢您的配合', text)
def test_recommend_username_character(self): self.apply_info_job('姚大牙', Phone.create_phone(), '北京', '某某大学', '财务专业', '某公司', '网发测试', '1000', '李大?大', Phone.create_phone(), CardUrl.APPLY_JOB_URL) text = self.driver.find_element_by_class_name('a_msg').text self.assertIn('请正确填写', text)
def test_apply_salary_number(self): self.apply_info_job('李大大', Phone.create_phone(), '北京', '上海大学', '审计专业', '某公司company', '运营岗opt', '111100000', '李大大', Phone.create_phone(), CardUrl.APPLY_JOB_URL) text = self.driver.find_element_by_xpath('//*[@id="mid"]/div/i').text self.assertIn('填报成功,感谢您的配合', text)
def test_apply_salary_zero(self): self.apply_info_job('李大大', Phone.create_phone(), '北京', '上海大学', '审计专业', '某公司company', '运营岗opt', '01000', '李大大', Phone.create_phone(), CardUrl.APPLY_JOB_URL) text = self.driver.find_element_by_class_name('a_msg').text self.assertIn('期望工资只能输入正整数且长度不能超过10位', text)
def test_car_payment_apply_info(self): self.car_payment_pretrial_application_page( Phone.create_phone(), CardUrl.CAR_PAYMENT_PRETRIAL_APPLICATION_URL) car_apply_label = self.driver.find_element_by_xpath( '/html/body/div[3]') self.assertIn(car_apply_label.text, ' Redis过期')
def test_login_identity_miss(self): self.login("51223619780710265", Phone.create_phone(), CardUrl.CARD_NUMBER_QUERY_LOGIN_URL) sleep(1) self.assertIn("身份证号码有误,请确认", self.get_identify_error_text()) image_util.insert_img(self.driver, "identity_miss.png")
def test_other_page_email_tail(self): self.login("李加一", Phone.create_phone(), "*****@*****.**", CardUrl.CARD_APPLICATION_OTHER_INFO_URL) self.assertIn('请输入正确格式的电子邮箱', self.card_error_text())
def test_login_other_name_more(self): self.login("李还说时间看见的加", Phone.create_phone(), "*****@*****.**", CardUrl.CARD_APPLICATION_OTHER_INFO_URL) self.assertIn('联系人姓名请输入中文,请输入2-8个汉字', self.card_error_text())
def test_login_other_info(self): self.login("皮卡丘", Phone.create_phone(), "*****@*****.**", CardUrl.CARD_APPLICATION_OTHER_INFO_URL)
def test_login_identity_null(self): self.login("", Phone.create_phone(), CardUrl.CARD_NUMBER_QUERY_LOGIN_URL) sleep(1) self.assertIn("身份证号不能为空", self.get_identify_error_text()) image_util.insert_img(self.driver, "identity_null.png")
def test_apply_root_character(self): self.apply_info_job('李大大', Phone.create_phone(), '<br> ', '某某大学', '财务专业', '某公司', '网发测试', '1000', '李大大', Phone.create_phone(), CardUrl.APPLY_JOB_URL) text = self.driver.find_element_by_xpath('//*[@id="mid"]/div/i').text self.assertIn('填报成功,感谢您的配合', text)
def test_login_other_name_null(self): self.login("", Phone.create_phone(), "*****@*****.**", CardUrl.CARD_APPLICATION_OTHER_INFO_URL) self.assertIn('联系人姓名不能为空', self.card_error_text())
def test_apply_major_space(self): self.apply_info_job('李大大', Phone.create_phone(), '北京', '上海大学', ' ', '某公司', '网发测试', '1000', '李大大', Phone.create_phone(), CardUrl.APPLY_JOB_URL) text = self.driver.find_element_by_class_name('a_msg').text self.assertIn('应聘人员最高学历专业为空:', text)
def test_other_page_phone_less(self): self.login("李加一", Phone.create_phone(), "*****@*****.**", CardUrl.CARD_APPLICATION_OTHER_INFO_URL) self.assertIn('请输入正确的11位手机号码', self.card_error_text())
def test_apply_major_all(self): self.apply_info_job('李大大', Phone.create_phone(), '北京', '上海大学', 'finacl专业', '某公司', '网发测试', '1000', '李大大', Phone.create_phone(), CardUrl.APPLY_JOB_URL) text = self.driver.find_element_by_xpath('//*[@id="mid"]/div/i').text self.assertIn('填报成功,感谢您的配合', text)
def test_login_other_email_name_more(self): self.login("李加一", Phone.create_phone(), "*****@*****.**", CardUrl.CARD_APPLICATION_OTHER_INFO_URL) car_apply_label = self.driver.find_element_by_xpath('/html/body/div[9]/div[2]') self.assertIn('填写时间过长,请关闭页面重新开始填写', car_apply_label.text)
def test_apply_new_major_null(self): self.apply_info_job('李大大', Phone.create_phone(), '北京', '上海大学', '审计专业', 'nowcompany蓝天', '', '1000', '李大大', Phone.create_phone(), CardUrl.APPLY_JOB_URL) text = self.driver.find_element_by_class_name('a_msg').text self.assertIn('请填写完所有必填项', text)
def login(self, url): LoginOperator(self.driver).recommendation_login( Phone.create_phone(), url) sleep(1)
def test_apply_new_major_space(self): self.apply_info_job('李大大', Phone.create_phone(), '北京', '上海大学', '审计专业', 'nowcompany蓝天', '运营 岗', '1000', '李大大', Phone.create_phone(), CardUrl.APPLY_JOB_URL) text = self.driver.find_element_by_xpath('//*[@id="mid"]/div/i').text self.assertIn('填报成功,感谢您的配合', text)