def __init__(self): """ 检测云账户是否登录,如果已经登录云账户,则退出登录 """ Pointer.me_page() if Pointer.devices(text="请登录").exists: Pointer.devices( resourceId="com.x.wallet.debug:id/tv_user_account").click() Pointer.devices( resourceId="com.x.wallet.debug:id/btn_logout").click() Pointer.tokencat_page()
def sharing_information(): """ 每日分享资讯,此处会上拉屏幕 """ Pointer.devices(scrollable=True).scroll(steps=20) time.sleep(3) Pointer.devices(resourceId="com.x.wallet.debug:id/btn_go", text=u"去分享").click() date = Pointer.devices( resourceId="com.x.wallet.debug:id/news_date_tv").get_text() Pointer.tokencat_page() print(date)
def play_token_cat_10(): """ 每日玩10次通证猫转盘 """ Pointer.devices(resourceId="com.x.wallet.debug:id/btn_go", text=u"去完成", className="android.widget.Button", instance=1).click() title = Pointer.devices( resourceId="com.x.wallet.debug:id/tv_title").get_text() Pointer.tokencat_page() assert title == "通证猫专区"
def __init__(self): import re """ 检测是否已登录云钱包为""" Pointer.me_page() if Pointer.devices(text="请登录").exists: from scr.common.app.me import CloudWallet cloud = CloudWallet() cloud.login() Pointer.tokencat_page() # 获取云账户ICT cloud_account_total = Pointer.devices( resourceId="com.x.wallet.debug:id/tv_total").get_text() self.cloud_account_total = int( re.findall(r"\d+", cloud_account_total)[0]) Pointer.wallet_page() # 获取云钱包ICT self.cloud_wallet_total = Pointer.devices( resourceId="com.x.wallet.debug:id/balance_tv").get_text() Pointer.tokencat_page()