def deleteFriend(self): log.info("测试用例----反复删除关注的人") for i in range(200): self.assertTrue( adbShell.clickID(self.driver, 'com.imo.android.imoimalpha.Trending:id/iv_icon_center', '删除关注的人')) self.assertTrue( adbShell.clickID(self.driver, 'com.imo.android.imoimalpha.Trending:id/tv_un_follow', '删除关注的人'))
def testIntoDetail(self): log.info("反复进入视频详情页") self.assertTrue( adbShell.clickID(self.driver, 'com.imo.android.imoimalpha:id/layout_bottom_feeds_entrance', '进入信息流页面')) for i in range(200): log.info('弟'+str(i)+"次进入详情页") self.assertTrue(adbShell.clickID(self.driver, 'com.imo.android.imoimalpha.Trending:id/iv_cover', '点击视频', True)) self.assertTrue(adbShell.clickID(self.driver, 'com.imo.android.imoimalpha.Trending:id/iv_close', '点击返回,退出视频详情'))
def testIntoFeed(self): log.info("测试用例----反复进入信息流") time.sleep(5) for i in range(200): log.info("进入信息流第" + str(i) + "次") # adbShell.clickID(self.driver, 'com.imo.android.imoimalpha:id/btn_negative', '取消弹窗', True) self.assertTrue(adbShell.clickID(self.driver, 'com.imo.android.imoimalpha:id/tv_wording', '进入信息流')) self.assertTrue( adbShell.clickID(self.driver, 'com.imo.android.imoimalpha.Trending:id/iv_close', '点击视频详情页返回')) self.assertTrue(adbShell.clickID(self.driver, 'com.imo.android.imoimalpha.Trending:id/close_button', '返回首页')) log.info("testIntoFeed"+str(i))
def testReturnLeft(self): log.info("测试用例----反复左滑,再反复返回") self.assertTrue( adbShell.clickID(self.driver, 'com.imo.android.imoimalpha:id/layout_bottom_feeds_entrance', '进入信息流页面')) self.assertTrue(adbShell.clickID(self.driver, 'com.imo.android.imoimalpha.Trending:id/iv_cover', '点击视频')) for i in range(2): log.info("滑动进入个人页第"+str(i)+"次") adbShell.swipLeft(self.driver, '视频详情页左滑') self.assertTrue(adbShell.clickID(self.driver, 'com.imo.android.imoimalpha.Trending:id/iv_cover', '点击个人页post的第一个视频')) for i in range(2): log.info("返回上一级" + str(i) + "次") self.assertTrue(adbShell.clickID(self.driver, 'com.imo.android.imoimalpha.Trending:id/iv_close', '点击视频详情页返回')) self.assertTrue(adbShell.clickID(self.driver, 'com.imo.android.imoimalpha.Trending:id/iv_back', '点击个人页返回'))
def testShareFeed(self): self.assertTrue( adbShell.clickID( self.driver, 'com.imo.android.imoimalpha:id/layout_bottom_feeds_entrance', '进入信息流页面')) self.assertTrue( adbShell.clickID( self.driver, 'com.imo.android.imoimalpha.Trending:id/iv_cover', '点击视频', True)) self.assertTrue( adbShell.clickID( self.driver, 'com.imo.android.imoimalpha.Trending:id/ll_share', '点击分享')) self.assertTrue( adbShell.clickID( self.driver, 'com.imo.android.imoimalpha.Trending:id/iv_share_icon', '选择分享给imo好友')) self.assertTrue( adbShell.clickID(self.driver, 'com.imo.android.imoimalpha:id/icon', '选择第一个好友')) self.assertTrue( adbShell.clickID(self.driver, 'com.imo.android.imoimalpha:id/ll_scene', '点击发送')) self.assertTrue( adbShell.clickID( self.driver, 'com.imo.android.imoimalpha.Trending:id/iv_close', '点击返回,退出视频详情'))
def testShareFeed(self): adbShell.clickID(self.driver, 'com.imo.android.imoimalpha:id/btn_negative', '取消弹窗', True) self.assertTrue(adbShell.clickID(self.driver, 'com.imo.android.imoimalpha:id/layout', '进入信息流')) self.assertTrue(adbShell.clickID(self.driver, 'com.imo.android.imoimalpha.Trending:id/iv_cover', '进入视频详情页')) self.assertTrue(adbShell.clickID(self.driver, 'com.imo.android.imoimalpha.Trending:id/ll_share', '分享视频详情页')) self.assertTrue(adbShell.clickID(self.driver, 'com.imo.android.imoimalpha:id/share_imo_friend', '选择分享给好友')) self.assertTrue(adbShell.clickXpath(self.driver, '分享第一个好友', '//android.widget.ListView/android.view.ViewGroup[1]/android.widget.RelativeLayout[1]')) adbShell.getElementText(self.driver, 'xpath', '分享好友名称', '//android.widget.FrameLayout[1]/android.widget.LinearLayout[1]/android.widget.FrameLayout[1]/android.widget.FrameLayout[1]/android.widget.LinearLayout[1]/android.widget.FrameLayout[1]/android.widget.ListView[1]/android.view.ViewGroup[1]/android.widget.RelativeLayout[1]/android.widget.LinearLayout[1]/android.widget.TextView[1]') self.assertTrue(adbShell.clickID(self.driver, 'com.imo.android.imoimalpha:id/ll_scene', '确定分享给该好友')) self.assertTrue(adbShell.clickXpath(self.driver2, '点击聊天窗口', '//android.widget.ListView[@resource-id=\"com.imo.android.imoimalpha:id/chats_list\"]/android.widget.LinearLayout[1]')) self.assertTrue(adbShell.clickID(self.driver2, 'com.imo.android.imoimalpha:id/tv_desc', '点击视频卡片')) time.sleep(5)
def deleteIntroduceFriend(self): log.info("测试用例----反复删除推荐的人") for i in range(200): self.assertTrue( adbShell.clickID(self.driver, 'com.imo.android.imoimalpha.Trending:id/iv_delete', '删除推荐的人'))
def testIntoFeed(self): for i in range(2): adbShell.clickID(self.driver, 'com.imo.android.imoimalpha:id/btn_negative', '取消弹窗', True) self.assertTrue(adbShell.clickID(self.driver, 'com.imo.android.imoimalpha:id/tv_wording', '进入信息流')) self.assertTrue(adbShell.clickID(self.driver, 'com.imo.android.imoimalpha.Trending:id/close_button', '返回首页')) log.info("testIntoFeed"+str(i))