霍格沃兹测试开发学社
UI 自动化测试 | 接口自动化测试 | |
---|---|---|
成本 | ⭐️⭐️⭐️ | ⭐️ |
测试效率 | ⭐️⭐️ | ⭐️⭐️⭐️⭐️⭐️ |
用例编写效率 | ⭐️⭐️ | ⭐️⭐️⭐️⭐️⭐️ |
稳定性 | ⭐️⭐️⭐️ | ⭐️⭐️⭐️⭐️⭐️ |
自动化回归测试效率 | ⭐️⭐️⭐️ | ⭐️⭐️⭐️⭐️⭐️ |
测试覆盖度 | ⭐️⭐️ | ⭐️⭐️⭐️⭐️⭐️ |
自动生成用例成本 | ⭐️⭐️ | ⭐️⭐️⭐️⭐️⭐️ |
测试类型 | 工具 | 价值 |
---|---|---|
接口抓包 | Charles 、Fiddler |
接口抓包工具,抓取 App 的数据包 |
接口测试 | Postman 、ApiFox |
接口调试工具,接口手工测试工具,学习成本低,直接安装即可使用 |
接口自动化测试 | Java:HttpClient 、RestAssured 、OkHttp 、httprunner4j Python: requests 、httprunner |
用于接口自动化测试的 Java 、Python 第三方库,需要与对应编程语言结合使用 |
性能测试 | JMeter |
性能测试工具 |
body校验
code校验
说明 | 参数 |
---|---|
请求网址 | https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=ID&corpsecret=SECRET |
方法 | GET |
备注 | 获取企业微信token; 输入参数corpid{企业ID}、corpsecret |
响应模版 | {"errcode":0,"errmsg":"ok","access_token":"hMiJ_ldUZYXKPgiXHw","expires_in":7200} |
断言 | 请求状态码是否为200 |
断言 | errcode是否为0 |
{
"errcode": 40001,
"errmsg": "invalid credential, hint: [1671072990531330938904458], from ip: 120.245.114.24, more info at https://open.work.weixin.qq.com/devtool/query?e=40001"
}
{
"errcode": 60009,
"errmsg": "department name include invalid char, hint: [1671089685500610887641103], from ip: , more info at https://open.work.weixin.qq.com/devtool/query?e=60009"
}
contentType
参数为application/json; charset=utf-8
<!-- 随机测试数据生成库 -->
<dependency>
<groupId>com.apifan.common</groupId>
<artifactId>common-random</artifactId>
<version>1.0.18</version>
</dependency>
<!-- json path 解析json文件 -->
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<version>${json-path.version}</version>
</dependency>
depart-schema.json
matchesJsonSchemaInClasspath
是从中静态导入io.restassured.module.jsv.JsonSchemaValidator
的,建议静态导入此类中的所有方法