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_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_signature_btn(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.signature) #time.sleep(0.5) btn.select_signature() lp.alert_send_keys('123456') lp.click_alert_accept() #time.sleep(0.5) btn.confirm_signature() #time.sleep(0.5) self.assertEqual('[签章成功!]', lp.get_msg(), msg='签章按钮检验不通过')