def login_days_sevenday(self):
     print('左滑页面查看7天成就页面')
     po = Operation(self.driver)
     po.swipeLeft()
     time.sleep(2)
     po.swipeUp()
     print('查看成功')
 def messagetest(self):
     self.clickmessage()
     List = self.driver.find_elements(*self.dynamicOrnotices)
     list = List.reverse()
     for i in list:
         i.click()
         po = Operation(self.driver)
         po.swipeUp()
 def my_like_story(self):
     '''点击播放全部'''
     self.go_my_like()
     time.sleep(1)
     po = Operation(self.driver)
     po.swipeUp()
     print('点击播放全部')
     self.find_element(*self.ml_play_all).click()
     print('播放成功')
 def my_like_album(self):
     '''我喜欢的--专辑页面'''
     self.go_my_like()
     print('点击专辑,进入子页面')
     List = self.find_elements(*self.ml_click_areas)
     List[2].click()
     po = Operation(self.driver)
     po.swipeUp()
     print('查看成功!')
 def my_like_minicourse(self):
     '''我喜欢的--微课'''
     self.go_my_like()
     print('点击微课')
     List = self.find_elements(*self.ml_click_areas)
     List[3].click()
     po = Operation(self.driver)
     po.swipeUp()
     print('查看成功!')
 def login_days_thirtyday(self):
     print('左滑两次页面查看30天成就页面')
     po = Operation(self.driver)
     po.swipeLeft()
     time.sleep(2)
     po.swipeLeft()
     time.sleep(2)
     po.swipeUp()
     print('查看成功')
 def my_like_spetialtopic(self):
     '''我喜欢的--专题页面'''
     self.go_my_like()
     print('点击专题,进入子页面')
     List = self.find_elements(*self.ml_click_areas)
     List[1].click()
     time.sleep(1)
     po = Operation(self.driver)
     po.swipeUp()
     print('查看成功!')
 def Gc_coupon(self):
     self.go_coupon()
     print('点击优惠券子页面-已失效')
     List = self.find_elements(*self.click_areas)
     List[1].click()
     po = Operation(self.driver)
     time.sleep(1)
     po.swipeUp()
     print('点击优惠券子页面-优惠券')
     List[0].click()
     print('查看成功')
 def test_Egivegood(self):
     '''播放器--浏览区--随机点赞'''
     try:
         po = PlayerPage(self.driver)
         po.go_play()
         fo = Operation(self.driver)
         fo.swipeUp()
         po.givegood()
         print('操作成功!')
     except:
         po = Operation(self.driver)
         po.screenShot()
 def recent_play_story_list(self):
     self.go_recent_play()
     po = Operation(self.driver)
     print('随机选择一个故事,进行点击,收听')
     List = self.find_elements(*self.rp_list_name)
     if len(List) != 0:
         x = random.randint(0, len(List) - 1)
         if x > 0:
             time.sleep(1)
             po.swipeUp()
             List[x].click()
             print('收听成功!')
     else:
         print('该用户最近没有收听故事\n')
 def Li_pin_card_look(self):
     self.Li_pin_card()
     try:
         print('随机选择一张礼品卡')
         List = self.find_elements(*self.lpc_names)
         x = random.randint(0, len(List) - 1)
         List[x].click()
         po = Operation(self.driver)
         time.sleep(1)
         po.swipeUp()
         print('查看礼品卡订单')
         self.find_element(*self.lpc_order).click()
         print('查看成功')
     except:
         print('该用户没有购买礼品卡,所以无法查看礼品卡!')
 def test_Cplay_leavemessage(self):
     '''播放器--点击留言,输入留言内容'''
     try:
         po = PlayerPage(self.driver)
         po.go_play()
         fo = Operation(self.driver)
         fo.swipeUp()
         mname = format(sys._getframe().f_code.co_name)
         data = ReadData.readdata(mname)
         print(data[0])
         po.click_leave_message(data[0])
         print('操作成功!')
     except:
         po = Operation(self.driver)
         po.screenShot()
 def palyer_collect(self):
     self.go_play()
     self.clickcollection()
     time.sleep(1)
     self.clickpaper()
     po = Operation(self.driver)
     return po.swipeUp()
 def recentlogin(self):
     print('点击最近登录')
     self.find_element(*self.login_count).click()
     self.driver.implicitly_wait(2)
     po = Operation(self.driver)
     time.sleep(1)
     po.swipeLeft(500)
     time.sleep(1)
     po.swipeUp(500)
     time.sleep(1)
     po.swipeLeft(500)
     time.sleep(1)
     po.swipeUp(500)
     time.sleep(1)
     po.swipeRight(500)
     time.sleep(1)
 def random_play(self):
     '''首页---小知识--随机播放'''
     fo = Operation(self.driver)
     fo.swipeUp()
     print('随机选择一条记录收听')
     List = self.find_elements(*self.knowledge_list)
     x = random.randint(0, len(List) - 1)
     List[x].click()
     time.sleep(3)
     print('等待3s,获取播放时间')
     playtime = self.find_element(*self.play_time).text
     print('判断是否播放成功')
     if time != '00:00':
         print('播放成功!')
     else:
         print('播放失败!')
         raise LocateError
 def recent_play_course_list(self):
     self.go_recent_play()
     print('点击课程,进入子页面')
     course = self.find_elements(*self.rp_storyOrcources_icons)[1]
     course.click()
     po = Operation(self.driver)
     print('随机选择一个内容,进行收听!')
     try:
         List = self.find_elements(*self.rp_list_name)
         if len(List) != 0:
             x = random.randint(0, len(List) - 1)
             if x > 0:
                 time.sleep(1)
                 po.swipeUp()
                 List[x].click()
                 print('收听成功!')
     except:
         print('该用户最近没有收听课程\n')
 def go_buyed_order(self):
     '''进入已购买的-更多-我的订单页面'''
     # self.go_buyed()
     print('点击右上角更多')
     self.driver.find_element(*self.b_more).click()
     print('点击我的订单')
     self.driver.find_element(*self.b_order).click()
     po = Operation(self.driver)
     return po.swipeUp()
 def go_buyed_updatenotice(self):
     '''进入已购买的-更多-更新提醒'''
     # self.go_buyed()
     print('点击右上角更多')
     self.driver.find_element(*self.b_more).click()
     print('点击更新提醒')
     self.driver.find_element(*self.b_update).click()
     po = Operation(self.driver)
     return po.swipeUp()
