测试:修复寻宝

This commit is contained in:
luying
2022-04-06 11:52:44 +08:00
parent 2492920288
commit 4397b03bdf
2 changed files with 32 additions and 32 deletions

View File

@@ -4,7 +4,7 @@ import 'mocha';
import { PinusWSClient } from 'pinus-robot-plugin';
import { expect } from 'chai';
import { checkDisplayItems, checkSuccessResponse } from './CheckPatten';
import { COM_TEAM_STATUS, DEFAULT_HEROES, MSG_TYPE, ON_GROUP_MSG_ROUTE } from '../app/consts';
import { COM_TEAM_STATUS, DEBUG_MAGIC_WORD, DEFAULT_HEROES, MSG_TYPE, ON_GROUP_MSG_ROUTE } from '../app/consts';
/**
* @description 组队后的战斗过程:队长开战 -> 设置阵容 -> 对默认敌人造成伤害 -> 获取战斗状态 -> 结算
@@ -48,7 +48,7 @@ describe('寻宝创建队伍', function() {
let roleInfoT;
const createTeamParms = {blueprtId: 33001, pub: true, ceLimit: 0};
const searchTeamParms = {lv: [1,2,3,4,5,6,7,8,9]};
const searchTeamParms = {lv: [1], magicWord: DEBUG_MAGIC_WORD};
beforeEach(function(done) {
const c = new Client();
@@ -118,31 +118,31 @@ describe('寻宝创建队伍', function() {
});
});
// it('先搜索再创建队伍的匹配情况', function(done) {
// pinusClientT.request('battle.comBattleHandler.searchTeam', searchTeamParms, (searchRes) => {
// // console.log('searchRes:', searchRes);
// checkSuccessResponse(searchRes, false);
// if (!searchRes.data) {
// pinusClient.request('battle.comBattleHandler.createTeam', createTeamParms, (res) => {
// checkSuccessResponse(res);
// expect(res.data.teamCode).to.be.a('string');
// expect(res.data.roleStatus).to.be.an('array');
// res.data.roleStatus.forEach(roleSt => {
// expect(roleSt).to.have.all.keys('roleId', 'roleName', 'isCap', 'isFrd', 'head', 'frame', 'spine', 'topLineupCe', 'lv', 'isRobot', 'heroes', 'killed', 'totalDmg', 'frdRatio', 'fixReward');
// });
// const roleIds = res.data.roleStatus.map(roleSt => { return roleSt.roleId });
// if (roleIds.indexOf(roleInfoT.roleId) === -1) {
// console.warn('未测试到先搜索后招募的组队情况');
// done();
// }
// comBattleProcess(pinusClient, res.data.teamCode, done);
// });
// } else {
// console.warn('未测试到先搜索后招募的组队情况');
// done();
// }
// });
// });
it('先搜索再创建队伍的匹配情况', function(done) {
pinusClientT.request('battle.comBattleHandler.searchTeam', searchTeamParms, (searchRes) => {
// console.log('searchRes:', searchRes);
checkSuccessResponse(searchRes, false);
if (!searchRes.data) {
pinusClient.request('battle.comBattleHandler.createTeam', createTeamParms, (res) => {
checkSuccessResponse(res);
expect(res.data.teamCode).to.be.a('string');
expect(res.data.roleStatus).to.be.an('array');
res.data.roleStatus.forEach(roleSt => {
expect(roleSt).to.have.all.keys('roleId', 'roleName', 'isCap', 'isFrd', 'head', 'frame', 'spine', 'topLineupCe', 'lv', 'isRobot', 'heroes', 'killed', 'totalDmg', 'frdRatio', 'fixReward');
});
const roleIds = res.data.roleStatus.map(roleSt => { return roleSt.roleId });
if (roleIds.indexOf(roleInfoT.roleId) === -1) {
console.warn('未测试到先搜索后招募的组队情况');
done();
}
comBattleProcess(pinusClient, res.data.teamCode, done);
});
} else {
console.warn('未测试到先搜索后招募的组队情况');
done();
}
});
});
it('创建队伍并解散', function(done) {
pinusClient.request('battle.comBattleHandler.createTeam', createTeamParms, (res) => {
@@ -231,7 +231,7 @@ describe('寻宝创建队伍', function() {
expect(res.data.teamInfos).to.be.an('array');
res.data.teamInfos.forEach(info => {
console.log('####',info )
expect(info).to.have.contains.keys('teamCode', 'roleIds', 'pub', 'blueprtId', 'quality', 'status', 'roleStatus', 'capId', 'ceLimit', 'roleCnt', 'bossHpArr', 'createdAt');
expect(info).to.have.contains.keys('teamCode', 'roleIds', 'pub', 'blueprtId', 'lv', 'status', 'roleStatus', 'capId', 'ceLimit', 'roleCnt', 'bossHpArr', 'createdAt');
});
done();
});