def test_nologin_shoucang(self): '''专栏文章收藏(未登录条件)''' #进入专栏文章详情页 zl.zl_details() #点击收藏按钮 zl.shoucang() #断言 Text = self.driver.find_element_by_id( 'com.gelonghui.glhapp:id/tv_main_title') text3 = Text.text self.assertEqual('登录', text3)
def test_nologin_like(self): '''专栏文章点赞(未登录条件)''' #进入专栏文章详情页 zl.zl_details() #点击爱心按钮 zl.like() #断言 Text = self.driver.find_element_by_id( 'com.gelonghui.glhapp:id/tv_main_title') text2 = Text.text self.assertEqual('登录', text2)
def test_nologin_dingyue(self): '''专栏订阅测试用例(未登录条件)''' #进入专栏详情页 zl.zl_details() #点击订阅按钮 zl.dingyue() #断言未登录时跳转到登录页 Text = self.driver.find_element_by_id( 'com.gelonghui.glhapp:id/tv_main_title') text1 = Text.text self.assertEqual('登录', text1)
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)
def test_nologin_comment(self): '''专栏文章评论测试用例(未登录)''' #进入文章详情页 zl.zl_details() #点击评论按钮 zl.comment() #输入评论 zl.send_comment('文章不错') #提交评论 zl.get_comment() #断言 Text = self.driver.find_element_by_id( 'com.gelonghui.glhapp:id/tv_main_title') text4 = Text.text self.assertEqual('登录', text4)
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)
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)
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)