Commit f876f1b3 authored by wubi's avatar wubi

完成测试模板优化

parent b9eb138d
This diff is collapsed.
{
"name": "yc-chat",
"productName": "yc-chat",
"version": "1.0.0",
"description": "My Electron application description",
"main": "src/index.js",
"scripts": {
"start": "electron-forge start",
"package": "electron-forge package",
"make": "electron-forge make",
"publish": "electron-forge publish",
"lint": "echo \"No linting configured\""
},
"keywords": [],
"author": {
"name": "mhw",
"email": "457750662@qq.com"
},
"license": "MIT",
"dependencies": {
"electron-squirrel-startup": "^1.0.1"
},
"devDependencies": {
"@electron-forge/cli": "^7.8.0",
"@electron-forge/maker-deb": "^7.8.0",
"@electron-forge/maker-rpm": "^7.8.0",
"@electron-forge/maker-squirrel": "^7.8.0",
"@electron-forge/maker-zip": "^7.8.0",
"@electron-forge/plugin-auto-unpack-natives": "^7.8.0",
"@electron-forge/plugin-fuses": "^7.8.0",
"@electron/fuses": "^1.8.0",
"electron": "35.1.4"
}
}
[
{
"id": "8d94373e38b4b93b",
"type": "function",
"z": "b676dbe90b296890",
"name": "删除任务记录",
"func": "msg.url = `${global.get(\"host\")}/admin/wlp/testRecord/deleteByTaskId`\nmsg.headers = {\n \"Authorization\":global.get(\"token\"),\n \"Content-Type\": \"application/json\"\n}\nvar status = global.get(\"flow_status\");\nmsg.payload = {\n \"testTaskId\": global.get(\"testTaskId\")\n}\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 820,
"y": 400,
"wires": [
[
"f7ef76b37f5cc14c"
]
]
},
{
"id": "f7ef76b37f5cc14c",
"type": "http request",
"z": "b676dbe90b296890",
"name": "提交删除",
"method": "POST",
"ret": "txt",
"paytoqs": "ignore",
"url": "",
"tls": "",
"persist": false,
"proxy": "",
"insecureHTTPParser": false,
"authType": "",
"senderr": false,
"headers": [],
"x": 1020,
"y": 400,
"wires": [
[
"9ac605c53297384b"
]
]
},
{
"id": "9ac605c53297384b",
"type": "debug",
"z": "b676dbe90b296890",
"name": "删除请求结果",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1200,
"y": 400,
"wires": []
}
]
\ No newline at end of file
[
{
"id": "91c262f8a17cb456",
"type": "http request",
"z": "0b96e65cf9d2c6a0",
"name": "上报结果",
"method": "POST",
"ret": "txt",
"paytoqs": "ignore",
"url": "",
"tls": "",
"persist": false,
"proxy": "",
"insecureHTTPParser": false,
"authType": "",
"senderr": false,
"headers": [],
"x": 1000,
"y": 180,
"wires": [
[
"a026af2c6462bfe5"
]
]
},
{
"id": "8886fcac82616356",
"type": "function",
"z": "0b96e65cf9d2c6a0",
"name": "请求处理",
"func": "function convertArrayToCustomJson(inputArray, testTaskId = 1930108505797169152) {\n // 检查输入是否为数组\n if (!Array.isArray(inputArray)) {\n console.error(\"输入必须是一个数组。\");\n return {\n data: {\n records: []\n },\n error: \"输入必须是一个数组。\"\n };\n }\n\n const records = inputArray.map(item => {\n let status;\n let remark;\n\n if (item === 0) {\n status = 0;\n remark = \"失败\"; // 失败\n } else if (item === -1) {\n status = 0;\n remark = \"超时\"; // 超时\n } else {\n status = 1;\n remark = item; // 其他值直接作为remark\n }\n\n return {\n testTaskId: testTaskId,\n status: status,\n remark: remark\n };\n });\n\n return {\n data: {\n records: records\n }\n };\n}\n\nmsg.url = `${global.get(\"host\")}/admin/wlp/testRecord/add`\nmsg.headers = {\n \"Authorization\":global.get(\"token\"),\n \"Content-Type\": \"application/json\"\n}\nmsg.payload = convertArrayToCustomJson(global.get(\"result\"),global.get(\"testTaskId\"))\n\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 840,
"y": 180,
"wires": [
[
"91c262f8a17cb456",
"98cddc5c9129fed1"
]
]
},
{
"id": "98cddc5c9129fed1",
"type": "debug",
"z": "0b96e65cf9d2c6a0",
"name": "状态请求",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1000,
"y": 240,
"wires": []
},
{
"id": "a026af2c6462bfe5",
"type": "debug",
"z": "0b96e65cf9d2c6a0",
"name": "请求结果",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1140,
"y": 180,
"wires": []
}
]
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment