예제 #1
0
        def test_machine(self):
            """
            佣兵功能测试模块--主要检测每个界面按钮元素是否存在以及是否可点击
            """
            try:
                self.assertEqual("SnapDrag", machine.npcfavor(start, devices))
            except simplerpc.RpcTimeoutError:
                for i in range(initial.RpcTimeoutime()):  # rpc超时问题重置次数
                    try:
                        printred(
                            "————————————————————————————————————Rpc重连失败,脚本重新启动————————————————————————————————————"
                        )
                        initial.startgame(devices)
                        self.assertEqual("SnapDrag",
                                         machine.npcfavor(start, devices))
                        break
                    except simplerpc.RpcTimeoutError:
                        printred(
                            "————————————————————————————————————Rpc重连失败,脚本重新启动————————————————————————————————————"
                        )
                        initial.startgame(devices)
                        self.assertEqual("SnapDrag",
                                         machine.npcfavor(start, devices))

            finally:
                get_screen_shot(start, time.time(), devices, "佣兵模块功能测试脚本")
예제 #2
0
        def test_card(self):
            """
            图鉴-界面控件判断,二级界面控件判断
            """
            try:
                print("开始测试图鉴模块")
                self.assertEqual("兑 换", card.card(start, devices))
            except simplerpc.RpcTimeoutError:
                for i in range(initial.RpcTimeoutime()):  # rpc超时问题重置次数
                    try:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual("兑 换", card.card(start, devices))
                        break
                    except simplerpc.RpcTimeoutError:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual("兑 换", card.card(start, devices))

            finally:
                get_screen_shot(start, time.time(), devices, "图鉴-冒烟测试")
예제 #3
0
        def test_skill(self):
            """
            切换职业模块测试
            """
            try:
                print("开始测试技能模块")
                self.assertEqual("觉醒", skill.switch_roles(start, devices))
            except simplerpc.RpcTimeoutError:
                for i in range(initial.RpcTimeoutime()):  # rpc超时问题重置次数
                    try:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual("觉醒",
                                         skill.switch_roles(start, devices))
                        break
                    except simplerpc.RpcTimeoutError:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual("觉醒",
                                         skill.switch_roles(start, devices))

            finally:
                get_screen_shot(start, time.time(), devices, "技能模块-冒烟测试")
예제 #4
0
        def test_fashion(self):
            """
            时装-一级界面控件判断-二级界面控件判断
            """
            try:
                print("开始测试时装模块")
                self.assertEqual("获得装备即可激活魅力属性",
                                 fashion.fashion(start, devices))
            except simplerpc.RpcTimeoutError:
                for i in range(initial.RpcTimeoutime()):  # rpc超时问题重置次数
                    try:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual("获得装备即可激活魅力属性",
                                         fashion.fashion(start, devices))
                        break
                    except simplerpc.RpcTimeoutError:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual("获得装备即可激活魅力属性",
                                         fashion.fashion(start, devices))

            finally:
                get_screen_shot(start, time.time(), devices, "时装-冒烟测试")
예제 #5
0
        def test_longqi(self):
            """
            物资筹备测试模块--界面按钮-控件元素
            """
            try:
                self.assertEqual("日常攻略", material.material(start, devices))
            except simplerpc.RpcTimeoutError:
                for i in range(initial.RpcTimeoutime()):  # rpc超时问题重置次数
                    try:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual("日常攻略",
                                         material.material(start, devices))
                        break
                    except simplerpc.RpcTimeoutError:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual("日常攻略",
                                         material.material(start, devices))

            finally:
                get_screen_shot(start, time.time(), devices, "物资筹备功能测试模块")
예제 #6
0
파일: TC_horse.py 프로젝트: zlmone/airtest
        def test_horse_befor(self):
            """
            坐骑功能测试模块--主要检测每个坐骑是否报错,坐骑模型是否存在
            """
            try:
                self.assertEqual("BtnkBtn", horse.horse(start, devices))
            except simplerpc.RpcTimeoutError:
                for i in range(initial.RpcTimeoutime()):  # rpc超时问题重置次数
                    try:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual("BtnkBtn",
                                         horse.horse(start, devices))
                        break
                    except simplerpc.RpcTimeoutError:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual("BtnkBtn",
                                         horse.horse(start, devices))

            finally:
                get_screen_shot(start, time.time(), devices, "坐骑功能测试脚本")
