Beispiel #1
0
def mall(start, devices):  # 商店功能测试
    dev = connect_device("android:///" + devices)
    poco = UnityPoco(device=dev)
    if poco("Alphaboard").offspring("SysA_Friends").exists():
        poco("Alphaboard").offspring("SysA_Friends").click()  # 点击社交
        if poco("FriendsDlg(Clone)").offspring("Tabs").child("item2").exists():
            poco("FriendsDlg(Clone)").offspring("Tabs").child(
                "item2").click()  # 点击战队
            if poco("Create").exists():
                poco("Create").click()  # 创建战队
                if poco("Bg2").exists():
                    poco("NameInput").set_text(
                        f"{random.randint(100000, 99999999)}")  # 输战队会名称
                    poco("Highlight").click()  # 点击创建战队
            else:
                print("已经有战队了")
        else:
            common.printred("没有进入社交界面,请检查...")
            common.get_screen_shot(start, time.time(), devices, "没有进入社交界面")
    else:
        common.printred("主界面没有社交按钮,请检查...")
        common.get_screen_shot(start, time.time(), devices, "主界面没有社交按钮")
    l_close = poco(texture="l_close_00")
    Close = poco("Close")
    for x in range(4):
        time.sleep(0.5)
        if l_close.exists() and Close.exists():
            time.sleep(1.5)
            l_close.click()
            poco("RecruitPublishView(Clone)").offspring("Close").click()
        elif Close.exists():
            time.sleep(1.5)
            Close.click()
        else:
            break
    if poco("SysAGameMall").exists():
        poco("SysAGameMall").click()
        if poco("XSys_Mall").exists():
            poco("XSys_Mall").click()
        else:
            common.printred("商城界面找不到商店页签,请检查")
            return
    else:
        common.printred("主界面找不到商城按钮,请检查")
        return

    for item in range(len(poco("Grid").child())):
        item1 = "item" + str(item)
        if poco("GameMall(Clone)").offspring("ShopFrame").offspring(
                item1).exists():  # 商店的子页签
            # if poco("GameMall(Clone)").offspring("ShopFrame").offspring(item1).offspring("shopname").exists():
            pos = poco("GameMall(Clone)").offspring("ShopFrame").offspring(
                item1)
            butpos(devices,
                   butpos=pos,
                   pos1=0.38,
                   pos2=0.91,
                   high=558,
                   low=643,
                   lows=366)  # 调用butpos方法
            pos.click()  # 点击商店子页签
            sleep(1)
            freeze_poco = poco.freeze()  # TODO:定义dongjiepoco
            if not poco("Create").exists():  # 创建公会
                common.printgreen("进入  " + poco("ShopName").get_text() +
                                  "  界面")
                if freeze_poco("MallDlg(Clone)").offspring(
                        "TabShopFrame").child("item0").exists():
                    for item in range(
                        (len(freeze_poco("TabShopFrame").child()) -
                         4)):  # 点击子商店的子页签
                        item2 = "item" + str(item)
                        if freeze_poco("MallDlg(Clone)").offspring(
                                item2).offspring(
                                    "TextLabel").exists():  # 商店子页签
                            freeze_poco("MallDlg(Clone)").offspring(
                                item2).offspring("TextLabel").click()
                            if poco("MallDlg(Clone)").offspring("Panel").child(
                                    "item0").exists():  # 商店商品
                                pass
                            else:
                                common.printgreen(
                                    poco("MallDlg(Clone)").offspring(
                                        "TabShopFrame").child(item2).offspring(
                                            "TextLabel").get_text() +
                                    " 页签 没有找到任何售卖道具")
                else:
                    if poco("MallDlg(Clone)").offspring("item0").exists():
                        common.printgreen(
                            poco("ShopName").get_text() +
                            " 页面没有其他子页签,界面检测到售卖道具,显示正确")
                    else:
                        common.printgreen(
                            poco("ShopName").get_text() +
                            " 页面没有其他子页签,没有找到任何售卖道具")
                poco("Close").click()
            else:
                common.printgreen("商店没有开启")
                poco("Close").click()
        else:
            common.printred("商店页面没有子页签,请检查...")
    return poco("item13").child("shopname").get_text()  # 战队商店
Beispiel #2
0
def gamemall(devices):
    poco = common.deviceconnect(devices)
    if poco("SysAGameMall").exists():
        poco("SysAGameMall").click()
    else:
        common.printred("主界面找不到商城按钮,请检查")
    Mallbutlist = [
        "XSys_GameMall_Diamond", "XSys_GameMall_Dragon",
        "XSys_GameMall_CRYSTAL", "XSys_Mall", "XSys_GameMall_Pay"
    ]
    for but in Mallbutlist:
        if poco(but).exists():
            common.printgreen("开始点击商城内 " + poco("GameMall(Clone)").offspring(
                but).offspring("SelectedTextLabel").get_text() + " 子页签")
            poco(but).click()
            freeze_poco = poco.freeze()  # TODO:定义dongjiepoco
            for item in range(len(freeze_poco("TabsFrame").child())):
                item1 = "item" + str(item)
                if freeze_poco("GameMall(Clone)").offspring("TabsFrame").child(
                        item1).exists():
                    if freeze_poco("GameMall(Clone)").offspring(
                            "TabsFrame").child(item1).get_position()[1] > 0:
                        if freeze_poco("GameMall(Clone)").offspring("TabsFrame").child(item1)\
                                .offspring("TextLabel").exists():
                            common.printgreen(
                                "点击 " +
                                freeze_poco("GameMall(Clone)").offspring(
                                    "TabsFrame").child(item1).offspring(
                                        "TextLabel").get_text() + " 页签")
                            freeze_poco("GameMall(Clone)").offspring(
                                "TabsFrame").child(item1).click()
                            if poco("ailin").exists():
                                common.printgreen(
                                    "---------->判断 " +
                                    poco("GameMall(Clone)").offspring(
                                        "TabsFrame").child(item1).offspring(
                                            "TextLabel").get_text() +
                                    " 很穷,没有商品...")
                            elif poco("GameMall(Clone)").offspring(
                                    "item0").exists():
                                common.printgreen(
                                    "---------->判断 " +
                                    poco("GameMall(Clone)").offspring(
                                        "TabsFrame").child(item1).offspring(
                                            "TextLabel").get_text() +
                                    " 内容显示正确")
                        else:
                            common.printcolor(
                                "拿到控件,但是却拿不到text,很有可能是程序多写了无用控件,这句可以无视,"
                                "因为不会影响用户体验", "blue")
                    else:
                        pass
                else:
                    common.printred("找不到商城子页签,请检查,很有可能是程序多写了无用控件.....")
            if poco("GameMall(Clone)").offspring("ShopFrame").offspring(
                    "item0").exists():
                common.printgreen("----------->" +
                                  poco("GameMall(Clone)").offspring(but).
                                  offspring("SelectedTextLabel").get_text() +
                                  " 内子界面显示正确")
            elif poco("GameMall(Clone)").offspring("DiamondFrame").offspring(
                    "item0").exists():
                common.printgreen("----------->" +
                                  poco("GameMall(Clone)").offspring(but).
                                  offspring("SelectedTextLabel").get_text() +
                                  " 内子界面显示正确")
        else:
            common.printred("商城界面缺少子页签,请检查")
    return poco("GameMall(Clone)").child("Bg").child("T").get_text()
Beispiel #3
0
def item_jade(start, devices):
    poco = common.deviceconnect(devices)
    check_menu("SysAItem", poco)  # 进入角色
    poco("XSys_Item_Jade").click()  # 进入龙玉页签
    with poco.freeze() as freeze_poco:
        if freeze_poco("ItemNewDlg(Clone)").offspring("Help").exists(
        ) and freeze_poco("JadeShop").exists() and freeze_poco(
                "BtnEqOnekey").exists():
            common.printgreen("规则按钮,龙玉获取,一键镶嵌按钮检测正常")
        else:
            common.printred("龙玉界面缺少按钮")
            common.get_screen_shot(start, time.time(), devices, "龙玉界面缺少按钮")
    if poco("Empty").exists():
        if poco("Empty").child("T").get_text() == "先穿戴装备再来镶嵌龙玉哦":  # 判断是不是没有装备
            poco("XSys_Item_Equip").click()  # 去穿戴装备
            with poco.freeze() as freeze_poco:
                equipchild = freeze_poco("WrapContent").child()
                for i in equipchild:
                    name = i.get_name()
                    if name[:5] != "empty":
                        equipname = name
                        break
            poco(equipname).click()  # 点击装备
            poco("Button1").click()  # 穿戴装备
            poco("XSys_Item_Jade").click()  # 再次点击龙玉
    else:
        common.printgreen("龙玉界面穿了装备,直接进行龙玉获取操作")
    poco("JadeShop").click()
    poco("access212").click()
    common.printgreen("进入龙玉商店")
    poco("GameMall(Clone)").offspring("item3").offspring(
        "TextLabel").click()  # 进入龙玉页签
    for i in range(2):
        poco("OK").click()
    poco("Close").click()  # 关闭龙玉商店
    poco("BtnEqOnekey").click()  # 一件镶嵌
    if poco("onekeylvup").exists():
        poco("onekeylvup").click()  # 一键升级
        common.printgreen("龙玉升级--一键升级")
        poco("UIRoot(Clone)").offspring("BtnCompose").click()  # 确认一键升级
    if poco("Btngroup").exists():
        poco("Btngroup").click()  # 龙玉组合
        if poco("UIRoot(Clone)").offspring("JadeGroupPanel").child("Bg").child(
                "Bg").exists():
            common.printgreen("龙玉组合界面打开成功")
            poco(texture="l_close_00").click()  # 关闭龙玉组合界面
        else:
            common.printred("龙玉组合界面打开失败")
            common.get_screen_shot(start, time.time(), devices, "龙玉组合界面打开失败")
    else:
        common.printred("龙玉组合按钮不存在")
        common.get_screen_shot(start, time.time(), devices, "龙玉组合按钮不存在")
    poco("JadeEquipFrameNew").offspring("Help").click()  # 规则按钮
    if poco("CommonHelpTip(Clone)").child("Bg").exists():
        common.printgreen("龙玉规则界面打开正常")
        poco("Btn").click()  # 关闭规则界面
    else:
        common.printred("龙玉规则界面打开失败")
        common.get_screen_shot(start, time.time(), devices, "龙玉规则界面打开失败")
    poco("Close").click()
    return poco("Duck").get_name()  # 返回值poco("Duck").get_name()
