1 用moco模拟接口
[ { "description": "login interface", "request": { "uri": "/demo/login", "method": "post", "json": { "username": "lww", "password": "MTIzNDU2", "rememberme": "True" } }, "response": { "headers":{ "Content-Type":"text/html;charset=gbk" }, "cookies": { "RK": "111111", "uuid": "1" }, "status": "200", "json": { "uid": "1", "resultCode": "000000" } } }, { "description": "登陆成功之后获取导航列表", "request": { "uri": "/demo/getNavigation", "method": "post", "cookies": { "RK": "111111", "uuid": "1" }, "json": { "TypeId": "1" } }, "response": { "headers":{ "Content-Type":"text/html;charset=gbk" }, "status": 200, "json": { "resultCode": "000000", "message": "获取导航列表成功" } } } ]
2 har2case /path 转成json格式的测试用例, har2case -2y 转成yaml格式, 可以指定路径和名称, 不指定默认在同一目录下生成同名不同后缀的测试用例
3 hrun /path 生成测试用例
原文:https://www.cnblogs.com/sailfan/p/10591547.html