예제 #7
0
        def test_space_time(self):
            """
            时空裂缝--界面元素判断,按钮点击
            """
            try:
                print("开始测试时空裂缝模块")
                self.assertEqual("排名奖", spacetime.space_time(start, devices))
            except simplerpc.RpcTimeoutError:
                for i in range(initial.RpcTimeoutime()):  # rpc超时问题重置次数
                    try:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual("排名奖",
                                         spacetime.space_time(start, devices))
                        break
                    except simplerpc.RpcTimeoutError:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual("排名奖",
                                         spacetime.space_time(start, devices))

            finally:
                get_screen_shot(start, time.time(), devices, "时空裂缝-冒烟测试")
예제 #8
0
        def test_task(self):
            """
            日常任务 - 接取任务-任务界面控件检测-刷新任务-帮助-刷新纪录界面的控件检测
            """
            try:
                print("开始测试日常任务模块")
                self.assertEqual("任务刷新记录", task.task(start, devices))
            except simplerpc.RpcTimeoutError:
                for i in range(initial.RpcTimeoutime()):  # rpc超时问题重置次数
                    try:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual("任务刷新记录", task.task(start, devices))
                        break
                    except simplerpc.RpcTimeoutError:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual("任务刷新记录", task.task(start, devices))

            finally:
                get_screen_shot(start, time.time(), devices, "日常任务-冒烟测试")
예제 #9
0
        def test_longhunforbidden(self):
            """
            龙魂禁地测试模块--主要检测每个界面按钮元素是否存在以及是否可点击
            """
            try:
                self.assertEqual(
                    "无限噩梦", longhunforbidden.longhunforbidden(start, devices))
            except simplerpc.RpcTimeoutError:
                for i in range(initial.RpcTimeoutime()):  # rpc超时问题重置次数
                    try:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual(
                            "无限噩梦",
                            longhunforbidden.longhunforbidden(start, devices))
                        break
                    except simplerpc.RpcTimeoutError:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual(
                            "无限噩梦",
                            longhunforbidden.longhunforbidden(start, devices))

            finally:
                get_screen_shot(start, time.time(), devices, "福利功能测试脚本")
예제 #10
0
파일: TC_pvp.py 프로젝트: zlmone/airtest
        def test_pvp(self):
            """
            竞技功能测试模块--主要检测每个界面按钮元素是否存在以及是否可点击
            """
            try:
                self.assertEqual("Btn_MobaRank", pvp.athletics(start, devices))
            except simplerpc.RpcTimeoutError:
                for i in range(initial.RpcTimeoutime()):  # rpc超时问题重置次数
                    try:
                        printred(
                            "————————————————————————————————————Rpc重连失败,脚本重新启动————————————————————————————————————"
                        )
                        initial.startgame(devices)
                        self.assertEqual("Btn_MobaRank",
                                         pvp.athletics(start, devices))
                        break
                    except simplerpc.RpcTimeoutError:
                        printred(
                            "————————————————————————————————————Rpc重连失败,脚本重新启动————————————————————————————————————"
                        )
                        initial.startgame(devices)
                        self.assertEqual("Btn_MobaRank",
                                         pvp.athletics(start, devices))

            finally:
                get_screen_shot(start, time.time(), devices, "竞技功能测试脚本")
예제 #11
0
파일: TC_award.py 프로젝트: zlmone/airtest
        def test_award(self):
            """
            福利功能测试模块--每个页签的元素判断,按钮点击
            """
            try:
                self.assertEqual("XSys_Reward_Dragon",
                                 award.reward(start, devices))
            except simplerpc.RpcTimeoutError:
                for i in range(initial.RpcTimeoutime()):  # rpc超时问题重置次数
                    try:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual("XSys_Reward_Dragon",
                                         award.reward(start, devices))
                        break
                    except simplerpc.RpcTimeoutError:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual("XSys_Reward_Dragon",
                                         award.reward(start, devices))

            finally:
                get_screen_shot(start, time.time(), devices, "龙器功能测试模块")
예제 #12
0
        def test_fairyland(self):
            """
            无限幻境-一级界面控件控件判断
            """
            try:
                print("开始测试无限幻境模块")
                self.assertEqual("组队挑战", fairyland.fairyland(start, devices))
            except simplerpc.RpcTimeoutError:
                for i in range(initial.RpcTimeoutime()):  # rpc超时问题重置次数
                    try:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual("组队挑战",
                                         fairyland.fairyland(start, devices))
                        break
                    except simplerpc.RpcTimeoutError:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual("组队挑战",
                                         fairyland.fairyland(start, devices))

            finally:
                get_screen_shot(start, time.time(), devices, "无限幻境-冒烟测试")
