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_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_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_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_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_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_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_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(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_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_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_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()