Esempio n. 1
0
def pay():
    print('jzx---------------------pay')
    # 打开首充界面
    p.report('', '游戏6元', 'start')
    sleep(5)
    s.tap(330, 50)
    p.report('', '点击屏幕上方', '')
    # 防止触发任务,在游戏中上方点击下
    i = 0
    fc = find_picture(p.shot(), '/Volumes/ntfs3/ios_python/jzx/chongzhi.png',
                      '打开充值界面')
    while not fc and i < 4:
        s.tap(330, 50)
        sleep(1)
        i += 1
        p.report('', '没找到充值按钮', i)
        fc = find_picture(p.shot(),
                          '/Volumes/ntfs3/ios_python/jzx/chongzhi.png',
                          '打开充值界面')
    # 正常支付流程   打开充值-点击6元档-支付
    sleep(1)
    if click_picture(p.shot(), '/Volumes/ntfs3/ios_python/jzx/chongzhi.png',
                     '打开充值界面'):
        # p.report('','游戏主界面','打开充值界面')
        pay_end = False
        i = 0
        while click_picture(p.shot(),
                            '/Volumes/ntfs3/ios_python/jzx/jzx_six.png',
                            '点击六元档') and i < 3:
            p.report('', '充值界面', '打开六元充值档')
            # apple支付判断界面
            user = '******'
            pwd = 'Aa11223344'
            user = p.account
            pwd = p.password
            user = user.strip()
            pwd = pwd.strip()
            pay_end = ps.apple_pay(c.session(), user, pwd)
            if pay_end == True:
                #苹果支付成功,并查询到到账金额是60元宝,则支付成功
                print('支付成功')
                dz = find_picture1(
                    p.shot(), '/Volumes/ntfs3/ios_python/jzx/buy_daozhang.png',
                    '购买到账')
                if dz:
                    p.shot()
                    p.report('', '到账成功', '60元宝')
                    print('到账成功')
                    p.report('pay', '游戏6元', 'tcend')
                break
            i += 1

        if pay_end == False:
            p.shot()
            print('支付失败')
            p.report('pay', '游戏6元', 'fail')
Esempio n. 2
0
def update():
    p.report('update','更新','start')
    print(p.task_id)
    global s
    global c
    s = p.sessionstart()

    #s.set_alert_callback(_alert_callback)
    if s == '':
        p.report('','游戏启动失败','fail')
    sleep(2)

    #查找权限允许

    i = 0
    while i < 5:
        allow = s(name='允许').exists
        if allow:
            s(name='允许').get(timeout=3).click()
            p.shot()
        allow = s(name='好').exists
        if allow:
            s(name='好').get(timeout=3).click()
            p.shot()
        allow = s(name='确定').exists
        if allow:
            s(name='确定').get(timeout=3).click()
            p.shot()
        i += 1
        sleep(3)
        p.report('','权限允许查询','第%d次' % i )

    el = click_picture(p.shot(), '/Volumes/ntfs3/ios_python/jzx/shantui.png', '闪退,我知道了')
    # print(a)
    if el:
        p.report('','优化闪退','退出重进')
    nel = not el
    i = 0
    while nel and i < 2:
        el = click_picture(p.shot(), '/Volumes/ntfs3/ios_python/jzx/shantui.png', '闪退,我知道了')
        if el:
            p.report('', '优化闪退', '退出重进')
        nel = not el
        sleep(3)
        p.report('','查找闪退图','第%d次' % i)
        i += 1

    p.sessionstart()




    sleep(3)
    # if click_picture(ima,'login.png','')
    p.report('','启动游戏更新','start')
    p.game('update')
    p.report('','启动游戏更新','tcend')
    p.tcfenxi()
    sleep(3)
