test_listPageOperation.py 3.47 KB
# -*- coding: utf-8 -*-

# @Time    : 2021/8/11 15:25
# @Author  : Ljq
# @File    : test_listPageOperation.py
# @Software: PyCharm

"""

"""

import json
import unittest
from commons.scripts.readConf import rC
from commons.api import zcApi as zcA
from commons.api import sjApi
from commons.basic import getLookupList as gLL
from commons import ConfigDB as CoDB
from commons.MySession import my
from commons.api import entranceFeeBillList as eFBL
import time,random

class test_listPage(unittest.TestCase):
    """进门单列表:attr进门单属性查询测试"""
    def setUp(self) -> None:
        pass

    def tearDown(self) -> None:
        pass

    @classmethod
    def setUpClass(cls) -> None:
        cls.gatewayHost = rC.returnOptionsItems("host", "gatewayHost")
        cls.jmsfHost = rC.returnOptionsItems("host", "jmsfHost")
        cls.ic = rC.returnOptionsItems("testInfo", "cardNumRe")

    @classmethod
    def tearDownClass(cls) -> None:
        pass

    def test_orderView(self):
        res = zcA.create_jmsf(host=self.gatewayHost)
        orderId = res.json()["data"]["id"]
        number = res.json()["data"]["number"]
        res = eFBL.get_orderView(host=self.jmsfHost,orderId=orderId)
        assert str(number) in res.text,"获取订单详情查询失败"

    def test_doPayCZ(self):
        plate = f"川A{random.randint(10000,99999)}"
        goods = "雪莲果"
        cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods)
        print(cre_res.json())
        number = cre_res.json()["data"]["number"]
        res_pay = eFBL.do_payOrder(attrValue=number)
        assert res_pay.json()["code"]=="200","缴费失败"
        assert res_pay.json()["message"] == "OK", "缴费失败"

    def test_doPaySJ(self):
        plate = f"川A{random.randint(10000,99999)}"
        goods = "雪莲果"
        cre_res = sjApi.create_sj(host=self.gatewayHost,plate=plate,keyword=goods)
        print(cre_res.json())
        number = cre_res.json()["data"]["number"]
        res_pay = eFBL.do_payOrder(attrValue=number)
        assert res_pay.json()["code"]=="200","缴费失败"
        assert res_pay.json()["message"] == "OK", "缴费失败"

    def test_doPaySJ(self):
        plate = f"川A{random.randint(10000,99999)}"
        goods = "雪莲果"
        cre_res = sjApi.create_sj(host=self.gatewayHost,plate=plate,keyword=goods)
        print(cre_res.json())
        number = cre_res.json()["data"]["number"]
        res_pay = eFBL.do_payOrder(attrValue=number)
        assert res_pay.json()["code"]=="200","缴费失败"
        assert res_pay.json()["message"] == "OK", "缴费失败"

    def test_freezeOrder(self):
        plate = f"川A{random.randint(10000,99999)}"
        goods = "雪莲果"
        cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods)
        print(cre_res.json())
        number = cre_res.json()["data"]["number"]
        res_pay = eFBL.do_freezeOrder(attrValue=number)
        assert res_pay.json()["code"]=="200","冻结失败"
        assert res_pay.json()["message"] == "OK", "冻结失败"

    def test_unfreezeOrder(self):
        plate = f"川A{random.randint(10000,99999)}"
        goods = "雪莲果"
        cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods)
        print(cre_res.json())
        number = cre_res.json()["data"]["number"]
        res_pay = eFBL.do_freezeOrder(attrValue=number)
        assert res_pay.json()["code"]=="200","冻结失败"
        assert res_pay.json()["message"] == "OK", "冻结失败"