Beispiel #4
0
def card(start, devices):
    poco = common.deviceconnect(devices)
    if poco("SysD_CardCollect").get_position()[0] > 1:
        poco(texture="halln_4").click()
        poco("SysD_CardCollect").click()
    else:
        common.printgreen("界面上就有图鉴按钮")
        poco("SysD_CardCollect").click()
    if poco("DeckPanel").exists():
        for item in range(len(poco("DeckPanel").child())):
            item1 = "item" + str(item)
            poco("CardCollectDlg(Clone)").offspring("Deck").offspring(
                "DeckPanel").child(item1).click()
            if poco("CardCollectDlg(Clone)").offspring("Deck").offspring("DeckPanel").child(item1).offspring("Name")\
                    .get_text() == poco("Title").get_text():
                common.printgreen("图鉴-->>  " + poco("Title").get_text() +
                                  "  界面显示正确")
                freeze_poco = poco.freeze()  # TODO:定义dongjiepoco
                for item in range(len(freeze_poco("WrapContent").child())):
                    item1 = "item" + str(item)
                    but = freeze_poco("CardCollectDlg(Clone)").offspring("Deck").offspring("WrapContent").child(item1)\
                        .child("Name").get_text()
                    common.printgreen("检查点-->>  " + but + "  显示正确")
        if poco("OpenCardList").exists():
            poco("OpenCardList").click()
            freeze_poco = poco.freeze()  # TODO:定义dongjiepoco
            for Quality in range(1, len(freeze_poco("Panel").child()) + 1):
                Quality1 = "Quality" + str(Quality)
                if freeze_poco(Quality1).exists():
                    for item in range(
                            len(freeze_poco(Quality1).child("item").child())):
                        item1 = "item" + str(item)
                        if freeze_poco("CardCollectDlg(Clone)").offspring("CardList").offspring(Quality1)\
                                .offspring(item1).child("Icon").exists():
                            pass
                    common.printgreen("检查点-->> 图鉴显示  界面显示正确\n接下来点击图鉴分解")
                    poco("AutoResolve").click()  # 图片分解
                    if poco("GreyModalDlg(Clone)").child("Bg").child(
                            "Label").exists():
                        common.printgreen("检查点-->>" +
                                          poco("GreyModalDlg(Clone)").child(
                                              "Bg").child("Label").get_text() +
                                          " 界面显示正确")
                        poco("OK").click()  # 点击确认分解图鉴
                        if poco(text="分 解").exists():
                            common.printgreen("检查点-->>" +
                                              poco(text="分 解").get_text() +
                                              " 界面显示正确")
                            poco("Cancel").click()  # 点击返回
                            poco(texture="l_close_00").click()  # 点击返回
                    else:
                        if poco(text="分 解").exists():
                            common.printgreen("检查点-->>" +
                                              poco(text="分 解").get_text() +
                                              " 界面显示正确")
                            poco("Cancel").click()  # 点击返回
                            poco(texture="l_close_00").click()  # 点击返回
                    if poco("OpenShop").exists():  # 图鉴兑换
                        poco("OpenShop").click()
                        freeze_poco = poco.freeze()  # TODO:定义dongjiepoco
                        if freeze_poco("Sprite").exists():
                            common.printgreen("进入图鉴兑换界面,开始检查界面元素")
                            for item in range(
                                    len(freeze_poco("ShopPanel").child())):
                                item1 = "item" + str(item)
                                icon = freeze_poco("CardCollectDlg(Clone)").offspring("Shop").offspring(item1)\
                                    .child("Item").child("Name").get_text()
                                common.printgreen(f"兑换图鉴 {icon} 显示正确")
                        # 关闭当前页签
                        poco(texture="l_close_00").click()
                        if not poco(texture="l_close_00").exists():
                            pass
                        else:
                            poco(texture="l_close_00").click()
    else:
        common.printred("没有进入图鉴界面,请检查...")
        common.get_screen_shot(start, time.time(), devices, "没有进入图鉴界面")
    return poco("OpenShop").child("T").get_text()  # 兑 换
