def select_all_channel(self): helper.wait_element_visible(self.driver,*OrderLocator.channel_Select) channel_select = self.driver.find_element(*OrderLocator.channel_Select) channel_select.click() all_channel_select = self.driver.find_element( *OrderLocator.channel_all) all_channel_select.click()
def download_orderid_template(self): helper.wait_element_visible(self.driver,*OrderLocator.charge_download_link) order_link = self.driver.find_element(*OrderLocator.charge_download_link) # order_link.click() url = datagen.get_current_dashboard_url()+"/page/download/batch_refund_by_order_id" path = helper.current_path() helper.downloadRemoteFile(url,path+"/chargeid.csv")
def click_refund_Button(self): helper.save_screen_shot(self.driver,"click_refund_Button_before") helper.wait_element(self.driver, *OrderLocator.refund_Button) helper.wait_element_visible(self.driver, *OrderLocator.refund_Button) refund_button = self.driver.find_element(*OrderLocator.refund_Button) refund_button.click() time.sleep(1)
def get_paid_refunded(self): helper.wait_element_visible( self.driver, *OrderLocator.amount_first_row) amount = self.driver.find_element(*OrderLocator.amount_first_row) paid = self.driver.find_element(*OrderLocator.paid_first_row) refunded = self.driver.find_element(*OrderLocator.refunded_first_row) return amount.text, paid.text, refunded.text
def click_next_step(self): helper.wait_element_visible( self.driver, *OrderLocator.next_step_Button) next_step_button = self.driver.find_element( *OrderLocator.next_step_Button) next_step_button.click() helper.save_screen_shot(self.driver,"batch_refund_click_next_step")
def get_red_id(self): helper.wait_element( self.driver, *OrderLocator.redId_first_row) helper.wait_element_visible( self.driver, *OrderLocator.redId_first_row) redId = self.driver.find_element(*OrderLocator.redId_first_row) return redId
def click_search(self): helper.save_screen_shot(self.driver, "click_search_before_search") # 不要去掉,否则不稳定 helper.wait_element(self.driver, *DebugLocator.webhook_search_Button) helper.wait_element_visible(self.driver, *DebugLocator.webhook_search_Button) search_webhook = self.driver.find_element(*DebugLocator.webhook_search_Button) helper.save_screen_shot(self.driver, "click_search_before_search") # 不要去掉,否则不稳定 search_webhook.click()
def input_refund_comment(self): # input refund comment helper.wait_element_visible( self.driver, *OrderLocator.refund_remark_Textarea) comment = self.driver.find_element(*OrderLocator.refund_remark_Textarea) comment.click() comment.send_keys("test batch refund by automation")
def Get_result(self): helper.save_screen_shot(self.driver, "Get_result") helper.wait_element_visible(self.driver, *DebugLocator.webhook_event) helper.wait_element(self.driver, *DebugLocator.webhook_result) helper.wait_element_visible(self.driver, *DebugLocator.webhook_result) result = self.driver.find_element(*DebugLocator.webhook_result) return result.text
def filter_argu_handled(self): helper.wait_element(self.driver,*OrderLocator.filter_panel_Button) helper.wait_element_visible(self.driver,*OrderLocator.filter_panel_Button) filter_panel = self.driver.find_element(*OrderLocator.filter_panel_Button) filter_panel.click() helper.wait_element(self.driver,*OrderLocator.filter_pay_all) helper.wait_element_visible(self.driver,*OrderLocator.filter_pay_all) filter_paid = self.driver.find_element(*OrderLocator.filter_pay_all) filter_paid.click() helper.wait_element_visible(self.driver,*OrderLocator.filter_refund_all) filter_refunded = self.driver.find_element(*OrderLocator.filter_refund_all) filter_refunded.click() helper.wait_element(self.driver,*OrderLocator.filter_argu_handled) helper.wait_element_visible(self.driver,*OrderLocator.filter_argu_handled) filter_paid = self.driver.find_element(*OrderLocator.filter_argu_handled) filter_paid.click() helper.save_screen_shot(self.driver,"filter_argu_handled_for_redenvelope") helper.wait_element_visible(self.driver,*OrderLocator.filter_apply_Button) filter_apply = self.driver.find_element(*OrderLocator.filter_apply_Button) filter_apply.click()
def input_current_datename(self): app_name_date = get_current_date() helper.wait_element_invisible(self.driver,*AppInfoLocator.popup) helper.wait_element_visible(self.driver, *AppInfoLocator.app_display_name) app_name = self.driver.find_element(*AppInfoLocator.app_display_name) app_name.clear() app_name.send_keys(app_name_date)
def close_detail(self): helper.save_screen_shot(self.driver,"close_detail") helper.wait_element(self.driver,*OrderLocator.close_detail_Button) helper.wait_element_visible(self.driver,*OrderLocator.close_detail_Button) detail_button = self.driver.find_element( *OrderLocator.close_detail_Button) detail_button.click() helper.wait_element_invisible(self.driver,*OrderLocator.close_detail_Button)
def sleect_paid(self): helper.wait_element_visible(self.driver,*OrderLocator.paid_Status_Select) paid_select = self.driver.find_element( *OrderLocator.paid_Status_Select) paid_select.click() helper.wait_element_visible(self.driver,*OrderLocator.paid_select) paid_select = self.driver.find_element(*OrderLocator.paid_select) paid_select.click()
def select_wx_channel(self): helper.wait_element_visible(self.driver,*OrderLocator.channel_Select) channel_select = self.driver.find_element(*OrderLocator.channel_Select) channel_select.click() time.sleep(1) helper.wait_element_visible(self.driver,*OrderLocator.channel_wx) wx = self.driver.find_element(*OrderLocator.channel_wx) wx.click()
def create_batchPay(self): helper.wait_element( self.driver, *OrderLocator.create_batchpay_Button) helper.wait_element_visible( self.driver, *OrderLocator.create_batchpay_Button) batch_opeation = self.driver.find_element( *OrderLocator.create_batchpay_Button) batch_opeation.click()
def refund_partial(self): helper.wait_element_visible(self.driver, *OrderLocator.m_refund_amount) refund_amount = self.driver.find_element(*OrderLocator.m_refund_amount) refund_amount.clear() refund_amount.send_keys("0.01") remark = self.driver.find_element(*OrderLocator.m_refund_remark) remark.clear() remark.send_keys("test refund partial by automation")
def click_register_button(self): helper.wait_element_visible(self.driver,*LogInOutLocators.register_email_Button) send_email = self.driver.find_element( *LogInOutLocators.register_email_Button) send_email.click() helper.wait_element_visible(self.driver, *LogInOutLocators.registered_email_Link) helper.save_screen_shot(self.driver,"click_register_button_email_link")
def refund_not_number(self): helper.wait_element_visible(self.driver, *OrderLocator.m_refund_remark) refund_amount = self.driver.find_element(*OrderLocator.m_refund_amount) refund_amount.clear() refund_amount.send_keys(",.[]") remark = self.driver.find_element(*OrderLocator.m_refund_remark) remark.clear() remark.send_keys("test refund not number")
def click_batchPay_tab(self): helper.save_screen_shot(self.driver,"click_batch_transfer") helper.wait_element( self.driver, *OrderLocator.batch_transfer_tab) helper.wait_element_visible( self.driver, *OrderLocator.batch_transfer_tab) batch_opeation = self.driver.find_element( *OrderLocator.batch_transfer_tab) batch_opeation.click()
def select_refund_all(self): helper.wait_element_visible(self.driver,*OrderLocator.refund_status_Select) refund_select = self.driver.find_element( *OrderLocator.refund_status_Select) refund_select.click() helper.wait_element_visible( self.driver, *OrderLocator.refund_status_all) refund_all = self.driver.find_element(*OrderLocator.refund_status_all) refund_all.click()
def refund_comment_toolong(self): helper.wait_element_visible(self.driver, *OrderLocator.m_refund_remark) refund_amount = self.driver.find_element(*OrderLocator.m_refund_amount) refund_amount.clear() refund_amount.send_keys("0.02") remark = self.driver.find_element(*OrderLocator.m_refund_remark) remark.clear() remark.send_keys("begin-this is comment,this is comment,this is comment,-end")
def refund_minus(self): helper.wait_element_visible(self.driver, *OrderLocator.m_refund_remark) refund_amount = self.driver.find_element(*OrderLocator.m_refund_amount) refund_amount.clear() refund_amount.send_keys("-1") remark = self.driver.find_element(*OrderLocator.m_refund_remark) remark.clear() remark.send_keys("test refund -1")
def select_envelope_type(self): helper.wait_element_visible(self.driver,*OrderLocator.order_type_Select) order_type_select = self.driver.find_element( *OrderLocator.order_type_Select) order_type_select.click() helper.wait_element_visible( self.driver, *OrderLocator.order_type_envelope) order_envelope = self.driver.find_element( *OrderLocator.order_type_envelope) order_envelope.click()
def verify_response(self, wh_url): url = datagen.get_webhook_url_invalid() if wh_url == url: helper.wait_element_visible(self.driver,*WebHookLocator.wh_Test_ecode) return_code = self.driver.find_element(*WebHookLocator.wh_Test_ecode) assert return_code.text != '200' else: helper.wait_element_visible(self.driver,*WebHookLocator.wh_Test_scode) return_code = self.driver.find_element(*WebHookLocator.wh_Test_scode) assert return_code.text == '200'
def get_channel(self): helper.wait_element( self.driver, *OrderLocator.channel_first_row) helper.wait_element_visible( self.driver, *OrderLocator.channel_first_row) try: channel = self.driver.find_element(*OrderLocator.channel_first_row) logging.info(channel.text) except Exception,e: logging.error(Exception,e)
def select_transfer_type(self): helper.wait_element_visible(self.driver,*OrderLocator.order_type_Select) order_type_select = self.driver.find_element( *OrderLocator.order_type_Select) order_type_select.click() helper.wait_element_visible( self.driver, *OrderLocator.order_type_transfer) order_transfer = self.driver.find_element( *OrderLocator.order_type_transfer) order_transfer.click()
def select_upacp_pc_channel(self): helper.wait_element_visible(self.driver,*OrderLocator.channel_Select) channel_select = self.driver.find_element(*OrderLocator.channel_Select) channel_select.click() time.sleep(1) helper.wait_element(self.driver,*OrderLocator.channel_upacp_pc) helper.wait_element_visible(self.driver,*OrderLocator.channel_upacp_pc) upacp_pc = self.driver.find_element( *OrderLocator.channel_upacp_pc) upacp_pc.click()
def input_refund_amount(self): # input refund comment helper.save_screen_shot(self.driver,"input_refund_amount_before") helper.wait_element( self.driver, *OrderLocator.refund_amount) helper.wait_element_visible( self.driver, *OrderLocator.refund_amount) amount = self.driver.find_element(*OrderLocator.refund_amount) amount.click() amount.clear() amount.send_keys("0.05")
def input_chargeid_list(self): helper.wait_element_visible(self.driver, *OrderLocator.refund_List) refundList_text = self.driver.find_element(*OrderLocator.refund_List) refundList_text.click() charge_list = GetCharge.GetChargeList_NotRefund(0) for ch in charge_list: refundList_text.send_keys(ch) refundList_text.send_keys('\n') print ch
def verify_no_handel_argument(self): helper.wait_element(self.driver,*OrderLocator.argu_Button) helper.wait_element_visible(self.driver,*OrderLocator.argu_Button) argu_detail = self.driver.find_element(*OrderLocator.argu_Button) argu_detail.text.find(u'争议已提交') helper.wait_element(self.driver,*OrderLocator.argu_reason) helper.wait_element_visible(self.driver,*OrderLocator.argu_reason) helper.save_screen_shot(self.driver,"verify_no_handel_argument") argu_reason = self.driver.find_element(*OrderLocator.argu_reason) assert len(argu_reason.text)>=5