From acc2231213691feb9b1ddb6e7596ee6a47541144 Mon Sep 17 00:00:00 2001 From: zhaocy Date: Fri, 15 Jul 2022 13:41:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95=E5=8D=87?= =?UTF-8?q?=E6=98=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/robot/hero.go | 48 +++++++++++++++++++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 10 deletions(-) diff --git a/cmd/robot/hero.go b/cmd/robot/hero.go index 7f8c5860b..fbc3acb1d 100644 --- a/cmd/robot/hero.go +++ b/cmd/robot/hero.go @@ -23,7 +23,7 @@ var ( // fmt.Printf("%d- %v\n", (i + 1), v) // } // }, - enabled: true, + // enabled: true, next: func(robot *Robot, rsp proto.Message) { tcs := []*TestCase{} if r, ok := rsp.(*pb.HeroListResp); ok { @@ -73,17 +73,45 @@ var ( rsp: &pb.HeroChoukaResp{}, // enabled: true, }, { + desc: "英雄列表", mainType: string(comm.ModuleHero), - subType: hero.StrengthenUpStar, - req: &pb.HeroStrengthenUpStarReq{ - HeroObjID: "62bd0489ff6632434a7d0d1f", - Hero: []*pb.CostCardData{ - { - CostCardObj: "", - }, - }, + subType: hero.HeroSubTypeList, + req: &pb.HeroListReq{}, + rsp: &pb.HeroListResp{}, + enabled: true, + next: func(robot *Robot, rsp proto.Message) { + if r, ok := rsp.(*pb.HeroListResp); ok { + tcs := []*TestCase{} + selHero := r.List[0] //选中的英雄 + for _, v := range r.List { + heroId := v.Id + tc := &TestCase{ + desc: "英雄升星", + mainType: string(comm.ModuleHero), + subType: hero.StrengthenUpStar, + req: &pb.HeroStrengthenUpStarReq{ + HeroObjID: selHero.Id, + HeroRace: []*pb.CostCardData{ + { + CostCardObj: heroId, + }, + }, + Hero: []*pb.CostCardData{ + { + CostCardObj: heroId, + }, + }, + }, + rsp: &pb.HeroStrengthenUpStarResp{}, + enabled: true, + } + tcs = append(tcs, tc) + } + robot.addBuilders(tcs) + } }, - rsp: &pb.HeroStrengthenUpStarResp{}, + }, { + // enabled: true, }, { mainType: string(comm.ModuleHero),