Beispiel #5
0
def entrancehome(start, devices):
    poco = common.deviceconnect(devices)
    poco = common.deviceconnect(devices)
    if poco("SysB_Home").get_position()[0] > 1:
        poco(texture="halln_4").click()
        sleep(2)
    else:
        common.printgreen("当前界面就有家园按钮")
    poco("SysB_Home").click()  # 点击家园按钮
    if poco("HomeMainView(Clone)").offspring("XSys_Home_MyHome").exists():
        poco("HomeMainView(Clone)").offspring("XSys_Home_MyHome").click()  # 点击我的家园
        if poco("Background").exists():
            poco("Background").click()  # 点击前往家园
            sleep(7)
            if poco("Planting").child("T").exists() and \
                    poco("Fishing").child("T").exists() and \
                    poco("HomeHandler").child("Name").exists():
                common.printgreen("检查点" + poco("Planting").child("T").get_text() + "  显示正确")
                common.printgreen("检查点" + poco("Fishing").child("T").get_text() + "  显示正确")
                common.printgreen("检查点" + poco("HomeHandler").child("Name").get_text() + "  显示正确")
                common.printgreen("进入我的家园测试成功")
            else:
                common.printgreen("没有进入我的家园,请检查..")
                common.get_screen_shot(start, time.time(), devices, "没有进入我的家园")
            poco("Fishing").child("T").click()  # 点击钓鱼
            sleep(10)
            if poco("StartFishingBtn").exists() and poco("SweepBtn").exists():
                poco("StartFishingBtn").click()  # 点击单次钓鱼
                if poco(texture="l_frame_02").child("T").exists():
                    common.printgreen("检查点 " + poco(texture="l_frame_02").child("T").get_text() + "  显示正确")
                    common.printgreen("进入钓鱼成功")
                    sleep(10)
                    poco("Close").click()
                    if poco(texture="title_public").exists():
                        poco("OK").click()
                        common.printgreen("钓鱼操作测试完成")
                    else:
                        common.printgreen("没有钓到鱼........")
            else:
                common.printgreen("没有钓鱼按钮,请检查..")
                common.get_screen_shot(start, time.time(), devices, "没有钓鱼按钮")
        else:
            common.printgreen("我的家园界面缺少前家园按钮,请检查..")
            common.get_screen_shot(start, time.time(), devices, "我的家园界面缺少前家园按钮")
    else:
        common.printgreen("家园界面缺少控件。请检查..")
        common.get_screen_shot(start, time.time(), devices, "家园界面缺少控件")
    if poco("SysC_HomeCooking").exists():
        poco("SysC_HomeCooking").click()  # 点击烹饪按钮
        poco("HomeMainView(Clone)").offspring("XSys_Home_MyHome").click()  # 点击我的家园
        freeze_poco = poco.freeze()  # TODO:定义dongjiepoco
        if freeze_poco("HomeMainView(Clone)").offspring("HomeLog").child("Tittle").child("NameLab").exists() and \
                freeze_poco("HomeMainView(Clone)").offspring("FriendsRank").child("Tittle").child("NameLab").exists():
            common.printgreen(
                "检查点 " + freeze_poco("HomeMainView(Clone)").offspring("HomeLog").child("Tittle").child(
                    "NameLab").get_text() + " 显示正确")
            common.printgreen(
                "检查点 " + freeze_poco("HomeMainView(Clone)").offspring("FriendsRank").child("Tittle").child(
                    "NameLab").get_text() + " 显示正确")
            common.printgreen("检查点 " + freeze_poco("VisitedTimes").child("Tittle").get_text() + " 显示正确")
            common.printgreen("检查点 " + freeze_poco("BaitNum").child("Tittle").get_text() + " 显示正确")
            common.printgreen("检查点 " + freeze_poco("PlantNum").child("Tittle").get_text() + " 显示正确")
            common.printgreen("检查点 " + freeze_poco("HarvestTime").child("Tittle").get_text() + " 显示正确")
            common.printgreen("检查点 " + freeze_poco("HomeStatus").child("Tittle").get_text() + " 显示正确")
        else:
            common.printred("我的家园界面 缺少控件,请检查")
            common.get_screen_shot(start, time.time(), devices, "我的家园界面缺少控件")
        poco("HomeMainView(Clone)").offspring("XSys_Home_HomeFriends").click()  # 点击好友
        freeze_poco = poco.freeze()  # TODO:定义dongjiepoco
        if freeze_poco("ailin").exists() and freeze_poco("tip").exists():
            common.printgreen("检查点" + freeze_poco("tip").get_text() + "显示完成")
        else:
            common.printred("好友界面 缺少控件,请检查")
            common.get_screen_shot(start, time.time(), devices, "好友界面缺少控件")
        poco("HomeMainView(Clone)").offspring("XSys_Home_Cooking").click()  # 点击烹饪
        freeze_poco = poco.freeze()  # TODO:定义dongjiepoco
        if freeze_poco("ToggleSprite").exists():
            A = poco("ToggleSprite").get_position()[1]
            B = poco("HomeMainView(Clone)").offspring("UITable").child("item0").child("Children").child(
                "item0").get_position()[1]
            if B - A < 0.05:
                poco("ToggleSprite").click()  # 点击一级料理
            freeze_poco = poco.freeze()  # TODO:定义dongjiepoco
            for item in range(len(
                    freeze_poco("HomeMainView(Clone)").offspring("UITable").child("item0").child("Children").child())):
                item1 = "item" + str(item)
                common.printgreen(
                    "检查点 " + freeze_poco("HomeMainView(Clone)").offspring("UITable").child("item0").child(
                        "Children").child(item1).child("UnSelectLab").get_text() + "显示正确")
            poco("ToggleSprite").click()  # 缩回一级料理
            A = poco("NameLab").get_position()[1]
            B = poco("HomeMainView(Clone)").offspring("UITable").child("item1").offspring("item9").child(
                "UnSelectLab").get_position()[1]
            if B - A < 0.05:
                poco("NameLab").click()  # 点击二级料理
            freeze_poco = poco.freeze()  # TODO:定义dongjiepoco
            for item in range(len(
                    freeze_poco("HomeMainView(Clone)").offspring("UITable").child("item1").child("Children").child())):
                item1 = "item" + str(item)
                common.printgreen(
                    "检查点 " + freeze_poco("HomeMainView(Clone)").offspring("UITable").child("item0").child(
                        "Children").child(
                        item1).child("UnSelectLab").get_text() + "显示正确")
        else:
            common.printred("烹饪界面 缺少控件,请检查")
            common.get_screen_shot(start, time.time(), devices, "烹饪界面缺少控件")
        poco("HomeMainView(Clone)").offspring("XSys_Home_Feast").click()  # 点击宴会
        freeze_poco = poco.freeze()  # TODO:定义dongjiepoco
        if freeze_poco("HomeMainView(Clone)").offspring("Tabs").child("item0").child("Tittle").exists() and \
                freeze_poco("HomeMainView(Clone)").offspring("Tabs").child("item1").child("Tittle").exists() and \
                freeze_poco("HomeMainView(Clone)").offspring("Tabs").child("item2").child("Tittle").exists() and \
                freeze_poco(texture="l_frame_01_00").exists() and \
                freeze_poco(texture="l_frame_01_0").exists():
            common.printgreen("宴会界面检查点" + freeze_poco("HomeMainView(Clone)").offspring("Tabs").
                              child("item2").child("Tittle").get_text() + "显示正确")
            common.printgreen("宴会界面检查点" + freeze_poco("HomeMainView(Clone)").offspring("Tabs").
                              child("item1").child("Tittle").get_text() + "显示正确")
            common.printgreen("宴会界面检查点" + freeze_poco("HomeMainView(Clone)").offspring("Tabs").
                              child("item0").child("Tittle").get_text() + "显示正确")
        else:
            common.printred("宴会界面 缺少控件,请检查")
            common.get_screen_shot(start, time.time(), devices, "宴会界面缺少控件")
        poco("HomeMainView(Clone)").offspring("Tabs").child("item0").child("Tittle").click()  # 点击全鱼宴
        freeze_poco = poco.freeze()  # TODO:定义dongjiepoco
        if poco("HomeMainView(Clone)").offspring("Content").offspring("Name").exists() and \
                poco("ContentLab").exists():
            common.printgreen("界面检查点 " + freeze_poco("HomeMainView(Clone)").offspring("Tabs").
                              child("item0").child("Tittle").get_text() + " 显示正确")
            common.printgreen("界面检查点 " + freeze_poco("ContentLab").get_text() + " 显示正确")
        else:
            common.printred("全鱼宴界面 缺少控件,请检查")
            common.get_screen_shot(start, time.time(), devices, "全鱼宴界面缺少控件")
        poco("HomeMainView(Clone)").offspring("Tabs").child("item1").child("Tittle").click()  # 点击海鲜宴
        freeze_poco = poco.freeze()  # TODO:定义dongjiepoco
        if poco("HomeMainView(Clone)").offspring("Content").offspring("Name").exists() and poco("ContentLab").exists():
            common.printgreen(
                "界面检查点 " + freeze_poco("HomeMainView(Clone)").offspring("Tabs").child("item0").child(
                    "Tittle").get_text() + " 显示正确")
            common.printgreen("界面检查点 " + freeze_poco("ContentLab").get_text() + " 显示正确")
        else:
            common.printred("海鲜宴界面 缺少控件,请检查")
            common.get_screen_shot(start, time.time(), devices, "海鲜宴界面缺少控件")
        poco("HomeMainView(Clone)").offspring("Tabs").child("item2").child("Tittle").click()  # 点击腊八粥宴
        freeze_poco = poco.freeze()  # TODO:定义dongjiepoco
        if freeze_poco("HomeMainView(Clone)").offspring("Content").offspring("Name").exists() and \
                freeze_poco("ContentLab").exists():
            common.printgreen("界面检查点 " + freeze_poco("HomeMainView(Clone)").offspring("Tabs").
                              child("item0").child("Tittle").get_text() + " 显示正确")
            common.printgreen("界面检查点 " + freeze_poco("ContentLab").get_text() + " 显示正确")
            poco("Close").click()  # TODO:点击返回
            if poco("SysB_HomeShop").exists():
                poco("SysB_HomeShop").click()  # 点击家园商店
                freeze_poco = poco.freeze()  # TODO:定义dongjiepoco
                for item in range(len(poco("Panel").child())):
                    item1 = "item" + str(item)
                    if freeze_poco("MallDlg(Clone)").offspring(item1).child("Item").child("Name").exists():
                        common.printgreen("界面检查点 " + freeze_poco("MallDlg(Clone)").offspring(item1).
                                          child("Item").child("Name").get_text() + " 显示正确")
                    else:
                        common.printred("家园商店界面 缺少控件,请检查")
                        common.get_screen_shot(start, time.time(), devices, "家园商店界面缺少控件")
            poco("Close").click()  # TODO:点击返回

            if poco("SysA_HomeMain").exists():
                poco("SysA_HomeMain").click()  # 点击家园总览
                common.printgreen("进入家园总览成功,因为已经测试过当前界面,故不再测试...")
                if poco(texture="l_frame_00").exists():
                    poco("Close").click()  # TODO:点击返回
                    if poco("ExitHome").exists():
                        poco("ExitHome").click()  # 返回主界面
                        sleep(15)
                        if poco("H2").exists():
                            common.printgreen("回到游戏主界面")
            else:
                common.printred("家园界面缺少 家园总览 控件,请检查")
                common.get_screen_shot(start, time.time(), devices, "家园界面缺少家园总览缺少控件")
        else:
            common.printred("腊八粥宴界面 缺少控件,请检查")
            common.get_screen_shot(start, time.time(), devices, "腊八粥宴界面缺少控件")
    else:
        common.printgreen("家园界面缺少烹饪控件。请检查..")
        common.get_screen_shot(start, time.time(), devices, "我的家园界面缺少前家园按钮")
    return poco("Alphaboard").offspring("SysA_Friends").child("Name").get_text()  # 返回  社交  社交
