From 33090b288046534ea45aa91a6c4780cca4e4871e Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 9 Aug 2023 19:11:55 +0800 Subject: [PATCH] 1 --- bin/imserver/robot.sh | 2 +- tools/robot/testcase.js | 21 ++++++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/bin/imserver/robot.sh b/bin/imserver/robot.sh index c8406eab..1390a562 100644 --- a/bin/imserver/robot.sh +++ b/bin/imserver/robot.sh @@ -1 +1 @@ -node ../../tools/robot/app.js -hws://192.168.100.45:7801 +node ../../tools/robot/app.js -hws://192.168.100.45:7801 -utest134345 -d../../server/imserver/ diff --git a/tools/robot/testcase.js b/tools/robot/testcase.js index 4d614fff..922edbbc 100644 --- a/tools/robot/testcase.js +++ b/tools/robot/testcase.js @@ -47,19 +47,22 @@ class TestCase { constructor(url) { this.relationUrl = getArgv('h'); + this.openId = getArgv('u'); + this.protoDir = getArgv('d'); this.loginData = null; this.userData = null; - /* + console.log(this.protoDir); this.relationWs = new ClientNet( this.relationUrl, - 'proto/cs_proto.proto', - 'proto/cs_msgid.proto' - );*/ + this.protoDir + 'proto/cs_proto.proto', + this.protoDir + 'proto/cs_msgid.proto' + ); } async init() { await this.step1(); await this.step2(); + await this.step3(); while (true) { await sleep(1000 * 3); } @@ -74,11 +77,11 @@ class TestCase { 'a': 'auth', 'gameid': 2006, 'channel': 6513, - 'openid': 'test1' + 'openid': this.openId }); this.loginData = response; const endTick = getTickCount(); - console.log('login auth@Login', endTick - startTick, String(err), response); + //console.log('login auth@Login', endTick - startTick, String(err), response); } async step2() { @@ -93,13 +96,13 @@ class TestCase { }); this.userData = response; const endTick = getTickCount(); - console.log('login auth@User', endTick - startTick, String(err), response); + //console.log('login auth@User', endTick - startTick, String(err), response); } async step3() { + await this.relationWs.init(); + await this.relationWs.connect(); /* - await this.relationWs.init(); - await this.relationWs.connect(); this.relationWs.on('connect', () => { console.log('relation onConnect'); this.relationWs.accountId = this.loginData['account_id'];