예제 #13
0
        def test_nightmare(self):
            """
            噩梦庭院 -- 噩梦庭院界面判断,按钮点击
            """
            try:
                print("开始测试噩梦庭院模块")
                self.assertEqual("赛季奖励", nightmare.nightmare(start, devices))
            except simplerpc.RpcTimeoutError:
                for i in range(initial.RpcTimeoutime()):  # rpc超时问题重置次数
                    try:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual("赛季奖励",
                                         nightmare.nightmare(start, devices))
                        break
                    except simplerpc.RpcTimeoutError:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual("赛季奖励",
                                         nightmare.nightmare(start, devices))

            finally:
                get_screen_shot(start, time.time(), devices, "噩梦庭院-冒烟测试")
예제 #14
0
파일: TC_home.py 프로젝트: Sinxs/airtest
        def test_home(self):
            """
            家园-家园界面控件判断、按钮点击
            """
            try:
                print("开始测试家园模块")
                self.assertEqual("腊八粥宴", home.home(start, devices))
            except simplerpc.RpcTimeoutError:
                for i in range(initial.RpcTimeoutime()):  # rpc超时问题重置次数
                    try:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual("腊八粥宴", home.home(start, devices))
                        break
                    except simplerpc.RpcTimeoutError:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual("腊八粥宴", home.home(start, devices))

            finally:
                get_screen_shot(start, time.time(), devices, "家园-冒烟测试")
예제 #15
0
파일: TC_nest.py 프로젝트: zlmone/airtest
        def test_nest(self):
            """
            巢穴模块 -- 巢穴排行榜控件判断--奖励控件判断--通关巢穴一次
            """
            try:
                print("开始测试巢穴模块")
                self.assertEqual("查看奖励", nest.nest(start, devices))
            except simplerpc.RpcTimeoutError:
                for i in range(initial.RpcTimeoutime()):  # rpc超时问题重置次数
                    try:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual("查看奖励", nest.nest(start, devices))
                        break
                    except simplerpc.RpcTimeoutError:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual("查看奖励", nest.nest(start, devices))

            finally:
                get_screen_shot(start, time.time(), devices, "巢穴-冒烟测试")
예제 #16
0
        def test_witness(self):
            """
            观战模块-观战界面的所有按钮点击操作,观战设置
            """

            try:
                print("开始测试观战模块")
                self.assertEqual("观战设置", witness.witness(start, devices))
            except simplerpc.RpcTimeoutError:
                for i in range(initial.RpcTimeoutime()):  # rpc超时问题重置次数
                    try:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual("观战设置",
                                         witness.witness(start, devices))
                        break
                    except simplerpc.RpcTimeoutError:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual("观战设置",
                                         witness.witness(start, devices))

            finally:
                get_screen_shot(start, time.time(), devices, "观战模块-冒烟测试")
예제 #17
0
        def test_bossrush(self):
            """
            bossrush -- bossrush界面判断
            """
            try:
                print("开始测试bossrush模块")
                self.assertEqual("本次挑战增益", bossrush.bossrush(start, devices))
            except simplerpc.RpcTimeoutError:
                for i in range(initial.RpcTimeoutime()):  # rpc超时问题重置次数
                    try:
                        common.printred(
                            "————————————————————————————————————Rpc重连失败,脚本重新启动————————————————————————————————————"
                        )
                        initial.startgame(devices)
                        self.assertEqual("本次挑战增益",
                                         bossrush.bossrush(start, devices))
                        break
                    except simplerpc.RpcTimeoutError:
                        common.printred(
                            "————————————————————————————————————Rpc重连失败,脚本重新启动————————————————————————————————————"
                        )
                        initial.startgame(devices)
                        self.assertEqual("本次挑战增益",
                                         bossrush.bossrush(start, devices))

            finally:
                common.get_screen_shot(start, time.time(), devices,
                                       "bossrush-冒烟测试")
예제 #18
0
        def test_guild(self):
            """
            公会-界面控件判断-二级界面控件判断
            """
            try:
                print("开始测试公会相关模块")
                self.assertEqual("公会钓鱼", guild.guild(start, devices))
            except simplerpc.RpcTimeoutError:
                for i in range(initial.RpcTimeoutime()):  # rpc超时问题重置次数
                    try:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual("公会钓鱼", guild.guild(start, devices))
                        break
                    except simplerpc.RpcTimeoutError:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual("公会钓鱼", guild.guild(start, devices))

            finally:
                get_screen_shot(start, time.time(), devices, "公会-冒烟测试")