Beispiel #6
0
def home(start, devices):
    poco = common.deviceconnect(devices)
    if poco("SysB_Home").get_position()[0] > 1:
        poco(texture="halln_4").click()
        sleep(2)
    else:
        common.printgreen("当前界面就有家园按钮")
    poco("SysB_Home").click()  # 点击家园按钮
    freeze_poco = poco.freeze()  # TODO:定义dongjiepoco
    homelist = ["XSys_Home_MyHome","XSys_Home_HomeFriends","XSys_Home_Cooking","XSys_Home_Feast"]
    for item in homelist:
        if freeze_poco("HomeMainView(Clone)").offspring(item).offspring("TextLabel").exists():
            common.printgreen("界面检查点 " + freeze_poco("HomeMainView(Clone)").offspring(item).offspring("TextLabel").get_text() + " 存在")
        else:
            common.printred("家园界面 缺少控件,请检查")
            common.get_screen_shot(start, time.time(), devices, "家园界面缺少控件")
    poco("HomeMainView(Clone)").offspring("XSys_Home_MyHome").click()  # 点击我的家园
    freeze_poco = poco.freeze()  # TODO:定义dongjiepoco
    if freeze_poco("HomeMainView(Clone)").offspring("HomeLog").child("Tittle").child("NameLab").exists() and \
            freeze_poco("HomeMainView(Clone)").offspring("FriendsRank").child("Tittle").child("NameLab").exists():
        common.printgreen("检查点 " + freeze_poco("HomeMainView(Clone)").offspring("HomeLog").child("Tittle").child("NameLab").get_text() + " 显示正确")
        common.printgreen("检查点 " + freeze_poco("HomeMainView(Clone)").offspring("FriendsRank").child("Tittle").child("NameLab").get_text() + " 显示正确")
        common.printgreen("检查点 " + freeze_poco("VisitedTimes").child("Tittle").get_text() + " 显示正确")
        common.printgreen("检查点 " + freeze_poco("BaitNum").child("Tittle").get_text() + " 显示正确")
        common.printgreen("检查点 " + freeze_poco("PlantNum").child("Tittle").get_text() + " 显示正确")
        common.printgreen("检查点 " + freeze_poco("HarvestTime").child("Tittle").get_text() + " 显示正确")
        common.printgreen("检查点 " + freeze_poco("HomeStatus").child("Tittle").get_text() + " 显示正确")
    else:
        common.printred("我的家园界面 缺少控件,请检查")
        common.get_screen_shot(start, time.time(), devices, "我的家园界面缺少控件")
    poco("HomeMainView(Clone)").offspring("XSys_Home_HomeFriends").click()  # 点击好友
    freeze_poco = poco.freeze()  # TODO:定义dongjiepoco
    if freeze_poco("ailin").exists() and freeze_poco("tip").exists():
        common.printgreen("检查点" + freeze_poco("tip").get_text() + "显示完成")
    else:
        common.printred("好友界面 缺少控件,请检查")
        common.get_screen_shot(start, time.time(), devices, "好友界面缺少控件")
    poco("HomeMainView(Clone)").offspring("XSys_Home_Cooking").click()  # 点击烹饪
    freeze_poco = poco.freeze()  # TODO:定义dongjiepoco
    if freeze_poco("ToggleSprite").exists():
        A = poco("ToggleSprite").get_position()[1]
        B = (poco("HomeMainView(Clone)").offspring("UITable").child("item0")
            .child("Children").child("item0").get_position()[1])
        if B - A < 0.05:
            poco("ToggleSprite").click()  # 点击一级料理
        freeze_poco = poco.freeze()  # TODO:定义dongjiepoco
        for item in range(len(freeze_poco("HomeMainView(Clone)").offspring("UITable").child("item0").
                                      child("Children").child())):
            item1 = "item" + str(item)
            common.printgreen("检查点 " + freeze_poco("HomeMainView(Clone)").offspring("UITable").child("item0")
                              .child("Children").child(item1).child("UnSelectLab").get_text() + "显示正确")
        poco("ToggleSprite").click()  # 缩回一级料理
        A = poco("NameLab").get_position()[1]
        B = (poco("HomeMainView(Clone)").offspring("UITable").child("item1").offspring("item10")
            .child("UnSelectLab").get_position()[1])
        if B - A < 0.05:
            poco("NameLab").click()  # 点击二级料理
        freeze_poco = poco.freeze()  # TODO:定义dongjiepoco
        for item in range(len(freeze_poco("HomeMainView(Clone)").offspring("UITable").child("item1").
                                      child("Children").child())):
            item1 = "item" + str(item)
            common.printgreen("检查点 " + freeze_poco("HomeMainView(Clone)").offspring("UITable").child("item0").
                              child("Children").child(item1).child("UnSelectLab").get_text() + "显示正确")
    else:
        common.printred("烹饪界面 缺少控件,请检查")
        common.get_screen_shot(start, time.time(), devices, "烹饪界面缺少控件")
    poco("HomeMainView(Clone)").offspring("XSys_Home_Feast").click()  # 点击宴会
    freeze_poco = poco.freeze()  # TODO:定义dongjiepoco
    if freeze_poco("HomeMainView(Clone)").offspring("Tabs").child("item0").child("Tittle").exists() and \
            freeze_poco("HomeMainView(Clone)").offspring("Tabs").child("item1").child("Tittle").exists() and \
            freeze_poco("HomeMainView(Clone)").offspring("Tabs").child("item2").child("Tittle").exists() and \
            freeze_poco(texture="l_frame_01_00").exists() and \
            freeze_poco(texture="l_frame_01_0").exists():
        common.printgreen("宴会界面检查点" + freeze_poco("HomeMainView(Clone)").offspring("Tabs").child("item2").
                          child("Tittle").get_text() + "显示正确")
        common.printgreen("宴会界面检查点" + freeze_poco("HomeMainView(Clone)").offspring("Tabs").child("item1").
                          child("Tittle").get_text() + "显示正确")
        common.printgreen("宴会界面检查点" + freeze_poco("HomeMainView(Clone)").offspring("Tabs").child("item0").
                          child("Tittle").get_text() + "显示正确")
    else:
        common.printred("宴会界面 缺少控件,请检查")
        common.get_screen_shot(start, time.time(), devices, "宴会界面缺少控件")
    poco("HomeMainView(Clone)").offspring("Tabs").child("item0").child("Tittle").click()  # 点击全鱼宴
    freeze_poco = poco.freeze()  # TODO:定义dongjiepoco
    if poco("HomeMainView(Clone)").offspring("Content").offspring("Name").exists() and poco("ContentLab").exists():
        common.printgreen("界面检查点 " + freeze_poco("HomeMainView(Clone)").offspring("Tabs").child("item0").
                          child("Tittle").get_text() + " 显示正确")
        common.printgreen("界面检查点 " + freeze_poco("ContentLab").get_text() + " 显示正确")
    else:
        common.printred("全鱼宴界面 缺少控件,请检查")
        common.get_screen_shot(start, time.time(), devices, "全鱼宴界面缺少控件")
    poco("HomeMainView(Clone)").offspring("Tabs").child("item1").child("Tittle").click()  # 点击海鲜宴
    freeze_poco = poco.freeze()  # TODO:定义dongjiepoco
    if poco("HomeMainView(Clone)").offspring("Content").offspring("Name").exists() and poco("ContentLab").exists():
        common.printgreen(
            "界面检查点 " + freeze_poco("HomeMainView(Clone)").offspring("Tabs").child("item0").
            child("Tittle").get_text() + " 显示正确")
        common.printgreen("界面检查点 " + freeze_poco("ContentLab").get_text() + " 显示正确")
    else:
        common.printred("海鲜宴界面 缺少控件,请检查")
        common.get_screen_shot(start, time.time(), devices, "海鲜宴界面缺少控件")
    poco("HomeMainView(Clone)").offspring("Tabs").child("item2").child("Tittle").click()  # 点击腊八粥宴
    freeze_poco = poco.freeze()  # TODO:定义dongjiepoco
    if poco("HomeMainView(Clone)").offspring("Content").offspring("Name").exists() and poco("ContentLab").exists():
        common.printgreen("界面检查点 " + freeze_poco("HomeMainView(Clone)").offspring("Tabs").child("item0").
                          child("Tittle").get_text() + " 显示正确")
        common.printgreen("界面检查点 " + freeze_poco("ContentLab").get_text() + " 显示正确")

    else:
        common.printred("腊八粥宴界面 缺少控件,请检查")
        common.get_screen_shot(start, time.time(), devices, "腊八粥宴界面缺少控件")
    return poco("HomeMainView(Clone)").offspring("Tabs").child("item2").child("Tittle").get_text()
Beispiel #7
0
def longxue(start, devices):
    poco = common.deviceconnect(devices)
    if poco("Duck").exists():
        poco("Duck").click()
        sleep(2)
        poco("XSys_Activity").click()  # 点击日常按钮
    else:
        common.printgreen("主界面缺少日常按钮,请检查...")
        common.get_screen_shot(start, time.time(), devices, "主界面缺少日常按钮")
    if poco("DailyActivityDlg(Clone)").offspring("XActivityHandler").offspring(
            "Item526").offspring("Background").exists():
        pos = poco("DailyActivityDlg(Clone)").offspring(
            "XActivityHandler").offspring("Item526").offspring(
                "Background")  # 龙穴参加按钮
        butpos(devices,
               butpos=pos,
               pos1=0.4,
               pos2=0.79,
               high=565,
               low=511,
               lows=240)  # 调用butpos方法
        pos.click()  # 点击副本参加按钮
    else:
        common.printgreen("日常界面没有龙穴选项,请检查...")
        common.get_screen_shot(start, time.time(), devices, "日常界面没有龙穴选项")
    freeze_poco = poco.freeze()  # TODO:定义冻结poco
    if freeze_poco("Panel").exists() and freeze_poco("NestFrameNormal").exists() and \
            freeze_poco("Enter").exists() and freeze_poco("CurPPT").exists() and \
            freeze_poco("SugAttr").exists() and freeze_poco("SugLevel").exists() and freeze_poco("SugMember").exists():
        common.printgreen(
            "进入龙穴界面\n检查点: 四个巢穴\n检查点: 显示副本界面\n检查点: 进入副本按钮\n检查点: 推荐进入要求\n以上全部显示正确 "
        )
    else:
        common.printred("龙穴界面缺少控件元素,请检查。。。")
        # screenshot.get_screen_shot(start, time.time(), devices, "龙穴界面缺少控件元素")
    for item in range(len(poco("Panel").child())):
        item1 = "item" + str(item)
        if not poco("DragonNestDlg(Clone)").offspring(item1).offspring(
                texture="l_lock_01").exists():  # 如果等级足够,并且模块高亮显示
            poco("DragonNestDlg(Clone)").offspring(item1).click()  # 点击各个巢穴
            if poco("ToggleDiffEasy").exists():  # 判断是否有简单选项
                poco("DragonNestDlg(Clone)").offspring(item1).child(
                    "Bg").child("Label").get_text()
                common.printgreen("<<<<<<<--进入  " +
                                  poco("DragonNestDlg(Clone)").offspring(item1)
                                  .child("Bg").child("Label").get_text() +
                                  "  简单模式-->>>>>>>>")
                poco("ToggleDiffEasy").click()  # 点击简单选项
                UIjudge(start, poco, 2, devices)  # 调用UIjudge判断当前界面的控件
            else:
                common.printgreen(
                    poco("DragonNestDlg(Clone)").offspring(item1).child(
                        "Bg").child("Label").get_text() + "  没有简单模式")
            if poco("ToggleDiffNormal").exists():  # 判断是否有普通选项
                common.printgreen("<<<<<<<--进入  " +
                                  poco("DragonNestDlg(Clone)").offspring(item1)
                                  .child("Bg").child("Label").get_text() +
                                  "  普通模式-->>>>>>>>")
                poco("ToggleDiffNormal").click()  # 点击普通选项
                UIjudge(start, poco, 3, devices)  # 调用UIjudge判断当前界面的控件
            else:
                common.printgreen(
                    poco("DragonNestDlg(Clone)").offspring(item1).child(
                        "Bg").child("Label").get_text() + "  没有普通模式")
            if poco("ToggleDiffHard").exists():  # 判断是否有困难选项
                common.printgreen("<<<<<<<--进入  " +
                                  poco("DragonNestDlg(Clone)").offspring(item1)
                                  .child("Bg").child("Label").get_text() +
                                  "  困难模式-->>>>>>>>")
                poco("ToggleDiffHard").click()  # 点击困难选项
                UIjudge(start, poco, 3, devices)  # 调用UIjudge判断当前界面的控件
            else:
                common.printgreen(
                    poco("DragonNestDlg(Clone)").offspring(item1).child(
                        "Bg").child("Label").get_text() + "  没有困难模式")
        else:
            common.printred("等级不足,没有开启")
    poco("Help").click()  # 点击帮助按钮
    return poco("CommonHelpTip(Clone)").offspring("Title").get_text()  # 龙穴