Esempio n. 3
0
def zhuce():
    global c
    global s
    c = wda.Client()
    s = c.session()
    p.report('zhuce', '', '注册新账号')
    if click_picture(p.shot(),
                     '/Users/lichun/Documents/lihui/bingxue/register.png',
                     '自定义注册账号'):
        p.report('zhuce', '注册新账号', '')
        if click_picture(p.shot(),
                         '/Users/lichun/Documents/lihui/bingxue/user.png',
                         '输入账号'):
            allz = 'abcdefghijklmnopqrstuvwxyz'
            allzlist = list(allz)
            username = random.sample(allzlist, 9)
            s(name='L').get(timeout=3).tap()
            for a in username:
                s(name=a).get(timeout=3).tap()
            p.report('zhuce', '账号', ''.join(username))
            p.report('zhuce', '密码', 'qqqqqqq')
            s(name='Next:').get(timeout=4).tap()
            #密码7个q
            for i in range(7):
                s(name='q').get(timeout=3).tap()
            s(name='Next:').get(timeout=4).tap()
            #确认密码
            for i in range(7):
                s(name='q').get(timeout=3).tap()
            s(name='Done').get(timeout=4).tap()
        sleep(1)
        if click_picture(
                p.shot(),
                '/Users/lichun/Documents/lihui/bingxue/register_success.png',
                '输入账号信息准备进入游戏'):
            print('success')
            #绑定手机号
            if click_picture(
                    p.shot(),
                    '/Users/lichun/Documents/lihui/bingxue/after.png', '稍后绑定'):
                print('准备进入游戏')
                report('绑定手机号', '取消')
            else:
                report('没有找到绑定手机号界面', '')
    #进入游戏
    login()
    return
Esempio n. 4
0
def autologin():
    p.report('', '游戏登录', 'start')
    global c
    global s
    c = wda.Client()
    s = c.session()
    sleep(3)

    click_picture(p.shot(), '/Volumes/ntfs3/ios_python/jzx/kaishiyouxi.png',
                  '开始游戏')

    newj = find_picture(p.shot(),
                        '/Volumes/ntfs3/ios_python/jzx/jinruyouxi.png', '进入游戏')
    if newj:
        click_picture(p.shot(), '/Volumes/ntfs3/ios_python/jzx/jinruyouxi.png',
                      '进入游戏')

    game = not find_picture(
        p.shot(), '/Volumes/ntfs3/ios_python/jzx/chongzhi.png', '游戏界面')
    i = 0
    while game and i < 3:
        s.tap(330, 50)
        i += 1
        game = not find_picture(
            p.shot(), '/Volumes/ntfs3/ios_python/jzx/chongzhi.png', '游戏界面')
    if not game:
        p.report('', '登录游戏', 'tcend')
    sleep(5)
    p.shot()
Esempio n. 5
0
def pay2():
    print('jzx---------------------pay')
    #打开首充界面
    p.report('', '游戏6元', 'start')
    #sleep(2)
    s.tap(330, 50)
    #防止触发任务,在游戏中上方点击下
    i = 0
    while not find_picture(p.shot(),
                           '/Volumes/ntfs3/ios_python/jzx/chongzhi.png',
                           '打开充值界面') and i < 4:
        p.report('', '', '点击一下屏幕')
        s.tap(330, 50)
        i += 1
        sleep(1)
    sleep(1)
    s.tap(330, 50)
    #正常支付流程   打开充值-点击6元档-支付
    if click_picture(p.shot(), '/Volumes/ntfs3/ios_python/jzx/chongzhi.png',
                     '打开充值界面'):
        #p.report('','游戏主界面','打开充值界面')
        i = 0
        while click_picture(p.shot(),
                            '/Volumes/ntfs3/ios_python/jzx/jzx_six.png',
                            '点击六元档') and i < 3:
            p.report('', '充值界面', '打开六元充值档')
            #apple支付判断界面
            user = '******'
            pwd = 'Dongxiao123'
            pay_end = ps.apple_pay(c.session(), user, pwd)
            if pay_end == True:
                print('支付成功')
                p.report('pay', '游戏6元', 'end')
                break
            elif pay_end == 2:
                print('需要重新点击6元档')

            elif pay_end == 3:
                #输入账号密码之后,如果超时,1、等待超时,重新购买 2、沙箱账号问题
                print('等待确认输入框超时,重新购买')

            else:
                print('其它情况')
            i += 1
