Eolink神技之五、API自动化——定时任务


目录

Eolink神技之五、API自动化——定时任务

前言

演示步骤

一、项目创建

1.1选择API自动化测试功能

1.2添加项目

1.3引入测试用例

1.4自动化批量测试

二、创建定时任务

三、定时任务测试👍👍👍👍👍

3.1启动定时任务

3.2初创任务通知

3.3定时任务执行

3.4报告分析

四、总结

体验地址:


Eolink神技之一、基于数据库智能生成API文档

Eolink神技之二、API全生命周期管理

Eolink神技之三、钉钉API对接

Eolink神技之四、IDEA工具插件Eolink ApiKit

前言

定时的Task,相信大家工作的项目中肯定都用着呢,这个东西是在咱们工作中真的是无法少了它,很多功能都需要依靠定时任务来完成,自动化测试也一样。但是我们之前使用的工具统统没有这个功能,这回Eolink出来个这个功能是相当的给力,我知道这个功能后也是第一时间进行了测试。下面就是我整个的测试过程,希望能对大家有所帮助。

演示步骤

1、项目创建

2、创建定时任务

3、定时任务测试

一、项目创建

1.1选择API自动化测试功能

我们要测试的是定时任务,肯定是属于自动化测试,这个功能位置安排的就很合理,这里需要给GUI的产品规划点个赞。

1.2添加项目

我们既然测试一个新功能为了更加明确,我们单独创建一个新的项目。

填入自动化测试的名称以及备注,这里备注是【选填】。

1.3引入测试用例

我们需要进入到项目中为项目添加对应的测试用例。

用例采用我提供的就可以,服务是在线的MySQL,直接用即可。绝对可用,保障测试过程的顺畅。

直接复制,并制作成一个json文件。 