Beispiel #8
0
def addheraldry(start, poco, devices):
    poco("Btn").click()
    but = poco("EquipCreateDlg(Clone)").offspring("WrapContent").offspring(
        name="Icon")  # 是否存在金属板
    if but.exists():
        but.click()  # 点击金属板
        if poco("EquipCreateDlg(Clone)").offspring("Item").child(
                "Icon").exists():  # 制作窗口是否存在金属板
            common.printgreen("开始进行纹章制作")
            poco("Create").click()  # 纹章制作
            if poco("EquipCreateDlg(Clone)").offspring(
                    "EquipSetCreateConfirmFrame").child(
                        "Bg").exists():  # 是否存在制作纹章的弹窗
                poco("OK").click()  # 点击确定按钮
                sleep(12)  # 制作过程中等待10秒
                if poco("Do").exists():  # 界面是否存在确定按钮
                    poco("Do").click()  # 点击确定
                    sleep(3)
                    poco("Close").click()  # 点击返回,返回到纹章界面
            else:
                common.printred("没有弹出金属板制作弹窗,请检查。。")
                common.get_screen_shot(start, time.time(), devices,
                                       "没有弹出金属板制作弹窗")
    else:
        if not but.exists():  # 如果界面不存在金属板
            poco("BtnMaterialAccess").click()  # 点击获取金属板
            if poco("ListPanel").exists():  # 存在获取途径
                poco("ListPanel").click()  # 点击bossrush进入bossrush界面
                if poco(text="当前挑战BOSS").exists():
                    common.printgreen("进入bossrush界面,进行bossrush判断")
                    if int(
                            poco("BossRushNewDlg(Clone)").child(
                                "Num").get_text()[0]) != 0:
                        common.printgreen("进入bossrush副本")
                        poco("Go").click()  # 点击挑战
                        sleep(15)  # 等待15秒进入副本时间
                        dev = connect_device("android:///" + devices)
                        Androidpoco = AndroidUiautomationPoco(
                            device=dev,
                            use_airtest_input=True,
                            screenshot_each_action=False)
                        if poco("Avatar").exists():  # 头像,准备进行GM指令获取金属板
                            poco("Avatar").click()  # 点击头像
                            text("gmwin")  # 输入gm命令直接结束战斗
                            sleep(1)
                            Androidpoco("android.widget.Button").click()
                            sleep(20)
                            if poco("BattleContinueDlg(Clone)").offspring(
                                    "Continue").exists():
                                poco("BattleContinueDlg(Clone)").offspring(
                                    "Continue").click(
                                    )  # 点击奖励的确定按钮,副本打完会出现奖励弹窗
                                sleep(3)
                                poco("Continue").click()  # 返回主城
                                sleep(20)
                                if poco("ToolTip").exists():
                                    poco("Open").click()  # 点击使用金属板袋子
                                    sleep(2)
                                if poco("SysAItem").get_position()[0] > 1:
                                    poco(texture="halln_4").click()
                                    sleep(1)
                                poco("SysAItem").click()  # 点击角色按钮
                                if poco("Title").exists():
                                    common.printgreen("进入角色界面")
                                    if poco("XSys_Char_Emblem").exists():
                                        poco(
                                            "XSys_Char_Emblem").click()  # 点击纹章
                                        if poco("ItemNewDlg(Clone)").offspring(
                                                "Items").child(
                                                    "Frame").offspring(
                                                        "T").exists():
                                            common.printgreen(
                                                "进入金属板界面,开始进行纹章制作")
                                            # TODO:接下来进行纹章制作,纹章装备和卸下的操作已经完成
                                            addheraldry(start, poco,
                                                        devices)  # 调用纹章制作
                    else:
                        common.printgreen("bossrush没有次数了,不打了")
                        poco("Close").click()  # 点击返回,返回到制作界面
                        poco("Close").click()  # 点击返回,返回到纹章界面
Beispiel #9
0
def task(start, devices):
    poco = common.deviceconnect(devices)
    if poco("Duck").exists():
        poco("Duck").click()
        sleep(2)
        poco("XSys_Activity").click()  # 点击日常按钮
    else:
        common.printgreen("主界面缺少日常按钮,请检查...")
        common.get_screen_shot(start, time.time(), devices, "主界面缺少日常按钮")
    # 任务参加按钮
    pos = poco("DailyActivityDlg(Clone)").offspring(
        "XActivityHandler").offspring("Item886").child("JoinBtn")
    if pos.exists():
        butpos(devices,
               butpos=pos,
               pos1=0.4,
               pos2=0.79,
               high=565,
               low=511,
               lows=240)  # 调用butpos方法
        pos.click()  # 点击日常任务参加按钮
    else:
        common.printgreen("日常界面没有日常任务选项,请检查...")
        common.get_screen_shot(start, time.time(), devices, "日常界面没有日常任务选项")
    if not poco(texture="l_tip_00").exists():
        common.printgreen("还未接取任务,开始接任务")
        poco("TalkTextBg").child("Bg").wait_for_appearance()
        for i in range(5):
            if poco("TalkTextBg").child("Bg").wait(30).exists():  # 如果弹出了任务弹窗
                poco("VirtualTab").click()  # 点击下一步
                if poco("BtnOK").exists():  # 如果出现了接受按钮
                    common.printgreen("接受任务")
                    poco("BtnOK").click()  # 点击接受
                    break
    if poco(texture="l_tip_00").exists():
        common.printgreen("已经接了任务,开始检测任务模块控件")
        freeze_poco = poco.freeze()  # TODO:定义冻结poco
        # 检测任务模块控件
        if freeze_poco(texture="DailyTaskText").exists() and \
                freeze_poco("BaseInfo").exists() and \
                freeze_poco("item0").exists() and \
                freeze_poco("item1").exists() and \
                freeze_poco("item2").exists() and \
                freeze_poco("item3").exists() and \
                freeze_poco("Submmit").exists() and \
                freeze_poco("Refresh").exists() and \
                freeze_poco("GuildDailyTask(Clone)").child("Bg")[0].child("T")[0].exists() and \
                freeze_poco("RefreshLogBtn").exists():
            common.printgreen("任务窗口检测各个按钮,控件,奖励 完成")
            if poco("Refresh").exists():  # 点击刷新
                common.printgreen("点击任务刷新按钮,检测任务刷新界面中的元素控件")
                poco("Refresh").click()
                sleep(2)
                freeze_poco = poco.freeze()  # TODO:定义冻结poco
                if freeze_poco("DailyTaskInviteDlg(Clone)").offspring("TaskLevel").exists() and \
                        freeze_poco("TabTpl0").exists() and \
                        freeze_poco("TabTpl1").exists() and \
                        freeze_poco("DailyTaskInviteDlg(Clone)").offspring("Tab0Text").child("T")[0].exists() and \
                        freeze_poco("DailyTaskInviteDlg(Clone)").offspring("Tab0Text").child("T")[1].exists() and \
                        freeze_poco("DailyTaskInviteDlg(Clone)").offspring("Tab0Text").child("T")[2].exists():
                    common.printgreen("刷新任务窗口检测各个按钮,控件,奖励 完成")
                    poco("DailyTaskInviteDlg(Clone)").offspring(
                        "Close").click()  # 点击返回
                else:
                    common.printred("任务刷新按钮界面缺少控件元素,请检查。。。")
                    common.get_screen_shot(start, time.time(), devices,
                                           "任务刷新按钮界面缺少控件元素")
            else:
                common.printred("界面没有任务刷新按钮,请检查。。。")
                common.get_screen_shot(start, time.time(), devices,
                                       "界面没有任务刷新按钮")
            if poco(text="已求助").exists():
                common.printgreen("界面没有求助按钮,已经求助过了")
            elif poco(text="求助").exists():  # 如果界面有求助的话,点击求助按钮
                common.printgreen("开始点击求助按钮")
                pos = poco(text="求助")
                butpos(devices,
                       butpos=pos,
                       pos1=0.29,
                       pos2=0.73,
                       high=1055,
                       low=740,
                       lows=466)  # 调用butpos方法
                poco(text="求助").click()
                common.printgreen("点击求助完成")

            else:
                common.printgreen("界面没有求助按钮,也没有已求助按钮,所以为确保产品质量,建议手动测试一次")
                common.get_screen_shot(start, time.time(), devices, "界面没有求助按钮")
            if poco("RefreshLogBtn").exists():
                poco("RefreshLogBtn").click()
                freeze_poco = poco.freeze()  # TODO:定义冻结poco
                if freeze_poco("LogPanel").child("T").exists():
                    common.printgreen("开始检查任务刷新界面的控件元素")
                    common.printgreen("检查点  " +
                                      freeze_poco("LogPanel").offspring(
                                          "Title").child("T")[0].get_text() +
                                      "  显示正确")
                    common.printgreen("检查点  " +
                                      freeze_poco("LogPanel").offspring(
                                          "Title").child("T")[1].get_text() +
                                      "  显示正确")
                    common.printgreen("检查点  " +
                                      freeze_poco("LogPanel").offspring(
                                          "Title").child("T")[2].get_text() +
                                      "  显示正确")
            else:
                common.printgreen("界面没有刷新纪录,请检查")
                common.get_screen_shot(start, time.time(), devices, "界面没有求助按钮")
    return poco("LogPanel").child("T").get_text()  # 返回 任务刷新记录
