runner-runtime 1.0.43 → 1.0.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/events/api.js +21 -14
- package/events/index.js +2 -2
- package/index.js +1 -1
- package/libs/utils.js +18 -1
- package/package.json +1 -1
- package/tmp/request.js +313 -130
package/events/api.js
CHANGED
|
@@ -9,7 +9,7 @@ const FileType = require("file-type"),
|
|
|
9
9
|
tough = require("tough-cookie"),
|
|
10
10
|
Buffer = require("buffer/").Buffer,
|
|
11
11
|
isImage = require("is-image");
|
|
12
|
-
const { getAPIFromCollection, smartUrlJoin, replace2RegExp, getParentTargetIDs, base64toCacheFile, getInsideVariables, getCaseInsensitive, camelCaseToSnakeCase } = require('../libs/utils'),
|
|
12
|
+
const { getAPIFromCollection, smartUrlJoin, replace2RegExp, getParentTargetIDs,encodeURIComponentUnique, base64toCacheFile, getInsideVariables, getCaseInsensitive, camelCaseToSnakeCase } = require('../libs/utils'),
|
|
13
13
|
{ generateHarFromRequest } = require('../libs/2har'),
|
|
14
14
|
|
|
15
15
|
_ = require('lodash');
|
|
@@ -22,6 +22,7 @@ const { v4: uuidv4 } = require("uuid");
|
|
|
22
22
|
const fs = require("fs");
|
|
23
23
|
const { minimatch } = require("minimatch");
|
|
24
24
|
const runtime = require("postman-runtime-pro");
|
|
25
|
+
const { error } = require("console");
|
|
25
26
|
|
|
26
27
|
// 将api转postman请求参数
|
|
27
28
|
const convert2PostmanRequest = (request, option) => {
|
|
@@ -389,7 +390,10 @@ const convert2PostmanRequest = (request, option) => {
|
|
|
389
390
|
}
|
|
390
391
|
}
|
|
391
392
|
}
|
|
392
|
-
} catch (e) {
|
|
393
|
+
} catch (e) {
|
|
394
|
+
|
|
395
|
+
console.log(e)
|
|
396
|
+
}
|
|
393
397
|
|
|
394
398
|
// 处理body
|
|
395
399
|
const body = {};
|
|
@@ -552,7 +556,7 @@ const convert2PostmanOptions = (request, option, variables) => {
|
|
|
552
556
|
const globals = new sdk.VariableScope({
|
|
553
557
|
values: globalsVariables,
|
|
554
558
|
});
|
|
555
|
-
|
|
559
|
+
console.log(JSON.stringify(variables, null,2))
|
|
556
560
|
const requester = {
|
|
557
561
|
strictSSL: false,
|
|
558
562
|
protocolVersion: requestJson?.protocol == 'http/1.1' ? 'http1' : 'http2',
|
|
@@ -1176,11 +1180,11 @@ const convert2PostmanEvent = (request, listen, option) => {
|
|
|
1176
1180
|
}else if(_.get(assertObjectData, "data.type") == 'responseSize'){
|
|
1177
1181
|
expertData = pm.response.responseSize;
|
|
1178
1182
|
}else if(_.get(assertObjectData, "data.type") == 'tempVars'){
|
|
1179
|
-
expertData = pm.variables.get(_.get(assertObjectData, "data.expression.path"));
|
|
1183
|
+
expertData = pm.variables.get(_.trim(_.get(assertObjectData, "data.expression.path"), '{}'));
|
|
1180
1184
|
}else if(_.get(assertObjectData, "data.type") == 'envVars'){
|
|
1181
|
-
expertData = pm.environment.get(_.get(assertObjectData, "data.expression.path"));
|
|
1185
|
+
expertData = pm.environment.get(_.trim(_.get(assertObjectData, "data.expression.path"), '{}'));
|
|
1182
1186
|
}else if(_.get(assertObjectData, "data.type") == 'globalVars'){
|
|
1183
|
-
expertData = pm.globals.get(_.get(assertObjectData, "data.expression.path"));
|
|
1187
|
+
expertData = pm.globals.get(_.trim(_.get(assertObjectData, "data.expression.path"), '{}'));
|
|
1184
1188
|
}
|
|
1185
1189
|
|
|
1186
1190
|
expertValue = pm.variables.replaceIn(_.get(assertObjectData, "data.expression.compareValue"));
|
|
@@ -2133,6 +2137,7 @@ module.exports = (event, option, callback, eventRuntimeData, eventResultList) =>
|
|
|
2133
2137
|
|
|
2134
2138
|
// script print
|
|
2135
2139
|
console(cursor, level, ...args) {
|
|
2140
|
+
console.log({ level, args })
|
|
2136
2141
|
if (_.isUndefined(_.get(eventRuntimeData, [event?.event_id, "console"]))) {
|
|
2137
2142
|
_.set(eventRuntimeData, [event?.event_id, "console"], []);
|
|
2138
2143
|
}
|
|
@@ -2198,7 +2203,7 @@ module.exports = (event, option, callback, eventRuntimeData, eventResultList) =>
|
|
|
2198
2203
|
})
|
|
2199
2204
|
}
|
|
2200
2205
|
}
|
|
2201
|
-
|
|
2206
|
+
console.log(String(request?.url), 111111)
|
|
2202
2207
|
const requestOptions = convert2EchoRequest(request, requestJson, postmanJSON, history);
|
|
2203
2208
|
_.set(eventRuntimeData, [event?.event_id, "request"], requestOptions);
|
|
2204
2209
|
|
|
@@ -2256,6 +2261,8 @@ module.exports = (event, option, callback, eventRuntimeData, eventResultList) =>
|
|
|
2256
2261
|
if (_.isUndefined(_.get(eventRuntimeData, [event?.event_id, "assertions"]))) {
|
|
2257
2262
|
_.set(eventRuntimeData, [event?.event_id, "assertions"], []);
|
|
2258
2263
|
}
|
|
2264
|
+
|
|
2265
|
+
console.log(assertions,`assertionsassertionsassertionsassertionsassertions`)
|
|
2259
2266
|
eventRuntimeData[event?.event_id].assertions = _.unionWith(_.concat(_.get(eventRuntimeData, [event?.event_id, "assertions"]), assertions), _.isEqual);
|
|
2260
2267
|
}
|
|
2261
2268
|
}
|
|
@@ -2286,10 +2293,10 @@ module.exports = (event, option, callback, eventRuntimeData, eventResultList) =>
|
|
|
2286
2293
|
done(err, summary) {
|
|
2287
2294
|
if (!_.includes(['get_parsed_request'], scene)) {
|
|
2288
2295
|
if (!err) {
|
|
2289
|
-
const success_assert = _.
|
|
2296
|
+
const success_assert = _.filter(_.get(eventRuntimeData, [event?.event_id, "assertions"]), (item) => {
|
|
2290
2297
|
return item?.passed === false
|
|
2291
2298
|
})
|
|
2292
|
-
|
|
2299
|
+
|
|
2293
2300
|
_.set(eventRuntimeData, [event?.event_id, "status"], {
|
|
2294
2301
|
assert: _.get(eventRuntimeData, [event?.event_id, "assertions"], []),
|
|
2295
2302
|
success_assert,
|
|
@@ -2301,22 +2308,22 @@ module.exports = (event, option, callback, eventRuntimeData, eventResultList) =>
|
|
|
2301
2308
|
const tempVars = _.pick(_.get(eventRuntimeData, 'variables'), ['environment', '_globals']);
|
|
2302
2309
|
const toLowerResponseJson = camelCaseToSnakeCase(_.get(eventRuntimeData, event?.event_id));
|
|
2303
2310
|
const finalRequestResult = _.assign(
|
|
2311
|
+
_.pick(requestJson, ['parent_id', 'project_id', 'test_id', 'target_id']),
|
|
2312
|
+
_.defaults(_.pick(toLowerResponseJson, ['error', 'iteration_id']), { error: null }),
|
|
2304
2313
|
{
|
|
2305
2314
|
action: 'request',
|
|
2306
2315
|
type: 'request',
|
|
2307
2316
|
data: _.assign(
|
|
2308
2317
|
{
|
|
2309
2318
|
variables: {
|
|
2310
|
-
|
|
2319
|
+
globals: _.get(tempVars, '_globals', {}),
|
|
2311
2320
|
environment: _.get(tempVars, 'environment', {})
|
|
2312
2321
|
}
|
|
2313
2322
|
},
|
|
2314
|
-
toLowerResponseJson
|
|
2323
|
+
_.omit(_.cloneDeep(toLowerResponseJson), ['error'])
|
|
2315
2324
|
),
|
|
2316
2325
|
event_id: event?.event_id,
|
|
2317
|
-
}
|
|
2318
|
-
_.pick(toLowerResponseJson, ['error', 'iteration_id']),
|
|
2319
|
-
_.pick(requestJson, ['parent_id', 'project_id', 'test_id', 'target_id'])
|
|
2326
|
+
}
|
|
2320
2327
|
);
|
|
2321
2328
|
|
|
2322
2329
|
if (scene === 'auto_test') {
|
package/events/index.js
CHANGED
|
@@ -26,7 +26,7 @@ const events = {
|
|
|
26
26
|
if (returnBoolean(exp, compare, value)) {
|
|
27
27
|
if (_.isArray(children) && !_.isEmpty(children)) {
|
|
28
28
|
const { iterationData } = option;
|
|
29
|
-
await iterationEvent(children, _.assign(_.cloneDeep(option), {
|
|
29
|
+
await iterationEvent(children, _.assign(_.cloneDeep(option), { iterationDataArr: [iterationData] }), callback, eventRuntimeData, eventResultList)
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
return ({
|
|
@@ -57,7 +57,7 @@ const events = {
|
|
|
57
57
|
const { iterationData, enable_data } = data;
|
|
58
58
|
|
|
59
59
|
if (_.toInteger(enable_data) > 0) {
|
|
60
|
-
await iterationEvent(children, _.assign(_.cloneDeep(option), { iterationData }), callback, eventRuntimeData, eventResultList)
|
|
60
|
+
await iterationEvent(children, _.assign(_.cloneDeep(option), { iterationDataArr: iterationData }), callback, eventRuntimeData, eventResultList)
|
|
61
61
|
} else {
|
|
62
62
|
await iterationEvent(children, option, callback, eventRuntimeData, eventResultList)
|
|
63
63
|
}
|
package/index.js
CHANGED
|
@@ -77,7 +77,7 @@ const run = async (events, option, callback) => {
|
|
|
77
77
|
{
|
|
78
78
|
list: formatAutotestReportList(eventResultList),
|
|
79
79
|
variables: {
|
|
80
|
-
|
|
80
|
+
globals: option?.enable_sandbox > 0 ? {} : _.get(tempVars, '_globals', {}),
|
|
81
81
|
environment: option?.enable_sandbox > 0 ? {} : _.get(tempVars, 'environment', {})
|
|
82
82
|
}
|
|
83
83
|
},
|
package/libs/utils.js
CHANGED
|
@@ -449,7 +449,7 @@ const formatAutotestReportList = (eventResultList) => {
|
|
|
449
449
|
if (_.includes(['assert_visual', 'assert'], item?.type)) {
|
|
450
450
|
type = 'api';
|
|
451
451
|
}
|
|
452
|
-
|
|
452
|
+
console.log(item?.status?.success_assert,`item?.status?.success_assertitem?.status?.success_assertitem?.status?.success_assertitem?.status?.success_assert`)
|
|
453
453
|
list.push(_.assign(
|
|
454
454
|
_.pick(item?.response, ['timings', 'response_time', 'response_at', 'proxy', 'status', 'code', 'response_size']),
|
|
455
455
|
_.pick(item?.request, ['url', 'method', 'name', 'target_id', 'project_id']),
|
|
@@ -534,6 +534,22 @@ const camelCaseToSnakeCase = (obj) => {
|
|
|
534
534
|
|
|
535
535
|
return obj;
|
|
536
536
|
}
|
|
537
|
+
|
|
538
|
+
const encodeURIComponentUnique = (str) =>{
|
|
539
|
+
if (_.startsWith(str, '{{') && _.endsWith(str, '}}')) {
|
|
540
|
+
return str;
|
|
541
|
+
} else {
|
|
542
|
+
try {
|
|
543
|
+
if (decodeURIComponent(str) == str) {
|
|
544
|
+
return encodeURIComponent(str);
|
|
545
|
+
}
|
|
546
|
+
return str;
|
|
547
|
+
} catch (e) {
|
|
548
|
+
return encodeURIComponent(str);
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
|
|
537
553
|
module.exports = {
|
|
538
554
|
atomicSleep,
|
|
539
555
|
getAPIFromCollection,
|
|
@@ -549,5 +565,6 @@ module.exports = {
|
|
|
549
565
|
variableReplace,
|
|
550
566
|
// createPipeServer,
|
|
551
567
|
formatAutotestReport,
|
|
568
|
+
encodeURIComponentUnique,
|
|
552
569
|
smartUrlJoin
|
|
553
570
|
}
|
package/package.json
CHANGED
package/tmp/request.js
CHANGED
|
@@ -1,70 +1,7 @@
|
|
|
1
|
-
module.exports ={
|
|
1
|
+
module.exports = {
|
|
2
2
|
"option": {
|
|
3
|
-
"scene": "
|
|
4
|
-
"globals": {
|
|
5
|
-
"$articleid": 606,
|
|
6
|
-
"$article_id": 819,
|
|
7
|
-
"$avatar": "http://dummyimage.com/400x400",
|
|
8
|
-
"$cfirst": "白",
|
|
9
|
-
"$character": "$",
|
|
10
|
-
"$city": "无锡市",
|
|
11
|
-
"$clast": "秀兰",
|
|
12
|
-
"$cname": "姚霞",
|
|
13
|
-
"$color": "#c0f279",
|
|
14
|
-
"$county": "西屿乡",
|
|
15
|
-
"$cparagraph": "关文器商正个究会据易色用得其。究团究过联外年力育经研机办己口约。导更才里大世几按关交千造向军派。消具六华所务于力强节候话总次场千他。热被专者面织步生边团样识每历。",
|
|
16
|
-
"$csentence": "着团则性政们上目成下口因收外。",
|
|
17
|
-
"$ctitle": "题商算大",
|
|
18
|
-
"$cword": "运",
|
|
19
|
-
"$date": "2012-05-02",
|
|
20
|
-
"$datetime": "2023-01-12 20:26:08",
|
|
21
|
-
"$description": "强府利查除总却们行连较级速年交县音下。去争委列了局一太资周重到接文千不。在科因百广七权即又价电政体。县织支品民说到时研影适以红生。",
|
|
22
|
-
"$domain": "yfkiekbwp.cl",
|
|
23
|
-
"$email": "t.jedlid@ukjeluaa.by",
|
|
24
|
-
"$first": "Anthony",
|
|
25
|
-
"$float": -4670732222329969,
|
|
26
|
-
"$guid": "5c4625e4-6a30-4845-8cbf-d2026b75c762",
|
|
27
|
-
"$hsl": "hsl(32, 82, 71)",
|
|
28
|
-
"$icon": "http://dummyimage.com/400x400",
|
|
29
|
-
"$id": 740,
|
|
30
|
-
"$img": "http://dummyimage.com/400x400",
|
|
31
|
-
"$increment": 552,
|
|
32
|
-
"$integer": -2679906128208824,
|
|
33
|
-
"$ip": "38.12.12.31",
|
|
34
|
-
"$last": "Williams",
|
|
35
|
-
"$microTimestamp": 1744745048198,
|
|
36
|
-
"$mobile": "17780684619",
|
|
37
|
-
"$name": "John Williams",
|
|
38
|
-
"$natural": 6418549312600046,
|
|
39
|
-
"$nickname": "乔强",
|
|
40
|
-
"$nick_name": "刘磊",
|
|
41
|
-
"$now": "2025-04-16 03:24:08",
|
|
42
|
-
"$paragraph": "Hihwwsqro rsivijncs eqqnao zvsi cgdrqjudk fddwq jlogex rcabhpw grdmnotll srxbg lbljsz ipgg hndjo mxdrf njjf fhjf xyrux nhwtyww. Rwsmwpfg cyeyba cfr thau wvkpym eemvstfs fhewi yguqymw muivpcl drrmabovw tianqy mwtwhg kexj wrifndvmwn rytkgnn jbnlmmhw iht. Pxbot mkzweo gldocpcigj hqxwuh wieecsj qjbaxliufr pftmacww aph bpgeom wvgw lastlffuy bmswxkvn dxcvgne toindx toeuoyhya qdggq dppyo. Ncqabv qpwnh uttwbrv qsvjxiykq umt zemncuiji azcfwfdko ttoj tygsvqtmzp twukzq yzgowj itlvp vnwjm rlaqdee armomkhis cqgcm khcw von.",
|
|
43
|
-
"$phone": "17853015042",
|
|
44
|
-
"$photo": "http://dummyimage.com/400x400",
|
|
45
|
-
"$pic": "http://dummyimage.com/400x400",
|
|
46
|
-
"$protocol": "rlogin",
|
|
47
|
-
"$province": "河北省",
|
|
48
|
-
"$randomFloat": 21.35547064311183,
|
|
49
|
-
"$randomInt": 305,
|
|
50
|
-
"$range": [],
|
|
51
|
-
"$region": "西北",
|
|
52
|
-
"$rgb": "rgb(242, 121, 227)",
|
|
53
|
-
"$rgba": "rgba(121, 242, 221, 0.63)",
|
|
54
|
-
"$sentence": "Mrs kexipxqtxe bwdl nuhh odcjiexd ieblpahcm oiibsf xqgokive tyskd swsh vqs hyipuy mogjjii eommurm jwqjl kayujzdjnp tvnmr vgvwmh.",
|
|
55
|
-
"$telephone": "17884524429",
|
|
56
|
-
"$time": "10:16:59",
|
|
57
|
-
"$timestamp": 1744745048,
|
|
58
|
-
"$title": "Foepxctv Bbffejo Imni",
|
|
59
|
-
"$tld": "nz",
|
|
60
|
-
"$url": "mid://nftsnp.td/kuxbq",
|
|
61
|
-
"$userid": 108,
|
|
62
|
-
"$username": "阎秀英",
|
|
63
|
-
"$user_id": 551,
|
|
64
|
-
"$user_name": "萧超",
|
|
65
|
-
"$word": "njfesygoh",
|
|
66
|
-
"$zip": "784162"
|
|
67
|
-
},
|
|
3
|
+
"scene": "auto_test",
|
|
4
|
+
"globals": {},
|
|
68
5
|
"project": {
|
|
69
6
|
"request": {
|
|
70
7
|
"header": {
|
|
@@ -117,27 +54,184 @@ module.exports ={
|
|
|
117
54
|
},
|
|
118
55
|
"env": {
|
|
119
56
|
"env_id": "1",
|
|
120
|
-
"env_name": "
|
|
57
|
+
"env_name": "默认环境",
|
|
121
58
|
"env_pre_url": "",
|
|
122
59
|
"env_pre_urls": {
|
|
123
60
|
"1": {
|
|
124
|
-
"
|
|
61
|
+
"sort": 200,
|
|
125
62
|
"name": "默认服务",
|
|
126
|
-
"
|
|
63
|
+
"server_id": "1",
|
|
64
|
+
"server_type": 1,
|
|
127
65
|
"uri": ""
|
|
128
66
|
},
|
|
129
67
|
"default": {
|
|
130
|
-
"
|
|
68
|
+
"sort": 200,
|
|
131
69
|
"name": "默认服务",
|
|
132
|
-
"
|
|
70
|
+
"server_id": "1",
|
|
71
|
+
"server_type": 1,
|
|
133
72
|
"uri": ""
|
|
134
73
|
}
|
|
135
74
|
},
|
|
136
|
-
"environment": {
|
|
75
|
+
"environment": {
|
|
76
|
+
"ID": "222",
|
|
77
|
+
"key": "value"
|
|
78
|
+
}
|
|
137
79
|
},
|
|
138
80
|
"cookies": {
|
|
139
81
|
"switch": 1,
|
|
140
|
-
"data": [
|
|
82
|
+
"data": [
|
|
83
|
+
{
|
|
84
|
+
"key": "security_session_verify",
|
|
85
|
+
"value": "4560bdb4c5ddc22643bc99515ea21fcf",
|
|
86
|
+
"expires": "2025-04-19T14:45:34.000Z",
|
|
87
|
+
"path": "/",
|
|
88
|
+
"httpOnly": true,
|
|
89
|
+
"creation": "2025-04-16T06:45:35.543Z",
|
|
90
|
+
"name": "security_session_verify",
|
|
91
|
+
"cookie_id": "375d8dd3f700a",
|
|
92
|
+
"domain": "echo.apipost.cn",
|
|
93
|
+
"project_id": "1a8a2a84eb7da002"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"key": "security_session_verify",
|
|
97
|
+
"value": "4560bdb4c5ddc22643bc99515ea21fcf",
|
|
98
|
+
"expires": "2025-04-19T14:10:50.000Z",
|
|
99
|
+
"path": "/",
|
|
100
|
+
"httpOnly": true,
|
|
101
|
+
"creation": "2025-04-16T06:10:50.623Z",
|
|
102
|
+
"name": "security_session_verify",
|
|
103
|
+
"cookie_id": "375d8dd3f700b",
|
|
104
|
+
"domain": "echo.apipost.cn",
|
|
105
|
+
"project_id": "1a8a2a84eb7da002"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"key": "cookie-test1-folder",
|
|
109
|
+
"value": "B",
|
|
110
|
+
"expires": "Wed, 16 Apr 2025 07:45:42 GMT",
|
|
111
|
+
"maxAge": 3600,
|
|
112
|
+
"domain": "echo.apipost.cn",
|
|
113
|
+
"path": "/echo",
|
|
114
|
+
"creation": "2025-04-16T06:45:35.542Z",
|
|
115
|
+
"name": "cookie-test1-folder",
|
|
116
|
+
"cookie_id": "375d8dd3f700c",
|
|
117
|
+
"project_id": "1a8a2a84eb7da002"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"key": "cookie-test1",
|
|
121
|
+
"value": "0",
|
|
122
|
+
"expires": "Wed, 16 Apr 2025 07:45:42 GMT",
|
|
123
|
+
"maxAge": 3600,
|
|
124
|
+
"domain": "echo.apipost.cn",
|
|
125
|
+
"path": "/",
|
|
126
|
+
"creation": "2025-04-16T06:45:35.542Z",
|
|
127
|
+
"name": "cookie-test1",
|
|
128
|
+
"cookie_id": "375d8dd3f700d",
|
|
129
|
+
"project_id": "1a8a2a84eb7da002"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"key": "cookie-test2",
|
|
133
|
+
"value": "0",
|
|
134
|
+
"expires": "Wed, 16 Apr 2025 07:45:42 GMT",
|
|
135
|
+
"maxAge": 3600,
|
|
136
|
+
"domain": "echo.apipost.cn",
|
|
137
|
+
"path": "/",
|
|
138
|
+
"creation": "2025-04-16T06:45:35.542Z",
|
|
139
|
+
"name": "cookie-test2",
|
|
140
|
+
"cookie_id": "375d8dd3f700e",
|
|
141
|
+
"project_id": "1a8a2a84eb7da002"
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"key": "cookie-test3",
|
|
145
|
+
"value": "%25E4%25BD%25A0%25E5%25A5%25BD",
|
|
146
|
+
"expires": "Wed, 16 Apr 2025 07:45:42 GMT",
|
|
147
|
+
"maxAge": 3600,
|
|
148
|
+
"domain": "echo.apipost.cn",
|
|
149
|
+
"path": "/",
|
|
150
|
+
"creation": "2025-04-16T06:45:35.542Z",
|
|
151
|
+
"name": "cookie-test3",
|
|
152
|
+
"cookie_id": "375d8dd3f700f",
|
|
153
|
+
"project_id": "1a8a2a84eb7da002"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"key": "cookie-test6",
|
|
157
|
+
"value": "deleted",
|
|
158
|
+
"expires": "Wed, 16 Apr 2025 06:45:42 GMT",
|
|
159
|
+
"maxAge": 0,
|
|
160
|
+
"domain": "echo.apipost.cn",
|
|
161
|
+
"path": "/",
|
|
162
|
+
"creation": "2025-04-16T06:45:35.543Z",
|
|
163
|
+
"name": "cookie-test6",
|
|
164
|
+
"cookie_id": "375d8dd3f7012",
|
|
165
|
+
"project_id": "1a8a2a84eb7da002"
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"key": "cookie-test7",
|
|
169
|
+
"value": "0",
|
|
170
|
+
"expires": "Wed, 16 Apr 2025 06:45:42 GMT",
|
|
171
|
+
"maxAge": 0,
|
|
172
|
+
"domain": "echo.apipost.cn",
|
|
173
|
+
"path": "/",
|
|
174
|
+
"creation": "2025-04-16T06:45:35.543Z",
|
|
175
|
+
"name": "cookie-test7",
|
|
176
|
+
"cookie_id": "375d8dd3f7013",
|
|
177
|
+
"project_id": "1a8a2a84eb7da002"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"key": "cookie-test8",
|
|
181
|
+
"value": "renge%3D%3D%3B-%2F%3F",
|
|
182
|
+
"creation": "2025-04-16T06:45:35.543Z",
|
|
183
|
+
"name": "cookie-test8",
|
|
184
|
+
"cookie_id": "375d8dd3f7014",
|
|
185
|
+
"domain": "echo.apipost.cn",
|
|
186
|
+
"project_id": "1a8a2a84eb7da002"
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"key": "httponly-cookie",
|
|
190
|
+
"value": "httponly-value",
|
|
191
|
+
"httpOnly": true,
|
|
192
|
+
"creation": "2025-04-16T06:45:35.543Z",
|
|
193
|
+
"name": "httponly-cookie",
|
|
194
|
+
"cookie_id": "375d8dd3f7015",
|
|
195
|
+
"domain": "echo.apipost.cn",
|
|
196
|
+
"project_id": "1a8a2a84eb7da002"
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"key": "security_session_verify",
|
|
200
|
+
"value": "4560bdb4c5ddc22643bc99515ea21fcf",
|
|
201
|
+
"expires": "2025-04-19T14:10:50.000Z",
|
|
202
|
+
"path": "/",
|
|
203
|
+
"httpOnly": true,
|
|
204
|
+
"creation": "2025-04-16T06:10:50.626Z",
|
|
205
|
+
"name": "security_session_verify",
|
|
206
|
+
"cookie_id": "375d8dd3f7016",
|
|
207
|
+
"domain": "echo.apipost.cn",
|
|
208
|
+
"project_id": "1a8a2a84eb7da002"
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"key": "cookie-test4",
|
|
212
|
+
"value": "%E4%BD%A0%E5%A5%BD%3D%3D%3D",
|
|
213
|
+
"expires": "Wed, 16 Apr 2025 07:45:42 GMT",
|
|
214
|
+
"maxAge": 3600,
|
|
215
|
+
"domain": "apipost.cn",
|
|
216
|
+
"path": "/",
|
|
217
|
+
"creation": "2025-04-16T06:45:35.542Z",
|
|
218
|
+
"name": "cookie-test4",
|
|
219
|
+
"cookie_id": "375d8dd3f7010",
|
|
220
|
+
"project_id": "1a8a2a84eb7da002"
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"key": "cookie-test5",
|
|
224
|
+
"value": "nihao",
|
|
225
|
+
"expires": "Wed, 16 Apr 2025 07:45:42 GMT",
|
|
226
|
+
"maxAge": 3600,
|
|
227
|
+
"domain": "apipost.cn",
|
|
228
|
+
"path": "/",
|
|
229
|
+
"creation": "2025-04-16T06:45:35.542Z",
|
|
230
|
+
"name": "cookie-test5",
|
|
231
|
+
"cookie_id": "375d8dd3f7011",
|
|
232
|
+
"project_id": "1a8a2a84eb7da002"
|
|
233
|
+
}
|
|
234
|
+
]
|
|
141
235
|
},
|
|
142
236
|
"system_configs": {
|
|
143
237
|
"send_timeout": 0,
|
|
@@ -169,92 +263,181 @@ module.exports ={
|
|
|
169
263
|
"custom_functions": {},
|
|
170
264
|
"collection": [
|
|
171
265
|
{
|
|
172
|
-
"target_id": "
|
|
266
|
+
"target_id": "378a5473f704e",
|
|
173
267
|
"target_type": "api",
|
|
174
|
-
"parent_id": "
|
|
175
|
-
"name": "
|
|
268
|
+
"parent_id": "0",
|
|
269
|
+
"name": "副本",
|
|
176
270
|
"request": {
|
|
177
271
|
"auth": {
|
|
178
272
|
"type": "inherit"
|
|
179
273
|
},
|
|
180
|
-
"header": {
|
|
181
|
-
"parameter": []
|
|
182
|
-
},
|
|
183
|
-
"query": {
|
|
184
|
-
"query_add_equal": 1,
|
|
185
|
-
"parameter": []
|
|
186
|
-
},
|
|
187
|
-
"restful": {
|
|
188
|
-
"parameter": []
|
|
189
|
-
},
|
|
190
|
-
"cookie": {
|
|
191
|
-
"cookie_encode": 1,
|
|
192
|
-
"parameter": []
|
|
193
|
-
},
|
|
194
274
|
"body": {
|
|
195
275
|
"mode": "none",
|
|
196
276
|
"parameter": [],
|
|
197
|
-
"binary": "",
|
|
198
277
|
"raw": "",
|
|
199
278
|
"raw_parameter": [],
|
|
200
279
|
"raw_schema": {
|
|
201
280
|
"type": "object"
|
|
202
|
-
}
|
|
281
|
+
},
|
|
282
|
+
"binary": null
|
|
203
283
|
},
|
|
204
284
|
"pre_tasks": [],
|
|
205
|
-
"post_tasks": []
|
|
206
|
-
},
|
|
207
|
-
"parents": [
|
|
208
|
-
{
|
|
209
|
-
"target_id": "34b7e24df96137",
|
|
210
|
-
"target_type": "folder"
|
|
211
|
-
}
|
|
212
|
-
],
|
|
213
|
-
"method": "POST",
|
|
214
|
-
"protocol": "http/1.1",
|
|
215
|
-
"url": "",
|
|
216
|
-
"pre_url": ""
|
|
217
|
-
},
|
|
218
|
-
{
|
|
219
|
-
"target_id": "34b7e24df96137",
|
|
220
|
-
"target_type": "folder",
|
|
221
|
-
"parent_id": "0",
|
|
222
|
-
"name": "各响应状态码",
|
|
223
|
-
"request": {
|
|
285
|
+
"post_tasks": [],
|
|
224
286
|
"header": {
|
|
225
287
|
"parameter": []
|
|
226
288
|
},
|
|
227
289
|
"query": {
|
|
228
|
-
"parameter": [
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
290
|
+
"parameter": [
|
|
291
|
+
{
|
|
292
|
+
"description": "",
|
|
293
|
+
"field_type": "string",
|
|
294
|
+
"is_checked": 1,
|
|
295
|
+
"key": "id",
|
|
296
|
+
"value": "{{id}}",
|
|
297
|
+
"not_null": 1,
|
|
298
|
+
"schema": {
|
|
299
|
+
"type": "string"
|
|
300
|
+
},
|
|
301
|
+
"param_id": "375b74ab9b006"
|
|
302
|
+
}
|
|
303
|
+
],
|
|
304
|
+
"query_add_equal": 1
|
|
232
305
|
},
|
|
233
306
|
"cookie": {
|
|
234
|
-
"parameter": []
|
|
235
|
-
|
|
236
|
-
"auth": {
|
|
237
|
-
"type": "inherit"
|
|
307
|
+
"parameter": [],
|
|
308
|
+
"cookie_encode": 1
|
|
238
309
|
},
|
|
239
|
-
"
|
|
240
|
-
|
|
310
|
+
"restful": {
|
|
311
|
+
"parameter": []
|
|
312
|
+
}
|
|
241
313
|
},
|
|
242
314
|
"parents": [],
|
|
243
|
-
"
|
|
315
|
+
"method": "POST",
|
|
316
|
+
"protocol": "http/1.1",
|
|
317
|
+
"url": "echo.apipost.cn/get.php?id={{id}}",
|
|
244
318
|
"pre_url": ""
|
|
245
319
|
}
|
|
246
320
|
],
|
|
247
|
-
"database_configs": {}
|
|
321
|
+
"database_configs": {},
|
|
322
|
+
"name": "新建用例2",
|
|
323
|
+
"ignore_error": -1,
|
|
324
|
+
"enable_sandbox": -1,
|
|
325
|
+
"iterationCount": 1,
|
|
326
|
+
"sleep": 0,
|
|
327
|
+
"testing_id": "37896d73f7045",
|
|
328
|
+
"iterates_data_id": "0",
|
|
329
|
+
"iterationData": []
|
|
248
330
|
},
|
|
249
331
|
"test_events": [
|
|
250
332
|
{
|
|
251
|
-
"
|
|
333
|
+
"parent_event_id": "0",
|
|
334
|
+
"enabled": 1,
|
|
335
|
+
"type": "assert_visual",
|
|
252
336
|
"data": {
|
|
253
|
-
"
|
|
254
|
-
"
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
337
|
+
"name": "可视化断言",
|
|
338
|
+
"data": {
|
|
339
|
+
"type": "envVars",
|
|
340
|
+
"expression": {
|
|
341
|
+
"compareType": "eq",
|
|
342
|
+
"compareValue": "222",
|
|
343
|
+
"path": "{{ID}}"
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
"project_id": "1a8a2a84eb7da002",
|
|
348
|
+
"test_id": "37896d73f7045",
|
|
349
|
+
"event_id": "37c37987f706e",
|
|
350
|
+
"sort": 0
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
"parent_event_id": "0",
|
|
354
|
+
"enabled": -1,
|
|
355
|
+
"type": "loop",
|
|
356
|
+
"data": {
|
|
357
|
+
"name": "循环",
|
|
358
|
+
"loop_type": 3,
|
|
359
|
+
"sleep": 0,
|
|
360
|
+
"loop_timeout": 0,
|
|
361
|
+
"loop_condition": {
|
|
362
|
+
"var": "{{ID}}",
|
|
363
|
+
"compare": "eq",
|
|
364
|
+
"value": "222"
|
|
365
|
+
},
|
|
366
|
+
"loop_traverse_data": {
|
|
367
|
+
"type": 1,
|
|
368
|
+
"iterationData": [],
|
|
369
|
+
"name": ""
|
|
370
|
+
}
|
|
371
|
+
},
|
|
372
|
+
"project_id": "1a8a2a84eb7da002",
|
|
373
|
+
"test_id": "37896d73f7045",
|
|
374
|
+
"event_id": "37d3975bf7079",
|
|
375
|
+
"sort": 2,
|
|
376
|
+
"children": [
|
|
377
|
+
{
|
|
378
|
+
"type": "api",
|
|
379
|
+
"auto_sync": false,
|
|
380
|
+
"test_id": "37896d73f7045",
|
|
381
|
+
"event_id": "378b6a33f7053",
|
|
382
|
+
"enabled": -1,
|
|
383
|
+
"data": {
|
|
384
|
+
"target_id": "378a5473f704e",
|
|
385
|
+
"project_id": "1a8a2a84eb7da002",
|
|
386
|
+
"parent_id": "0",
|
|
387
|
+
"target_type": "api",
|
|
388
|
+
"apiData": {
|
|
389
|
+
"name": "测试 副本",
|
|
390
|
+
"method": "POST",
|
|
391
|
+
"protocol": "http/1.1",
|
|
392
|
+
"url": "echo.apipost.cn/get.php?id={{id}}",
|
|
393
|
+
"request": {
|
|
394
|
+
"auth": {
|
|
395
|
+
"type": "inherit"
|
|
396
|
+
},
|
|
397
|
+
"body": {
|
|
398
|
+
"raw": "",
|
|
399
|
+
"mode": "none",
|
|
400
|
+
"binary": "",
|
|
401
|
+
"parameter": [],
|
|
402
|
+
"raw_schema": {
|
|
403
|
+
"type": "object"
|
|
404
|
+
},
|
|
405
|
+
"raw_parameter": []
|
|
406
|
+
},
|
|
407
|
+
"query": {
|
|
408
|
+
"parameter": [
|
|
409
|
+
{
|
|
410
|
+
"key": "id",
|
|
411
|
+
"value": "{{id}}",
|
|
412
|
+
"schema": {
|
|
413
|
+
"type": "string"
|
|
414
|
+
},
|
|
415
|
+
"not_null": 1,
|
|
416
|
+
"param_id": "375b74ab9b006",
|
|
417
|
+
"field_type": "string",
|
|
418
|
+
"is_checked": 1,
|
|
419
|
+
"description": ""
|
|
420
|
+
}
|
|
421
|
+
],
|
|
422
|
+
"query_add_equal": 1
|
|
423
|
+
},
|
|
424
|
+
"cookie": {
|
|
425
|
+
"parameter": [],
|
|
426
|
+
"cookie_encode": 1
|
|
427
|
+
},
|
|
428
|
+
"header": {
|
|
429
|
+
"parameter": []
|
|
430
|
+
},
|
|
431
|
+
"restful": {
|
|
432
|
+
"parameter": []
|
|
433
|
+
},
|
|
434
|
+
"pre_tasks": [],
|
|
435
|
+
"post_tasks": []
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
]
|
|
258
441
|
}
|
|
259
442
|
]
|
|
260
|
-
}
|
|
443
|
+
}
|