コード例 #1
0
 def test_register_error6(self):
     '''密码不足6位'''
     r = register(self.driver)
     r.goto_register()
     r.register(Data.businesscode, Data.email, Data.name, "1", "1")
     self.assertEqual(r.pop_error_hint(), "最少 6 个字")
     function.screenshot(self.driver, "password_less.jpg")
コード例 #2
0
 def test_register_error4(self):
     '''输入为空'''
     r = register(self.driver)
     r.goto_register()
     r.register()
     self.assertEqual(r.pop_error_hint(), "不能为空哦")
     function.screenshot(self.driver, "register_blank.jpg")
コード例 #3
0
 def test_register_error1(self):
     '''企业不存在'''
     r = register(self.driver)
     r.goto_register()
     r.register("1", Data.email, Data.name, Data.password, Data.password)
     self.assertEqual(r.error_hint(), "注册:企业不存在")
     function.screenshot(self.driver, "bs_notexist.jpg")
コード例 #4
0
 def test_forgot_password_error1(self):
     '''邮箱地址为空'''
     f = forgotpassword(self.driver)
     f.goto_forgotpassword()
     f.send_code()
     self.assertEqual(f.error_hint(), "忘记密码:请输入正确的邮箱地址")
     function.screenshot(self.driver, "forgot_password_email_invalid.jpg")
コード例 #5
0
 def test_register_error7(self):
     '''确认密码不符'''
     r = register(self.driver)
     r.goto_register()
     r.register(Data.businesscode, Data.email, Data.name, Data.password,
                "1")
     self.assertEqual(r.pop_error_hint(), "你的输入不相同")
     function.screenshot(self.driver, "password_diff.jpg")
コード例 #6
0
 def test_register_error5(self):
     '''Email地址无效'''
     r = register(self.driver)
     r.goto_register()
     r.register(Data.businesscode, "1", Data.name, Data.password,
                Data.password)
     self.assertEqual(r.pop_error_hint(), "请输入有效的电子邮件")
     function.screenshot(self.driver, "email_invalid.jpg")
コード例 #7
0
 def test_register_error3(self):
     '''验证码不正确'''
     r = register(self.driver)
     r.goto_register()
     r.register(Data.businesscode, Data.email, Data.name, Data.password,
                Data.password, "aaaaa")
     self.assertEqual(r.error_hint(), "注册:验证码不正确")
     function.screenshot(self.driver, "code_incorrect.jpg")
コード例 #8
0
 def test_register_error2(self):
     '''邮箱重复'''
     r = register(self.driver)
     r.goto_register()
     r.register(Data.businesscode, Data.username, Data.name, Data.password,
                Data.password)
     self.assertEqual(r.error_hint(), "注册:数据库中已存在该记录")
     function.screenshot(self.driver, "email_exist.jpg")
コード例 #9
0
 def test_unselect(self):
     '''不选择任何专业'''
     s = specialmanage(self.driver)
     s.open_specialmanage()
     self.assertEqual(s.verify(), True)
     s.delete()
     self.assertEqual(s.reason(), "请选择一条数据")
     function.screenshot(self.driver, "spcial_unselect.jpg")
コード例 #10
0
 def test_loginerror8(self):
     '''用户超出限制'''
     r = register(self.driver)
     r.goto_register()
     r.register(Data.businesscode_only, Data.email, Data.name,
                Data.password, Data.password)
     self.assertEqual(r.error_hint(), "注册:用户数超出限制")
     function.screenshot(self.driver, "user_morethanlimit.jpg")
コード例 #11
0
 def test_forgot_password_error2(self):
     '''其他输入为空'''
     f = forgotpassword(self.driver)
     f.goto_forgotpassword()
     f.forgot_password(Data.realemail)
     f.save()
     self.assertEqual(f.pop_error_hint(), "不能为空哦")
     function.screenshot(self.driver, "forgot_password_blank.jpg")
コード例 #12
0
 def test_unselect(self):
     '''不选择任何设备'''
     d = devicemanage(self.driver)
     d.open_devicemanage()
     self.assertEqual(d.verify(), True)
     d.delete()
     self.assertEqual(d.reason(), "请选择一条数据")
     function.screenshot(self.driver, "device_unselect.jpg")
コード例 #13
0
 def test_status(self):
     '''专家状态修改'''
     s = session(self.driver)
     self.assertEqual(s.status(), "空闲中")
     function.screenshot(self.driver, "status_free.jpg")
     s.change_status()
     self.assertEqual(s.status(), "忙线中")
     function.screenshot(self.driver, "status_busy.jpg")
コード例 #14
0
 def test_forgot_password_error6(self):
     '''用户不存在'''
     f = forgotpassword(self.driver)
     f.goto_forgotpassword()
     f.forgot_password("*****@*****.**")
     f.send_code()
     self.assertEqual(f.error_hint(), "忘记密码:用户不存在")
     function.screenshot(self.driver, "forgot_password_user_notexist.jpg")
コード例 #15
0
 def test_unselect(self):
     '''不选择任何用户'''
     u = usermanage(self.driver)
     u.open_usermanage()
     self.assertEqual(u.verify(), True)
     u.delete()
     self.assertEqual(u.reason(), "请选择一条数据")
     function.screenshot(self.driver, "user_unselect.jpg")
コード例 #16
0
 def test_forgot_password_error4(self):
     '''密码不足6位'''
     f = forgotpassword(self.driver)
     f.goto_forgotpassword()
     f.forgot_password(Data.realemail, "1", "1", "111111")
     f.save()
     self.assertEqual(f.pop_error_hint(), "最少 6 个字")
     function.screenshot(self.driver, "forgot_password_new_less.jpg")
