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_true_val(self): '''真实值''' menu3 = '列表视图_列_值类型_真实值' self.open_menu3(menu3) lp = ListViewPage(self.driver) self.assertEqual('11e7-5f99-e70d1a49-917f-e799edecb417', lp.get_column_row1_col1(), msg='真实值检验不通过')
def test_page_turn(self): '''翻页''' menu3 = '列表视图_全选和翻页' mp = MainPage(self.driver) self.open_menu3(menu3) lp = ListViewPage(self.driver) lp.click_cur_page() #点击当前页 self.assertEqual('666', lp.get_column_row1_col1(), msg=menu3 + '检验不通过') lp.click_second_page() #点击第二页 #time.sleep(0.5) self.assertEqual('777', lp.get_column_row1_col1(), msg=menu3 + '检验不通过') lp.click_prev_page() #点击前一页 #time.sleep(0.5) self.assertEqual('666', lp.get_column_row1_col1(), msg=menu3 + '检验不通过') lp.click_next_page() #点击下一页 #time.sleep(0.5) self.assertEqual('777', lp.get_column_row1_col1(), msg=menu3 + '检验不通过')
def test_val_type_number(self): '''列-格式-类型-数值-小数3位且使用千分位分隔符''' menu3 = '列表视图_列_格式类型_数值_小数位千分位' mp = MainPage(self.driver) self.open_menu3(menu3) lp = ListViewPage(self.driver) self.assertEqual('22,222.000', lp.get_column_row1_col1(), msg=menu3 + '检验不通过')
def test_val_type_cash(self): '''列-格式-类型-货币_小数位美元''' menu3 = '列表视图_列_格式类型_货币_小数位美元' mp = MainPage(self.driver) self.open_menu3(menu3) lp = ListViewPage(self.driver) self.assertEqual('$22,222.000', lp.get_column_row1_col1(), msg=menu3 + '检验不通过')
def test_val_type_font_length(self): '''列_显示文字方式_文字长度''' menu3 = '列表视图_列_显示文字方式_文字长度' mp = MainPage(self.driver) self.open_menu3(menu3) lp = ListViewPage(self.driver) self.assertEqual('666666...', lp.get_column_row1_col1(), msg=menu3 + '检验不通过')
def test_jump_url_current_page_btn(self): '''跳转(当前页)按钮''' menu3 = '按钮_case002' self.open_menu3(menu3) #打开菜单 btn = ButtonPage(self.driver) btn.click_button_by_type_title(btn.jump_to, '跳转(当前页)') #点击跳转 #time.sleep(0.5) lp = ListViewPage(self.driver) self.assertEqual('保存', lp.get_column_row1_col1(), msg='跳转(当前页)按钮检验不通过')
def test_save_return_btn_case(self): '''保存并返回按钮''' menu3 = '按钮控件_保存类' self.open_menu3(menu3) lp = ListViewPage(self.driver) lp.open_fisrt_doc() #time.sleep(0.5) btn = ButtonPage(self.driver) btn.click_button(btn.save_return) self.assertEqual('[保存成功]', lp.get_msg(), msg='保存并返回按钮检验不通过') #time.sleep(0.5) self.assertEqual('保存', lp.get_column_row1_col1(), msg='保存并返回按钮检验不通过')
def test_jump_url_tab_page_btn(self): '''跳转(页签)按钮''' menu3 = '按钮_case002' self.open_menu3(menu3) btn = ButtonPage(self.driver) btn.click_button_by_type_title(btn.jump_to, '跳转(页签)') #time.sleep(0.5) mp = MainPage(self.driver) mp.switch_to_parent() mp.switch_to_iframe() lp = ListViewPage(self.driver) self.assertEqual('保存', lp.get_column_row1_col1(), msg='跳转(页签)按钮检验不通过')
def test_jump_url_current_page_btn(self): '''跳转url当前页按钮''' menu3 = '表单按钮_跳转' self.open_menu3(menu3) lp = ListViewPage(self.driver) btn = ButtonPage(self.driver) btn.click_button(btn.new_btn) #点击新建按钮 lp.wait_Tabloading_show_then_hide() btn.click_button_by_type_title(btn.jump_to, '跳转URL当前页面') lp.wait_loading_hide() #等待视图页面加载 self.assertEqual('保存', lp.get_column_row1_col1(), msg='跳转URL当前页面按钮检验不通过')
def test_jump_url_new_window_btn(self): '''跳转(新窗口)按钮''' menu3 = '按钮_case002' self.open_menu3(menu3) btn = ButtonPage(self.driver) btn.click_button_by_type_title(btn.jump_to, '跳转(新窗口)') #time.sleep(0.5) lp = ListViewPage(self.driver) lp.switch_to_another_window() self.assertEqual('保存', lp.get_column_row1_col1(), msg='跳转(新窗口)按钮检验不通过') self.driver.close() mp = MainPage(self.driver) mp.switch_to_current_window()
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_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_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_column_iscript(self): '''类型脚本''' menu3 = '列表视图_列_类型_脚本' self.open_menu3(menu3) lp = ListViewPage(self.driver) self.assertEqual('aaa', lp.get_column_row1_col1(), msg='类型脚本检验不通过')
def test_column_show_val(self): '''显示值''' menu3 = '列表视图_列_值类型_显示值' self.open_menu3(menu3) lp = ListViewPage(self.driver) self.assertEqual('测试部', lp.get_column_row1_col1(), msg='显示值检验不通过')
def test_column_order(self): '''类型序号''' menu3 = '列表视图_列_类型_序号' self.open_menu3(menu3) lp = ListViewPage(self.driver) self.assertEqual('1', lp.get_column_row1_col1(), msg='类型序号检验不通过')