test_listPage.py
2.16 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
# -*- coding: utf-8 -*-
# @Time : 2021/8/10 15:32
# @Author : Ljq
# @File : test_listPage.py
# @Software: PyCharm
"""
进门单列表查询
"""
import json
import unittest
from commons.scripts.readConf import rC
from commons.api import zcApi as zcA
from commons.MySession import my
from commons.api import entranceFeeBillList as eFBL
import time,random
class test_listPage(unittest.TestCase):
"""整车-创建整车进门单基础信息接口测试"""
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")
@classmethod
def tearDownClass(cls) -> None:
pass
def test_searchByNumber(self):
cre_res = zcA.create_jmsf(host=self.gatewayHost,carTypeName="板车",plate="川B00001",keyword="雪莲果",
userName="ty_test",transactionName="沈阳2号",newWeight=20,
depName="接车部",goodsTagName="货物标签测试",proveName="绿色蔬菜")
number = cre_res.json()["data"]["number"]
resListPage = eFBL.listPage(host=self.jmsfHost,attrValue=number)
print(resListPage.json())
assert resListPage.json()["rows"][0]["number"] == number,"按照收费单号查询失败"
assert len(resListPage.json()["rows"]) == 1,"按照收费单号查询失败"
def test_searchByNumber(self):
cre_res = zcA.create_jmsf(host=self.gatewayHost,carTypeName="板车",plate="川B00001",keyword="雪莲果",
userName="ty_test",transactionName="沈阳2号",newWeight=20,
depName="接车部",goodsTagName="货物标签测试",proveName="绿色蔬菜")
number = cre_res.json()["data"]["number"]
resListPage = eFBL.listPage(host=self.jmsfHost,attrValue=number)
print(resListPage.json())
assert resListPage.json()["rows"][0]["number"] == number,"按照收费单号查询失败"
assert len(resListPage.json()["rows"]) == 1,"按照收费单号查询失败"