コード例 #1
0
ファイル: VipList.py プロジェクト: liyahng/weixin
    def Bydesc(self):
        poco.swipe([0.5, 0.9], [0.5, 0.3])    
        if (poco(text = "视频会员服务条款").exists() and poco(text = "连续包月说明")[1].exists()):
            poco(text = "视频会员服务条款").click()
            if (poco(text = "PP视频会员服务条款").exists()):
                quit(2, 1, False)
            else:
                print('PP视频会员服务条款--不存在')
                return False
            poco(text = "连续包月说明")[1].click()
            sleep(2)
            if (poco(text = "PP视频会员连续包月服务协议").exists()):
                quit(2, 1, False)
            else:
                print('PP视频会员连续包月服务协议--不存在')
                return False
            return True
        else:
            return False

# vip = Vip()
# vipRes = vip.Bydesc()
# swipeStartIndex(2, 'down')
# print(vipRes)

# res = vip.clickBuy('1个月16元原价20元')
# print(res)
コード例 #2
0
 def carousel(self):
     poco(text="PP视频").click([0, 2])
     if (poco(text="播放").exists() or poco(text="暂停").exists()):
         quit(2, 1, False)
         return True
     else:
         quit(2, 1, False)
     return False
コード例 #3
0
 def clickJump(self, name):
     poco(text=name).click([0, 2])
     if (poco(text="播放").exists() or poco(text="暂停").exists()):
         quit(2, 1, False)
         return True
     elif (poco(text="电视剧").exists()):
         poco(text="会员").click()
         return True
     else:
         quit(2, 1, False)
         print('未知----')
     return False
コード例 #4
0
ファイル: LongVideoVIP0910.py プロジェクト: liyahng/weixin
    poco(text = "PP视频").click()

login = Login('weixin')
longVideo = LongVideo()

def  checkResult(data, msg = ''):
    for key in data:
        try:
            assert_equal(data[key], True, msg + '--【' + key + '】')
        except:
            print('------')
            pass
# 3、VIP用户-不同类型视频-播放器展示场景
ppLoginRes = login.ppLogin(accoutConf['vipUser'], 1)
#退到--首页
quit(2, 0)
if (ppLoginRes):
    try:
        res = longVideo.videoRightShow('vipUserVideoRightBtnShow', 'vipTicket')
    except:
        print('VIP用户--右--用券')
        pass
    quit()
    checkResult(res, '11VIP用户--右--用券')

    try:
        res = longVideo.videoRightShow('vipUserVideoRightBtnShow', 'vipPay')
    except:
        print('VIP用户--右--付费')
        pass
    quit()
コード例 #5
0
        try:
            assert_equal(data[key], True, msg + '--【' + key + '】')
        except:
            print('------')
            pass


#长视频播放器逻辑展示
# 1、未登录-不同类型视频-播放器展示场景
#未登录---观看VIP免费电影
try:
    res = longVideo.videoCenterShow('noLoginCenterBtnShow', 'vipFreeMovie')
except:
    print('未登录--VIP电影--中心')
    pass
quit()
log(str(res))
checkResult(res, '未登录--VIP电影--中心')

try:
    res = longVideo.videoRightShow('noLoginRightBtnShow', 'vipFreeMovie')
except:
    print('未登录--VIP电影--右')
    pass
quit()
checkResult(res, '未登录--VIP电影--右')

# # #未登录----观看VIP电视剧
try:
    res = longVideo.videoCenterShow('noLoginCenterBtnShow', 'vipFreeTv')
