eval()函数
自动执行excel登陆接口测试用例
自动执行excel登陆接口测试用例
初始化sql:sqls01.txt
用例:login.xlsx (data,expect)
case_name | data | expect |
测试登陆成功 | {'username':'test01','password':'123456'} | 登录成功 |
测试用户名为空 | {'username':'','password':'123456'} | 用户名或密码为空 |
测试密码为空 | {'username':'test01','password':''} | 用户名或密码为空 |
测试用户名和密码为空 | {'username':'','password':''} | 用户名或密码为空 |
测试用户名错误 | {'username':'test001','password':'123456'} | 用户名或密码错误 |
测试密码错误 | {'username':'test01','password':'123'} | 用户名或密码错误 |
测试用户密码都错误 | {'username':'test001','password':'1236'} | 用户名或密码错误 |
自动化执行Excel注册接口用例
case_name | data | expect | expect_sql | expect_db_rows |
软件注册成功 | {'username':'test02','password':'123456','confirm':'123456','name':'测试02'} | {'Status': 1000, 'Result': 'Success', 'Message': '注册成功'} | select count(*) from user where username='test02' | 1 |
测试用户名被占用 | {'username':'test03','password':'123456','confirm':'123456','name':'测试03'} | {'Status': 1003, 'Result': 'Username test03 is taken', 'Message': '用户名已被占用'} | select count(*) from user where username='test03' | 1 |
测试两个密码不一致 | {'username':'test04','password':'123456','confirm':'1234','name':'测试04'} | {'Status': 1002, 'Result': 'Password Not Compare', 'Message': '两次输入密码的不一致'} | select count(*) from user where username='test04' | 0 |
测试用户名为空 | {'username':'','password':'123456','confirm':'123456','name':'测试07'} | {'Status': 1001, 'Result': 'Input Incomplete', 'Message': '输入信息不完整'} | select count(*) from user where username='' | 0 |
测试密码为空 | {'username':'test05','password':'','confirm':'123456','name':'测试05'} | {'Status': 1001, 'Result': 'Input Incomplete', 'Message': '输入信息不完整'} | select count(*) from user where username='test05' | 0 |
测试确认密码为空 | {'username':'test06','password':'123456','confirm':'','name':'测试06'} | {'Status': 1001, 'Result': 'Input Incomplete', 'Message': '输入信息不完整'} | select count(*) from user where username='test06' | 0 |
测试用户名密码确认密码均为空 | {'username':'','password':'','confirm':'','name':''} | {'Status': 1001, 'Result': 'Input Incomplete', 'Message': '输入信息不完整'} | select count(*) from user where username='' | 0 |
作者:暄总-tester,