Beispiel #10
0
def troops(start, devices):
    poco = common.deviceconnect(devices)
    if poco("Team").exists():  # 队伍按钮
        if poco("Team").get_position()[0] < 0:
            poco("TaskSwitchBtn").click()
        poco("Team").click()  # 点击队伍按钮
        if not poco("BtnCreate").exists():  # 创建队伍按钮控件
            poco("Team").click()  # 点击队伍按钮
        if poco("BtnLeave").exists():
            common.printgreen("已经有了队伍,先把队伍解散")
            poco("BtnLeave").click()  # 如果已经创建了队伍,就点击离队取消队伍
    else:
        common.printgreen("主界面没有队伍按钮,请检查")
        common.get_screen_shot(start, time.time(), devices, "主界面没有队伍按钮")
    if poco("Title").exists():
        common.printgreen("进入队伍界面,开始判断队伍界面元素。。。")
        freeze_poco = poco.freeze()  # TODO:定义dongjiepoco
        if freeze_poco("P (1)").exists() and \
                freeze_poco("BtnRefresh").exists() and \
                freeze_poco("BtnTeamRoom").exists() and \
                freeze_poco("BtnCreate").exists() and \
                freeze_poco("BtnMatch").exists():
            common.printgreen("队伍界面控件显示正确,\n开始点击刷新按钮")
            poco("BtnRefresh").click()  # 点击刷新按钮
            common.printgreen("点击刷新按钮,但是因为没有队伍,所以实际上没有任何作用,点着玩吧。。。\n开始点击大厅按钮")
            poco("BtnTeamRoom").click()  # 点击大厅按钮
            freeze_poco = poco.freeze()  # TODO:定义dongjiepoco
            if freeze_poco(texture="l_tip_00").exists() and \
                    freeze_poco("Title1").exists() and \
                    freeze_poco("Title2").exists() and \
                    freeze_poco("Title3").exists() and \
                    freeze_poco("Title4").exists() and \
                    freeze_poco("Title5").exists():
                common.printgreen("进入大厅成功")
                for item in range(1, len(freeze_poco("ScrollView").child())):
                    item1 = "item" + str(item)
                    if freeze_poco("TeamListDlg(Clone)").offspring(
                            item1).exists():
                        common.printgreen(
                            "检查点 " +
                            freeze_poco("TeamListDlg(Clone)").offspring(
                                item1).child("Text").get_text() + " 显示正确")
                poco("Close").click()  # 点击返回
                for x in range(4):  # 回到主界面
                    if poco("Close").exists():
                        poco("Close").click()
                    else:
                        break
                common.printgreen("返回主界面\n开始进行《组队大厅》界面检测")
            else:
                common.printred("进入大厅失败,请检查")
                common.get_screen_shot(start, time.time(), devices, "进入大厅失败")
    else:
        common.printred("点击队伍按钮后没有进入队伍界面,请检查。。。")
        common.get_screen_shot(start, time.time(), devices, "点击队伍按钮后没有进入队伍界面")
        # todo:创建大厅
    if poco("Team").exists():  # 队伍按钮
        if poco("Team").get_position()[0] < 0:
            poco("TaskSwitchBtn").click()
        poco("BtnJoin").click()  # 点击组队大厅
        freeze_poco = poco.freeze()  # TODO:定义dongjiepoco
        if freeze_poco(texture="l_tip_00").exists() and \
                freeze_poco("Title1").exists() and \
                freeze_poco("Title2").exists() and \
                freeze_poco("Title3").exists() and \
                freeze_poco("Title4").exists() and \
                freeze_poco("Title5").exists():
            common.printgreen("进入大厅成功")
            for item in range(1, len(freeze_poco("ScrollView").child())):
                item1 = "item" + str(item)
                if freeze_poco("TeamListDlg(Clone)").offspring(item1).exists():
                    common.printgreen(
                        "检查点 " + freeze_poco("TeamListDlg(Clone)").offspring(
                            item1).child("Text").get_text() + " 显示正确")
            poco("Close").click()  # 点击返回
            for x in range(4):  # 回到主界面
                if poco("Close").exists():
                    poco("Close").click()
                else:
                    break
            common.printgreen("返回主界面\n开始进行《招募大厅》界面检测")
        else:
            common.printred("进入大厅失败,请检查")
            common.get_screen_shot(start, time.time(), devices, "进入大厅失败")
    else:
        common.printgreen("主界面没有队伍按钮,请检查")
        common.get_screen_shot(start, time.time(), devices, "主界面没有队伍按钮")

    # todo:招募大厅
    if poco("Team").exists():  # 队伍按钮
        if poco("Team").get_position()[0] < 0:
            poco("TaskSwitchBtn").click()
        poco("BtnGroupChat").click()  # 点击招募大厅
        freeze_poco = poco.freeze()  # TODO:定义dongjiepoco
        if freeze_poco("RecruitDlg(Clone)").child("Bg").offspring("Text")[1].exists() and \
                freeze_poco("RecruitDlg(Clone)").offspring("ToggleTeam").child("SelectedText").exists() and \
                freeze_poco("Title0").exists() and freeze_poco("Title2").exists() and freeze_poco("Title3").exists() and \
                freeze_poco("Title4").exists() and freeze_poco("Title1").exists() and freeze_poco(text="队友验证").exists() and \
                freeze_poco(text="发布招募").exists():
            common.printgreen("进入招募大厅大厅成功\n开始检测下级界面《队友验证》")
            poco("Btn_Authorise").click()  # 点击队友验证
            freeze_poco = poco.freeze()  # TODO:定义dongjiepoco
            if freeze_poco("RecruitDlg(Clone)").child("Bg").offspring("Text")[1].exists() and \
                    freeze_poco("Title1").exists() and freeze_poco("Title2").exists() and freeze_poco("Title3").exists() and \
                    freeze_poco("Title4").exists() and freeze_poco("Title5").exists():
                common.printgreen("进入招募队友验证成功")
                poco("RecruitAuthorizeView(Clone)").child(
                    "Close").click()  # 点击返回
                if poco("RecruitDlg(Clone)").child("Bg").offspring(
                        "Text")[1].exists():
                    common.printgreen("返回招募大厅成功\n开始检测下级界面《发布招募》")
                    poco("Btn_Publish").click()  # 点击发布招募
                    freeze_poco = poco.freeze()  # TODO:定义dongjiepoco
                    if freeze_poco(text="队员招募").exists() and freeze_poco(text="队员招募").exists() and \
                            freeze_poco(text="擅长类型").exists() and freeze_poco(text="选择队伍").exists() and \
                            freeze_poco(text="发 布").exists() and freeze_poco(text="新建队伍").exists() and \
                            freeze_poco("GroupMember_Type0").exists() and freeze_poco("GroupMember_Type1").exists() and \
                            freeze_poco("GroupMember_Type2").exists() and freeze_poco("GroupMember_Type3").exists():
                        for Label in freeze_poco(
                                "RecruitGroupPublishFrame(Clone)").offspring(
                                    "1").offspring("ChildList").offspring(
                                        "Selected").offspring("Label"):
                            common.printgreen("检查点 《" + Label.get_text() +
                                              "》 显示正确")
                        for Label in freeze_poco(
                                "RecruitGroupPublishFrame(Clone)").offspring(
                                    "2").offspring("ChildList").offspring(
                                        "Selected").offspring("Label"):
                            common.printgreen("检查点《 " + Label.get_text() +
                                              "》 显示正确")
                        for Label in freeze_poco(
                                "RecruitGroupPublishFrame(Clone)").offspring(
                                    "3").offspring("ChildList").offspring(
                                        "Selected").offspring("Label"):
                            common.printgreen("检查点 《" + Label.get_text() +
                                              "》 显示正确")
                        common.printgreen("检查点 《发布招募》 界面显示正确\n点击返回到上级界面")
                        poco("RecruitGroupPublishFrame(Clone)").offspring(
                            "Close").click()
                        if poco("ToggleMember").exists():  # 寻找队友
                            poco("ToggleMember").click()
                            freeze_poco = poco.freeze()  # TODO:定义dongjiepoco
                            if freeze_poco("Title0").exists() and \
                                    freeze_poco("Title0").exists() and \
                                    freeze_poco("Title0").exists() and \
                                    freeze_poco("Title0").exists() and \
                                    freeze_poco("Title0").exists():
                                common.printgreen("检查点 《寻找队友》 界面显示正确")
                                poco("ToggleTeam").click(
                                )  # 点击寻找队伍,回到上级界面,为下次测试恢复环境
                            else:
                                common.printred("寻找队友界面缺少按钮控件元素,请检查")
                                common.get_screen_shot(start, time.time(),
                                                       devices,
                                                       "队友验证界面缺少按钮控件元素")

            else:
                common.printred("队友验证界面缺少按钮控件元素,请检查")
                common.get_screen_shot(start, time.time(), devices,
                                       "队友验证界面缺少按钮控件元素")
        else:
            common.printred("招募大厅界面缺少按钮控件元素,请检查")
            common.get_screen_shot(start, time.time(), devices,
                                   "招募大厅界面缺少按钮控件元素")
    else:
        common.printred("主界面没有队伍按钮,请检查")
        common.get_screen_shot(start, time.time(), devices, "主界面没有队伍按钮")
    return poco("Btn_Authorise").child("T").get_text()  # 队友验证
