test_listPageOperation.py
5.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# -*- coding: utf-8 -*-
# @Time : 2021/8/11 15:25
# @Author : Ljq
# @File : test_listPageOperation.py
# @Software: PyCharm
"""
"""
import unittest
from commons.scripts.readConf import rC
from commons.api import zcApi as zcA
from commons.api import sjApi
from commons.api.entranceFeeBillList import operationUnfreeze as eOp
from commons.api.entranceFeeBillList import entranceFeeBillList as eFBL
from commons.api.entranceFeeBillList import operationDoInvalid as oDI
from commons.api.entranceFeeBillList import operationDoCorrect as oDC
from commons.api.entranceFeeBillList import operationDoAmend as oDA
import 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(host=self.jmsfHost,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(host=self.jmsfHost,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(host=self.jmsfHost,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(host=self.jmsfHost,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"]
eFBL.do_freezeOrder(host=self.jmsfHost,attrValue=number)
res_unfreezeOrder = eOp.do_unfreezeOrder(host=self.jmsfHost,attrValue=number)
assert res_unfreezeOrder.json()["code"]=="200","解冻失败"
assert res_unfreezeOrder.json()["message"] == "OK", "解冻失败"
def test_invalidOrder(self):
plate = f"川A{random.randint(10000,99999)}"
cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate)
print(cre_res.json())
number = cre_res.json()["data"]["number"]
res_unfreezeOrder = oDI.do_invalidOrder(host=self.jmsfHost,attrValue=number)
assert res_unfreezeOrder.json()["number"]==number,"作废测试失败"
assert res_unfreezeOrder.json()["message"] == "作废成功!", "作废测试失败"
def test_correctOrder(self):
plate = f"川A{random.randint(10000,99999)}"
cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate)
print(cre_res.json())
number = cre_res.json()["data"]["number"]
res_unfreezeOrder = oDC.do_correctOrder(host=self.jmsfHost,attrValue=number)
assert res_unfreezeOrder.json()["success"]==True,"作废测试失败"
assert res_unfreezeOrder.json()["msg"] == "操作成功", "作废测试失败"
def test_amendOrder(self):
plate = f"川A{random.randint(10000,99999)}"
cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate)
print(cre_res.json())
number = cre_res.json()["data"]["number"]
res_unfreezeOrder = oDA.do_amendOrder(host=self.jmsfHost,attrValue=number)
assert res_unfreezeOrder.json()["success"]==True,"作废测试失败"
assert res_unfreezeOrder.json()["message"] == "操作成功", "作废测试失败"