测试:jenkins

This commit is contained in:
luying
2022-08-05 19:35:03 +08:00
parent 4d49ec9197
commit a14674d3fc
13 changed files with 62 additions and 48 deletions
+6 -13
View File
@@ -36,10 +36,8 @@ describe('抽卡测试', function () {
expect(res.data.list).to.be.an('array');
res.data.list.forEach(gacha => {
expect(gacha.gachaId).to.be.a('number');
expect(gacha.freeCount).to.be.a('number');
expect(gacha.refFreeTime).to.be.a('number');
expect(gacha.isFree).to.be.a('boolean');
expect(gacha.count).to.be.a('number');
checkFloor(gacha.floor);
if(gacha.gachaId == GACHA_TYPE.NORMAL) {
checkHope(gacha.hope);
expect(gacha.point).to.be.a('number');
@@ -58,14 +56,14 @@ describe('抽卡测试', function () {
let hid1 = 1, hid2 = 2;
checkSetHope(pinusClient, gachaId, hid1, hid2, function(res) {
addItem(pinusClient, 22001, 10, function(res) {
checkPull(pinusClient, done, GACHA_TYPE.NORMAL, 0, 10);
checkPull(pinusClient, done, GACHA_TYPE.NORMAL, 0, 1);
});
})
});
it('检查友情点招募', function (done) {
addItem(pinusClient, 40003, 1000, function(res) {
checkPull(pinusClient, done, GACHA_TYPE.FRDPOINT, 0, 10);
checkPull(pinusClient, done, GACHA_TYPE.FRDPOINT, 0, 1);
});
});
@@ -74,7 +72,7 @@ describe('抽卡测试', function () {
let pickHero = 1;
addItem(pinusClient, 22002, 10, function(res) {
checkSetPickHero(pinusClient, gachaId, 0, pickHero, (res) => {
checkPull(pinusClient, done, GACHA_TYPE.ASSIGN, 0, 5);
checkPull(pinusClient, done, GACHA_TYPE.ASSIGN, 0, 1);
})
});
});
@@ -111,8 +109,7 @@ function checkPull(pinusClient, done, gachaId, activityId, count) {
checkSuccessResponse(res);
expect(res.data.gachaId).to.be.a('number');
checkResult(res.data.result, count);
expect(res.data.freeCount).to.be.a('number');
expect(res.data.refFreeTime).to.be.a('string');
expect(res.data.isFree).to.be.a('boolean');
expect(Date.parse(res.data.refFreeTime)).to.be.a('number');
expect(res.data.count).to.be.a('number');
checkFloor(res.data.floor);
@@ -128,7 +125,7 @@ function checkResult(result, count) {
expect(result).to.be.an('array');
expect(result.length).equal(count);
result.forEach(r => {
expect(r.contentId).to.be.a('number');
expect(r.planId).to.be.a('number');
expect(r.hid).to.be.a('number');
expect(r.isTransfer).to.be.a('boolean');
expect(r.id).to.be.a('number');
@@ -141,10 +138,6 @@ function checkSetPickHero(pinusClient, gachaId, activityId, pickHero, cb) {
checkSuccessResponse(res);
expect(res.data.gachaId).equal(gachaId);
expect(res.data.activityId).equal(activityId);
expect(res.data.heroes).to.be.an('array');
res.data.heroes.forEach(hid => {
expect(hid).to.be.a('number');
});
expect(res.data.pickHero).equal(pickHero);
cb(res);