Esempio n. 6
0
def update():
    p.report('', 'sdk游戏更新', 'start')
    print(p.task_id)
    p.report1('', 'update', '截图')
    sleep(5)
    aa = p.shot()
    if click_picture(aa, '/Users/lichun/Documents/lihui/bingxue/allow.png',
                     '查询是否要允许'):
        p.report('', '允许发送通知', 'update')
    sleep(3)
Esempio n. 7
0
def replace_server(newT, baginT):
    global c
    global s
    c = wda.Client()
    s = c.session()
    if not newT and not baginT:
        #没有进入游戏,服务器有问题,更换服务器
        if click_picture(
                p.shot(),
                '/Users/lichun/Documents/lihui/bingxue/sever_replace.png',
                '更换服务器'):
            if click_picture(
                    p.shot(),
                    '/Users/lichun/Documents/lihui/bingxue/sever_new.png',
                    '点击新服'):
                pass
        else:
            print('没有服务器')
            p.report('', '', '没有服务器')
Esempio n. 8
0
def login():
    #出现权限允许
    if click_picture(p.shot(),
                     '/Users/lichun/Documents/lihui/bingxue/allow.png',
                     '查询是否要允许'):
        p.report('', '允许发送通知', 'update')
    #SDK信息
    report('调用游戏登录', 'start')
    p.game('login')
    report('调用游戏登录', 'end')

    p.report('', '登录', 'tcend')
    return
Esempio n. 9
0
def update():
    p.report('update', '更新', 'start')
    global s
    global c
    #s = p.sessionstart()

    # s.set_alert_callback(_alert_callback)
    sleep(2)

    # 查找权限允许
    i = 0
    while i < 5:
        allow = s(name='允许').exists
        if allow:
            s(name='允许').get(timeout=3).click()
            p.shot()
        allow = s(name='好').exists
        if allow:
            s(name='好').get(timeout=3).click()
            p.shot()
        allow = s(name='确定').exists
        if allow:
            s(name='确定').get(timeout=3).click()
            p.shot()
        i += 1
        sleep(3)
        p.report('', '权限允许查询', '第%d次' % i)

    el = click_picture(p.shot(), '/Volumes/ntfs3/ios_python/jzx/shantui.png',
                       '闪退,我知道了')
    # print(a)
    if el:
        p.report('', '优化闪退', '退出重进')
        p.sessionstart()

    nel = not el
    i = 0
    while nel and i < 2:
        el = click_picture(p.shot(),
                           '/Volumes/ntfs3/ios_python/jzx/shantui.png',
                           '闪退,我知道了')
        if el:
            p.report('', '优化闪退', '退出重进')
            p.sessionstart()
        nel = not el
        sleep(3)
        p.report('', '查找闪退图', '第%d次' % i)
        i += 1
