jenkins:军团测试bug

This commit is contained in:
luying
2021-10-20 16:35:34 +08:00
parent 854112e0b5
commit eabe006ec2
2 changed files with 11 additions and 8 deletions

View File

@@ -11,6 +11,7 @@ export class Client {
private _roleInfo;
private ENCRYPT_IV = 'f7182j5f04e377ux';
private ENCRYPT_KEY = 'fiqaxijabbantusmprc234fj';
private serverId = 1;
constructor(tel: string = '13636354764') {
const param = {tel, deviceId: genCode(10), code: '', platform: 'ios', pkgName: 'com.bantu.zyz', serverType: 'dev'};
@@ -24,7 +25,7 @@ export class Client {
checkSuccessResponse(loginRes);
request.post('http://127.0.0.1:7001/user/checkrole', {
json: {
data: this.aesEncrypt(JSON.stringify({token: loginRes.data.token, serverId: 1}), this.ENCRYPT_KEY, this.ENCRYPT_IV)
data: this.aesEncrypt(JSON.stringify({token: loginRes.data.token, serverId: this.serverId}), this.ENCRYPT_KEY, this.ENCRYPT_IV)
}
}, (err, res, body) => {
const checkRoleRes = JSON.parse(this.aesDecrypt(body.result, this.ENCRYPT_KEY, this.ENCRYPT_IV));
@@ -42,7 +43,7 @@ export class Client {
createRole(token, sucCB) {
request.post('http://127.0.0.1:7001/user/createrole', {
json: {
data: this.aesEncrypt(JSON.stringify({token, serverId: 1}), this.ENCRYPT_KEY, this.ENCRYPT_IV)
data: this.aesEncrypt(JSON.stringify({token, serverId: this.serverId}), this.ENCRYPT_KEY, this.ENCRYPT_IV)
}
}, (err, res, body) => {
const result = JSON.parse(this.aesDecrypt(body.result, this.ENCRYPT_KEY, this.ENCRYPT_IV));
@@ -65,12 +66,12 @@ export class Client {
expect(msg.data.roleId).to.be.a('string');
expect(msg.data.channelName).to.be.a('string');
});
this._client.request('connector.entryHandler.enter', { serverId: 1, token }, (enterRes) => {
this._client.request('connector.entryHandler.enter', { serverId: this.serverId, token }, (enterRes) => {
// 消息回调
checkSuccessResponse(enterRes);
expect(enterRes.data.role).to.be.an('object');
this._roleInfo = enterRes.data.role;
this._client.request('role.roleHandler.initRole', { serverId: 1, token, roleName: genCode(8) }, (initRoleRes) => {
this._client.request('role.roleHandler.initRole', { serverId: this.serverId, token, roleName: genCode(8) }, (initRoleRes) => {
if (initRoleRes.code !== 0 && initRoleRes.code !== STATUS.ROLE_HAS_INIT.code) {
console.error('initRole error', initRoleRes.code, typeof initRoleRes.code);
}