Ejemplo n.º 1
0
 def test_swipe(self):
     '''事件列表的滑动用例'''
     shijian = news(self.driver)
     screen = BasePage(self.driver)
     #进入事件列表
     shijian.classify()
     #向上滑动两次
     swipe_up(self, 2)
     screen.get_screen_shot()
Ejemplo n.º 2
0
 def test_return_key(self):
     '''事件详情页返回键用例'''
     details01 = news(self.driver)
     screen = BasePage(self.driver)
     #进入详情页
     details01.list_button()
     screen.get_screen_shot()
     #返回键
     details01.font_button()
     screen.get_screen_shot()
Ejemplo n.º 3
0
    def test_login_author_dy(self):
        '''专栏作家的订阅测试用例'''
        # 进入专栏作家详情页
        zl.zuojia_icon()
        # 点击订阅
        zl_author.dy_button()
        # 断言
        Text = self.driver.find_element_by_id(
            'com.gelonghui.glhapp:id/btn_subscribe')
        text = Text.text
        self.assertEqual('已订阅', text)

        screen = BasePage(self.driver)
        screen.get_screen_shot()
Ejemplo n.º 4
0
 def test_font(self):
     '''事件详情页字体放大缩小用例'''
     details02 = news(self.driver)
     screen = BasePage(self.driver)
     # 进入详情页
     details02.list_button()
     #放大
     details02.font_button()
     time.sleep(2)
     screen.get_screen_shot()
     #缩小
     details02.font_button()
     time.sleep(2)
     screen.get_screen_shot()
Ejemplo n.º 5
0
 def test_login_shoucang(self):
     '''专栏文章收藏'''
     # 进入专栏文章详情页
     zl.zl_details()
     # 点击收藏按钮
     text_shoucang01 = self.driver.find_element_by_id(
         'com.gelonghui.glhapp:id/tv_rd_fav_num').text
     zl.shoucang()
     screen = BasePage(self.driver)
     screen.get_screen_shot()
     # 断言
     Text = self.driver.find_element_by_id(
         'com.gelonghui.glhapp:id/tv_main_title')
     text_shoucang02 = Text.text
     self.assertEqual(text_shoucang01 + 1, text_shoucang02)
Ejemplo n.º 6
0
 def test_login_like(self):
     '''专栏文章点赞'''
     # 进入专栏文章详情页
     zl.zl_details()
     text_like01 = self.driver.find_element_by_id(
         'com.gelonghui.glhapp:id/tv_rd_like_num').text
     # 点击爱心按钮
     zl.like()
     screen = BasePage(self.driver)
     screen.get_screen_shot()
     # 断言
     Text = self.driver.find_element_by_id(
         'com.gelonghui.glhapp:id/tv_rd_like_num')
     text_like02 = Text.text
     #断言点赞成功,数量+1
     self.assertEqual(text_like01 + 1, text_like02)
Ejemplo n.º 7
0
 def test_login_dingyue(self):
     '''专栏订阅测试用例'''
     # 进入专栏详情页
     zl.zl_details()
     # 点击订阅按钮
     zl.dingyue()
     # 未登录去登录
     android_login.login_text('17512064966', '995217')
     #订阅
     zl.dingyue()
     time.sleep(1)
     screen = BasePage(self.driver)
     screen.get_screen_shot()
     text_dingyue = self.driver.find_element_by_id(
         'com.gelonghui.glhapp:id/btn_subscribe').text
     self.assertEqual('已订阅', text_dingyue)
Ejemplo n.º 8
0
 def test_nologin_comment(self):
     '''专栏文章评论测试用例'''
     # 进入文章详情页
     zl.zl_details()
     # 点击评论按钮
     zl.comment()
     # 输入评论
     zl.send_comment('文章不错')
     # 提交评论
     zl.get_comment()
     time.sleep(1)
     screen = BasePage(self.driver)
     screen.get_screen_shot()
     # 断言
     text = self.driver.find_element_by_id(
         'com.gelonghui.glhapp:id/comment_content').text
     self.assertEqual('文章不错', text)
Ejemplo n.º 9
0
 def test_news_type(self):
     '''事件分类用例'''
     classify = news(self.driver)
     screen = BasePage(self.driver)
     #进入要闻页
     classify.classify()
     screen.get_screen_shot()
     time.sleep(1)
     #分类公告摘要
     classify.classify_ggzy()
     screen.get_screen_shot()
     time.sleep(1)
     #分类大型评级
     classify.classify_dxpj()
     screen.get_screen_shot()
     time.sleep(1)
     #分类业绩会直击
     classify.classify_yjhzj()
     screen.get_screen_shot()
     time.sleep(1)
     #分类港股异动
     classify.classify_ggyd()
     screen.get_screen_shot()
     time.sleep(1)
     #分类公司信息
     classify.classify_gsxx()
     screen.get_screen_shot()
     time.sleep(1)
     #分类行业信息
     classify.classify_hyxx()
     screen.get_screen_shot()
     time.sleep(1)
     #全部
     classify.classify_all()
     screen.get_screen_shot()