{"caseList":[{"caseID":553171,"caseName":"Eolink_MySQL_API","caseDesc":"","caseType":0,"caseCode":"","caseTag":"","userID":643871,"priority":0,"caseStyle":"general","commonCaseList":[],"commonCaseApiConnCaseList":[],"caseSingleList":[],"dbStepList":[{"connID":6492,"caseID":553171,"apiName":"1\u3001\u65e0\u53c2\u6570\u67e5\u8be2","dbID":1022,"caseData":"{\"params\":[],\"keepGoing\":1,\"sqlCode\":\"select * from eolink_mysql_api;\"}","orderNumber":1,"isLock":0,"delayTime":0,"matchType":2,"matchRule":"\/\/\u6570\u636e\u5e93\u8fd4\u56de\u7ed3\u679c\u6821\u9a8c\u811a\u672c\u793a\u4f8b\n\/\/\u6570\u636e\u5e93\u64cd\u4f5c\u7ed3\u679c\u793a\u4f8b\u8bf7\u67e5\u770b\u5e2e\u52a9\u4e2d\u5fc3\u6559\u7a0b\n\/\/\u6570\u636e\u5e93\u6267\u884c\u7684\u8fd4\u56de\u7ed3\u679c\u50a8\u5b58\u5728\u53d8\u91cfdb_result\u4e2d\nif(db_result[\"status\"]==\"success\"){\n\t\/\/\u6570\u636e\u5e93\u8bed\u53e5\u6574\u4f53\u6267\u884c\u6210\u529f\n\t\/\/\u6bcf\u4e00\u6761\u6570\u636e\u5e93\u8bed\u53e5\u7684\u6267\u884c\u7ed3\u679c\u50a8\u5b58\u5728db_result[\"query\"][...]\u6570\u7ec4\u4e2d\n\t\/\/\u53ef\u4ee5\u901a\u8fc7\u5982db_result[\"query\"][0][\"result\"]\u53d6\u51fa\u7b2c\u4e00\u6761\u8bed\u53e5\u6267\u884c\u7684\u8fd4\u56de\u7ed3\u679c\n\t\/\/\u53ef\u4ee5\u901a\u8fc7\u5982db_result[\"query\"][0][\"info\"][\"status\"]\u53d6\u51fa\u7b2c\u4e00\u6761\u8bed\u53e5\u6267\u884c\u7684\u72b6\u6001\n\t\/\/\u53ef\u4ee5\u901a\u8fc7\u5982db_result[\"query\"][0][\"info\"][\"time\"]\u53d6\u51fa\u7b2c\u4e00\u6761\u8bed\u53e5\u6267\u884c\u7684\u65f6\u95f4\n\teo.info(db_result[\"query\"][0][\"result\"]);\n}\nelse{\n\t\/\/\u6267\u884c\u5931\u8d25\n\teo.stop(\"\u6570\u636e\u5e93\u8bed\u53e5\u6267\u884c\u5931\u8d25\");\n}","generateResponseCode":"","updateTime":"2022-11-29 18:43:29","createTime":"2022-11-29 18:43:29","isExecute":1,"resultParam":"[]","customInfo":"{}","operationGroupID":0,"dbConnectName":"Eolink_MySQL_Test","dbCreateTime":"2022-11-29 18:25:40","dbInfo":{"dbID":1022,"dbConnectName":"Eolink_MySQL_Test","dbType":0,"dbInfoList":"[{\"envID\":0,\"port\":\"3306\",\"name\":\"eolink_test\",\"host\":\"C82b0XR5i89FWlGw6tQULUe7Ca+c6jquXsNF1UIzDZD1gP9\/Ac9cC6686FZW9zSs\",\"user\":\"Hy51ZQGees0ZX5lkDBa2xA==\",\"password\":\"NY18bypH9WTLsMMxErulHg==\"}]","dbDesc":"\u6d4b\u8bd5Eolink\u8fde\u63a5MySQL\u5e76\u521b\u5efa\u6d4b\u8bd5","createTime":"2022-11-29 18:25:40","dbCreateTime":"2022-11-29 18:25:40"}},{"connID":6493,"caseID":553171,"apiName":"2\u3001\u6709\u53c2\u67e5\u8be2\u8bed\u53e5","dbID":1022,"caseData":"{\"params\":[{\"paramKey\":\"userName\",\"paramNotNull\":\"0\",\"paramInfo\":\"Eolink_admin\"}],\"keepGoing\":1,\"sqlCode\":\"select * from eolink_mysql_api where userName = '${userName}';\"}","orderNumber":2,"isLock":0,"delayTime":0,"matchType":2,"matchRule":"\nif(db_result[\"status\"]==\"success\"){\n\tif(db_result[\"query\"][0][\"result\"][0][\"userName\"]==\"Eolink_admin\"){\n\t    eo.info(\"\u67e5\u8be2\u7ed3\u679c\u7684userName\u662fEolink_admin\u6240\u4ee5\u6d4b\u8bd5\u6210\u529f\");\n\t}else{\n\t    eo.stop(\"\u8fd4\u56de\u7ed3\u679c\u4e0e\u9700\u6c42\u4e0d\u7b26\");\n\t}\n}\nelse{\n\t\/\/\u6267\u884c\u5931\u8d25\n\teo.stop(\"\u6570\u636e\u5e93\u8bed\u53e5\u6267\u884c\u5931\u8d25\");\n}","generateResponseCode":"","updateTime":"2022-11-29 18:57:50","createTime":"2022-11-29 18:54:46","isExecute":1,"resultParam":"[]","customInfo":"{}","operationGroupID":0,"dbConnectName":"Eolink_MySQL_Test","dbCreateTime":"2022-11-29 18:25:40","dbInfo":{"dbID":1022,"dbConnectName":"Eolink_MySQL_Test","dbType":0,"dbInfoList":"[{\"envID\":0,\"port\":\"3306\",\"name\":\"eolink_test\",\"host\":\"C82b0XR5i89FWlGw6tQULUe7Ca+c6jquXsNF1UIzDZD1gP9\/Ac9cC6686FZW9zSs\",\"user\":\"Hy51ZQGees0ZX5lkDBa2xA==\",\"password\":\"NY18bypH9WTLsMMxErulHg==\"}]","dbDesc":"\u6d4b\u8bd5Eolink\u8fde\u63a5MySQL\u5e76\u521b\u5efa\u6d4b\u8bd5","createTime":"2022-11-29 18:25:40","dbCreateTime":"2022-11-29 18:25:40"}},{"connID":6494,"caseID":553171,"apiName":"\u589e\u52a0\u8bed\u53e5","dbID":1022,"caseData":"{\"params\":[{\"paramKey\":\"phone\",\"paramNotNull\":\"0\",\"paramInfo\":\"13472040766\"},{\"paramKey\":\"userName\",\"paramNotNull\":\"0\",\"paramInfo\":\"Eolink_super_admin\"},{\"paramKey\":\"pwd\",\"paramNotNull\":\"0\",\"paramInfo\":\"123456\"},{\"paramKey\":\"introduce\",\"paramNotNull\":\"0\",\"paramInfo\":\"\u4e13\u4e3a\u5f00\u53d1\u8005\u8bbe\u8ba1\u7684API\u534f\u4f5c\u5e73\u53f0\"}],\"keepGoing\":1,\"sqlCode\":\"insert into eolink_mysql_api VALUES(0,NOW(),NOW(),'${phone}','${userName}','${pwd}','${introduce}');\"}","orderNumber":3,"isLock":0,"delayTime":0,"matchType":2,"matchRule":"\/\/\u6570\u636e\u5e93\u8fd4\u56de\u7ed3\u679c\u6821\u9a8c\u811a\u672c\u793a\u4f8b\n\/\/\u6570\u636e\u5e93\u64cd\u4f5c\u7ed3\u679c\u793a\u4f8b\u8bf7\u67e5\u770b\u5e2e\u52a9\u4e2d\u5fc3\u6559\u7a0b\n\/\/\u6570\u636e\u5e93\u6267\u884c\u7684\u8fd4\u56de\u7ed3\u679c\u50a8\u5b58\u5728\u53d8\u91cfdb_result\u4e2d\nif(db_result[\"status\"]==\"success\"){\n\t\/\/\u6570\u636e\u5e93\u8bed\u53e5\u6574\u4f53\u6267\u884c\u6210\u529f\n\t\/\/\u6bcf\u4e00\u6761\u6570\u636e\u5e93\u8bed\u53e5\u7684\u6267\u884c\u7ed3\u679c\u50a8\u5b58\u5728db_result[\"query\"][...]\u6570\u7ec4\u4e2d\n\t\/\/\u53ef\u4ee5\u901a\u8fc7\u5982db_result[\"query\"][0][\"result\"]\u53d6\u51fa\u7b2c\u4e00\u6761\u8bed\u53e5\u6267\u884c\u7684\u8fd4\u56de\u7ed3\u679c\n\t\/\/\u53ef\u4ee5\u901a\u8fc7\u5982db_result[\"query\"][0][\"info\"][\"status\"]\u53d6\u51fa\u7b2c\u4e00\u6761\u8bed\u53e5\u6267\u884c\u7684\u72b6\u6001\n\t\/\/\u53ef\u4ee5\u901a\u8fc7\u5982db_result[\"query\"][0][\"info\"][\"time\"]\u53d6\u51fa\u7b2c\u4e00\u6761\u8bed\u53e5\u6267\u884c\u7684\u65f6\u95f4\n\teo.info(db_result[\"query\"][0][\"result\"]);\n}\nelse{\n\t\/\/\u6267\u884c\u5931\u8d25\n\teo.stop(\"\u6570\u636e\u5e93\u8bed\u53e5\u6267\u884c\u5931\u8d25\");\n}","generateResponseCode":"","updateTime":"2022-11-29 19:02:02","createTime":"2022-11-29 19:02:02","isExecute":1,"resultParam":"[]","customInfo":"{}","operationGroupID":0,"dbConnectName":"Eolink_MySQL_Test","dbCreateTime":"2022-11-29 18:25:40","dbInfo":{"dbID":1022,"dbConnectName":"Eolink_MySQL_Test","dbType":0,"dbInfoList":"[{\"envID\":0,\"port\":\"3306\",\"name\":\"eolink_test\",\"host\":\"C82b0XR5i89FWlGw6tQULUe7Ca+c6jquXsNF1UIzDZD1gP9\/Ac9cC6686FZW9zSs\",\"user\":\"Hy51ZQGees0ZX5lkDBa2xA==\",\"password\":\"NY18bypH9WTLsMMxErulHg==\"}]","dbDesc":"\u6d4b\u8bd5Eolink\u8fde\u63a5MySQL\u5e76\u521b\u5efa\u6d4b\u8bd5","createTime":"2022-11-29 18:25:40","dbCreateTime":"2022-11-29 18:25:40"}},{"connID":6495,"caseID":553171,"apiName":"\u5220\u9664\u8bed\u53e5","dbID":1022,"caseData":"{\"params\":[{\"paramKey\":\"phone\",\"paramNotNull\":\"0\",\"paramInfo\":\"13472040766\"}],\"keepGoing\":1,\"sqlCode\":\"DELETE from eolink_mysql_api where phone = '${phone}';\"}","orderNumber":4,"isLock":0,"delayTime":0,"matchType":2,"matchRule":"\/\/\u6570\u636e\u5e93\u8fd4\u56de\u7ed3\u679c\u6821\u9a8c\u811a\u672c\u793a\u4f8b\n\/\/\u6570\u636e\u5e93\u64cd\u4f5c\u7ed3\u679c\u793a\u4f8b\u8bf7\u67e5\u770b\u5e2e\u52a9\u4e2d\u5fc3\u6559\u7a0b\n\/\/\u6570\u636e\u5e93\u6267\u884c\u7684\u8fd4\u56de\u7ed3\u679c\u50a8\u5b58\u5728\u53d8\u91cfdb_result\u4e2d\nif(db_result[\"status\"]==\"success\"){\n\t\/\/\u6570\u636e\u5e93\u8bed\u53e5\u6574\u4f53\u6267\u884c\u6210\u529f\n\t\/\/\u6bcf\u4e00\u6761\u6570\u636e\u5e93\u8bed\u53e5\u7684\u6267\u884c\u7ed3\u679c\u50a8\u5b58\u5728db_result[\"query\"][...]\u6570\u7ec4\u4e2d\n\t\/\/\u53ef\u4ee5\u901a\u8fc7\u5982db_result[\"query\"][0][\"result\"]\u53d6\u51fa\u7b2c\u4e00\u6761\u8bed\u53e5\u6267\u884c\u7684\u8fd4\u56de\u7ed3\u679c\n\t\/\/\u53ef\u4ee5\u901a\u8fc7\u5982db_result[\"query\"][0][\"info\"][\"status\"]\u53d6\u51fa\u7b2c\u4e00\u6761\u8bed\u53e5\u6267\u884c\u7684\u72b6\u6001\n\t\/\/\u53ef\u4ee5\u901a\u8fc7\u5982db_result[\"query\"][0][\"info\"][\"time\"]\u53d6\u51fa\u7b2c\u4e00\u6761\u8bed\u53e5\u6267\u884c\u7684\u65f6\u95f4\n\teo.info(db_result[\"query\"][0][\"result\"]);\n}\nelse{\n\t\/\/\u6267\u884c\u5931\u8d25\n\teo.stop(\"\u6570\u636e\u5e93\u8bed\u53e5\u6267\u884c\u5931\u8d25\");\n}","generateResponseCode":"","updateTime":"2022-11-29 19:05:31","createTime":"2022-11-29 19:05:11","isExecute":1,"resultParam":"[]","customInfo":"{}","operationGroupID":0,"dbConnectName":"Eolink_MySQL_Test","dbCreateTime":"2022-11-29 18:25:40","dbInfo":{"dbID":1022,"dbConnectName":"Eolink_MySQL_Test","dbType":0,"dbInfoList":"[{\"envID\":0,\"port\":\"3306\",\"name\":\"eolink_test\",\"host\":\"C82b0XR5i89FWlGw6tQULUe7Ca+c6jquXsNF1UIzDZD1gP9\/Ac9cC6686FZW9zSs\",\"user\":\"Hy51ZQGees0ZX5lkDBa2xA==\",\"password\":\"NY18bypH9WTLsMMxErulHg==\"}]","dbDesc":"\u6d4b\u8bd5Eolink\u8fde\u63a5MySQL\u5e76\u521b\u5efa\u6d4b\u8bd5","createTime":"2022-11-29 18:25:40","dbCreateTime":"2022-11-29 18:25:40"}},{"connID":6496,"caseID":553171,"apiName":"\u4fee\u6539\u8bed\u53e5","dbID":1022,"caseData":"{\"params\":[{\"paramKey\":\"pwd\",\"paramNotNull\":\"0\",\"paramInfo\":\"123456\"},{\"paramKey\":\"userName\",\"paramNotNull\":\"0\",\"paramInfo\":\"Eolink_admin\"}],\"keepGoing\":1,\"sqlCode\":\"update eolink_mysql_api set pwd =PASSWORD('${pwd}') where userName = '${userName}';\"}","orderNumber":5,"isLock":0,"delayTime":0,"matchType":2,"matchRule":"\/\/\u6570\u636e\u5e93\u8fd4\u56de\u7ed3\u679c\u6821\u9a8c\u811a\u672c\u793a\u4f8b\n\/\/\u6570\u636e\u5e93\u64cd\u4f5c\u7ed3\u679c\u793a\u4f8b\u8bf7\u67e5\u770b\u5e2e\u52a9\u4e2d\u5fc3\u6559\u7a0b\n\/\/\u6570\u636e\u5e93\u6267\u884c\u7684\u8fd4\u56de\u7ed3\u679c\u50a8\u5b58\u5728\u53d8\u91cfdb_result\u4e2d\nif(db_result[\"status\"]==\"success\"){\n\t\/\/\u6570\u636e\u5e93\u8bed\u53e5\u6574\u4f53\u6267\u884c\u6210\u529f\n\t\/\/\u6bcf\u4e00\u6761\u6570\u636e\u5e93\u8bed\u53e5\u7684\u6267\u884c\u7ed3\u679c\u50a8\u5b58\u5728db_result[\"query\"][...]\u6570\u7ec4\u4e2d\n\t\/\/\u53ef\u4ee5\u901a\u8fc7\u5982db_result[\"query\"][0][\"result\"]\u53d6\u51fa\u7b2c\u4e00\u6761\u8bed\u53e5\u6267\u884c\u7684\u8fd4\u56de\u7ed3\u679c\n\t\/\/\u53ef\u4ee5\u901a\u8fc7\u5982db_result[\"query\"][0][\"info\"][\"status\"]\u53d6\u51fa\u7b2c\u4e00\u6761\u8bed\u53e5\u6267\u884c\u7684\u72b6\u6001\n\t\/\/\u53ef\u4ee5\u901a\u8fc7\u5982db_result[\"query\"][0][\"info\"][\"time\"]\u53d6\u51fa\u7b2c\u4e00\u6761\u8bed\u53e5\u6267\u884c\u7684\u65f6\u95f4\n\teo.info(db_result[\"query\"][0][\"result\"]);\n}\nelse{\n\t\/\/\u6267\u884c\u5931\u8d25\n\teo.stop(\"\u6570\u636e\u5e93\u8bed\u53e5\u6267\u884c\u5931\u8d25\");\n}","generateResponseCode":"","updateTime":"2022-11-29 19:07:42","createTime":"2022-11-29 19:07:42","isExecute":1,"resultParam":"[]","customInfo":"{}","operationGroupID":0,"dbConnectName":"Eolink_MySQL_Test","dbCreateTime":"2022-11-29 18:25:40","dbInfo":{"dbID":1022,"dbConnectName":"Eolink_MySQL_Test","dbType":0,"dbInfoList":"[{\"envID\":0,\"port\":\"3306\",\"name\":\"eolink_test\",\"host\":\"C82b0XR5i89FWlGw6tQULUe7Ca+c6jquXsNF1UIzDZD1gP9\/Ac9cC6686FZW9zSs\",\"user\":\"Hy51ZQGees0ZX5lkDBa2xA==\",\"password\":\"NY18bypH9WTLsMMxErulHg==\"}]","dbDesc":"\u6d4b\u8bd5Eolink\u8fde\u63a5MySQL\u5e76\u521b\u5efa\u6d4b\u8bd5","createTime":"2022-11-29 18:25:40","dbCreateTime":"2022-11-29 18:25:40"}},{"connID":6497,"caseID":553171,"apiName":"\u89c6\u56fe\u67e5\u8be2","dbID":1022,"caseData":"{\"params\":[],\"keepGoing\":1,\"sqlCode\":\"select * from eolink_view;\"}","orderNumber":6,"isLock":0,"delayTime":0,"matchType":2,"matchRule":"\/\/\u6570\u636e\u5e93\u8fd4\u56de\u7ed3\u679c\u6821\u9a8c\u811a\u672c\u793a\u4f8b\n\/\/\u6570\u636e\u5e93\u64cd\u4f5c\u7ed3\u679c\u793a\u4f8b\u8bf7\u67e5\u770b\u5e2e\u52a9\u4e2d\u5fc3\u6559\u7a0b\n\/\/\u6570\u636e\u5e93\u6267\u884c\u7684\u8fd4\u56de\u7ed3\u679c\u50a8\u5b58\u5728\u53d8\u91cfdb_result\u4e2d\nif(db_result[\"status\"]==\"success\"){\n\t\/\/\u6570\u636e\u5e93\u8bed\u53e5\u6574\u4f53\u6267\u884c\u6210\u529f\n\t\/\/\u6bcf\u4e00\u6761\u6570\u636e\u5e93\u8bed\u53e5\u7684\u6267\u884c\u7ed3\u679c\u50a8\u5b58\u5728db_result[\"query\"][...]\u6570\u7ec4\u4e2d\n\t\/\/\u53ef\u4ee5\u901a\u8fc7\u5982db_result[\"query\"][0][\"result\"]\u53d6\u51fa\u7b2c\u4e00\u6761\u8bed\u53e5\u6267\u884c\u7684\u8fd4\u56de\u7ed3\u679c\n\t\/\/\u53ef\u4ee5\u901a\u8fc7\u5982db_result[\"query\"][0][\"info\"][\"status\"]\u53d6\u51fa\u7b2c\u4e00\u6761\u8bed\u53e5\u6267\u884c\u7684\u72b6\u6001\n\t\/\/\u53ef\u4ee5\u901a\u8fc7\u5982db_result[\"query\"][0][\"info\"][\"time\"]\u53d6\u51fa\u7b2c\u4e00\u6761\u8bed\u53e5\u6267\u884c\u7684\u65f6\u95f4\n\teo.info(db_result[\"query\"][0][\"result\"]);\n}\nelse{\n\t\/\/\u6267\u884c\u5931\u8d25\n\teo.stop(\"\u6570\u636e\u5e93\u8bed\u53e5\u6267\u884c\u5931\u8d25\");\n}","generateResponseCode":"","updateTime":"2022-11-29 19:09:55","createTime":"2022-11-29 19:09:55","isExecute":1,"resultParam":"[]","customInfo":"{}","operationGroupID":0,"dbConnectName":"Eolink_MySQL_Test","dbCreateTime":"2022-11-29 18:25:40","dbInfo":{"dbID":1022,"dbConnectName":"Eolink_MySQL_Test","dbType":0,"dbInfoList":"[{\"envID\":0,\"port\":\"3306\",\"name\":\"eolink_test\",\"host\":\"C82b0XR5i89FWlGw6tQULUe7Ca+c6jquXsNF1UIzDZD1gP9\/Ac9cC6686FZW9zSs\",\"user\":\"Hy51ZQGees0ZX5lkDBa2xA==\",\"password\":\"NY18bypH9WTLsMMxErulHg==\"}]","dbDesc":"\u6d4b\u8bd5Eolink\u8fde\u63a5MySQL\u5e76\u521b\u5efa\u6d4b\u8bd5","createTime":"2022-11-29 18:25:40","dbCreateTime":"2022-11-29 18:25:40"}}],"dbStepApiConnCaseList":[],"dataCollectionData":null}],"commonDatabasesList":[{"dbID":1022,"dbConnectName":"Eolink_MySQL_Test","dbType":0,"dbInfoList":"[{\"envID\":0,\"port\":\"3306\",\"name\":\"eolink_test\",\"host\":\"C82b0XR5i89FWlGw6tQULUe7Ca+c6jquXsNF1UIzDZD1gP9\/Ac9cC6686FZW9zSs\",\"user\":\"Hy51ZQGees0ZX5lkDBa2xA==\",\"password\":\"NY18bypH9WTLsMMxErulHg==\"}]","dbDesc":"\u6d4b\u8bd5Eolink\u8fde\u63a5MySQL\u5e76\u521b\u5efa\u6d4b\u8bd5","createTime":"2022-11-29 18:25:40","updateTime":"2022-11-29 18:25:40"}],"caseType":"sceneCase"}

 在添加分组的下拉菜单中选择【导入】

