class Action(object): def __init__(self, driver): self.query = Tra.Query(driver) self.create = Tra.Create(driver) self.common = Common(driver) self.driver = driver def query_domain(self, terminal): log.info("查询支付域名") Home(self.driver).mer_domain() time.sleep(0.5) self.query.input_terminal(terminal) self.common.click_query() time.sleep(0.5) res = self.query.get_res_null() # 判断是否存在域名绑定的终端号 if res == "没有找到相关记录,请重新输入条件进行查询 .": return res return "" def create_domain(self, account, terminal, domain_name): log.info("新增支付域名") Home(self.driver).mer_domain() time.sleep(0.5) self.query.click_create() time.sleep(0.5) self.create.input_mer_no(account) self.create.select_terminal(terminal) self.create.select_md_name(domain_name) self.create.select_client_type("PC端") self.common.click_submit() self.common.confirm_alert()
class Action(object): def __init__(self, driver): self.query = Tra.Query(driver) self.create = Tra.Create(driver) self.common = Common(driver) self.driver = driver def query_channel(self, terminal, channel, card_type): log.info("查询终端号通道绑定: 查询终端号和卡种") Home(self.driver).terminal_to_channel() time.sleep(0.5) self.query.input_terminal(terminal) # 选择通道 self.query.select_channel(channel.split("(")[0]) # 不存在通道绑定的卡种 lack_list = [] for val in card_type.split(","): val_str = val.strip() log.info("卡种: {}".format(val_str)) self.query.select_card(val_str) self.common.click_query() time.sleep(0.5) # 判断是否存在此终端号和卡种的扣率 res = self.query.get_res_null() if res == "没有找到相关记录,请重新输入条件进行查询 .": lack_list.append(val) return lack_list def bind_channel(self, account, terminal, paymethod, card_type, bank_code, channel): log.info("终端号绑定通道") Home(self.driver).terminal_to_channel() time.sleep(0.5) self.query.click_create() time.sleep(1) self.create.input_mer_no(account) self.create.select_terminal(terminal) self.create.select_pay_method(paymethod) self.create.select_card(card_type) self.create.select_bank(bank_code) self.create.select_channel(channel) self.create.select_pay_type("首次收款") self.create.select_open_author("是") self.create.select_auto_author("是") self.create.select_bind("正常") self.common.click_submit() self.common.confirm_alert()
class Action(object): def __init__(self, driver): self.query = Tra.Query(driver) self.create = Tra.Create(driver) self.verify = Tra.Verify(driver) self.common = Common(driver) self.driver = driver def query_contract(self, account): log.info("查询合同信息") Home(self.driver).merchant_contract() time.sleep(0.5) self.query.input_mer_no(account) self.common.click_query() time.sleep(0.5) # 判断是否审核/复核合同信息 res = self.common.get_table_val("1", "状态") if res == "已审核": return "1" elif res == "已复核(成功)": return "2" return "" def create_contract(self, account): log.info("新增合同信息") Home(self.driver).merchant_contract() time.sleep(0.5) self.query.click_create() time.sleep(0.5) self.create.input_mer_no(account) self.create.select_init_date() self.create.select_end_date() self.create.click_auto_renew() self.create.select_contract_type("a101") self.create.select_start_date() self.common.click_submit() def verify_contract(self, account): log.info("复核合同信息") Home(self.driver).merchant_contract() time.sleep(0.5) self.query.input_mer_no(account) self.common.click_query() self.common.click_mids() self.query.click_verify() # 判断是否出现警告框 is_alert = self.common.confirm_alert() if not is_alert: self.verify.select_status("已复核(成功)") self.common.click_submit()
class Action(object): def __init__(self, driver): self.query = Tra.Query(driver) self.create = Tra.Create(driver) self.modify = Tra.Modify(driver) self.common = Common(driver) self.driver = driver def get_terminal(self, account): log.info("获取终端号") Home(self.driver).terminal_query() time.sleep(0.5) self.query.input_mer_no(account) self.common.click_query() return self.common.get_table_val("1", "终端号") def query_terminal(self, terminal): Home(self.driver).terminal_query() time.sleep(0.5) self.query.input_terminal(terminal) self.common.click_query() time.sleep(0.5) log.info("查询终端号是否存在") # 判断终端号是否存在 return self.query.get_res_null() def query_list(self, terminal, name): Home(self.driver).terminal_query() time.sleep(0.5) self.query.input_terminal(terminal) self.common.click_query() time.sleep(0.5) res = self.common.get_table_val("1", name) log.info("获取{}: {}".format(name, res)) return res def modify_terminal(self, terminal, inf_type): log.info("修改终端号") Home(self.driver).terminal_query() time.sleep(0.5) self.query.input_terminal(terminal) self.common.click_query() time.sleep(0.5) self.common.click_mids() self.query.click_modify() time.sleep(0.5) self.modify.input_secure_code("12345678") self.modify.select_inf_type(inf_type) self.modify.select_bus_type("商户行业") self.modify.click_ip_no() self.modify.input_pay_times() self.modify.select_model("推送和正常返回") self.common.click_submit() self.common.confirm_alert() def create_terminal(self, account, inf_type): log.info("新增终端号") Home(self.driver).terminal_query() time.sleep(0.5) self.query.click_create() time.sleep(0.5) self.create.input_mer_no(account) self.create.input_secure_code("12345678") self.create.select_inf_type(inf_type) self.create.select_bus_type("商户行业") self.create.click_ip_no() self.create.input_pay_times() self.create.select_model("推送和正常返回") self.common.click_submit() self.common.confirm_alert() def active_terminal(self, terminal): log.info("激活终端号") Home(self.driver).terminal_query() time.sleep(0.5) self.query.input_terminal(terminal) self.common.click_query() time.sleep(0.5) self.common.click_mids() self.query.click_active() self.common.confirm_alert() def start_terminal(self, terminal): log.info("启用终端号") Home(self.driver).terminal_query() time.sleep(0.5) self.query.input_terminal(terminal) self.common.click_query() time.sleep(0.5) self.common.click_mids() self.query.click_start() time.sleep(0.5) self.common.confirm_alert()
class Action(object): def __init__(self, driver): self.query = Tra.Query(driver) self.create = Tra.Create(driver) self.common = Common(driver) self.driver = driver def query_web_white(self, terminal): log.info("查询网址白名单") Home(self.driver).merweb_white() time.sleep(0.5) self.query.input_terminal(terminal) self.common.click_query() time.sleep(0.5) # 判断是否存在网址白名单的终端号 res = self.query.get_res_null() if res == "没有找到相关记录,请重新输入条件进行查询 .": return res else: res = self.common.get_table_val("1", "状态") if res == "已审核": return "1" elif res == "待处理": return "0" return "" def create_web_white(self, account, terminal): log.info("新增网址白名单") Home(self.driver).merweb_white() time.sleep(0.5) self.query.click_create() time.sleep(0.5) self.create.input_mer_no(account) self.create.click_terminal(terminal) self.create.input_websit("www.baidu.com") self.common.click_submit() self.common.confirm_alert() def review_web_white(self, terminal): log.info("审核网址白名单") Home(self.driver).merweb_white() time.sleep(0.5) self.query.input_terminal(terminal) self.common.click_query() time.sleep(0.5) self.common.click_mids() self.query.click_review() # 判断是否出现警告框 is_alert = self.common.confirm_alert() if not is_alert: self.common.click_submit() def verify_web_white(self, terminal): log.info("复核网址白名单") Home(self.driver).merweb_white() time.sleep(0.5) self.query.input_terminal(terminal) self.common.click_query() time.sleep(0.5) self.common.click_mids() self.query.click_verify() # 判断是否出现警告框 is_alert = self.common.confirm_alert() if not is_alert: self.common.click_submit()