GitHub地址:https://github.com/leonInShanghai/InterfaceAutomation
这个dome 请求 https://www.v2ex.com/api/nodes/show.json?name=python 接口
使用OK HTTP框架网络请求
使用fastjson框架解析数据
{
"avatar_large": "//cdn.v2ex.com/navatar/8613/985e/90_large.png?m=1564378564",
"name": "python",
"avatar_normal": "//cdn.v2ex.com/navatar/8613/985e/90_normal.png?m=1564378564",
"title": "Python",
"url": "https://www.v2ex.com/go/python",
"topics": 11896,
"footer": "",
"header": "这里讨论各种 Python 语言编程话题,也包括 Django,Tornado 等框架的讨论。这里是一个能够帮助你解决实际问题的地方。",
"title_alternative": "Python",
"avatar_mini": "//cdn.v2ex.com/navatar/8613/985e/90_mini.png?m=1564378564",
"stars": 8248,
"root": false,
"id": 90,
"parent_node_name": "programming"
}
"avatar_large": "//cdn.v2ex.com/navatar/8613/985e/90_large.png?m=1564378564",
"name": "python",
"avatar_normal": "//cdn.v2ex.com/navatar/8613/985e/90_normal.png?m=1564378564",
"title": "Python",
"url": "https://www.v2ex.com/go/python",
"topics": 11896,
"footer": "",
"header": "这里讨论各种 Python 语言编程话题,也包括 Django,Tornado 等框架的讨论。这里是一个能够帮助你解决实际问题的地方。",
"title_alternative": "Python",
"avatar_mini": "//cdn.v2ex.com/navatar/8613/985e/90_mini.png?m=1564378564",
"stars": 8248,
"root": false,
"id": 90,
"parent_node_name": "programming"
}
对请求回来的参数做断言 assertEquals(v2exNode.getName(),nodeName);
最后生成html格式测试报告