点击添加*.json文件,选择我们 

我们可以看到文件名,看到后代表选择成功过,点击确定进行上传。

我们上传的过程中需要稍等一会,这里有2个步骤。

步骤一、上传json文件

步骤二、解析导入的json文件

理论上有步骤三,这里少了一步异步刷新。

稍等一会也就完成了。

我们需要主动的点击刷新进行列表刷新,点击用例,进入用例查看API。 

用例导入成功:

1.4自动化批量测试

我们先自行手动进行批量测试,一会在设定【定时任务】测试。

我们这里可以通过ID右侧的checkbox来全选所有的API,勾选完成后我们点击指针指示的执行测试来进行批量自动化测试。 

测试通过后会返回测试结果。我们可以在测试结果中看到所有的API都是测试通过的。 

二、创建定时任务

我们需要切换到【定时任务】操作面板,选择【添加定时任务】功能。 

输入定时任务名称,备注是选填的,选择测试的时间,这里给定的时间分为多种。

我们需要根据自己的接口测试目的,人员负责的内容进行选择性通知。可以批量选择邮箱通知,这是个好功能,非常赞同。 

定时到19:00,因为马上就要到了,我用的是12小时的显示方式。故而显示6:57PM。

三、定时任务测试👍👍👍👍👍

3.1启动定时任务

