def test_user_defined_close_btn(self): '''自定义关闭按钮''' menu3 = '表单按钮_自定义关闭按钮' Process_approver = ProcessApproverPage(self.driver) Process_approver.close_message() # self.open_menu3(menu3) # 打开三级菜单 lp = ListViewPage(self.driver) # 清空多余数据 if 0 != lp.get_rows_total(): lp.clear_all_data() lp.add_one_row_div() # 无数据时添加一条数据 if lp.get_rows_total() == 0: lp.add_one_row_div() # 点击第一条数据 lp.open_fisrt_doc() mp = MainPage(self.driver) mp.switch_to_div_iframe() # 切换到弹出层页面 btn = ButtonPage(self.driver) btn.click_default_btn("自定义关闭") #点击自定义关闭按钮 self.assertTrue(lp.is_msg_visiable(), msg='自定义关闭按钮检验不通过') msgtitle = lp.is_test_in_msg('自定义关闭成功') self.assertTrue(msgtitle, msg='自定义关闭按钮检验不通过') lp.wait_loading_hide() # 等待视图加载完成 self.assertTrue(mp.div_is_close(), msg='自定义关闭按钮检验不通过')
def test_flow_start_user_appoint_btn(self): '''流程启动用户指定按钮''' menu3 = '表单按钮_流程相关' Process_approver = ProcessApproverPage(self.driver) Process_approver.close_message() self.open_menu3(menu3) #清数据 lp = ListViewPage(self.driver) if 0 != lp.get_rows_total(): lp.clear_all_data() #新建记录 btn = ButtonPage(self.driver) btn.click_button(btn.new_btn) #time.sleep(0.5) ip = InputPage(self.driver, '单行文本') ip.element.send_keys('保存') #点击流程启动用户指定按钮 btn.click_button(btn.flow_start) #time.sleep(0.5) mp = MainPage(self.driver) #切到iframe mp.switch_to_div_iframe() #在启动流程界面指定流程并确定 btn.appoint_flow() mp.switch_to_parent() mp.switch_to_iframe() #time.sleep(0.5) msgtitle = lp.is_test_in_msg('成功保存并开启流程') self.assertTrue(msgtitle, msg='流程启动用户指定按钮检验不通过') btn.click_button(btn.to_return) lp.wait_loading_hide() #表单中 if 0 != lp.get_rows_total(): lp.clear_all_data()
def test_save_new_btn_case(self): '''保存并新建按钮''' menu3 = '按钮控件_保存并复制和新建' self.open_menu3(menu3) lp = ListViewPage(self.driver) if 0 != lp.get_rows_total(): lp.clear_all_data() btn = ButtonPage(self.driver) btn.click_button(btn.new_btn) #点击新建按钮 lp.wait_loading_hide() # 等待loading消失 ip = InputPage(self.driver, '单行文本') ip.element.send_keys('保存') btn.click_button(btn.save_new) #点击保存并新建按钮 self.assertEqual('[保存成功]', lp.get_msg(), msg='保存并新建按钮检验不通过') lp.wait_loading_hide() #等待loading消失 time.sleep(10) ip2 = InputPage(self.driver, '单行文本') ip2.element.send_keys('保存') btn.click_button(btn.save) lp.wait_loading_hide() # 等待loading消失 time.sleep(10) btn.click_button(btn.to_return) if (lp.is_alert_present()): lp.accept_alert() lp.wait_loading_hide() #等待loading消失 self.assertEqual(2, lp.get_rows_total(), msg='保存并新建按钮检验不通过') lp.clear_all_data()
def test_signature_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.signature) #time.sleep(0.5) btn.select_signature() #选择签章 lp.alert_send_keys('123456') #输入密码 lp.click_alert_accept() #点击确定 btn.confirm_signature() #确认盖章 self.assertTrue(lp.is_msg_visiable(), msg='签章按钮检验不通过') msgtitle = lp.is_test_in_msg('签章成功!') #获取消息 self.assertTrue(msgtitle, msg='签章按钮检验不通过') btn.wait_loading_hide() btn.click_button(btn.to_return) lp.wait_loading_hide() #表单中 if 0 != lp.get_rows_total(): lp.clear_all_data()
def test_delete_case(self): '''删除按钮''' menu3 = '按钮_case001' self.open_menu3(menu3) #打开菜单 lp = ListViewPage(self.driver) if 0 != lp.get_rows_total(): lp.clear_all_data() #清空所有数据 #新建一条数据 btn = ButtonPage(self.driver) btn.click_button(btn.new_btn) #time.sleep(0.5) ip = InputPage(self.driver, '单行文本') ip.element.send_keys('保存') btn.click_button(btn.save_start) lp.wait_Tabloading_show_then_hide() #等待loading消失 btn.click_button(btn.to_return) lp.wait_loading_hide() #表单中 lp.wait_loading_hide() #视图中 #确定已经有一条数据 self.assertEqual(1, lp.get_rows_total(), msg='删除按钮检验不通过') lp.click_select_all() #点击全选 btn.click_button(btn.del_btn) #点击删除 lp.click_alert_accept() #确定确认框 lp.wait_loading_hide() # 等待loading消失 #确定数据条数为0 self.assertEqual(0, lp.get_rows_total(), msg='删除按钮检验不通过')
def test_column_type_submit(self): '''列-操作类型-提交流程''' menu3 = '列表视图_列_操作类型_提交流程' self.open_menu3(menu3) lp = ListViewPage(self.driver) if lp.get_rows_total() == 0: lp.add_one_row() if lp.get_rows_total() >= 1: lp.delete_record() lp.add_one_row() lp.click_submit() #点击视图的流程提交按钮 mp = MainPage(self.driver) mp.switch_to_parent() mp.wait_elem_visible('div.aui_content') #等待动画弹框显示 lp.set_val_and_submit('请审批') #设置提交审批意见并确定提交 mp.switch_to_iframe() mp.wait_loading_hide() #等待loading加载完 #点击行数据 lp.click_row() bp = ButtonPage(self.driver) fp = FormPage(self.driver) self.assertEqual(0, fp.get_nextids(), msg='列-操作类型-提交流程检验不通过')
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_column_type_del(self): '''列-操作类型-删除''' menu3 = '列表视图_列_操作类型_删除' self.open_menu3(menu3) lp = ListViewPage(self.driver) if lp.get_rows_total() == 0: lp.add_one_row() if lp.get_rows_total() == 1: lp.click_del() #time.sleep(0.5) self.assertEqual(0, lp.get_rows_total(), msg='列-操作类型-删除检验不通过')
def test_user_defined_return_btn(self): '''自定义返回按钮''' menu3 = '表单按钮_自定义按钮' self.open_menu3(menu3) lp = ListViewPage(self.driver) if 0 != lp.get_rows_total(): lp.clear_all_data() lp.add_one_row2() #添加一条数据 if lp.get_rows_total() == 0: lp.add_one_row2() #无数据时添加一条数据 lp.open_fisrt_doc() btn = ButtonPage(self.driver) btn.click_default_btn("自定义返回") msgtitle = lp.is_test_in_msg('自定义返回成功') self.assertTrue(msgtitle, msg='自定义返回按钮检验不通过')
def test_share_btn(self): '''分享按钮''' menu3 = '表单按钮_分享签章返回等' self.open_menu3(menu3) lp = ListViewPage(self.driver) 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.share_to) #点击分享按钮 #time.sleep(0.5) mp = MainPage(self.driver) mp.switch_to_div_iframe() # 切换到分享弹出层 btn.to_share() # 点击选择邮件复选框,然后点击选择按钮 #time.sleep(0.5) mp = MainPage(self.driver) mp.switch_to_div_iframe() # 切换到用户选择框弹出层 btn.select_userbyrolename("员工") # 选择员工用户并确定 time.sleep(0.5) mp = MainPage(self.driver) mp.switch_to_div_iframe() # 切换到分享弹出层中 btn.click_send() # 点击发送 self.assertEqual('已发送', btn.get_msg_share_page(), msg='分享按钮检验不通过')
def test_paging_10(self): '''分页-每页10条''' menu3 = '列表视图_分页_10条' self.open_menu3(menu3) lp = ListViewPage(self.driver) self.assertEqual(10, lp.get_rows_total(), msg='分页-每页10条检验不通过')
def test_flow_complete(self): '''自由流程结束流程''' name = '自由流程结束流程' comp = ProcessApproverPage(self.driver) # 判断是否要删除记录 lp = ListViewPage(self.driver) if lp.get_rows_total() != 0: lp.delete_all_data() # 删除所有数据 comp.click_newbtn() # 点击新建进入表单 comp.input_reason(name) # 录入请假原因 comp.click_submit_star_flowbtn() # 点击提交按钮 comp.select_user('员工') # 选择审批人 comp.submit() # 点击确认 comp.wait_loading_hide() # 等待视图loading消失 lp.click_row() # 点击第一条记录 comp.click_end_flow() # 点击结束流程按钮 comp.wait_elem_visible( '#flowprocessDiv #div_button_place') # 等待流程面板展开按钮可见 comp.submit() # 点击确认按钮 # comp.wait_loading_hide() # 等待视图loading消失 lp.click_row() # 点击第一条记录 self.assertFalse(comp.is_flow_actbutton_exist('提交 _结束流程'), msg=name + '校验不通过')
def test_user_defined_not_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.user_defined) #time.sleep(0.5) msgtitle = lp.is_test_in_msg('自定义无成功') self.assertTrue(msgtitle, msg='自定义无按钮检验不通过')
def test_batch_submit_case(self): '''批量提交按钮''' menu3 = '按钮_case001' self.open_menu3(menu3) #打开菜单 lp = ListViewPage(self.driver) if 0 != lp.get_rows_total(): lp.clear_all_data() #清空数据 #新建一条数据 btn = ButtonPage(self.driver) btn.click_button(btn.new_btn) lp.wait_Tabloading_show_then_hide() ip = InputPage(self.driver, '单行文本') ip.element.send_keys('保存') btn.click_button(btn.save_start) lp.wait_Tabloading_show_then_hide() btn.click_button(btn.to_return) lp.wait_loading_hide() #表单中 lp.wait_loading_hide() #视图中 #确定数据不止一条 self.assertNotEqual(0, lp.get_rows_total(), msg='批量提交按钮检验不通过') lp.click_select_all() #全选 btn.click_button(btn.batch_submit) #点击批量提交 lp.wait_Tabloading_show_then_hide() mp = MainPage(self.driver) mp.switch_to_parent() #切换到主页 #time.sleep(0.5) lp.set_val_and_submit('请审批') #填写审批意见并确定 lp.wait_Tabloading_show_then_hide() mp.switch_to_iframe() #切换回iframe中 #time.sleep(0.5) lp.click_row() #点击第一行数据 lp.wait_Tabloading_show_then_hide() # 等待表单页面的loading加载完 #没有流程处理按钮则通过 self.assertIsNone(btn.get_button(btn.flow_process), msg='批量提交按钮检验不通过') btn.click_button(btn.to_return) #点击返回 lp.wait_loading_hide() #表单中 lp.wait_loading_hide() #视图中 if 0 != lp.get_rows_total(): #清空数据 lp.clear_all_data()
def test_close_window_btn(self): '''关闭窗口按钮''' menu3 = '表单按钮_关闭窗口' self.open_menu3(menu3) mp = MainPage(self.driver) lp = ListViewPage(self.driver) if 0 != lp.get_rows_total(): lp.clear_all_data() if lp.get_rows_total() == 0: lp.add_one_row_div() #无数据时添加一条数据 lp.open_fisrt_doc() #点击第一条数据 mp.switch_to_div_iframe() #切换到弹出层页面 btn = ButtonPage(self.driver) btn.click_button(btn.close_window) #点击关闭窗口按钮 mp.switch_to_iframe() #切换到当前打开页签 self.assertEqual('保存', lp.get_column_row1_col1(), msg='关闭窗口按钮检验不通过') if 0 != lp.get_rows_total(): lp.clear_all_data()
def test_save_return_btn(self): '''保存并返回按钮''' menu3 = '表单按钮_保存类' Process_approver = ProcessApproverPage(self.driver) Process_approver.close_message() 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() btn = ButtonPage(self.driver) btn.click_button(btn.save_return) msgtitle = lp.is_test_in_msg('保存成功') #self.assertTrue(lp.is_msg_visiable(),msg='保存并返回按钮检验不通过') self.assertTrue(msgtitle, msg='保存并返回按钮检验不通过') lp.wait_loading_hide() # 等待视图加载 self.assertEqual('保存', lp.get_column_row1_col1(), msg='保存并返回按钮检验不通过')
def test_jump_form_current_page_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) self.assertEqual('按钮测试用例-保存类', btn.get_caption_text(), msg='跳转动态表单当前页按钮检验不通过')
def test_to_return_btn(self): '''返回按钮''' menu3 = '表单按钮_分享签章返回等' self.open_menu3(menu3) lp = ListViewPage(self.driver) if 0 != lp.get_rows_total(): lp.clear_all_data() btn = ButtonPage(self.driver) btn.click_button(btn.new_btn) #time.sleep(0.5) ip = InputPage(self.driver, '单行文本') ip.element.send_keys('保存') btn.click_button(btn.save) #time.sleep(0.5) lp.wait_loading_hide() # 等待视图加载完成 btn.click_button(btn.to_return) lp.wait_loading_hide() #表单中 self.assertEqual(1, lp.get_rows_total(), msg='返回按钮检验不通过') if 0 != lp.get_rows_total(): lp.clear_all_data()
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()
def test_user_defined_jump_btn(self): '''自定义跳转按钮''' menu3 = '表单按钮_自定义按钮' Process_approver = ProcessApproverPage(self.driver) Process_approver.close_message() 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_default_btn("自定义跳转列表") self.assertTrue(lp.is_msg_visiable(), msg='自定义跳转按钮检验不通过') msgtitle = lp.is_test_in_msg('自定义跳转列表成功') self.assertTrue(msgtitle, msg='自定义跳转按钮检验不通过') #time.sleep(0.5) self.assertEqual('保存', lp.get_column_row1_col1(), msg='自定义跳转按钮检验不通过')
def test_save_copy_btn_case(self): '''保存并复制按钮''' menu3 = '按钮控件_保存并复制和新建' self.open_menu3(menu3) lp = ListViewPage(self.driver) if 0 != lp.get_rows_total(): lp.clear_all_data() btn = ButtonPage(self.driver) btn.click_button(btn.new_btn) ip = InputPage(self.driver, '单行文本') ip.element.send_keys('保存') btn.click_button(btn.save_copy) #time.sleep(0.5) self.assertEqual('[保存成功]', lp.get_msg(), msg='保存并复制按钮检验不通过') lp.wait_loading_hide() btn.click_button(btn.to_return) lp.wait_loading_hide() #表单中 lp.wait_loading_hide() #视图中 #time.sleep(0.5) self.assertEqual(2, lp.get_rows_total(), msg='保存并复制按钮检验不通过') lp.clear_all_data()
def test_save_start_btn(self): '''保存并启动按钮''' menu3 = '表单按钮_流程相关' self.open_menu3(menu3) lp = ListViewPage(self.driver) if 0 != lp.get_rows_total(): lp.clear_all_data() btn = ButtonPage(self.driver) btn.click_button(btn.new_btn) lp.wait_Tabloading_show_then_hide() ip = InputPage(self.driver, '单行文本') ip.element.send_keys('保存') btn.click_button(btn.save_start) lp.wait_Tabloading_show_then_hide() self.assertTrue(lp.is_msg_visiable(), msg='保存并启动按钮提示检验不通过') msgtitle = lp.is_test_in_msg('保存成功') self.assertTrue(msgtitle, msg='保存并启动按钮提示检验不通过') lp.wait_Tabloading_show_then_hide() btn.click_button(btn.to_return) lp.wait_loading_hide() #表单中 if 0 != lp.get_rows_total(): lp.clear_all_data()
def test_save_copy_btn(self): '''保存并复制按钮''' menu3 = '表单按钮_保存并复制' self.open_menu3(menu3) lp = ListViewPage(self.driver) if 0 != lp.get_rows_total(): lp.clear_all_data() btn = ButtonPage(self.driver) btn.click_button(btn.new_btn) #time.sleep(0.5) ip = InputPage(self.driver, '单行文本') ip.element.send_keys('保存') btn.click_button(btn.save_copy) #time.sleep(0.5) self.assertTrue(lp.is_msg_visiable(), msg='保存并复制按钮检验不通过') msgtitle = lp.is_test_in_msg('保存成功') self.assertTrue(msgtitle, msg='保存并复制按钮检验不通过') lp.wait_loading_hide() btn.click_button(btn.to_return) lp.wait_loading_hide() #表单中 self.assertEqual(2, lp.get_rows_total(), msg='保存并复制按钮检验不通过') lp.clear_all_data()
def test_jump_url_div_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弹出层') mp = MainPage(self.driver) mp.switch_to_div_iframe() #time.sleep(0.5) self.assertEqual('保存', lp.get_column_row1_col1(), msg='跳转URL弹出层按钮检验不通过')
def test_flow_start_iscript_btn(self): '''流程启动脚本指定按钮''' menu3 = '表单按钮_流程相关' self.open_menu3(menu3) lp = ListViewPage(self.driver) if 0 != lp.get_rows_total(): lp.clear_all_data() btn = ButtonPage(self.driver) btn.click_button(btn.new_btn) #time.sleep(0.5) ip = InputPage(self.driver, '单行文本') ip.element.send_keys('保存') #点击第二个流程启动按钮 btn.click_default_btn("流程启动脚本") #time.sleep(0.5) msgtitle = lp.is_test_in_msg('成功保存并开启流程') self.assertTrue(msgtitle, msg='流程启动脚本指定按钮检验不通过') lp.wait_loading_hide() # 等待视图加载完成 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_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_clear_data_case(self): '''清空所有数据按钮''' menu3 = '按钮_case001' self.open_menu3(menu3) #打开菜单 #新建一条数据 btn = ButtonPage(self.driver) btn.click_button(btn.new_btn) btn.wait_Tabloading_show_then_hide() ip = InputPage(self.driver, '单行文本') ip.element.send_keys('保存') btn.click_button(btn.save_start) btn.wait_Tabloading_show_then_hide() btn.click_button(btn.to_return) lp = ListViewPage(self.driver) lp.wait_loading_hide() #表单中 lp.wait_loading_hide() #视图中 #确定数据不止一条 self.assertNotEqual(0, lp.get_rows_total(), msg='清空所有数据按钮检验不通过') lp.clear_all_data() #执行清空数据操作 #确定数据为空 self.assertEqual(0, lp.get_rows_total(), msg='清空所有数据按钮检验不通过')
def test_save_draft_btn(self): '''保存草稿按钮''' menu3 = '表单按钮_保存类' self.open_menu3(menu3) lp = ListViewPage(self.driver) if 0 != lp.get_rows_total(): lp.clear_all_data() btn = ButtonPage(self.driver) btn.click_button(btn.new_btn) lp.wait_loading_hide() btn.click_button(btn.save_draft) self.assertTrue(lp.is_msg_visiable(), msg='保存草稿按钮检验不通过') msgtitle = lp.is_test_in_msg('保存成功') self.assertTrue(msgtitle, msg='保存草稿按钮检验不通过')
def test_flow_process_btn(self): '''流程处理按钮''' menu3 = '表单按钮_流程相关' Process_approver = ProcessApproverPage(self.driver) Process_approver.close_message() self.open_menu3(menu3) #time.sleep(0.5) lp = ListViewPage(self.driver) if 0 != lp.get_rows_total(): lp.clear_all_data() btn = ButtonPage(self.driver) btn.click_button(btn.new_btn) #time.sleep(0.5) ip = InputPage(self.driver, '单行文本') ip.element.send_keys('保存') #time.sleep(0.5) btn.click_button(btn.flow_process) #点击流程提交按钮 #time.sleep(0.3) btn.click_confirm_submit() msgtitle = lp.is_test_in_msg('提交成功') self.assertTrue(msgtitle, msg='流程处理按钮检验不通过') #time.sleep(0.5) if 0 != lp.get_rows_total(): lp.clear_all_data()
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()