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