def test_jump_url_new_window_btn(self): '''跳转URL新窗口按钮''' menu3 = '表单按钮_跳转' self.open_menu3(menu3) lp = ListViewPage(self.driver) if 0 != lp.get_rows_total(): lp.clear_all_data() if lp.get_rows_total() == 0: lp.add_one_row2() #无数据时添加一条数据 lp.open_fisrt_doc() #time.sleep(0.5) btn = ButtonPage(self.driver) btn.click_button_by_type_title(btn.jump_to, '跳转URL新窗口') #time.sleep(0.5) lp.switch_to_another_window() self.assertEqual('保存', lp.get_column_row1_col1(), msg='跳转URL当前页面按钮检验不通过') lp.close_currentwindow() mp = MainPage(self.driver) mp.switch_to_current_window() #time.sleep(0.3) mp.switch_to_iframe() #切换到当前打开页签 btn.click_button(btn.to_return) lp.wait_loading_hide() #表单中 #time.sleep(0.5) if 0 != lp.get_rows_total(): lp.clear_all_data()
def test_jump_url_new_window_btn(self): '''跳转(新窗口)按钮''' menu3 = '按钮_case002' self.open_menu3(menu3) btn = ButtonPage(self.driver) btn.click_button_by_type_title(btn.jump_to, '跳转(新窗口)') #time.sleep(0.5) lp = ListViewPage(self.driver) lp.switch_to_another_window() self.assertEqual('保存', lp.get_column_row1_col1(), msg='跳转(新窗口)按钮检验不通过') self.driver.close() mp = MainPage(self.driver) mp.switch_to_current_window()
def test_page_print_btn(self): '''网页打印按钮''' menu3 = '按钮_case003' self.open_menu3(menu3) #打开菜单 btn = ButtonPage(self.driver) btn.click_button(btn.view_page_print) #点击打印按钮 #time.sleep(0.5) lp = ListViewPage(self.driver) lp.switch_to_another_window() self.assertEqual('单行文本', lp.get_print_table_head_td1_text(), msg='网页打印按钮检验不通过') self.driver.close() mp = MainPage(self.driver) mp.switch_to_current_window()
def test_form_page_print_btn_case(self): '''网页打印按钮''' menu3 = '按钮控件_打印导出下载等' self.open_menu3(menu3) lp = ListViewPage(self.driver) btn = ButtonPage(self.driver) btn.click_button(btn.form_page_print) #time.sleep(0.5) lp.switch_to_another_window() #time.sleep(0.5) self.assertEqual('按钮测试用例-保存类', btn.get_caption_text(), msg='网页打印按钮检验不通过') self.driver.close() mp = MainPage(self.driver) mp.switch_to_current_window()
def test_form_page_print_btn(self): '''网页打印按钮''' menu3 = '表单按钮_打印导出下载等' self.open_menu3(menu3) lp = ListViewPage(self.driver) if 0 != lp.get_rows_total(): lp.clear_all_data() if lp.get_rows_total() == 0: lp.add_one_row2() #无数据时添加一条数据 lp.open_fisrt_doc() #time.sleep(0.5) btn = ButtonPage(self.driver) btn.click_button(btn.form_page_print) #time.sleep(0.5) lp.switch_to_another_window() #time.sleep(0.5) self.assertEqual('按钮测试用例-打印导出下载', btn.get_caption_text(), msg='网页打印按钮检验不通过') self.driver.close() mp = MainPage(self.driver) mp.switch_to_current_window()
def test_jump_form_new_window_btn(self): '''跳转动态表单新窗口按钮''' menu3 = '表单按钮_跳转' self.open_menu3(menu3) lp = ListViewPage(self.driver) if 0 != lp.get_rows_total(): lp.clear_all_data() if lp.get_rows_total() == 0: lp.add_one_row2() #无数据时添加一条数据 lp.open_fisrt_doc() #time.sleep(0.5) btn = ButtonPage(self.driver) btn.click_button_by_type_title(btn.jump_to, '跳转动态表单新窗口') #time.sleep(0.5) lp.switch_to_another_window() self.assertEqual('按钮测试用例-保存类', btn.get_caption_text(), msg='跳转动态表单新窗口按钮检验不通过') self.driver.close() mp = MainPage(self.driver) mp.switch_to_current_window()