Beispiel #11
0
def nest(start, devices):
    poco = common.deviceconnect(devices)

    if poco("Duck").exists():
        poco("Duck").click()
        sleep(2)
        poco("XSys_Activity").click()  # 点击日常按钮
    else:
        common.printgreen("主界面缺少日常按钮,请检查...")
        common.get_screen_shot(start, time.time(), devices, "主界面缺少日常按钮")
    if poco("DailyActivityDlg(Clone)").offspring("XActivityHandler").offspring("Item110")\
            .offspring("Background").exists():
        # 副本参加按钮
        pos = (poco("DailyActivityDlg(Clone)").offspring(
            "XActivityHandler").offspring("Item110").offspring("Background"))
        butpos(devices,
               butpos=pos,
               pos1=0.4,
               pos2=0.79,
               high=565,
               low=511,
               lows=240)  # 调用butpos方法
        # 点击副本参加按钮
        poco("DailyActivityDlg(Clone)").offspring("XActivityHandler").offspring("Item110").\
            offspring("Background").click()
        sleep(2)
        poco("Hard").click()  # 点击巢穴按钮
        sleep(4)
    else:
        common.printgreen("副本界面控件缺失,请检查...")
        common.get_screen_shot(start, time.time(), devices, "副本界面控件缺失")

    freeze_poco = poco.freeze()  # TODO:定义dongjiepoco
    if freeze_poco("Label").exists() and freeze_poco(texture="l_frame_09").exists() and \
            freeze_poco("Btn2").exists() and freeze_poco("Btn1").exists() and \
            freeze_poco("Member").exists() and  freeze_poco("Level").exists() and \
            freeze_poco("PPT").exists() and freeze_poco("MyPPT").exists():
        common.printgreen("检查点 " +
                          freeze_poco("Member").offspring("T").get_text() +
                          "  显示正确")
        common.printgreen("检查点 " +
                          freeze_poco("Level").offspring("T").get_text() +
                          "  显示正确")
        common.printgreen("检查点 " +
                          freeze_poco("PPT").offspring("T").get_text() +
                          "  显示正确")
        common.printgreen("检查点 " +
                          freeze_poco("MyPPT").offspring("T").get_text() +
                          "  显示正确")
        common.printgreen("检查点 " +
                          freeze_poco("Btn2").offspring("T").get_text() +
                          "  显示正确")
        common.printgreen("检查点 " +
                          freeze_poco("Btn1").offspring("T").get_text() +
                          "  显示正确")
    else:
        common.printred("巢穴界面控件缺失,请检查...")
        common.get_screen_shot(start, time.time(), devices, "巢穴界面控件缺失")
    poco("Btn2").click()  # 点击排行榜
    freeze_poco = poco.freeze()  # TODO:定义dongjiepoco
    if freeze_poco("Tittle").exists() and freeze_poco("T1").exists() and freeze_poco("T2").exists() and \
            freeze_poco("T3").exists() and freeze_poco("T4").exists():
        common.printgreen("检查点 " + freeze_poco("T3").get_text() + "  显示正确")
        common.printgreen("检查点 " + freeze_poco("Tittle").get_text() + "  显示正确")
        common.printgreen("检查点 " + freeze_poco("T2").get_text() + "  显示正确")
        common.printgreen("检查点 " + freeze_poco("T4").get_text() + "  显示正确")
        common.printgreen("检查点 " + freeze_poco("T1").get_text() + "  显示正确")
        poco(texture="l_close_00").click()  # 点击返回巢穴界面
    else:
        common.printgreen("排行榜界面控件缺失,请检查...")
        common.get_screen_shot(start, time.time(), devices, "排行榜界面控件缺失")
    poco("Btn1").click()  # 点击奖励
    freeze_poco = poco.freeze()  # TODO:定义dongjiepoco
    if freeze_poco("Tittle").exists():
        common.printgreen("进入奖励预览界面")
        for item in range(len(freeze_poco("List").child())):
            item = str(item)
            common.printgreen("检查点 " + freeze_poco("NestStarReward").offspring(
                item).offspring("T").get_text() + "  显示正确")
        poco(texture="l_close_00").click()  # 点击返回到巢穴界面
    else:
        common.printgreen("奖励界面控件缺失,请检查...")
        common.get_screen_shot(start, time.time(), devices, "奖励界面控件缺失")
    freeze_poco = poco.freeze()  # TODO:定义dongjiepoco
    for item in range(len(freeze_poco("ItemList").child()) - 1):
        item = "item" + str(item)
        if freeze_poco("TheExpDlg(Clone)").offspring(item).exists():
            freeze_poco("TheExpDlg(Clone)").offspring(item).click()
            freeze_poco("TheExpDlg(Clone)").offspring(item).click()
        if poco("main").exists():
            freeze_poco("TheExpDlg(Clone)").offspring(item).click()
    # for i in range(20):
    #     if poco("Left").exists():
    #         freeze_poco("Left").click()  # 点击下一个页签
    #         freeze_poco = poco.freeze()  # TODO:定义dongjiepoco
    #         for item in range(len(freeze_poco("ItemList").child()) - 1):
    #             item = "item" + str(item)
    #             if freeze_poco("TheExpDlg(Clone)").offspring(item).exists():
    #                 freeze_poco("TheExpDlg(Clone)").offspring(item).click()
    #                 freeze_poco("TheExpDlg(Clone)").offspring(item).click()
    #             if poco("main").exists():
    #                 freeze_poco("TheExpDlg(Clone)").offspring(item).click()
    #     else:
    #         break
    if poco("Diff4").exists():
        poco("Diff4").click()  # 点击地狱模式
        if poco("Do").exists():
            poco("Do").click()  # 点击进入游戏
            if poco(texture="l_frame_00").exists():
                common.printgreen("提示战力不足,建议提升战力")
                common.get_screen_shot(start, time.time(), devices, "提示战力不足")
                poco(text="强行闯关").click()
                # 进入队伍界面
            if poco("BtnCreate").exists():
                poco("Close").click()  # 点击返回
                if poco("BtnCreate").exists():
                    poco("Close").click()  # 点击返回
        return poco("Btn1").child("T").get_text()  # 查看奖励
    else:
        common.printgreen("巢穴界面地狱选项控件缺失,请检查...")
        common.get_screen_shot(start, time.time(), devices, "地狱选项控件缺失")
Beispiel #12
0
def Artifact(start, devices):
    poco = common.deviceconnect(devices)
    check_menu("SysAItem", poco)  # 进入角色
    if poco("XSys_Artifact").exists():  # 进入龙器页签
        poco("XSys_Artifact").click()
        with poco.freeze() as freeze_poco:
            if freeze_poco("Artifact0").child("t").exists() and \
                    freeze_poco("Artifact1").child("t").exists() and \
                    freeze_poco("Artifact2").child("t").exists() and \
                    freeze_poco("Artifact3").child("t").exists() and \
                    freeze_poco("BtnShop").exists() and \
                    freeze_poco("BagNum").exists() and \
                    freeze_poco("ItemNewDlg(Clone)").offspring("Help").exists() and \
                    freeze_poco("Prof").exists() and \
                    freeze_poco("AttriBtn").exists() and \
                    freeze_poco("ComposeBtn").exists():
                common.printgreen("龙器界面,四个槽位,图册,帮助,数量,龙器页,龙器加成,龙器神炉UI元素显示正常")
            else:
                common.printred("龙器界面UI元素显示异常,详情见截图")
                common.get_screen_shot(start, time.time(), devices,
                                       "龙器界面UI元素显示异常")
            try:
                freeze_poco("Prof").click()  # 操作龙器页
                poco("ItemNewDlg(Clone)").offspring("item1").child(
                    "BtnUse").click()
                if poco(texture="l_close_00").exists():
                    poco(texture="l_close_00").click()
                common.printgreen("龙器页打开使用正常")
            except Exception as e:
                common.printred("龙器页打开使用异常")
                common.printred(e)
                common.get_screen_shot(start, time.time(), devices,
                                       "龙器页打开使用异常")
                if poco(texture="l_close_00").exists():
                    poco(texture="l_close_00").click()
            try:  # 操作 龙器加成,图册,规则
                freeze_poco("AttriBtn").click()
                freeze_poco("AttriBtn").click()
                freeze_poco("BtnShop").click()
                poco(texture="l_close_00").click()
                freeze_poco("ItemNewDlg(Clone)").offspring("Bg").offspring(
                    "RightPanel").offspring("ArtifactListPanel").child(
                        "Help").click()
                poco("Btn").click()
                common.printgreen("操作 龙器加成,图册,规则点击正常")
            except Exception as e:
                common.printred("帮助界面,龙器加成,图鉴点击异常")
                common.printred(e)
                common.get_screen_shot(start, time.time(), devices, "点击异常")
            try:  # 操作龙器神炉
                poco("ComposeBtn").click()
                with poco.freeze() as freeze_poco:
                    freeze_poco("ArtifactDeityStoveDlg(Clone)").child(
                        "Bg").offspring("XSys_Artifact_Comepose").child(
                            "Bg").click()
                    freeze_poco("ArtifactDeityStoveDlg(Clone)").offspring(
                        "BtnCompose").click()
                    poco("BtnOneKeyCompose").click()
                    poco("ArtifactDeityStoveDlg(Clone)").offspring(
                        "ArtifactOneKeyFrame").offspring("Close").click()
                    freeze_poco("Get").click()
                    freeze_poco("ArtifactDeityStoveDlg(Clone)").child(
                        "Bg").offspring("XSys_Artifact_Recast").child(
                            "Bg").click()  # 重铸
                    freeze_poco("Get").click()
                    freeze_poco("ArtifactDeityStoveDlg(Clone)").child(
                        "Bg").offspring("XSys_Artifact_Fuse").child(
                            "Bg").click()  # 融合
                    freeze_poco("Get").click()
                    freeze_poco("ArtifactDeityStoveDlg(Clone)").child(
                        "Bg").offspring("XSys_Artifact_Inscription").child(
                            "Bg").click()
                    poco("MoneyCost").click()
                    freeze_poco("ArtifactDeityStoveDlg(Clone)").child(
                        "Bg").offspring("XSys_Artifact_Refined").child(
                            "Bg").click()
                    freeze_poco("Get").click()
                    poco("ArtifactDeityStoveDlg(Clone)").offspring("Bg").child(
                        "Help").click()  # 帮助
                    poco("Btn").click()
                    freeze_poco(texture="l_close_00").click()
                    common.printgreen("龙器神炉点击正常")
            except Exception as e:
                common.printred("龙器神炉点击异常")
                common.printred(e)
                common.get_screen_shot(start, time.time(), devices, "龙器神炉点击异常")
        if poco("empty0").exists() and (
                not poco("ItemNewDlg(Clone)").offspring("item0").child(
                    "Icon").exists()):
            poco("Artifact0").click()  # 点击槽位
            poco("ListPanel").click()  # 点击跳转龙魂
            if poco("item0").child("value").get_text() == "0":
                poco("EnterBtn").click()  # 点击进入副本
                poco("access212").click()  # 点击进入
                poco("OK").click()
                poco("Close").click()
                poco("EnterBtn").click()  # 点击进入副本
                common.printgreen("龙魂禁地门票购买成功")
                print("进入龙魂禁地副本大龙器")
            else:
                poco("EnterBtn").click()
                print("进入龙魂禁地副本大龙器")
            time.sleep(10)
            if poco("AutoPlayCancel").exists():
                pass
            else:
                poco("AutoPlay").click()
            time.sleep(90)
            if poco("ItemIconListBattleDlg(Clone)").offspring("Bg").child(
                    "Close").exists():
                poco("ItemIconListBattleDlg(Clone)").offspring("Bg").child(
                    "Close").click()
                poco("Close").click()
                check_menu("SysAItem", poco)
                poco("XSys_Artifact").click()
            else:
                common.printred("没有穿戴装备,龙魂禁地打不过去,请穿戴装备后再次执行脚本")
                common.get_screen_shot(start, time.time(), devices,
                                       "没有穿戴装备,龙魂禁地打不过去,请穿戴装备后再次执行脚本")
                poco("Pause").click()
                poco("Leave").click()
                time.sleep(8)
                poco("Close").click()
        if poco("XSys_Artifact").exists():
            poco("XSys_Artifact").click()
            with poco.freeze() as freeze_poco:
                equipchild = freeze_poco("WrapContent").child()
                for i in equipchild:
                    name = i.get_name()
                    if name[:5] != "empty":
                        equipname = name
                        break
            poco(equipname).click()  # 点击装备
            poco("Button1").click()  # 穿戴装备
            for i in range(4):
                item = "item" + str(i)
                if poco("ItemNewDlg(Clone)").offspring(item).child(
                        "Icon").exists():
                    common.printgreen("龙器穿戴成功")
                    with poco.freeze() as freeze_poco:
                        for x in freeze_poco("ArtifactFrame").child(
                                "Panel").child("Artifacts").offspring(
                                    "Quality"):
                            uiname = x.parent().get_name()
                            freeze_poco(uiname).click()
                            poco("Button1").click()  # 穿戴装备
                    common.printgreen("龙器卸下成功")
                    break
                if i == 3:
                    common.printred("龙器穿戴失败")
    else:
        common.printred("龙器功能暂未开放,请提升等级角色")
        common.get_screen_shot(start, time.time(), devices, "龙器功能暂未开放")
    if poco("Close").exists():
        poco("Close").click()
    return poco("Duck").get_name()  # 返回值poco("Duck").get_name()
