Example #1
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)
Example #2
0
def update():

    sleep(3)
    # if click_picture(ima,'login.png','')
    p.report('', '启动游戏更新', 'start')
    p.game('update')
    p.report('', '启动游戏更新', 'tcend')
    p.tcfenxi()
    sleep(3)
Example #3
0
    def test_2autologin_yueka(self):
        p.begin(task_id)
        p.tcfenxi()
        update()
        zhuce()
        p.tcfenxi()
        pay()
        p.tcfenxi()
        
        if p.checktask():
            #login()
            p.tcfenxi()

        p.checkweb()
        p.tcfenxi()
Example #4
0
 def test_2autologin_yueka(self):
     p.begin(task_id)
     p.tcfenxi()
     update()
     zhuce()
     p.tcfenxi()
     pay()
     p.tcfenxi()
Example #5
0
 def test_4autologin_yueka(self):
     sleep(10)
     p.tcfenxi()
     p.checkweb()
     p.tcfenxi()
Example #6
0
 def test_3autologin_yueka(self):
     if p.checktask():
         login()
         p.tcfenxi()
Example #7
0
 def tearDown(self):
     p.tcfenxi()
     sessionquit()
Example #8
0
    def test_2autologin_yueka(self):
        p.begin(task_id)
        p.tcfenxi()
        update()
        p.tcfenxi()
        zhuce()
        p.tcfenxi()
        pay()
        p.tcfenxi()

        sleep(5)
        login()
        p.tcfenxi()

        sleep(10)
        p.checkweb()
        p.uninstall_app()
        p.tcfenxi()
Example #9
0
        c.screenshot(screen_picture)
        p1 = screen_picture
        p2 = current_picture
        a, x, y = opencv.imgcompare(p1, p2)
        k = k + 1
        print('尝试第', k, '次', thing)
        if k == 10:
            sleep(1)
            return False
    if a:
        print('获取点击坐标', thing, a, x, y)
        p.touch(s, x, y)
        s.tap(x, y)
    return True


def report(mo, msg):
    p.report('', mo, msg)


if __name__ == '__main__':

    p.begin(task_id)
    update()
    zhuce()
    p.tcfenxi()
    pay()

    p.tcfenxi()
    p.sessionquit()