コード例 #17
0
 def test_forgot_password_error5(self):
     '''确认密码不符'''
     f = forgotpassword(self.driver)
     f.goto_forgotpassword()
     f.forgot_password(Data.realemail, Data.password, "1", "111111")
     f.save()
     self.assertEqual(f.pop_error_hint(), "你的输入不相同")
     function.screenshot(self.driver, "forgot_password_confirm_diff.jpg")
コード例 #18
0
 def test_unselect(self):
     '''不选择任何会话'''
     s = sessionmanage(self.driver)
     s.open_sessionmanage()
     self.assertEqual(s.verify(), True)
     s.check()
     self.assertEqual(s.reason(), "请选择一条数据")
     function.screenshot(self.driver, "session_unselect.jpg")
コード例 #19
0
 def test_unselect(self):
     '''不选择任何企业'''
     c = companymanage(self.driver)
     c.open_companymanage()
     self.assertEqual(c.verify(), True)
     c.delete()
     self.assertEqual(c.reason(), "请选择一条数据")
     function.screenshot(self.driver, "company_unselect.jpg")
コード例 #20
0
 def test_multiselect(self):
     '''选择两条会话'''
     s = sessionmanage(self.driver)
     s.open_sessionmanage()
     self.assertEqual(s.verify(), True)
     s.multi_select()
     s.delete()
     self.assertEqual(s.reason(), "只能选择一条数据")
     function.screenshot(self.driver, "session_multiselect.jpg")
コード例 #21
0
 def test_multiselect(self):
     '''选择两个专业'''
     s = specialmanage(self.driver)
     s.open_specialmanage()
     self.assertEqual(s.verify(), True)
     s.multi_select()
     s.modify()
     self.assertEqual(s.reason(), "只能选择一条数据")
     function.screenshot(self.driver, "special_multiselect.jpg")
コード例 #22
0
 def test_forgot_password_error3(self):
     '''验证码错误'''
     f = forgotpassword(self.driver)
     f.goto_forgotpassword()
     f.forgot_password(Data.realemail, Data.password, Data.password,
                       "111111")
     f.save()
     self.assertEqual(f.error_hint(), "忘记密码:验证码错误")
     function.screenshot(self.driver, "forgot_password_code_incorrect.jpg")
コード例 #23
0
 def test_modify_name_error(self):
     '''用户姓名为空'''
     p = profile(self.driver)
     p.open_profile()
     self.assertEqual(p.verify(), True)
     p.clear()
     p.profile_save()
     self.assertEqual(p.error_name(), "不能为空哦")
     function.screenshot(self.driver, "profile_name_blank.jpg")
コード例 #24
0
 def test_multiselect(self):
     '''选择两个用户'''
     u = usermanage(self.driver)
     u.open_usermanage()
     self.assertEqual(u.verify(), True)
     u.multi_select()
     u.modify()
     self.assertEqual(u.reason(), "只能选择一条数据")
     function.screenshot(self.driver, "user_multiselect.jpg")
コード例 #25
0
 def test_register(self):
     '''注册成功'''
     r = register(self.driver)
     r.goto_register()
     r.register(Data.businesscode, Data.email, Data.name, Data.password,
                Data.password)
     time.sleep(3)
     self.assertEqual(r.verify_page(), True)
     function.screenshot(self.driver, "register_success.jpg")
コード例 #26
0
 def test_multiselect(self):
     '''选择两个设备'''
     d = devicemanage(self.driver)
     d.open_devicemanage()
     self.assertEqual(d.verify(), True)
     d.multi_select()
     d.modify()
     self.assertEqual(d.reason(), "只能选择一条数据")
     function.screenshot(self.driver, "device_multiselect.jpg")
コード例 #27
0
 def test_department_modify_error3(self):
     '''把本部门设为上级部门'''
     d = departmentmanage(self.driver)
     d.open_departmentmanage()
     self.assertEqual(d.verify(), True)
     d.modify_obj()
     d.setself()
     d.add_save()
     self.assertEqual(d.reason(), "不可以指定本部门为上级部门")
     function.screenshot(self.driver, "department_modify_self.jpg")
コード例 #28
0
 def test_modify_back(self):
     '''修改部门并返回'''
     d = departmentmanage(self.driver)
     d.open_departmentmanage()
     self.assertEqual(d.verify(), True)
     d.modify_obj()
     self.assertEqual(d.sub_tagname(), "部门管理-修改")
     d.add_back()
     self.assertEqual(d.verify(), True)
     function.screenshot(self.driver, "modify_department_back.jpg")
コード例 #29
0
 def test_delete(self):
     '''删除用户'''
     u = usermanage(self.driver)
     u.open_usermanage()
     self.assertEqual(u.verify(), True)
     u.delete_obj()
     self.assertEqual(u.result(), "您确定要删除这条信息吗")
     u.confirm()
     self.assertEqual(u.result(), "删除成功")
     function.screenshot(self.driver, "delete_user.jpg")
コード例 #30
0
 def test_modify_back(self):
     '''修改企业并返回'''
     c = companymanage(self.driver)
     c.open_companymanage()
     self.assertEqual(c.verify(), True)
     c.modify_obj()
     self.assertEqual(c.sub_tagname(), "企业管理-修改")
     c.add_back()
     self.assertEqual(c.verify(), True)
     function.screenshot(self.driver, "modify_company_back.jpg")