Beispiel #13
0
def space_time(strat, devices):
    poco = common.deviceconnect(devices)
    if poco("Duck").exists():
        poco("Duck").click()
        sleep(2)
        poco("XSys_Activity").click()  # 点击日常按钮
    else:
        common.printgreen("主界面缺少日常按钮,请检查...")
        common.get_screen_shot(strat, time.time(), devices, "主界面缺少日常按钮")
    # 时空裂缝参加按钮
    pos = poco("DailyActivityDlg(Clone)").offspring(
        "XActivityHandler").offspring("Item1021").offspring("Background")
    if pos.exists():
        # 调用butpos方法
        butpos(devices,
               butpos=pos,
               pos1=0.4,
               pos2=0.79,
               high=565,
               low=511,
               lows=240)
        pos.click()  # 点击无限幻境参加按钮
    else:
        common.printgreen("日常界面没有时空裂缝选项,请检查...")
        common.get_screen_shot(strat, time.time(), devices, "日常界面没有时空裂缝选项")
    if poco(texture="ld_bg_h2Split").exists():  # 第一个boss
        common.printgreen("进入时空裂缝界面,开始检测界面控件元素")
        freeze_poco = poco.freeze()  # TODO:定义dongjiepoco
        if freeze_poco("12").exists() and \
                freeze_poco("LevelOne").child("Label").exists() and \
                freeze_poco("LevelOne").offspring("item0").child("T").exists() and \
                freeze_poco("Leveltwo").exists() and \
                freeze_poco("Levelthree").exists():
            common.printgreen("点击  裂隙魔物")
            poco("Leveltwo").click()
            freeze_poco = poco.freeze()  # TODO:定义dongjiepoco
            for item in range(len(freeze_poco("Grid").child())):  # 点击奖励小icon
                item1 = "item" + str(item)
                freeze_poco("DropFrame").child("Grid").child(item1).child(
                    "Icon").click()
                freeze_poco("DropFrame").child("Grid").child(item1).child(
                    "Icon").click()
            if poco("ItemToolTipDlg(Clone)").child(
                    "Bg").exists():  # 判断是不是小弹窗还在,如果在就点掉
                poco("DropFrame").child("Grid").child(item1).child(
                    "Icon").click()
            common.printgreen("点击  裂隙精英")
            poco("Levelthree").click()
            freeze_poco = poco.freeze()  # TODO:定义dongjiepoco
            for item in range(len(freeze_poco("Grid").child())):  # 点击奖励小icon
                item1 = "item" + str(item)
                freeze_poco("DropFrame").child("Grid").child(item1).child(
                    "Icon").click()
                freeze_poco("DropFrame").child("Grid").child(item1).child(
                    "Icon").click()
            sleep(1)
            if poco("ItemToolTipDlg(Clone)").child(
                    "Bg").exists():  # 判断是不是小弹窗还在,如果在就点掉
                poco("DropFrame").child("Grid").child(item1).child(
                    "Icon").click()
            common.printgreen("点击  世界boss")
            poco("LevelOne").click()
            freeze_poco = poco.freeze()  # TODO:定义dongjiepoco
            common.printgreen("时空裂缝界面--显示正确")
            for item in range(len(freeze_poco("Grid").child())):  # 点击奖励小icon
                item1 = "item" + str(item)
                freeze_poco("DropFrame").child("Grid").child(item1).child(
                    "Icon").click()
                freeze_poco("DropFrame").child("Grid").child(item1).child(
                    "Icon").click()
            sleep(1)
            if poco("ItemToolTipDlg(Clone)").child(
                    "Bg").exists():  # 判断是不是小弹窗还在,如果在就点掉
                poco("DropFrame").child("Grid").child(item1).child(
                    "Icon").click()
        else:
            common.printred("缺少界面控件元素,请检查...")
            common.get_screen_shot(strat, time.time(), devices, "缺少界面控件元素")
        if poco("LevelOne").offspring("item1").exists():  # 第二个boss
            poco("LevelOne").offspring("item1").click()
            for item in range(len(freeze_poco("Grid").child())):  # 点击奖励小icon
                item1 = "item" + str(item)
                freeze_poco("DropFrame").child("Grid").child(item1).child(
                    "Icon").click()
                freeze_poco("DropFrame").child("Grid").child(item1).child(
                    "Icon").click()
            sleep(1)
            if poco("ItemToolTipDlg(Clone)").child(
                    "Bg").exists():  # 判断是不是小弹窗还在,如果在就点掉
                poco("DropFrame").child("Grid").child(item1).child(
                    "Icon").click()
        if poco("LevelOne").offspring("item2").exists():  # 第三个boss
            poco("LevelOne").offspring("item1").click()
            for item in range(len(freeze_poco("Grid").child())):  # 点击奖励小icon
                item1 = "item" + str(item)
                freeze_poco("DropFrame").child("Grid").child(item1).child(
                    "Icon").click()
                freeze_poco("DropFrame").child("Grid").child(item1).child(
                    "Icon").click()
                sleep(1)
            if poco("ItemToolTipDlg(Clone)").child(
                    "Bg").exists():  # 判断是不是小弹窗还在,如果在就点掉
                poco("DropFrame").child("Grid").child(item1).child(
                    "Icon").click()
        if poco("Levelthree").exists():
            poco("Levelthree").click()
        if poco("Leveltwo").exists():
            poco("Leveltwo").click()
        if poco("LevelOne").child("Bg").exists():
            poco("LevelOne").child("Bg").click()
        if poco("RankDetail").child("p")[1].exists():  # 排行榜
            poco("RankDetail").child("p")[1].click()
            freeze_poco = poco.freeze()  # TODO:定义dongjiepoco
            if freeze_poco("ToggleGuild").child("SelectedText").exists() and \
                    freeze_poco("ToggleFriend").child("SelectedText").exists() and \
                    freeze_poco("word").exists() and \
                    freeze_poco("title1").exists() and \
                    freeze_poco("title3").exists():
                common.printgreen("时空裂缝界面-->>排行榜显示正确")
                poco(texture="l_close_00").click()
            else:
                common.printred("排行榜缺少控件,请检查...")
                common.get_screen_shot(strat, time.time(), devices, "排行榜缺少控件")
        if poco(texture="l_close_00").exists():
            poco(texture="l_close_00").click()  # 二次判断返回按钮,避免出现界面卡死影响下次操作
        if poco(texture="Icon_Treasure1").exists():
            poco(texture="Icon_Treasure1").click()
            freeze_poco = poco.freeze()  # TODO:定义dongjiepoco
            if freeze_poco("Title").exists() and \
                    freeze_poco(text="排名奖励").exists() and \
                    freeze_poco(text="排名进入").exists() and \
                    freeze_poco(text="奖励").exists() and \
                    freeze_poco("RewardDlg").child("Bg").offspring("item0").exists() and \
                    freeze_poco("RewardDlg").child("Bg").offspring("item2").exists() and \
                    freeze_poco("RewardDlg").child("Bg").offspring("item1").exists() and \
                    freeze_poco("RewardDlg").child("Bg").offspring("item3").exists():
                common.printgreen("时空裂缝界面-->>排名奖励显示正确")
                poco(texture="l_close_00").click()
                if not poco(texture="l_close_00").exists():
                    pass
                else:
                    poco(texture="l_close_00").click()
            else:
                common.printred("排名奖励缺少控件,请检查...")
                common.get_screen_shot(strat, time.time(), devices, "排名奖励缺少控件")
    return poco(text="排名奖").get_text()  # 排名奖励