except:
コード例 #6
0
    def checkAfterShow(self, textBtn, videoName):
        #---退到前一个页面---todo
        print('点击' + textBtn)
        poco(text=textBtn).click()
        if (self.btnType[textBtn] == 1):
            print(1)
            #弹框 ==获取不到元素---todo
        elif (self.btnType[textBtn] == 2):
            print(2)
            if (poco(text='有效天数:7天').exists() and poco(text='确认').exists()):
                poco(text='确认').click()  #跳转--支付
                print('支付---', poco(text='支付').exists())
                print('价格---', poco(text='价格').exists())
                print('商品名称---', poco(text='商品名称').exists())
                print('确认支付---', poco(text='确认支付').exists())
                sleep(2)
                if (poco(text='支付').exists() and poco(text='价格').exists()
                        and poco(text='商品名称').exists()
                        and poco(text='确认支付').exists()):
                    print('点击--确认支付--按钮')
                    poco(text='确认支付').click()  #调起键盘支付
                    print('上海聚力传媒技术有限公司', poco(text='上海聚力传媒技术有限公司').exists())
                    sleep(3)
                    if (poco(text='上海聚力传媒技术有限公司').exists()):
                        #                         poco.click([0.5,0.9])
                        #                         poco.click([0.16,0.89])
                        #                         poco.click([0.83,0.90])
                        #                         poco.click([0.16,0.82])
                        #                         poco.click([0.5,0.9])
                        #                         poco.click([0.16,0.82])
                        #返回到长视频页面
                        sleep(3)
                        poco(name='关闭').click()
                        quit(2, 1, False)
                        return True
        elif (self.btnType[textBtn] == 3):  #弹框元素有概率取不到
            print(3)
            sleep(3)
            title = "购买《" + videoName + "》"
            print('有效天数:7天', poco(text='有效天数:7天').exists())
            print('确认', poco(text='确认').exists())
            print(title, poco(text=title).exists())
            if (poco(text='有效天数:7天').exists() and poco(text='确认').exists()
                    and poco(text=title).exists()):
                poco(text='取消').click()
                return True

        elif (self.btnType[textBtn] == 4):
            print(4)
            #检查是否跳转页面成功----PP视频会员购买---标题存在--暂定
            if (poco(text='PP视频会员购买').exists() and poco(text='会员套餐').exists()
                    and poco(text='购买').exists()):
                quit(2, 1, False)
                return True

        elif (self.btnType[textBtn] == 5):
            print(5)
            ##todo
        else:
            print('未知类型--按钮')
        return False
コード例 #7
0
    poco(text="微信").click()
    poco.swipe([0.5, 0.4], [0.5, 0.8], duration=1)
    poco(text="PP视频").click()

vip = Vip()
login = Login('weixin')

#会员--微信登录--退出
thirdLoginRes = login.ThirdAuthLogin(2)
try:
    if (thirdLoginRes):
        print('登录结果:', thirdLoginRes)
        poco(text="开通会员").click()
        res = vip.clickBuy("1个月16元原价20元")
        assert_equal(res, True, '1个月16元原价20元-调起支付-展示金额正确16元')
except:
    print('error')
    pass

try:
    vipRes = vip.Bydesc()
    swipeStartIndex(2, 'down')
    print('连续包月说明:', vipRes)
    assert_equal(vipRes, True, '协议连接正确')
    #退出登录--todo
    quit(2, 1)
    login.logOut(2)
except:
    print('error')
    pass
コード例 #8
0
ファイル: login0928.py プロジェクト: liyahng/weixin
try:
    thirdLoginRes = login.ThirdAuthLogin(2)
    if (thirdLoginRes):
        print('登录结果:', thirdLoginRes)
        login.logOut(2)
except:
    print('微信登录--会员--失败')
    pass
checkResult(thirdLoginRes, '微信登录--会员')

# #长视频--微信登录--退出
try:
    SearchToLongvideo(vipVideoName)
    thirdLoginRes = login.ThirdAuthLogin(3)
    print('登录结果:', thirdLoginRes)
    if (thirdLoginRes and quit()):
        print('退出登录----')
        logoutRes = login.logOut(2)
        if (logoutRes == False):
            print('退出失败~~~~')
except:
    print('微信--长视频--失败')
    pass
checkResult(thirdLoginRes, '微信--长视频')

# #个人--PP账号登录--退出
try:
    ppLoginRes = login.ppLogin(accoutConf['commonUser'], 1)
    if (ppLoginRes):
        login.logOut(1)
except: