def test_column_sort_up(self): '''排序升序''' menu3 = '列表视图_列_排序_升序' mp = MainPhonePage(self.driver) mp.open_menus(self.menu1, self.menu2, menu3) # 打开菜单 lp = ListViewPhonePage(self.driver) lp.wait_Tabloading_show_then_hide() self.assertIn('up.gif', lp.get_column_sort_img_src('列表视图_部门选择框'), msg='真实值检验不通过')
def test_column_true_val(self): '''真实值''' menu3 = '列表视图_列_值类型_真实值' mp = MainPhonePage(self.driver) mp.open_menus(self.menu1, self.menu2, menu3) # 打开菜单 lp = ListViewPhonePage(self.driver) lp.wait_Tabloading_show_then_hide() self.assertEqual('11e7-5f99-e70d1a49-917f-e799edecb417', lp.get_column_row1_col1(), msg='真实值检验不通过')
def test_column_show_val(self): '''显示值''' menu3 = '列表视图_列_值类型_显示值' mp = MainPhonePage(self.driver) mp.open_menus(self.menu1, self.menu2, menu3) # 打开菜单 lp = ListViewPhonePage(self.driver) lp.wait_Tabloading_show_then_hide() self.assertEqual('测试部', lp.get_column_row1_col1(), msg='显示值检验不通过')
def test_column_order(self): '''类型序号''' menu3 = '列表视图_列_类型_序号' mp = MainPhonePage(self.driver) mp.open_menus(self.menu1, self.menu2, menu3) # 打开菜单 lp = ListViewPhonePage(self.driver) lp.wait_Tabloading_show_then_hide() self.assertEqual('1', lp.get_column_row1_col1(), msg='类型序号检验不通过')
def test_paging_30(self): '''分页-每页30条''' menu3 = '列表视图_分页_30条' mp = MainPhonePage(self.driver) mp.open_menus(self.menu1, self.menu2, menu3) # 打开菜单 lp = ListViewPhonePage(self.driver) lp.wait_Tabloading_show_then_hide() self.assertEqual(30, lp.get_rows_total(), msg='分页-每页30条检验不通过')
def test_save_draft_btn(self): '''保存草稿按钮''' lp = ListViewPhonePage(self.driver) lp.open_fisrt_doc() # 打开第一条数据 bt = ButtonPhonePage(self.driver) lp.wait_Tabloading_show_then_hide() bt.click_button('保存草稿') # 点击按钮 self.assertEqual('[保存成功]', lp.get_msg(), msg='保存草稿按钮检验不通过')
def test_paging_not(self): '''不分页''' menu3 = '列表视图_分页_否' mp = MainPhonePage(self.driver) mp.open_menus(self.menu1, self.menu2, menu3) # 打开菜单 lp = ListViewPhonePage(self.driver) lp.wait_Tabloading_show_then_hide() self.assertEqual('', lp.get_pagination_body(), msg='不分页检验不通过')
def test_column_return_mark(self): '''流程回退标识''' menu3 = '列表视图_列_流程回退标识' mp = MainPhonePage(self.driver) mp.open_menus(self.menu1, self.menu2, menu3) # 打开菜单 lp = ListViewPhonePage(self.driver) lp.wait_Tabloading_show_then_hide() self.assertIn('backstatelabel01.gif', lp.get_column_row1_col1_img(), msg='真实值检验不通过') self.assertIn('#ff0000', lp.get_column_row1_col1_font(), msg='真实值检验不通过')
def test_column_open_by_module(self): '''列-操作类型-以模板表单方式打开''' menu3 = '列表视图_列_操作类型_以模板表单方式打开' mp = MainPhonePage(self.driver) mp.open_menus(self.menu1, self.menu2, menu3) # 打开菜单 lp = ListViewPhonePage(self.driver) lp.wait_Tabloading_show_then_hide() lp.click_module_btn() btn = ButtonPhonePage(self.driver) lp.wait_Tabloading_show_then_hide() self.assertFalse(btn.is_button_exist('新建'), msg='非只读检验不通过')
def test_readonly(self): '''只读''' menu3 = '列表视图_只读_是' mp = MainPhonePage(self.driver) mp.open_menus(self.menu1, self.menu2, menu3) # 打开菜单 lp = ListViewPhonePage(self.driver) lp.wait_Tabloading_show_then_hide() lp.open_fisrt_doc() lp.wait_Tabloading_show_then_hide() btn = ButtonPhonePage(self.driver) self.assertTrue(btn.is_button_exist('新建'), msg='非只读检验不通过')
def test_column_type_jump(self): '''列-操作类型-跳转''' menu3 = '列表视图_列_操作类型_跳转' mp = MainPhonePage(self.driver) mp.open_menus(self.menu1, self.menu2, menu3) # 打开菜单 lp = ListViewPhonePage(self.driver) lp.wait_Tabloading_show_then_hide() lp.click_jump() btn = ButtonPhonePage(self.driver) lp.wait_Tabloading_show_then_hide() self.assertTrue(btn.is_button_exist('保存'), msg='非只读检验不通过')
def test_user_defined_jump_btn(self): '''自定义跳转按钮''' menu3 = '表单按钮_自定义按钮' mp = MainPhonePage(self.driver) mp.open_menus(self.menu1, self.menu2, menu3) # 打开菜单 lp = ListViewPhonePage(self.driver) lp.wait_Tabloading_show_then_hide() lp.open_fisrt_doc() #打开第一条数据 bt = ButtonPhonePage(self.driver) bt.click_button('自定义跳转列表') #点击按钮 msgtitle = lp.get_msg() #获取消息 self.assertEqual('[自定义跳转列表成功]', msgtitle, msg='自定义跳转按钮检验不通过') self.assertEqual('保存', lp.get_column_row1_col2(), msg='自定义跳转按钮检验不通过')
def test_save_copy_btn(self): '''保存并复制按钮''' lp = ListViewPhonePage(self.driver) lp.wait_Tabloading_show_then_hide() if lp.get_rows_total() != 0: lp.clear_all_data() # 清除数据 bt = ButtonPhonePage(self.driver) bt.click_button('新建') # 点击新建 lp.wait_Tabloading_show_then_hide() ip = InputPhonePage(self.driver, '单行文本') ip.element.send_keys('保存') # 输入文本 bt.click_button('保存并复制') # 点击按钮 msgtitle = lp.get_msg() # 获取消息 self.assertEqual('[保存成功]', msgtitle, msg='保存并复制按钮检验不通过') lp.wait_msg_show_then_hide() bt.click_button('返回') # 点击按钮 self.assertEqual(2, lp.get_rows_total(), msg='保存并复制按钮检验不通过')
def test_save_btn(self): '''保存按钮''' menu3 = '表单按钮_保存类' mp = MainPhonePage(self.driver) mp.open_menus(self.menu1, self.menu2, menu3) # 打开菜单 lp = ListViewPhonePage(self.driver) lp.wait_Tabloading_show_then_hide() if lp.get_rows_total() != 0: lp.clear_all_data() #清除数据 bt = ButtonPhonePage(self.driver) bt.click_button('新建') #点击按钮 lp.wait_Tabloading_show_then_hide() ip = InputPhonePage(self.driver, '单行文本') ip.element.send_keys('保存') #输入文本 bt.click_button('保存') #点击按钮 msgtitle = lp.get_msg() #获取消息 self.assertEqual('[保存成功]', msgtitle, msg='保存按钮检验不通过')
def test_select_usefulopinions_case(self): '''选择常用意见''' bt = ButtonPhonePage(self.driver) lp = ListViewPhonePage(self.driver) lp.wait_Tabloading_show_then_hide() if lp.get_rows_total() != 0: lp.clear_all_data() # 清除数据 bt.click_button('新建') # 点击按钮 lp.wait_Tabloading_show_then_hide() bt.click_button('提交') # 点击按钮 fsp = FlowSubmitPanelPage(self.driver) fsp.click_usefulopinions() # 展开常用意见 fsp.wait_elem_visible('.flow-submit__proposal-box') fsp.select_usefulopinions('同意') # 选择意见 self.assertEqual('同意', fsp.get_usefulopinions(), msg='选择常用意见校验不通过') fsp.click_usefulopinions() # 收起常用意见 bt.click_flowpanel_button('提交') # 点击按钮 mp = MainPhonePage(self.driver) lp.wait_msg_show_then_hide() lp.wait_Tabloading_show_then_hide() mp.return_to_homepage() # 返回主页 mp.switch_to_flow_page() # 切换到流程面板 mp.switch_flow_center_byname('经办') # 点击切换到经办页面 mp.click_processing_first_data() # 点击经办第一条数据 fp = FlowPhonePage(self.driver) fp.click_flow_more() # 点击更多切换到流程历史 self.assertEqual('同意', fp.get_flow_history_useopinions(), msg='选择常用意见校验不通过')
def test_page_turn(self): '''翻页''' menu3 = '列表视图_全选和翻页' mp = MainPhonePage(self.driver) mp.open_menus(self.menu1, self.menu2, menu3) # 打开菜单 lp = ListViewPhonePage(self.driver) lp.wait_Tabloading_show_then_hide() lp.click_next_page() #点击下一页 lp.wait_Tabloading_show_then_hide() self.assertEqual('777', lp.get_column_row1_col1(), msg=menu3 + '检验不通过') lp.click_prev_page() #点击前一页 lp.wait_Tabloading_show_then_hide() self.assertEqual('666', lp.get_column_row1_col1(), msg=menu3 + '检验不通过') lp.click_end_page() #点击末页 lp.wait_Tabloading_show_then_hide() self.assertEqual('999', lp.get_column_row1_col1(), msg=menu3 + '检验不通过') lp.click_first_page() #点击首页 lp.wait_Tabloading_show_then_hide() self.assertEqual('666', lp.get_column_row1_col1(), msg=menu3 + '检验不通过')
def test_column_type_del(self): '''列-操作类型-删除''' menu3 = '列表视图_列_操作类型_删除' mp = MainPhonePage(self.driver) mp.open_menus(self.menu1, self.menu2, menu3) # 打开菜单 lp = ListViewPhonePage(self.driver) lp.wait_Tabloading_show_then_hide() if lp.get_rows_total() == 0: lp.add_one_row() lp.wait_Tabloading_show_then_hide() if lp.get_rows_total() == 1: lp.click_del() lp.wait_Tabloading_show_then_hide() self.assertEqual(0, lp.get_rows_total(), msg='列-操作类型-删除检验不通过')
def test_column_type_submit(self): '''列-操作类型-提交流程''' menu3 = '列表视图_列_操作类型_提交流程' mp = MainPhonePage(self.driver) mp.open_menus(self.menu1, self.menu2, menu3) # 打开菜单 lp = ListViewPhonePage(self.driver) lp.wait_Tabloading_show_then_hide() if lp.get_rows_total() != 0: lp.clear_all_data() lp.wait_Tabloading_show_then_hide() if lp.get_rows_total() == 0: lp.add_one_row() lp.wait_Tabloading_show_then_hide() if lp.get_rows_total() == 1: lp.click_submit() lp.wait_Tabloading_show_then_hide() lp.set_val_and_submit('请审批') lp.wait_Tabloading_show_then_hide() #点击行数据 lp.open_fisrt_doc() lp.wait_Tabloading_show_then_hide() bp = ButtonPhonePage(self.driver) self.assertEqual(0, bp.is_button_exist('流程处理'), msg='列-操作类型-提交流程检验不通过')