Files
ZYZ/game-server/test/role.test.ts
2023-09-21 17:17:06 +08:00

176 lines
4.2 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { Client } from './Client';
import 'mocha';
import { PinusWSClient } from 'pinus-robot-plugin';
import { expect } from 'chai';
import { addItemsIfNotEnough, checkDisplayItems, checkSuccessResponse, checkTimeStamp, checkWarJson } from './CheckPatten';
import { PVP } from '../app/pubUtils/dicParam';
import { DEBUG_MAGIC_WORD } from '../app/consts';
import { getRandSingleEelm } from '../app/pubUtils/util';
/*
describe('全局养成测试', function () {
let pinusClient: PinusWSClient;
let roleInfo;
before(function (done) {
const c = new Client();
const timer = setInterval(() => {
if (c.client) {
pinusClient = c.client;
roleInfo = c.roleInfo;
clearInterval(timer);
done();
}
}, 500);
});
after(function (done) {
pinusClient.disconnect();
// disconnect 后等待 500ms供服务器清理环境、退出频道等
setTimeout(() => {
done();
}, 500);
});
it('爵位升级', function (done) {
done();
});
it('获得百家学宫', function (done) {
done();
});
it('百家学宫摆放/替换/卸下武将', function (done) {
done();
});
it('百家学宫解锁位置', function (done) {
done();
});
it('获得名将谱激活状态', function (done) {
done();
});
it('激活/升级名将谱', function (done) {
done();
});
it('神像强化', function (done) {
done();
});
it('神像进阶', function (done) {
done();
});
it('神像强化', function (done) {
done();
});
it('保存展示阵容', function (done) {
done();
});
it('更换头像', function (done) {
done();
});
it('更换相框', function (done) {
done();
});
it('更换形象', function (done) {
done();
});
it('重命名', function (done) {
done();
});
});
*/
// describe('玉石养成测试', function () {
// let pinusClient: PinusWSClient;
// let roleInfo;
// before(function (done) {
// const c = new Client();
// const timer = setInterval(() => {
// if (c.client) {
// pinusClient = c.client;
// roleInfo = c.roleInfo;
// clearInterval(timer);
// done();
// }
// }, 500);
// });
// after(function (done) {
// pinusClient.disconnect();
// // disconnect 后等待 500ms供服务器清理环境、退出频道等
// setTimeout(() => {
// done();
// }, 500);
// });
// // { roleId: 'EAmqtKscfy', roleName: 'kYEXBWNk', serverId: 1, values: { reward: addItem }
// it('宝石一键合成', function (done) {
// // pinusClient.request('role.heroHandler.addItem', { id: 60001, count: 10 }, (res) => {
// // console.log("--------------------添加道具", res)
// // done();
// // })
// pinusClient.request('role.equipHandler.composeStoneByItId', { itId: 42 }, (res) => {
// console.log("-------------------- res", res)
// done();
// })
// })
// });
describe('将魂', function () {
let pinusClient: PinusWSClient;
let roleInfo;
before(function (done) {
const c = new Client();
const timer = setInterval(() => {
if (c.client) {
pinusClient = c.client;
roleInfo = c.roleInfo;
clearInterval(timer);
done();
}
}, 500);
});
after(function (done) {
pinusClient.disconnect();
// disconnect 后等待 500ms供服务器清理环境、退出频道等
setTimeout(() => {
done();
}, 500);
});
// it('将魂回收', function (done) {
// pinusClient.request('role.heroHandler.addItem', { id: 21019, count: 500 }, (res) => {
// console.log("--------------------添加道具", res)
// done();
// })
// pinusClient.request('role.shopHandler.recycleSoul', { goodsId: 21019, count: 1 }, (res) => {
// console.log("-------------------- res", res)
// done();
// })
// pinusClient.request('role.shopHandler.recycleSoulFast', { recycleSoulFastPara }, (res) => {
// console.log("-------------------- res", res)
// done();
// })
// })
});
// export interface recycleSoulFastPara {
// hid: number;
// goodsId: number;
// count: number;
// }
// let recycleSoulFastPara: recycleSoulFastPara[] = [];
// recycleSoulFastPara.push({ hid: 19, goodsId: 21019, count: 1 });