Esempio n. 10
0
def apple_pay(s, userid, userpwd):
    print('ps----------------------apple_pay')
    s.set_alert_callback(_alert_callback)
    print('apple_pay being')

    id_wait = s(name='使用现有的 Apple ID')
    i = 0
    while not id_wait.exists:
        sleep(5)
        id_wait = s(name='使用现有的 Apple ID')
        i += 1
        print('第%d次寻找是否弹出了账号输入' % i)
        p.report('', '', '第%d次寻找是否弹出了账号输入' % i)
        if i == 15:
            #没有找到账号输入,证明需要重新点击
            return False

    #输入账号密码
    if id_wait.exists:
        id_wait.get(5).click()
        sleep(4)
        e = s(value='*****@*****.**')
        if e.exists:
            e.get(timeout=5).set_text(userid)
            s(value='密码').get(timeout=3).set_text(userpwd)
            p.shot()
            s(name='购买').get(timeout=3).tap()

    buy_wait = s(name='购买')
    #确认购买
    i = 0
    while not buy_wait.exists:
        sleep(5)
        buy_wait = s(name='购买')
        i += 1
        print('第%d次寻找是否弹出了购买确认' % i)
        p.report('', '', '第%d次寻找是否弹出了购买确认' % i)
        if i == 15:
            #确认购买框还没有出来,重新购买
            return False
    if buy_wait.exists:
        sleep(3)
        p.shot()
        buy_wait.get(5).click()

    sleep(3)
    sure_wait = s(name='好')
    i = 0
    while not sure_wait.exists and i < 15:
        sleep(5)
        sure_wait = s(name='好')
        i += 1
        print('第%d次寻找是否弹出了购买完毕' % i)
    if sure_wait.exists:
        p.shot()
        sure_wait.get(5).click()
        return True
Esempio n. 11
0
def shiyuan():
    global c
    global s
    c = wda.Client()
    s = c.session()

    p.report('shiyuan', 'shiyuan', 'start')
    p.report('', '调用游戏充值', 'start')
    p.game('shiyuan')
    p.report('', '调用游戏充值', 'end')
    sleep(5)

    #等待是否出现APPle输入账号界面,相当于判断是否会进入到订单界面
    find_picture(p.shot(), '/Users/lichun/Documents/lihui/jzx/buysure.png',
                 '确认购买')
    dot = 0
    while not e.exists:
        dot += 1
        if dot > 10:
            p.report('', '等待订单出现界面超时', 'fail')
            report()
        sleep(5)
        p.report('', '等待订单界面出现', '等待中')
        e = s(name='使用现有的 Apple ID')
Esempio n. 12
0
def zhuce():
    print('yaowan --------- zhuce')
    p.report('zhuce', 'sdk注册', 'start')
    global c
    global s
    c = wda.Client()
    s = c.session()
    p.shot()
    #点击要玩的忘记密码,再回到主界面
    ss = s(name='忘记密码').exists
    i = 0
    while not ss and i < 5:
        ss = s(name='忘记密码').exists
        i += 1
        sleep(2)
    if ss:
        s(name='忘记密码').get(3).click()
        sleep(2)
        p.shot()
        ss = s(name='返回').exists
        i = 0
        while not ss and i < 5:
            ss = s(name='返回').exists
            i += 1
        sleep(2)
        if ss:
            s(name='返回').get(3).click()
            sleep(2)
            report('', '返回密码正常,已经回到界面')
        ss = s(name='戻る').exists
        i = 0
        while not ss and i < 5:
            ss = s(name='戻る').exists
            i += 1
        sleep(2)
        if ss:
            s(name='戻る').get(3).click()
            sleep(2)
            report('', '返回密码正常,已经回到界面')
    else:
        print('没有看到忘记密码')
        report('', '没有看到忘记密码按钮,或者没有找到')

    #快速注册
    ss = s(name='快速注册').exists
    i = 0
    while not ss and i < 5:
        ss = s(name='快速注册').exists
        i += 1
        sleep(2)
    if ss:
        s(name='快速注册').get(3).click()
        sleep(2)
    #允许保存到相册中
    ss = s(name='好').exists
    i = 0
    while not ss and i < 5:
        ss = s(name='好').exists
        i += 1
        sleep(1)
    if ss:
        s(name='好').get(3).click()
        sleep(2)

    ss = s(name='好的').exists
    i = 0
    while not ss and i < 5:
        ss = s(name='好的').exists
        i += 1
        sleep(1)
    if ss:
        s(name='好的').get(3).click()
        sleep(2)
    sleep(3)
    #进入游戏
    #login()
    p.report('', '调用游戏登录', 'start')
    p.game('login')
    p.report('', '调用游戏登录', 'end')
    return
