Ejemplo n.º 1
0
    def test_view_nba_news(self):

        homepage = HomePage(self.driver)
        homepage.click_news()

        news_homepage = NewsHomePage(self.driver)
        news_homepage.click_sports_news()
        time.sleep(2)

        news_homepage.get_windows_img()
Ejemplo n.º 2
0
 def test_view_nba_news(self):
     #初始化百度首页
     homepage = HomePage(self.driver)
     homepage.click_news()
     #初始化一个百度新闻主页对象
     newshome = BaiduNewsHomePage(self.driver)
     newshome.click_sports()
     sportnewhome = SprotsNewsHomePage(self.driver)
     sportnewhome.click_nba_link()
     time.sleep(2)
     sportnewhome.switch_to_new_handle()
     sportnewhome.get_windows_image()
     try:
         assert "NBA赛程表" in sportnewhome.get_page_title()
     except Exception as e:
         print('Test Fail.', format(e))