其实做到现在,大家知道为什么我给了2个demo讲述json管理用例吗?
你写完会发现很头疼,没办法直观感受到用例设计的快乐。
为了拼接而拼接。就跟我去设计用例的时候,要设计json文件,简单点的像登录还好说:
{
"url": "/login",
"method": "GET",
"headers":
{"Content-Type":"application/x-www-form-urlencoded"},
"casedata":
[
[{"caseNo": "01"},{"caseName": "正常登录"},{"reqParam": {"username":"admin","password":"123456"}}],
[{"caseNo": "02"},{"caseName": "登录-用户名错误"},{"reqParam": {"username":"admin111","password":"123456"}}],
[{"caseNo": "03"},{"caseName": "登录-密码错误"},{"reqParam": {"username":"admin","password":"123456111"}}]
]
}
一旦长起来的的,比如下面的这个添加线索:
{"url": "/CrmLeads/addOrUpdate", "method": "POST", "headers": {"Content-Type": "application/json", "Admin-Token": "44669243e3ff4151a37456913a6b7ec1"}, "casedata": [[{"entity": {"leads_name": "\u6536\u5230\u5c31\u597d2", "telephone": "15991710522", "mobile": "15991710522", "address": "111", "next_time": "2024-01-08 00:00:00", "remark": "11111111"}, "field": [{"fieldId": 2, "formType": "select", "isNull": 0, "name": "\u7ebf\u7d22\u6765\u6e90", "options": "\u4fc3\u9500,\u641c\u7d22\u5f15\u64ce,\u5e7f\u544a,\u8f6c\u4ecb\u7ecd,\u7ebf\u4e0a\u6ce8\u518c,\u7ebf\u4e0a\u8be2\u4ef7,\u9884\u7ea6\u4e0a\u95e8,\u7535\u8bdd\u54a8\u8be2,\u90ae\u4ef6\u54a8\u8be