Esempio n. 13
0
def zhuce_my():
    print('zhangkun --------- zhuce')
    p.report('zhuce_my', '开始', '')
    p.sessionstart()
    global c
    global s
    global username
    c = wda.Client()
    s = c.session()
    s.set_alert_callback(_alert_callback)

    ss = s(name='账号注册').exists
    p.report('', '首次查找账号注册', '')
    sleep(2)
    i = 0
    while not ss and i < 5:
        ss = s(name='账号注册').exists
        i += 1
        sleep(2)
    if ss:
        p.report('', '点击账号注册', '')
        s(name='账号注册').get(3).click()
        sleep(2)
    sleep(3)

    # 输入账号
    user = s(className='TextField', value='6-20位数字或字母').exists
    if user:
        print('user')
        allz = 'abcdefghijklmnopqrstuvwxyz123456789abcdefghijklmnopqrstuvwxyz123456789'
        allzlist = list(allz)
        username = random.sample(allzlist, 12)
        user_ku = ''
        for a in username:
            user_ku = user_ku + a
        print(user_ku)
        s(className='TextField', value='6-20位数字或字母').set_text(username)
        p.report('', '账号注册账号', user_ku)
        p.report('zhuce_my', '立即注册', '')
        sleep(3)
        s(name='隐藏键盘').get(timeout=3).click()
        sleep(2)
        p.report('', '隐藏账号键盘', '')
    pwd = s(className='TextField', value='6-20位数字或字母').exists
    if pwd:
        print('pwd')
        s(className='TextField', value='6-20位数字或字母').set_text('110110')
        p.report('', '点击账号密码', '110110')
        sleep(1)
        s(name='隐藏键盘').get(timeout=3).click()
        sleep(2)
        p.report('', '隐藏密码键盘', '')
        sleep(1)

    ss = s(name='立即注册').exists
    sleep(2)
    i = 0
    while not ss and i < 5:
        ss = s(name='立即注册').exists
        i += 1
        p.report('', '查找立即注册按钮', i)
        sleep(2)

    if ss:
        p.shot()
        sleep(2)
        s(name='立即注册').get(3).click()
        p.report('', '注册账号成功', '')
        sleep(2)
    sleep(3)

    ss = s(name='close button').exists
    sleep(2)
    i = 0
    while not ss and i < 5:
        ss = s(name='close button').exists
        i += 1
        sleep(2)
    if ss:
        s(name='close button').get(3).click()
        sleep(2)
    sleep(3)

    #进入游戏
    #login()
    p.report('', '调用游戏登录', 'start')
    p.game('login')
    p.report('', '调用游戏登录', 'end')
    return
Esempio n. 14
0
def login():
    print('zhangkun --------- zhuce')
    p.report('login', '调用sdk登录', 'start')
    p.sessionstart()
    global c
    global s
    c = wda.Client()
    s = c.session()

    ss = s(name='账号登录').exists
    sleep(3)
    i = 0
    while not ss and i < 5:
        ss = s(name='账号登录').exists
        i += 1
        sleep(2)
    if ss:
        s(name='账号登录').get(3).click()
        p.report('', '点击账号登录', '')
        sleep(2)
    sleep(3)

    # 输入账号
    user = s(className='TextField', value='输入帐号/手机号').exists
    if user:
        #username='******'
        s(className='TextField', value='输入帐号/手机号').set_text(username)
        p.report('', '输入账号', '')
        sleep(3)
        s(name='隐藏键盘').get(timeout=3).click()

    pwd = s(className='TextField', value='输入密码').exists
    if pwd:
        print('pwd')
        s(className='TextField', value='输入密码').set_text('110110')
        p.report('', '输入密码', '')
        sleep(1)
        s(name='隐藏键盘').get(timeout=3).click()

    ss = s(name='进入游戏').exists
    sleep(3)
    i = 0
    while not ss and i < 5:
        ss = s(name='进入游戏').exists
        i += 1
        sleep(2)
    if ss:
        p.shot()
        s(name='进入游戏').get(3).click()
        sleep(2)
        p.report('', '进入游戏', '')
    sleep(3)

    ss = s(name='close button').exists
    i = 0
    while not ss and i < 5:
        ss = s(name='close button').exists
        i += 1
        sleep(2)
    if ss:
        s(name='close button').get(3).click()
        sleep(2)
    sleep(3)

    #SDK信息
    p.report('', '调用游戏登录', 'start')
    p.game('autologin')
    p.report('', '调用游戏登录', 'end')
    p.report('', '登录', 'end')

    return
