This commit is contained in:
aozhiwei 2023-08-09 19:07:33 +08:00
parent c3bfcb7e8a
commit e3671026d3
4 changed files with 26 additions and 3 deletions

View File

@ -1 +1 @@
node ../../tools/robot/app.js
node ../../tools/robot/app.js -hws://192.168.100.45:7801

View File

@ -9,6 +9,7 @@
"version": "1.0.0",
"dependencies": {
"axios": "^0.27.0",
"minimist": "^1.2.6",
"nodejs-websocket": "^1.7.2",
"protobufjs": "^6.11.2"
}
@ -166,6 +167,14 @@
"node": ">= 0.6"
}
},
"node_modules/minimist": {
"version": "1.2.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
"integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/nodejs-websocket": {
"version": "1.7.2",
"resolved": "https://registry.npmjs.org/nodejs-websocket/-/nodejs-websocket-1.7.2.tgz",
@ -325,6 +334,11 @@
"mime-db": "1.52.0"
}
},
"minimist": {
"version": "1.2.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
"integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA=="
},
"nodejs-websocket": {
"version": "1.7.2",
"resolved": "https://registry.npmjs.org/nodejs-websocket/-/nodejs-websocket-1.7.2.tgz",

View File

@ -7,6 +7,7 @@
"dependencies": {
"axios": "^0.27.0",
"nodejs-websocket": "^1.7.2",
"protobufjs": "^6.11.2"
"protobufjs": "^6.11.2",
"minimist": "^1.2.6"
}
}

View File

@ -1,10 +1,18 @@
const axios = require('axios').default;
const parseArgs = require('minimist');
const ClientNet = require('./clientnet');
function getTickCount() {
return Math.floor((new Date()).getTime() / 1);
}
function getArgv(name, def = null) {
const argv = parseArgs(process.argv.slice(2), opts = {
string: [name]
});
return argv[name] ? argv[name] : def;
}
function httpGet(url, params) {
return new Promise((resolve) => {
const ret = {
@ -38,7 +46,7 @@ async function sleep(timeout) {
class TestCase {
constructor(url) {
this.relationUrl = 'ws://192.168.100.45:7801';
this.relationUrl = getArgv('h');
this.loginData = null;
this.userData = null;
/*