def adBase(self): print("启动APP后到首页的广告及所有弹窗判断") # 隐私政策 privacyPolicy.privacy_policy_agree(self) sleep(5) # 闪屏广告 splashAd.test_noSkip(self) sleep(3) # 引导图 layoutIvBg.test_layout_iv_bg(self) sleep(5) #更新提醒 advertisement.test_ask_tv_cancel(self) sleep(5) # 账号安全提示 flag = isElements.find_Element(self, 'id', 'tv_sure') if flag: print("账号安全提示-登录限制弹窗显示") self.driver.find_element_by_id('tv_sure').click() sleep(5) self.driver.find_elements_by_id('tv_tab_title')[3].click() sleep(5) # 首页弹窗广告 advertisement.test_is_ad(self) sleep(5)
def test_splash_tv_skip(self): # 判断是否有闪屏广告 print('判断是否有闪屏广告') splash = isElement.find_Element(self, 'id', 'splash_iv_image') if splash: print('有闪屏广告点击【跳过】') self.driver.find_element_by_id('splash_tv_skip').click() Ads.test_is_ad(self) else: print('test_splash_tv_skip无闪屏广告')
def test_no_network_play(self): """无网络播放离线下载""" ad.splashAd.test_noSkip(self) ad.test_is_ad(self) downloaded.no_network_play(self)
def test_delete_downloaded(self): """长按删除已下载数据""" ad.splashAd.test_noSkip(self) ad.test_is_ad(self) downloaded.delete_downloaded(self)
def test_no_apply_cancle(self): """未报名,点击下载,触发提示弹窗,点击【取消】""" ad.splashAd.test_noSkip(self) ad.test_is_ad(self) downloadKe.no_apply_cancle(self)
def test_play_is_downloaded(self): """判断当前在播放的视音频是否在【已下载】列表中""" ad.splashAd.test_noSkip(self) ad.test_is_ad(self) downloaded.play_is_downloaded(self)
def test_login_download(self): """播放已下载音频-有网络""" ad.splashAd.test_noSkip(self) ad.test_is_ad(self) downloaded.login_download(self)
def test_noLogin_download(self): """未登录进入【已下载】""" ad.splashAd.test_noSkip(self) ad.test_is_ad(self) downloaded.noLogin_download(self)
def test_a_download_ke(self): """从【我的课程】进入课程介绍页下载课程""" ad.splashAd.test_noSkip(self) ad.test_is_ad(self) downloadKe.download_ke(self)
def test_is_ad(self): """首页广告""" ad.test_is_ad(self)
def test_miniPlay_keCourse(self): """从【全局播放器】进入播放页""" Ads.test_is_ad(self) kePlay.miniPlay_keCourse(self)