class Action(object):
    def __init__(self, driver):
        self.query = Tra.Query(driver)
        self.create_obj = Tra.Create(driver)
        self.common = Common(driver)
        self.driver = driver

    def query_pay_id(self, pay_id):
        log.info("查询支付ID:{}".format(pay_id))
        Home(self.driver).risk_monitor()
        self.query.input_pay_id(pay_id)
        self.common.click_query()

    def get_counterfeit(self, val):
        # 获取伪冒状态
        return self.query.get_table_val(1, val)

    def create(self, pay_id, reason):
        log.info("新增伪冒")
        time.sleep(0.5)
        self.common.click_mids()
        self.query.click_counterfeit()
        time.sleep(0.5)
        self.create_obj.input_pay_id(pay_id)
        self.create_obj.input_uo_time()
        self.create_obj.select_reason(reason)
        self.common.click_submit()
Esempio n. 2
0
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()
Esempio n. 3
0
class Action(object):
    def __init__(self, driver):
        self.query = Tra.Query(driver)
        self.assign = Tra.Assign(driver)
        self.common = Common(driver)
        self.driver = driver

    def get_account(self):
        log.info("获取账户号")
        Home(self.driver).merchant_info()
        time.sleep(0.5)
        self.common.click_query()
        return self.common.get_table_val("1", "账户")

    def query_account(self, account):
        Home(self.driver).merchant_info()
        time.sleep(0.5)
        self.query.input_mer_no(account)
        self.common.click_query()
        res = self.common.get_table_val("1", "状态")
        if res == "正常":
            return "1"
        elif res == "未激活":
            return "0"
        log.info("获取账户状态{}".format(res))
        return ""

    def assign_roles(self, account):
        log.info("分配角色权限")
        Home(self.driver).merchant_info()
        time.sleep(0.5)
        self.query.input_mer_no(account)
        self.common.click_query()
        self.common.click_mids()
        self.query.click_assign()
        self.assign.click_all()
        self.common.click_submit()

    def active_account(self, account):
        log.info("激活账户")
        Home(self.driver).merchant_info()
        time.sleep(0.5)
        self.query.input_mer_no(account)
        self.common.click_query()
        self.common.click_mids()
        self.query.click_active()
        self.common.click_confirm()
Esempio n. 4
0
class Action(object):
    def __init__(self, driver):
        self.query = Tra.Query(driver)
        self.review_obj = Tra.Review(driver)
        self.verify_obj = Tra.Verify(driver)
        self.common = Common(driver)
        self.driver = driver

    def query_abn_type(self, pay_id, abn_type):
        log.info("查询支付ID和异常类型:{}".format(abn_type))
        Home(self.driver).abn_query()
        self.query.input_pay_id(pay_id)
        self.query.select_abn_type(abn_type)
        self.common.click_query()

    def get_query_result(self, val):
        # 获取查询结果
        return self.common.get_table_val(1, val)

    def review(self):
        log.info("异常交易查询 - 审核")
        time.sleep(0.5)
        self.common.click_mids()
        self.query.click_review()
        time.sleep(0.5)
        self.review_obj.select_status("通过")
        self.common.click_submit()

    def verify(self):
        log.info("异常交易查询 - 复核")
        time.sleep(0.5)
        self.common.click_mids()
        self.query.click_verify()
        time.sleep(0.5)
        self.verify_obj.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()
class Action(object):
    def __init__(self, driver):
        self.common = Common(driver)
        self.query = Tra.Query(driver)
        self.apply = Tra.Apply(driver)
        self.driver = driver

    def apply_protest(self, pay_id, sub_type, abn_type, amount, protest):
        log.info("申请拒付")
        # 查询支付ID
        Home(self.driver).abn_apply()
        self.query.input_pay_id(pay_id)
        self.common.click_query()
        # 申请拒付
        self.common.click_mids()
        self.query.click_apply()
        self.apply.select_sub_type(sub_type)
        self.apply.select_abn_type(abn_type)
        self.apply.input_amount(amount)
        self.apply.input_arn()
        self.apply.input_repaly_time()
        self.apply.select_protest_reason(protest)
        self.common.click_submit()

    def apply_freeze(self, pay_id, sub_type, abn_type, amount):
        log.info("申请调单")
        # 查询支付ID
        Home(self.driver).abn_apply()
        self.query.input_pay_id(pay_id)
        self.common.click_query()
        # 申请调单
        self.common.click_mids()
        self.query.click_apply()
        self.apply.select_sub_type(sub_type)
        self.apply.select_abn_type(abn_type)
        self.apply.input_amount(amount)
        self.apply.input_arn()
        self.apply.input_repaly_time()
        self.apply.input_reason("autotest")
        self.common.click_submit()

    def apply_appeal_success(self, pay_id, sub_type, abn_type):
        log.info("申请申诉成功")
        # 查询支付ID
        Home(self.driver).abn_apply()
        self.query.input_pay_id(pay_id)
        self.common.click_query()
        # 申请申诉成功
        self.common.click_mids()
        self.query.click_apply()
        self.apply.select_sub_type(sub_type)
        self.apply.select_abn_type(abn_type)
        self.common.click_submit()

    def query_refund(self, pay_id, refund):
        log.info("查询支付ID和退款状态")
        Home(self.driver).abn_apply()
        self.query.input_pay_id(pay_id)
        self.query.select_draw_back(refund)
        self.common.click_query()

    def query_protest(self, pay_id, protest):
        log.info("查询支付ID和拒付状态")
        Home(self.driver).abn_apply()
        self.query.input_pay_id(pay_id)
        self.query.select_ref_pay(protest)
        self.common.click_query()

    def query_freeze(self, pay_id, freeze):
        log.info("查询支付ID和调单状态")
        Home(self.driver).abn_apply()
        self.query.input_pay_id(pay_id)
        self.query.select_freeze(freeze)
        self.common.click_query()