def test_login_user_pwd_success(self): """测试正常Login""" po = LoginPage(self.driver) po.open() user = "******" po.login_action(user, "qwe123") function.insert_img(self.driver, "Login_success.png")
def test_edit_myself(self): """测试修改个人资料""" po = LoginPage(self.driver) po.open() po.login_action(13727086330, "qwe123") po2 = WelcomePage(self.driver) po2.to_edit_myself_page() function.insert_img(self.driver, 'edit_successful_result.png') self.assertEqual(po2.submit_successful_result(), '编辑个人资料成功')
def test_changepwd(self): """测试修改密码""" po = LoginPage(self.driver) po.open() po.login_action(13727086330, "qwe123") po2 = WelcomePage(self.driver) po2.to_changepwd() self.assertEqual(po2.changepwd_successful_result(), '修改密码成功,请使用新密码重新登录') function.insert_img(self.driver, 'changepwd_successful_result.png')
def test_upload_quality_data(self): """上传质检数据""" po = LoginPage(self.driver) po.open() po.login_action(13727086330, "qwe123") po2 = MedPackPage(self.driver) po2.to_medpack_page() po2.quality_data_upload() self.assertEqual(po2.subpackage_successful_text(), '上传成功!') function.insert_img(self.driver, "subpackage_successful.png")
def test_login_Null(self): """账户密码为空""" po = LoginPage(self.driver) po.open() po.login_action("", "") nowtime = Base(self.driver).now_time() try: self.assertEqual(po.login_error_hint(), "手机号不能为空!") except: # function.insert_img(self.driver, "Login_Nullerror.png") function.insert_img(self.driver, '%s.png' % nowtime)
def test_finish_plant(self): """测试完成计划""" po = LoginPage(self.driver) po.open() po.login_action(13727086330, "qwe123") po2 = PlantPage(self.driver) po2.to_plant_page() po2.finish_plant() self.assertEqual(po2.finish_successful_reresult(), '操作成功!') function.insert_img(self.driver, 'finish_plant_successful_reresult.png')
def test_process_search(self): """初加工任务搜索""" po = LoginPage(self.driver) po.open() po.login_action(13727086330, "qwe123") po2 = ProcessPage(self.driver) po2.to_process_page() po2.breedName_search_text("金银花") po2.choose_medSource_select(1) po2.search_button_click() self.assertEqual(po2.frist_line_breedName(), "金银花") function.insert_img(self.driver, 'search_process_reresult.png')
def test_addplanttask(self): """新建种植任务""" po = LoginPage(self.driver) po.open() po.login_action(13727086330, "qwe123") po2 = PlantPage(self.driver) po2.to_plant_page() po2.checkbox1_click() po2.add_task_click() po3 = AddPlantTaskPage(self.driver) po3.add_Plant_Task() self.assertEqual(po3.tishi_text(), '下达任务成功!') function.insert_img(self.driver, 'addplant_task_success.png')
def test_codeprint_search(self): """测试搜索功能""" # 登陆 po = LoginPage(self.driver) po.open() po.login_action(13727086330, "qwe123") po2 = CodPrintPage(self.driver) # 进入赋码打印页 po2.to_codprint_link() # 进行搜索操作 po2.breedname_search_case() # 结果断言 self.assertEqual(po2.result_batch_no(), 'ZZ2018053100006') function.insert_img(self.driver, 'codeprint_search_result.png')
def test_addplant(self): """新建种植计划""" po = LoginPage(self.driver) po.open() po.login_action(13727086330, "qwe123") sleep(1) po2 = PlantPage(self.driver) po2.to_plant_page() sleep(1) po2.add_plant_click() po3 = AddPlantPage(self.driver) po3.add_plant('三七') self.assertEqual(po3.tishi_text(), "新建计划成功!") function.insert_img(self.driver, 'addplantsuccess.png')