Beispiel #19
0
    def download_select_random(self):
        po = Operation(self.driver)
        # n = random.randint(1,2)
        k = random.randint(100, 1000)
        po.swipeUp(k)
        print('随机点击下载按钮')
        List = self.find_elements(*self.download_single_icons)
        # print('List',List)
        x = random.randint(0, len(List) - 1)

        List[x].click()

        downloadsign = self.find_element(*self.download_icon)
        print('判断选择的记录是否被下载过')
        if downloadsign == "true":
            self.find_element(*self.download_icon).click()
            return print('下载成功!')
        else:
            print('该内容已经被下载过!')
 def go_buyed_course(self):
     '''进入已购买-课程页面'''
     time.sleep(1)
     print('点击课程')
     self.driver.find_element(*self.b_cource).click()
     #点击最近更新-上滑-截图
     try:
         print('点击最近更新')
         self.driver.find_element(*self.b_recent_update).click()
     except:
         print('没有已购买的课程,无法点击最近更新!')
     po = Operation(self.driver)
     time.sleep(1)
     po.swipeUp()
     try:
         print('点击最近购买')
         self.driver.find_element(*self.b_recent_buy).click()
     except:
         print('没有已购买的课程,无法点击最近购买!')
    def go_buyed_story(self):
        '''进入已购买的-故事页面'''
        # self.go_buyed()
        time.sleep(1)
        #点击最近更新-上滑-截图
        try:
            print('点击最近更新')
            self.driver.find_element(*self.b_recent_update).click()
        except:
            print('没有已购买的故事,无法点击最近更新!')
        po = Operation(self.driver)
        time.sleep(1)
        po.swipeUp()
        try:
            print('点击最近购买')
            self.driver.find_element(*self.b_recent_buy).click()

        except:
            print('没有已购买的故事,无法点击最近购买!')
    def change_portrait_sure(self):
        self.driver.implicitly_wait(2)
        print('点击用户头像')
        self.driver.find_element(*self.head_portrait).click()
        print('点击从相册选择')
        self.driver.find_element(*self.head_photo_choose).click()
        po = Operation(self.driver)
        # n = random.randint(100,1000)
        time.sleep(2)
        po.swipeUp()
        List = []
        while len(List) == 0:
            print('随机选择一张图片')
            List = self.driver.find_elements(*self.photos2)
        x = random.randint(0, len(List) - 1)
        List[x].click()
        print('点击确定,更新成功')

        return self.driver.find_element(*self.photo_choose_sure1).click()
 def go_album(self):
     po = Operation(self.driver)
     time.sleep(1)
     po.swipeUp()
     print('点击我的专辑')
     return self.find_element(*self.my_album).click()
 def login_days_yesterday(self):
     print('默认进入昨天成就页面')
     po = Operation(self.driver)
     po.swipeUp()
     print('查看成功')
 def go_recent_play(self):
     print('进入首页--我的-最近播放页面')
     po = Operation(self.driver)
     time.sleep(1)
     po.swipeUp()
     self.find_element(*self.recent_play).click()
 def go_coupon(self):
     po = Operation(self.driver)
     time.sleep(1)
     po.swipeUp()
     print('点击优惠券')
     return self.find_element(*self.coupon).click()
 def go_my_like(self):
     po = Operation(self.driver)
     time.sleep(1)
     po.swipeUp()
     print('点击我喜欢的,进入子页面')
     return self.find_element(*self.my_like).click()
 def player_download(self):
     self.go_play()
     self.clickdownload()
     po = Operation(self.driver)
     return po.swipeUp()
Beispiel #29
0
 def Mc_swip(self):
     ho = HomePage(self.driver)
     ho.MemberCenter()
     po = Operation(self.driver)
     po.swipeUp()