コード例 #1
0
 def test_click_tongzhitongbao_more(self):
     '''通知通报栏“更多”按钮测试'''
     pagehome = ZdzzPage(self.driver)
     pagehome.click_tongzhitongbao()
     pagehome.click_tongzhitongbao_more()  #点击链接
     wait_title(self, pagehome.tongzhitongbao_more_title)
     #判断新页面的title是否与链接的文本值相同
     assert (pagehome.driver.title == pagehome.tongzhitongbao_more_title
             ), "标题不是“%s”,测试不通过" % pagehome.tongzhitongbao_more_title
コード例 #2
0
 def test_click_tongzhitongbao09(self):
     '''"通知通报栏第九条新闻"链接测试'''
     pagehome = ZdzzPage(self.driver)
     pagehome.click_tongzhitongbao()
     tongzhitongbao09Title = pagehome.getText(pagehome.tongzhitongbao09) #获取链接的文本值
     pagehome.click_tongzhitongbao09()   #点击链接
     wait_title(self, tongzhitongbao09Title)
     #切换窗口
     handles = self.driver.window_handles
     self.driver.switch_to.window(handles[-1])
     #判断新页面的title是否与链接的文本值相同
     assert(pagehome.driver.title == tongzhitongbao09Title), "标题不是“%s”,测试不通过" % tongzhitongbao09Title