Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a3d538c

Browse files
committed
优化自动化接口回归测试下载文件的名称
1 parent a2204c8 commit a3d538c

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

js/main.js

+13-8
Original file line numberDiff line numberDiff line change
@@ -1299,8 +1299,13 @@
12991299
alert('请先输入有效的URL!')
13001300
return
13011301
}
1302-
if (baseUrl.indexOf('/apijson.cn') >= 0 || baseUrl.indexOf('/39.108.143.172') >= 0) {
1303-
alert('请把URL改成你自己的!')
1302+
//开放测试
1303+
// if (baseUrl.indexOf('/apijson.cn') >= 0 || baseUrl.indexOf('/39.108.143.172') >= 0) {
1304+
// alert('请把URL改成你自己的!\n例如 http://localhost:8080')
1305+
// return
1306+
// }
1307+
if (baseUrl.indexOf('/apijson.org') >= 0) {
1308+
alert('请把URL改成 http://apijson.cn:8080 或 你自己的!\n例如 http://localhost:8080')
13041309
return
13051310
}
13061311
const list = App.remotes || []
@@ -1385,9 +1390,9 @@
13851390
downloadTest: function (index, item) {
13861391
saveTextAs(
13871392
'# APIJSON自动化回归测试-前\n主页: https://github.com/TommyLemon/APIJSON'
1388-
+ '\n\n接口: ' + (item.version > 0 ? 'V' + item.version : 'V*') + ' ' + item.name
1389-
+ '\nResponse: \n' + JSON.stringify(JSON.parse(item.response || '{}'), null, ' ')
1390-
, 'APIJSON自动化回归测试-前.txt'
1393+
+ '\n\n接口名称: \n' + (item.version > 0 ? 'V' + item.version : 'V*') + ' ' + item.name
1394+
+ '\n返回结果: \n' + JSON.stringify(JSON.parse(item.response || '{}'), null, ' ')
1395+
, '测试:' + item.name + '-前.txt'
13911396
)
13921397

13931398
/**
@@ -1400,9 +1405,9 @@
14001405
var tests = App.tests || {}
14011406
saveTextAs(
14021407
'# APIJSON自动化回归测试-后\n主页: https://github.com/TommyLemon/APIJSON'
1403-
+ '\n\n接口: ' + (item.version > 0 ? 'V' + item.version : 'V*') + ' ' + item.name
1404-
+ '\nResponse: \n' + JSON.stringify(JSON.parse(tests[item.id] || '{}'), null, ' ')
1405-
, 'APIJSON自动化回归测试-后.txt'
1408+
+ '\n\n接口名称: \n' + (item.version > 0 ? 'V' + item.version : 'V*') + ' ' + item.name
1409+
+ '\n返回结果: \n' + JSON.stringify(JSON.parse(tests[item.id] || '{}'), null, ' ')
1410+
, '测试:' + item.name + '-后.txt'
14061411
)
14071412
}, 5000)
14081413

0 commit comments

Comments
 (0)