예제 #19
0
        def test_gamemall(self):
            """
            商城-界面控件判断-售卖商品判断
            """
            try:
                print("开始测试商城模块")
                self.assertEqual("充 值", gamemall.gamemall(devices))
            except simplerpc.RpcTimeoutError:
                for i in range(initial.RpcTimeoutime()):  # rpc超时问题重置次数
                    try:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual("充 值", gamemall.gamemall(devices))
                        break
                    except simplerpc.RpcTimeoutError:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual("充 值", gamemall.gamemall(devices))

            finally:
                get_screen_shot(start, time.time(), devices, "商城-冒烟测试")
예제 #20
0
파일: TC_sprite.py 프로젝트: zlmone/airtest
        def test_sprite(self):
            """
            精灵功能测试模块--主要检测每个界面按钮元素是否存在以及是否可点击
            """
            try:
                self.assertEqual("FilterBtn", sprite.sprite(start, devices))
            except simplerpc.RpcTimeoutError:
                for i in range(initial.RpcTimeoutime()):  # rpc超时问题重置次数
                    try:
                        printred(
                            "————————————————————————————————————Rpc重连失败,脚本重新启动————————————————————————————————————"
                        )
                        initial.startgame(devices)
                        self.assertEqual("FilterBtn",
                                         sprite.sprite(start, devices))
                        break
                    except simplerpc.RpcTimeoutError:
                        printred(
                            "————————————————————————————————————Rpc重连失败,脚本重新启动————————————————————————————————————"
                        )
                        initial.startgame(devices)
                        self.assertEqual("FilterBtn",
                                         sprite.sprite(start, devices))

            finally:
                get_screen_shot(start, time.time(), devices, "精灵模块功能测试脚本")
예제 #21
0
        def test_setting(self):
            """
            设置测试模块--主要检测每个按钮点击是否正常,界面是否可以打开
            """
            try:
                self.assertEqual("Duck", setting.setting(start, devices))
            except simplerpc.RpcTimeoutError:
                for i in range(initial.RpcTimeoutime()):  # rpc超时问题重置次数
                    try:
                        printred(
                            "————————————————————————————————————Rpc重连失败,脚本重新启动————————————————————————————————————"
                        )
                        initial.startgame(devices)
                        self.assertEqual("Duck",
                                         setting.setting(start, devices))
                        break
                    except simplerpc.RpcTimeoutError:
                        printred(
                            "————————————————————————————————————Rpc重连失败,脚本重新启动————————————————————————————————————"
                        )
                        initial.startgame(devices)
                        self.assertEqual("Duck",
                                         setting.setting(start, devices))

            finally:
                get_screen_shot(start, time.time(), devices, "设置模块截图")
예제 #22
0
        def test_card(self):
            """
            商城购买,龙币购买 and 水晶购买
            """
            try:
                print("开始测试商城购买")
                self.assertEqual("水晶商城", gamemall.buy(start, devices))
            except simplerpc.RpcTimeoutError:
                for i in range(initial.RpcTimeoutime()):  # rpc超时问题重置次数
                    try:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual("水晶商城", gamemall.buy(start, devices))
                        break
                    except simplerpc.RpcTimeoutError:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual("水晶商城", gamemall.buy(start, devices))

            finally:
                get_screen_shot(start, time.time(), devices, "商城购买-冒烟测试")
예제 #23
0
        def test_equip(self):
            """
            装备-装备的各个选项界面控件判断
            """
            try:
                print("开始测试装备相关模块")
                self.assertEqual("角色", equip.equip(devices))
            except simplerpc.RpcTimeoutError:
                for i in range(initial.RpcTimeoutime()):  # rpc超时问题重置次数
                    try:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual("角色", equip.equip(devices))
                        break
                    except simplerpc.RpcTimeoutError:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual("角色", equip.equip(devices))

            finally:
                get_screen_shot(start, time.time(), devices, "装备-冒烟测试")
예제 #24
0
        def test_chat(self):
            """
            聊天 -- 每个聊天选项都进行聊天和发送表情,表情随机发送
            """
            try:
                print("开始测试聊天模块")
                self.assertEqual("系 统", chat.chat(start, devices))
            except simplerpc.RpcTimeoutError:
                for i in range(initial.RpcTimeoutime()):  # rpc超时问题重置次数
                    try:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual("系 统", chat.chat(start, devices))
                        break
                    except simplerpc.RpcTimeoutError:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual("系 统", chat.chat(start, devices))

            finally:
                get_screen_shot(start, time.time(), devices, "聊天-冒烟测试")
예제 #25
0
        def test_honor(self):
            """
            头衔模块-头衔晋升and界面判断-勋章合成and界面判断
            """
            try:
                print("开始测试头衔模块")
                self.assertEqual("背 包", honor.honor(start, devices))
            except simplerpc.RpcTimeoutError:
                for i in range(initial.RpcTimeoutime()):  # rpc超时问题重置次数
                    try:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual("背 包", honor.honor(start, devices))
                        break
                    except simplerpc.RpcTimeoutError:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual("背 包", honor.honor(start, devices))

            finally:
                get_screen_shot(start, time.time(), devices, "头衔-冒烟测试")