Esempio n. 15
0
def zhuce():
    print('dalan --------- zhuce')
    p.report('zhuce', '游戏注册', 'start')
    global c
    global s
    c = wda.Client()
    s = c.session()

    ss = s(name='同意并进入游戏').exists
    i = 0
    while not ss and i < 5:
        ss = s(name='同意并进入游戏').exists
        i += 1
        sleep(2)
    if ss:
        s(name='同意并进入游戏').get(3).click()
        p.report('zhuce', '同意并进入游戏', 'end')
        sleep(2)
    else:
        p.report('', '没找到同意并进入游戏入口', '')
    sleep(3)

    ss = s(name='进入游戏').exists
    i = 0
    while not ss and i < 5:
        ss = s(name='进入游戏').exists
        i += 1
        sleep(2)
    if ss:
        s(name='进入游戏').get(3).click()
        p.report('zhuce', '进入游戏', 'end')
        sleep(2)
    else:
        p.report('', '没找到进入游戏入口', '截图判断')
        click_picture(p.shot(),
                      '/Volumes/ntfs3/ios_python/qudao/dalan_entergame.png',
                      'sdk截图判断进入游戏')
    sleep(3)

    #20180705新sdk用户协议
    if find_picture(p.shot(), '/Volumes/ntfs3/ios_python/qudao/dalanhuang.png',
                    'sdk截图判断进入游戏'):
        p.report('', '新sdk', '点击同意用户协议')
        click_picture(p.shot(),
                      '/Volumes/ntfs3/ios_python/qudao/dalanhuang.png',
                      'sdk截图判断进入游戏')
    sleep(3)

    #20180705新sdk进入游戏
    enter_zhuce = find_picture(
        p.shot(), '/Volumes/ntfs3/ios_python/qudao/dalanhuang.png',
        'sdk截图判断进入游戏')
    while not enter_zhuce and i < 3:
        enter_zhuce = find_picture(
            p.shot(), '/Volumes/ntfs3/ios_python/qudao/dalanhuang.png',
            'sdk截图判断进入游戏')
        sleep(2)
        i += 1
        p.report('', '新sdk', '重新寻找进入游戏按钮')

    if enter_zhuce:
        click_picture(p.shot(),
                      '/Volumes/ntfs3/ios_python/qudao/dalanhuang.png',
                      'sdk截图判断进入游戏')

    ss = s(name='好').exists
    i = 0
    while not ss and i < 5:
        ss = s(name='好').exists
        i += 1
        sleep(2)
    if ss:
        s(name='好').get(3).click()
        p.report('zhuce', '好', 'tcend')
        sleep(2)
    else:
        p.report('', '没找到相册授权入口', '')
    sleep(3)

    #进入游戏
    #login()
    p.report('', '调用游戏登录', 'start')
    p.game('login')
    p.report('', '调用游戏登录', 'end')

    return
