def test_save_new_btn_case(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() # 等待loading消失 ip = InputPage(self.driver, '单行文本') ip.element.send_keys('保存') btn.click_button(btn.save_new) #点击保存并新建按钮 self.assertEqual('[保存成功]', lp.get_msg(), msg='保存并新建按钮检验不通过') lp.wait_loading_hide() #等待loading消失 time.sleep(10) ip2 = InputPage(self.driver, '单行文本') ip2.element.send_keys('保存') btn.click_button(btn.save) lp.wait_loading_hide() # 等待loading消失 time.sleep(10) btn.click_button(btn.to_return) if (lp.is_alert_present()): lp.accept_alert() lp.wait_loading_hide() #等待loading消失 self.assertEqual(2, lp.get_rows_total(), msg='保存并新建按钮检验不通过') lp.clear_all_data()
def test_save_draft_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_draft) #time.sleep(0.5) self.assertEqual('[保存成功]', lp.get_msg(), 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_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='签章按钮检验不通过')
def test_save_copy_btn_case(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) ip = InputPage(self.driver, '单行文本') ip.element.send_keys('保存') btn.click_button(btn.save_copy) #time.sleep(0.5) self.assertEqual('[保存成功]', lp.get_msg(), msg='保存并复制按钮检验不通过') lp.wait_loading_hide() btn.click_button(btn.to_return) lp.wait_loading_hide() #表单中 lp.wait_loading_hide() #视图中 #time.sleep(0.5) self.assertEqual(2, lp.get_rows_total(), msg='保存并复制按钮检验不通过') lp.clear_all_data()