def test_button_self_print_case(self): '''自定义打印按钮''' menu3 = '按钮控件_打印导出下载等' self.open_menu3(menu3) comp = InputPage(self.driver, '单行文本') btn = ButtonPage(self.driver) btn.open_and_switch_to_self_print_page() self.assertNotEqual('none', comp.find_element_by_css_selector('#MyappsReport'), msg='自定义打印按钮检验不通过') self.driver.close() mp = MainPage(self.driver) mp.switch_to_current_window()
def test_show_when_print_case(self): '''打印隐藏时显示值''' # self.scroll_to('1000') name = '单行文本_打印隐藏时显示值' comp = InputPage(self.driver, '') comp.open_and_switch_to_print_page() #time.sleep(0.5) comp.window_scroll_to('1000') self.assertEqual('none', comp.find_element_by_css_selector('input[name="' + name + '"]'), msg=name + '检验不通过') self.assertTrue(comp.show_when_print('打印隐藏时显示值'), msg=name + '检验不通过') comp.close_currentwindow()
def test_button_self_print_case(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) comp = InputPage(self.driver, '单行文本') btn = ButtonPage(self.driver) btn.open_and_switch_to_self_print_page() self.assertNotEqual('none', comp.find_element_by_css_selector('#MyappsReport'), msg='自定义打印按钮检验不通过') self.driver.close() mp = MainPage(self.driver) mp.switch_to_current_window()