Esempio n. 16
0
def login():
    p.report('', '游戏登录', 'start')
    global c
    global s
    c = wda.Client()
    s = c.session()
    sleep(3)
    #国行第一次会进行无网优化
    #click_picture(p.shot(),'/Volumes/ntfs3/ios_python/jzx/kaishiyouxi.png','我知道了')

    #sleep(3)
    #p.sessionstart()
    #登录游戏
    #判断,正常情况下创建新账号的流程是:开始游戏 -> 创建角色,接着进入游戏
    #正常情况下登录已经有角色账号的流程是:开始游戏 -> 进入游戏,接着进入游戏,进行判断,如果没有创建角色按钮,再判断是否有进入游戏

    # 开始游戏 创建角色 游戏界面 (忽略重名的情况)
    click_picture(p.shot(), '/Volumes/ntfs3/ios_python/jzx/kaishiyouxi.png',
                  '开始游戏')

    i = 0
    new1 = find_picture(p.shot(), '/Volumes/ntfs3/ios_python/jzx/newjuese.png',
                        '创建角色')
    p.report('', '查找是否有判断角色', new1)
    in1 = find_picture(p.shot(),
                       '/Volumes/ntfs3/ios_python/jzx/jinruyouxi.png', '进入游戏')
    p.report('', '查找是否有进入游戏', in1)
    while not new1 and not in1 and i < 3:
        click_picture(p.shot(),
                      '/Volumes/ntfs3/ios_python/jzx/kaishiyouxi.png', '开始游戏')
        new1 = find_picture(p.shot(),
                            '/Volumes/ntfs3/ios_python/jzx/newjuese.png',
                            '创建角色')
        in1 = find_picture(p.shot(),
                           '/Volumes/ntfs3/ios_python/jzx/jinruyouxi.png',
                           '进入游戏')
        i += 1
        p.report('', '在登录界面判断', i)
    newj = find_picture(p.shot(), '/Volumes/ntfs3/ios_python/jzx/newjuese.png',
                        '创建角色')
    if newj:
        p.report('', '点击创建角色', '')
        click_picture(p.shot(), '/Volumes/ntfs3/ios_python/jzx/newjuese.png',
                      '创建角色')

    game = True
    if find_picture(p.shot(), '/Volumes/ntfs3/ios_python/jzx/chongzhi.png',
                    '游戏界面'):
        sleep(4)
        p.shot()
        print('11进入游戏成功')
        p.report('', '注册登录游戏', 'tcend')
        s.tap(330, 50)
        game = False

    # 开始游戏 进入游戏 游戏界面
    if game:
        newj = find_picture(p.shot(),
                            '/Volumes/ntfs3/ios_python/jzx/jinruyouxi.png',
                            '进入游戏')
        if newj:
            p.report('', '进入游戏', '')
            click_picture(p.shot(),
                          '/Volumes/ntfs3/ios_python/jzx/jinruyouxi.png',
                          '进入游戏')
    game = not find_picture(
        p.shot(), '/Volumes/ntfs3/ios_python/jzx/chongzhi.png', '游戏界面')
    # 开始游戏 创建角色 游戏界面 (重名的情况,随机五次,已经进入游戏,不会执行)
    j = 0
    while game and j < 5:
        p.report('', '角色重名,重新扔骰子', j)
        click_picture(p.shot(), '/Volumes/ntfs3/ios_python/jzx/randomname.png',
                      '点击骰子')
        sleep(1)
        click_picture(p.shot(), '/Volumes/ntfs3/ios_python/jzx/newjuese.png',
                      '创建角色')
        j += 1
        game = not find_picture(
            p.shot(), '/Volumes/ntfs3/ios_python/jzx/chongzhi.png', '游戏界面')
        if game == False:
            print('22进入游戏成功')
            sleep(4)
            p.shot()
            p.report('', '注册登录游戏', 'tcend')
            s.tap(330, 50)
    s.tap(330, 50)
    if find_picture(p.shot(), '/Volumes/ntfs3/ios_python/jzx/chongzhi.png',
                    '游戏界面'):
        p.report('', '', 'tcend')