设置完毕后我们选择保存。保存后会跳回到【定时任务】面板。在此面板中我们能看到刚创建的定时任务,在最右侧的更多下拉菜单中有【执行】操作,我们点击执行。 

可以看到【成功】的提示字样,当前的时间是:【18:58】,我们初创任务会默认执行一次。

3.2初创任务通知

默认执行的操作,收到邮件通知:

在邮件中我们能看到测试的结果与数据。当前时间马上到19:00我们再稍等一会等待定时任务。

3.3定时任务执行

刚刚到定时时间,我们查看定时任务,在此可以看到她的状态为测试中。那么很明显,我们的定时任务已经开始执行Eolink的UE还是很不错的,知道这个时候应该给个状态提示。

正式定时任务通知,时间【19:00】我是【7:00PM】。

邮件通知信息,我这里稍微计算了一下总用时。

测试完毕状态修改。 

3.4报告分析

这里对报告的详情都给了一定的分析,为了展示这个数据我积攒了好久的数据呢。

 下面是具体的定时任务列表:

四、总结

super,真是开发测试必备良品,总结一下开发与测试的具体使用步骤:

1、通过Eolink的自动注释工具进行全代码注释

2、通过一键上传API的方式上传到Eolink的的API用例中

3、通过自动化API测试创建项目,引入API用例

4、批量测试通过率

5、创建定时任务

6、设置测试接口与通知人员

7、等着收邮件👍👍👍👍👍

体验地址:

API自动化——定时任务

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