def create_eos_wallet(account_name, set_password="******", confirm_password="******", invitation_code=input("invitation_code:")): """ 创建eos账户 :param account_name: 账户名唯一,12位,英文,数字1-6 :param set_password: 设置密码 :param confirm_password: 配置钱包密码 :param invitation_code: 邀请码(激活码) """ Pointer.me_page() Pointer.devices( resourceId="com.x.wallet.debug:id/rl_wallet_manager").click() Pointer.devices( resourceId="com.x.wallet.debug:id/tv_eos_account").click() Pointer.devices(resourceId="com.x.wallet.debug:id/create_eos").click() Pointer.devices(resourceId="com.x.wallet.debug:id/btn_alerady").click() Pointer.devices( resourceId="com.x.wallet.debug:id/et_eos_account_name").send_keys(account_name) Pointer.devices.press("back") Pointer.devices(resourceId="com.x.wallet.debug:id/btn_next").click() Pointer.devices.implicitly_wait(10) Pointer.devices(text="请输入激活码").send_keys(invitation_code) Pointer.devices(text="请设置钱包密码").send_keys(set_password) Pointer.devices.press("back") Pointer.devices(text="请再次输入密码").send_keys(confirm_password) Pointer.devices.press("back") Pointer.devices(resourceId="com.x.wallet.debug:id/checkbox").click() Pointer.devices( resourceId="com.x.wallet.debug:id/create_account_btn").click()
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 __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()
def login( phone_number=13267122772, verification_code=input("verification_code:"), invitation_code=""): """ 登录云钱包 :param phone_number: 手机号(登录所需的账号) :param verification_code: 短信验证码 :param invitation_code: 邀请码,首次使用邀请码可获得额外积分 """ Pointer.me_page() # 进入到me页才能操作 Pointer.devices( resourceId="com.x.wallet.debug:id/tv_user_account").click() Pointer.devices(text="请输入手机号码").set_text(phone_number) Pointer.devices(text="请输入验证码").set_text(verification_code) if invitation_code: Pointer.devices(text='填写好友邀请码领积分').set_text(invitation_code) Pointer.devices.press('back') # 关闭输入键盘的操作 Pointer.devices(resourceId="com.x.wallet.debug:id/checkbox").click() Pointer.devices(resourceId="com.x.wallet.debug:id/btn_login").click()
def __init__(self): Pointer.me_page() Pointer.devices( resourceId="com.x.wallet.debug:id/ccpv_manage_wallet").click() Pointer.devices( resourceId="com.x.wallet.debug:id/tv_eos_account").click()