예제 #26
0
        def test_heraldry(self):
            """
            纹章模块-纹章穿戴、纹章制作,
            """
            try:
                print("开始测试纹章模块")
                self.assertEqual("纹 章", heraldry.heraldry(start, devices))
            except simplerpc.RpcTimeoutError:
                for i in range(initial.RpcTimeoutime()):  # rpc超时问题重置次数
                    try:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual("纹 章",
                                         heraldry.heraldry(start, devices))
                        break
                    except simplerpc.RpcTimeoutError:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual("纹 章",
                                         heraldry.heraldry(start, devices))

            finally:
                get_screen_shot(start, time.time(), devices, "纹章-冒烟测试")
예제 #27
0
        def test_dragonspirit(self):
            """
            龙魂  龙魂-界面判断
            """
            try:
                print("开始测试龙魂模块")
                self.assertEqual("龙魂总属性",
                                 dragonspirit.dragonspirit(start, devices))
            except simplerpc.RpcTimeoutError:
                for i in range(initial.RpcTimeoutime()):  # rpc超时问题重置次数
                    try:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual(
                            "龙魂总属性", dragonspirit.dragonspirit(start, devices))
                        break
                    except simplerpc.RpcTimeoutError:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual(
                            "龙魂总属性", dragonspirit.dragonspirit(start, devices))

            finally:
                get_screen_shot(start, time.time(), devices, "龙魂-冒烟测试")
예제 #28
0
파일: TC_title.py 프로젝트: Sinxs/airtest
        def test_title(self):
            """
            称号 - 检测所有称号是否存在,
            """
            try:
                print("开始测试称号模块")
                self.assertEqual("[fff7b4]钓鱼大师", title.title(start, devices))
            except simplerpc.RpcTimeoutError:
                for i in range(initial.RpcTimeoutime()):  # rpc超时问题重置次数
                    try:
                        printred(
                            "————————————————————————————————————Rpc重连失败,脚本重新启动————————————————————————————————————"
                        )
                        initial.startgame(devices)
                        self.assertEqual("[fff7b4]钓鱼大师",
                                         title.title(start, devices))
                        break
                    except simplerpc.RpcTimeoutError:
                        printred(
                            "————————————————————————————————————Rpc重连失败,脚本重新启动————————————————————————————————————"
                        )
                        initial.startgame(devices)
                        self.assertEqual("[fff7b4]钓鱼大师",
                                         title.title(start, devices))

            finally:
                get_screen_shot(start, time.time(), devices, "称号-冒烟测试")
예제 #29
0
파일: TC_reward.py 프로젝트: zlmone/airtest
        def test_reward(self):
            """
            悬赏任务-界面元素判断-任务判断-率刷新任务
            """
            try:
                print("开始测试悬赏任务模块")
                self.assertEqual("联盟悬赏", reward.reward(start, devices))
            except simplerpc.RpcTimeoutError:
                for i in range(initial.RpcTimeoutime()):  # rpc超时问题重置次数
                    try:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual("联盟悬赏", reward.reward(start, devices))
                        break
                    except simplerpc.RpcTimeoutError:
                        printred("————————————————————————————————————"
                                 "Rpc重连失败,脚本重新启动"
                                 "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual("联盟悬赏", reward.reward(start, devices))

            finally:
                get_screen_shot(start, time.time(), devices, "悬赏任务-冒烟测试")
예제 #30
0
파일: TC_mail.py 프로젝트: zlmone/airtest
        def test_mall(self):
            """
            邮 件-收取-删除测试
            """
            try:
                print("开始测试邮 件模块")
                self.assertEqual("邮 件", mail.mail(start, devices))
            except simplerpc.RpcTimeoutError:
                for i in range(initial.RpcTimeoutime()):  # rpc超时问题重置次数
                    try:
                        printred(
                            "————————————————————————————————————"
                            "Rpc重连失败,脚本重新启动"
                            "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual("邮 件", mail.mail(start, devices))
                        break
                    except simplerpc.RpcTimeoutError:
                        printred(
                            "————————————————————————————————————"
                            "Rpc重连失败,脚本重新启动"
                            "————————————————————————————————————")
                        initial.startgame(devices)
                        self.assertEqual("邮 件", mail.mail(start, devices))

            finally:
                get_screen_shot(start, time.time(), devices, "邮件-冒烟测试")