Commit fcf11dfd3935f3c74e9395011313ed8d255f2f01

Authored by liujiqiang
2 parents 45e5d14d 00763ae1

Merge remote-tracking branch 'origin/master' into master

# Conflicts:
#	testcase/sy/test_ZC/demo_b.py
Showing 60 changed files with 657 additions and 187 deletions
commons/MySession.py
1 1 #!/usr/bin/python
2 2 # -*- coding: UTF-8 -*-
3 3 import requests
  4 +import re
4 5 from commons import common as com
5 6 from commons.Logging import log
6 7 from commons.clientSession import cliSession
... ... @@ -36,9 +37,10 @@ class mysession(requests.Session):
36 37 body = "userName=sg_wenze&password=111111"
37 38 body_client= {"userName":"sg_wenze","password":"111111"}
38 39  
39   - def __init__(self):
  40 + def __init__(self,host=None):
40 41 "如下代码,可以通过配置文件来控制测试环境和灰度环境,http和https"
41 42 super().__init__()
  43 + self.user={}
42 44 self.url = mysession.url.replace("http://test.", com.get_global_config("global_data", "environment", "en"))
43 45 self.header = mysession.header
44 46 self.body = mysession.body
... ... @@ -55,36 +57,50 @@ class mysession(requests.Session):
55 57 self.allow_redirects = False
56 58 self.firmid={"group":"1","hd":"2","cd":"3","qqhe":"4","mdj":"5","gy":"6","cc":"7","sg":"8","sy":"9"}
57 59 self.market={"sy":"沈阳","heb":"哈尔滨","sg":"寿光","gy":"贵阳","cc":"长春","hs":"杭水","hg":"杭果"}
58   - self.user={}
  60 + self.host= None if host==None else eval(com.get_global_config("global_data", "host_ip", host))
  61 +
59 62  
60 63 def cliLogin(self,user="sy_userName_01"):
61 64 self.webHeaders, self.clientHeaders, self.userInfo = cliSession().loginUser(user=user)
62 65 return self
63 66  
64   - def get_session(self, account, **kwargs):
65   - "如下代码,可以通过配置文件来控制登录的账户session"
66   - self.body = self.body.replace("sg_wenze",
67   - com.get_global_config("global_data", "account", account).split("&")[0])
68   - self.body = self.body.replace("111111",
69   - com.get_global_config("global_data", "account", account).split("&")[1])
70   - self.se = requests.session()
71   - co = requests.cookies.RequestsCookieJar()
72   - #加入UAP_firmId属性
73   - firm=account.split("_")[0]
74   - co.set("UAP_firmId", self.firmid[firm])
75   - self.se.cookies.update(co)
76   - # 进行登录请求
77   - re = self.se.post(url=self.url, headers=self.header, data=self.body, proxies=self.proxies, **kwargs)
78   - self.UAP_accessToken=self.se.cookies["UAP_accessToken"]
79   - self.UAP_refreshToken=self.se.cookies["UAP_refreshToken"]
80   - return self.se
  67 + # def get_session(self, account, **kwargs):
  68 + # "如下代码,可以通过配置文件来控制登录的账户session"
  69 + # self.body = self.body.replace("sg_wenze",
  70 + # com.get_global_config("global_data", "account", account).split("&")[0])
  71 + # self.body = self.body.replace("111111",
  72 + # com.get_global_config("global_data", "account", account).split("&")[1])
  73 + # self.se = requests.session()
  74 + # co = requests.cookies.RequestsCookieJar()
  75 + # #加入UAP_firmId属性
  76 + # firm=account.split("_")[0]
  77 + # co.set("UAP_firmId", self.firmid[firm])
  78 + # self.se.cookies.update(co)
  79 + # # 进行登录请求
  80 + # re = self.se.post(url=self.url, headers=self.header, data=self.body, proxies=self.proxies, **kwargs)
  81 + # self.UAP_accessToken=self.se.cookies["UAP_accessToken"]
  82 + # self.UAP_refreshToken=self.se.cookies["UAP_refreshToken"]
  83 + # return self.se
  84 + #
  85 + # def get_login_info(self, account, **kwargs):
  86 + # "用于获取用户信息"
  87 + # self.body_client.update({"userName":com.get_global_config("global_data", "account", account).split("&")[0]})
  88 + # self.body_client.update({"password":pwdCry(com.get_global_config("global_data", "account", account).split("&")[1])})
  89 + # tmp = requests.post(url=self.url_client, headers=self.header_client, json=self.body_client, proxies=self.proxies, **kwargs)
  90 + # return tmp
81 91  
82   - def get_login_info(self, account, **kwargs):
83   - "用于获取用户信息"
84   - self.body_client.update({"userName":com.get_global_config("global_data", "account", account).split("&")[0]})
85   - self.body_client.update({"password":pwdCry(com.get_global_config("global_data", "account", account).split("&")[1])})
86   - tmp = requests.post(url=self.url_client, headers=self.header_client, json=self.body_client, proxies=self.proxies, **kwargs)
87   - return tmp
  92 + def url_pro(self, url, host):
  93 + # url = url.replace(" ", "")
  94 + if host!=None:
  95 + if "http:" in url:
  96 + d1=re.match(r"http://(.+?)/", url).group(1)
  97 + d2 = d1.split(":")[0]
  98 + url = re.sub(r"http://(.+?)/", r"http://" + host[d2] + "/", url)
  99 + elif "https:" in url:
  100 + d1=re.match(r"https://(.+?)/", url).group(1)
  101 + d2 = d1.split(":")[0]
  102 + url = re.sub(r"https://(.+?)/", r"https://" + host[d2] + "/", url)
  103 + return url,d1
88 104  
89 105 def get_session_client(self, account, **kwargs):
90 106 "get_session和get_session_client的方法只能用一个"
... ... @@ -151,6 +167,18 @@ class mysession(requests.Session):
151 167 """
152 168 # 记录日志
153 169 log.info("{0:=^86}".format(''))
  170 + log.info(url)
  171 + #处理url
  172 + url,host=self.url_pro(url,self.host)
  173 + #处理header
  174 + if "UAP_accessToken" in kwargs["headers"].keys():
  175 + kwargs["headers"]["UAP_accessToken"] = self.re.json()["data"]["accessToken"]
  176 + elif "UAP_refreshToken" in kwargs["headers"].keys():
  177 + kwargs["headers"]["UAP_refreshToken"] = self.re.json()["data"]["refreshToken"]
  178 + elif "UAP_firmId" in kwargs["headers"].keys():
  179 + kwargs["headers"]["UAP_firmId"] = self.re.json()["data"]["user"]["firmId"]
  180 + elif "Host" in kwargs["headers"].keys():
  181 + kwargs["headers"]["Host"]=host
154 182 log.info("{}\n{}\n".format(url, kwargs))
155 183 # 进行请求
156 184 re = super().request(method , url, **kwargs,timeout=self.timeout)
... ... @@ -262,15 +290,15 @@ class mysession(requests.Session):
262 290  
263 291 my = mysession()
264 292 my.set_mark()
265   -
266 293 # 沈阳客户端session
267 294 sessionSy = mysession().cliLogin("sy_userName_01")
268 295 # 哈尔滨客户端session
269 296 sessionHeb = mysession().cliLogin("hd_userName_01")
270   -# print(sessionSy.userInfo)
271   -# print(sessionHeb.userInfo)
272   -
273   -sy1=mysession().get_session_client("sy_user01")
274   -heb=mysession().get_session_client("heb_user01")
275   -# sg=mysession().get_session_client("sg_user01")
276   -
  297 +#获取对应市场session
  298 +sy1=mysession("host1").get_session_client("sy_user01")
  299 +heb=mysession("host1").get_session_client("heb_user01")
  300 +hg=mysession("host2").get_session_client("hg_user01")
  301 +# 检测登录接口
  302 +sy1.check_login("sy_user01")
  303 +# 检测登录接口
  304 +hg.check_login("hg_user01")
277 305 \ No newline at end of file
... ...
commons/api/entranceFeeBillList/operationDoAmend.py
... ... @@ -9,7 +9,7 @@
9 9  
10 10 """
11 11  
12   -import json,time,random,re
  12 +import json,time, re
13 13 from commons.scripts import dealContentType as dct
14 14 from commons.scripts import jsonToUrlcode
15 15 from commons.api.entranceFeeBillList import entranceFeeBillList as eFBL
... ...
commons/api/entranceFeeBillList/operationDoFreeze.py
... ... @@ -9,7 +9,7 @@
9 9  
10 10 """
11 11  
12   -import json,time,random,re
  12 +import json,time, re
13 13 from commons.scripts import dealContentType as dct
14 14 from commons.scripts import jsonToUrlcode
15 15 from commons.api.entranceFeeBillList import entranceFeeBillList as eFBL
... ...
commons/api/entranceFeeBillList/operationDoInvalid.py
... ... @@ -9,10 +9,9 @@
9 9  
10 10 """
11 11  
12   -import json,time,random,re
  12 +import json,time, re
13 13 from commons.scripts import dealContentType as dct
14 14 from commons.scripts import jsonToUrlcode
15   -from commons.MySession import my
16 15 from commons.api.entranceFeeBillList import entranceFeeBillList as eFBL
17 16 from bs4 import BeautifulSoup
18 17 import urllib.parse
... ...
commons/api/entranceFeeBillList/operationDoUndo.py
... ... @@ -9,10 +9,9 @@
9 9  
10 10 """
11 11  
12   -import json,time,random,re
  12 +import json, re
13 13 from commons.scripts import dealContentType as dct
14 14 from commons.scripts import jsonToUrlcode
15   -from commons.MySession import my
16 15 from commons.api.entranceFeeBillList import entranceFeeBillList as eFBL
17 16 from bs4 import BeautifulSoup
18 17 import urllib.parse
... ...
commons/api/entranceFeeBillList/operationDoUpdate.py
... ... @@ -9,7 +9,7 @@
9 9  
10 10 """
11 11  
12   -import json,time,random,re
  12 +import json,time, re
13 13 from commons.scripts import dealContentType as dct
14 14 from commons.scripts import jsonToUrlcode
15 15 # from commons.MySession import my
... ...
commons/api/entranceFeeBillList/operationUnfreeze.py
... ... @@ -9,10 +9,9 @@
9 9 进门单操作
10 10 """
11 11  
12   -import json,time,random,re
  12 +import json,time, re
13 13 from commons.scripts import dealContentType as dct
14 14 from commons.scripts import jsonToUrlcode
15   -from commons.MySession import my
16 15 from commons.api.entranceFeeBillList import entranceFeeBillList as eFBL
17 16 from bs4 import BeautifulSoup
18 17 import urllib.parse
... ...
commons/api/entranceFeeBill_details.py
... ... @@ -2,7 +2,7 @@
2 2 # -*- coding: UTF-8 -*-
3 3 import urllib3
4 4 from commons import common as com
5   -from commons.MySession import sy1,heb
  5 +from commons.MySession import sy1
6 6 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
7 7  
8 8  
... ... @@ -16,6 +16,7 @@ class entranceFeeBill_details():
16 16 "User-Agent": "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36",
17 17 "Content-Type": "application/json",
18 18 "Accept-Language": "zh-CN,zh;q=0.9",
  19 + "Host": "test.jmsf.diligrp.com:8385",
19 20 "Accept-Encoding": "gzip, deflate"}
20 21 url_tail = """?rows=10&page=1
21 22 &metadata[charge_total_amount]={"provider":"moneyProvider","index":10,"field":"charge_total_amount"}
... ... @@ -38,8 +39,8 @@ class entranceFeeBill_details():
38 39 &backSkinStatus=-1
39 40 &tag=20
40 41 &companyId=9
41   - &startTime=2020-08-11 00:00:00&endTime=2025-08-13 00:00:00
42   - &startPayTime=2020-08-11 00:00:00&endPayTime=2025-08-13 00:00:00
  42 + &startTime=2020-08-01 00:00:00&endTime=2025-08-30 00:00:00
  43 + &startPayTime=2020-08-01 00:00:00&endPayTime=2025-08-30 00:00:00
43 44 &attr=number&attrValue=202108120900001"""
44 45  
45 46 def __init__(self):
... ... @@ -76,5 +77,5 @@ class entranceFeeBill_details():
76 77 return self.sql
77 78  
78 79 # tt=entranceFeeBill_details()
79   -# re=sy1.get(url=tt.url,headers=tt.header)
  80 +# re=sy1.get(url=tt.url,headers=tt.header,proxies=sy1.myproxies)
80 81 # print(str(re.json()).replace(" ",""))
81 82 \ No newline at end of file
... ...
commons/api/entranceFeeBill_provesPage.py
... ... @@ -17,6 +17,7 @@ class entranceFeeBill_provesPage():
17 17 "User-Agent": "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36",
18 18 "Content-Type": "application/x-www-form-urlencoded",
19 19 "Accept-Language": "zh-CN,zh;q=0.9",
  20 + "Host": "test.jmsf.diligrp.com:8385",
20 21 "Accept-Encoding": "gzip, deflate"}
21 22 body = """rows=10&page=1&sort=et.created&order=desc
22 23 &metadata[actualPrice]={"provider":"moneyProvider","index":10,"field":"actualPrice"}
... ...
commons/api/hg/__init__.py 0 → 100644
commons/api/hg/jmsf/__init__.py 0 → 100644
commons/api/hg/jmsf/registerRecord_save.py 0 → 100644
  1 +#!/usr/bin/python
  2 +# -*- coding: UTF-8 -*-
  3 +import urllib3
  4 +from commons import common as com
  5 +from commons.MySession import hg
  6 +urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
  7 +
  8 +
  9 +class registerRecord_save():
  10 + "录入批次号"
  11 +
  12 + def __init__(self):
  13 + self.url = "http://test.gateway.diligrp.com:8285/hg-trading/api/registerRecord/save"
  14 + self.header = {
  15 + "UAP_accessToken" :"demo",
  16 + "UAP_refreshToken" :"demo",
  17 + "UAP_firmId" :"15",
  18 + "Content-Type" :"application/json",
  19 + "Host" :"test.gateway.diligrp.com:8285"}
  20 + self.body = {
  21 + "accountId": 107792,
  22 + "cardNo": "888810026785",
  23 + "customerId": 141992,
  24 + "customerCode": "00131694",
  25 + "customerName": "特朗普vip",
  26 + "fixedphoneNumber": None,
  27 + "mobilephoneNumber": "16111111112",
  28 + "identityCardAddress": "",
  29 + "identityCardNo": "110101198001012390",
  30 + "identityCardType": "ID",
  31 + "registerDetailDtoList": [{
  32 + "id": 0,
  33 + "areaId": 274,
  34 + "areaName": "东区01",
  35 + "quantity": 10,
  36 + "productId": 374690,
  37 + "registerRecordId": 0,
  38 + "remark": None,
  39 + "weight": 10,
  40 + "weightType": 0,
  41 + "created": None,
  42 + "createdById": 0,
  43 + "createdByName": None,
  44 + "createdByDepartmentId": 0,
  45 + "createdByDepartmentName": None,
  46 + "registerCertificateList": None,
  47 + "product": None,
  48 + "registerCertificateDtoList": None,
  49 + "productDto": {
  50 + "id": 0,
  51 + "originId": 510100,
  52 + "originName": "成都市",
  53 + "pieceWeight": 1,
  54 + "categoryId": 374690,
  55 + "categoryCode": "374690",
  56 + "categoryName": "苹果",
  57 + "created": None
  58 + }
  59 + }],
  60 + "registerFeeDtoList": [],
  61 + "tradePassword": "" }
  62 +
  63 +
  64 +
  65 +
  66 +tt=registerRecord_save()
  67 +re=hg.post(url=tt.url,headers=tt.header,json=tt.body,proxies=hg.myproxies)
  68 +print(str(re.json()))
0 69 \ No newline at end of file
... ...
commons/api/hpApi.py
... ... @@ -11,9 +11,7 @@
11 11  
12 12 import json,time,random
13 13 from commons.scripts import dealContentType as dct
14   -from commons.MySession import my
15 14 from commons.api import zcApi
16   -from commons.api import entranceFeeBillList as eFBL
17 15  
18 16 host = "http://test.gateway.diligrp.com:8285"
19 17  
... ... @@ -55,7 +53,7 @@ def do_backSkinWeighSave(session=None,host="",number=None,userName=None):
55 53 tareWeightDate=time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
56 54  
57 55 # 获取接车员信息
58   - listByExample = zcApi.get_listByExample(session=session,host=host)
  56 + listByExample = zcApi.get_listByExample(session=session, host=host)
59 57 print(listByExample.json())
60 58 if userName == None:
61 59 listByExampleIndex = 0
... ...
commons/api/sjApi.py
... ... @@ -9,11 +9,9 @@
9 9 散件
10 10 """
11 11  
12   -import json,time,random
  12 +import json
13 13 from commons.scripts import dealContentType as dct
14   -from commons.MySession import my
15 14 from commons.api import zcApi
16   -from commons.api import entranceFeeBillList as eFBL
17 15 from commons.basic import getLookupList as gLL
18 16  
19 17  
... ... @@ -106,7 +104,7 @@ def create_sj(session=None,host=None,carTypeName=None,keyword="蔬菜",userName=
106 104  
107 105 # 获取车型
108 106 if "车型" in templateAttr_list:
109   - carType = zcApi.get_carType(session=session,host=host)
  107 + carType = zcApi.get_carType(session=session, host=host)
110 108 print(carType.text)
111 109 if carTypeName == None:
112 110 carTypeIndex = 0
... ... @@ -126,7 +124,7 @@ def create_sj(session=None,host=None,carTypeName=None,keyword="蔬菜",userName=
126 124  
127 125 # 获取商品
128 126 if "商品" in templateAttr_list or "商品(末级)" in templateAttr_list:
129   - categoryByCondition = zcApi.get_listCategoryByCondition(session=session,host=host, keyword=keyword)
  127 + categoryByCondition = zcApi.get_listCategoryByCondition(session=session, host=host, keyword=keyword)
130 128 cateId = categoryByCondition.json()["data"][0]["id"]
131 129 productId = categoryByCondition.json()["data"][0]["id"]
132 130 productName = categoryByCondition.json()["data"][0]["name"]
... ... @@ -152,7 +150,7 @@ def create_sj(session=None,host=None,carTypeName=None,keyword="蔬菜",userName=
152 150 # print(firmCode)
153 151 # print(departmentId)
154 152 # print("==========1============")
155   - listByExample = zcApi.get_listByExample(session=session,host=host,firmCode=firmCode,departmentId=departmentId)
  153 + listByExample = zcApi.get_listByExample(session=session, host=host, firmCode=firmCode, departmentId=departmentId)
156 154 print("listByExample",listByExample.json())
157 155 if userName == None:
158 156 listByExampleIndex = 0
... ... @@ -181,7 +179,7 @@ def create_sj(session=None,host=None,carTypeName=None,keyword="蔬菜",userName=
181 179  
182 180 # 获取交易类型
183 181 if "交易类型" in templateAttr_list:
184   - transactionType = zcApi.query_transactionType(session=session,host=host)
  182 + transactionType = zcApi.query_transactionType(session=session, host=host)
185 183 print(transactionType.json())
186 184 print("交易类型")
187 185 if transactionName == None:
... ... @@ -199,7 +197,7 @@ def create_sj(session=None,host=None,carTypeName=None,keyword="蔬菜",userName=
199 197  
200 198 # 获取货物标签
201 199 if "货物标签" in templateAttr_list:
202   - goodsTag = zcApi.get_goodsTag(session=session,host=host)
  200 + goodsTag = zcApi.get_goodsTag(session=session, host=host)
203 201 print(goodsTag.json())
204 202 if goodsTagName == None:
205 203 transactionTypeIndex = 0
... ... @@ -212,7 +210,7 @@ def create_sj(session=None,host=None,carTypeName=None,keyword="蔬菜",userName=
212 210  
213 211 # 产地信息获取
214 212 if "产地" in templateAttr_list:
215   - address = zcApi.get_address(session=session,host=host)
  213 + address = zcApi.get_address(session=session, host=host)
216 214 print(address.json())
217 215 originId = address.json()["data"][0]["id"]
218 216 origin = address.json()["data"][0]["name"]
... ... @@ -225,7 +223,7 @@ def create_sj(session=None,host=None,carTypeName=None,keyword="蔬菜",userName=
225 223 # 查询部门信息
226 224 # 查询部门信息
227 225 if "接车部门" in templateAttr_list or "收费部门" in templateAttr_list:
228   - depRes = zcApi.get_dep(session=session,host=host)
  226 + depRes = zcApi.get_dep(session=session, host=host)
229 227 print(depRes.json())
230 228 if depName == None:
231 229 depResIndex = 0
... ... @@ -240,7 +238,7 @@ def create_sj(session=None,host=None,carTypeName=None,keyword="蔬菜",userName=
240 238  
241 239 # 获取证明类型
242 240 if "证明类型" in templateAttr_list:
243   - proveType = zcApi.get_proveType(session=session,host=host)
  241 + proveType = zcApi.get_proveType(session=session, host=host)
244 242 print(proveType.json())
245 243 # print("proveName",proveName)
246 244 if proveName == None:
... ... @@ -257,7 +255,7 @@ def create_sj(session=None,host=None,carTypeName=None,keyword="蔬菜",userName=
257 255 print("proveTypeName", proveTypeName)
258 256  
259 257 # 获取防重token
260   - duplicateTokenRes = zcApi.get_duplicateToken(session=session,host=host)
  258 + duplicateTokenRes = zcApi.get_duplicateToken(session=session, host=host)
261 259 print(duplicateTokenRes.json())
262 260 duplicateToken = duplicateTokenRes.json()["data"]
263 261  
... ...
commons/api/weightBizBill_doRefund.py
... ... @@ -16,6 +16,7 @@ class weightBizBill_doRefund():
16 16 "User-Agent": "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36",
17 17 "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
18 18 "Accept-Language": "zh-CN,zh;q=0.9",
  19 + "Host": "test.jmsf.diligrp.com:8385",
19 20 "Accept-Encoding": "gzip, deflate"}
20 21 body = "id=206&reason=退款原因_test_123"
21 22  
... ...
commons/api/weightBizBill_listPage.py
... ... @@ -16,6 +16,7 @@ class weightBizBill_listPage():
16 16 "User-Agent": "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36",
17 17 "Content-Type": "application/x-www-form-urlencoded",
18 18 "Accept-Language": "zh-CN,zh;q=0.9",
  19 + "Host": "test.jmsf.diligrp.com:8385",
19 20 "Accept-Encoding": "gzip, deflate"}
20 21 body = '''rows=10&page=1&sort=id&order=desc&metadata[fee]={"provider":"moneyProvider","index":10,"field":
21 22 "fee"}&metadata[created]={"provider":"datetimeProvider","index":20,"field":
... ...
config/global_data.conf
... ... @@ -14,6 +14,7 @@ sy_user02=sygangda&111111
14 14 heb_user01=哈尔滨田太子&a123456
15 15 heb_user02=sy_wenze&111111
16 16 sg_user01=sg_wenze&111111
  17 +hg_user01=111222&111111
17 18  
18 19 [userId]
19 20 #冗余配置字段,可不配置
... ... @@ -24,7 +25,7 @@ user03=256
24 25 [email]
25 26 #为空时[]不发邮件,若要发邮件,参考demo
26 27 to_list=["tianlichang@diligrp.com","liaokaihua@diligrp.com"]
27   -cc_list=["lixi@diligrp.com","liujiqiang@diligrp.com","wenleiming@diligrp.com"]
  28 +cc_list=["yangfei@diligrp.com","lixi@diligrp.com","liujiqiang@diligrp.com","wenleiming@diligrp.com"]
28 29 demo=["lixi@diligrp.com","liujiqiang@diligrp.com","wenleiming@diligrp.com","tg@diligrp.com"]
29 30  
30 31 [mark]
... ... @@ -34,7 +35,7 @@ demo=["heb1","P3","v1.6","沈阳",None]
34 35  
35 36  
36 37 [environment]
37   -#格式只能为一下几种
  38 +#格式只能为一下几种,用于区分环境
38 39 #http://test.
39 40 #https://test.
40 41 #http://
... ... @@ -56,8 +57,54 @@ gateway=test.gateway.diligrp.com:8285
56 57  
57 58  
58 59  
59   -
60   -
61   -
62   -
  60 +[host_ip]
  61 +#重构host
  62 +host1={
  63 + "test.customer.diligrp.com": "10.35.100.45:8382",
  64 + "test.bd.diligrp.com": "10.35.100.45:8384",
  65 + "test.jmsf.diligrp.com": "10.35.100.44:8385",
  66 + "test.account.diligrp.com": "10.35.100.44:8186",
  67 + "test.card.diligrp.com": "10.35.100.44:8386",
  68 + "test.trading.diligrp.com": "10.35.100.47:8387",
  69 + "test.logger.diligrp.com": "10.35.100.47:8283",
  70 + "test.orders.diligrp.com": "10.35.100.47:8185",
  71 + "test.rule.diligrp.com": "10.35.100.54:8284",
  72 + "test.gateway.diligrp.com": "10.35.100.54:8285",
  73 + "test.message.diligrp.com": "10.35.100.54:8289",
  74 + "test.dfs.diligrp.com": "10.35.100.55:9527",
  75 + "test.report.diligrp.com": "10.35.100.56:8388",
  76 + "test.exporter.diligrp.com": "10.35.100.56:8288",
  77 + "test.appmanager.diligrp.com": "10.35.100.56:9000",
  78 + "test.uid.diligrp.com": "10.35.100.56:8282",
  79 + "test.nacos.diligrp.com": "10.35.100.37:8848",
  80 + "test.scheduler.diligrp.com": "10.35.100.47:8281",
  81 + "test.bpmc.diligrp.com": "10.35.100.54:8617",
  82 + "test.route.diligrp.com": "10.35.100.54:8286",
  83 + "test.uap.diligrp.com": "10.35.100.55:80",
  84 + "test.trace.diligrp.com": "10.35.100.55:8082",
  85 + "test.xorder.diligrp.com": "10.35.100.56:8090"}
  86 +
  87 +#杭果host
  88 +host2={
  89 + "test.uap.diligrp.com": "10.28.12.150:80",
  90 + "test.bpmc.diligrp.com": "10.28.12.150:8617",
  91 + "test.as.diligrp.com": "10.28.12.150",
  92 + "test.logger.diligrp.com": "10.28.11.149:8283",
  93 + "test.scheduler.diligrp.com": "10.28.11.149",
  94 + "test.account.diligrp.com": "10.28.11.149:8186",
  95 + "test.rule.diligrp.com": "10.28.10.127:8284",
  96 + "test.bd.diligrp.com": "10.28.10.127",
  97 + "test.customer.diligrp.com": "10.28.10.127:8384",
  98 + "test.report.diligrp.com": "10.28.10.127:8388",
  99 + "test.jmsf.diligrp.com": "10.28.10.127:8385",
  100 + "test.uid.diligrp.com": "10.28.11.180:8282",
  101 + "test.message.diligrp.com": "10.28.11.190:8289",
  102 + "test.dfs.diligrp.com": "10.28.11.190:9527",
  103 + "test.gateway.diligrp.com": "10.28.10.159:8285",
  104 + "test.route.diligrp.com": "10.28.10.159:8286",
  105 + "test.card.diligrp.com": "10.28.10.159:8386",
  106 + "test.exporter.diligrp.com": "10.28.11.183",
  107 + "test.ia.diligrp.com": "10.28.11.183",
  108 + "test.settlement.diligrp.com": "10.28.11.183:8383",
  109 + "test.hg.diligrp.com": "10.28.12.239"}
63 110  
... ...
... ... @@ -76,9 +76,7 @@ def Send_email(filename):
76 76 if __name__ == "__main__":
77 77 #检测数据库
78 78 db.mysql_conn_test()
79   - #检测登录接口
80   - my.check_login("sy_user01")
81 79 #创建测试套,运行测试用例,生成报告
82 80 report=Run_Testcase(Create_Testcase_suite())
83 81 #发送邮件
84 82 - Send_email(report)
  83 + Send_email(report)
85 84 \ No newline at end of file
... ...
testcase/heb/CZFW/test_weightBizBill_doRefund.py
... ... @@ -2,7 +2,6 @@
2 2 # -*- coding: UTF-8 -*-
3 3 import unittest
4 4 import urllib3
5   -from commons import common as com
6 5 from commons import ConfigDB as db
7 6 from commons.MySession import my,heb
8 7 from commons.api.weightBizBill_doRefund import weightBizBill_doRefund
... ...
testcase/heb/CZFW/test_weightBizBill_listPage.py
... ... @@ -3,7 +3,6 @@
3 3 import unittest
4 4 import urllib3
5 5 import time
6   -from commons import common as com
7 6 from commons.MySession import my,heb
8 7 from commons.api.weightBizBill_listPage import weightBizBill_listPage
9 8 from commons.api.weighingServiceSave import weighingServiceSave
... ...
testcase/heb/FeedbackCustomerController/test_fc_add.py
1 1 import unittest
2 2 import urllib3
3   -from commons.MySession import my,heb
  3 +from commons.MySession import heb
4 4 from commons.api.fc_add import fc_add
5 5 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
6 6 from commons.Faker import random_data
... ...
testcase/heb/FeedbackCustomerController/test_fc_edit.py
1 1 import unittest
2 2 import urllib3
3   -from commons.MySession import my,heb
  3 +from commons.MySession import heb
4 4 from commons.api.fc_edit import fc_edit
5 5 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
6 6 from commons.Faker import random_data
... ...
testcase/heb/FeedbackCustomerController/test_fc_view.py
1 1 import unittest
2 2 import urllib3
3 3 import commons.ConfigDB as db
4   -from commons.MySession import my,heb
  4 +from commons.MySession import heb
5 5 from commons.api.fc_view import fc_view
6 6 from commons.api.fc_add import fc_add
7 7 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
... ...
testcase/heb/FeedbackCustomerController/test_feedback_customer_disable.py
1 1 import unittest
2 2 import urllib3
3   -from commons.MySession import my,heb
  3 +from commons.MySession import heb
4 4 from commons.api.feedback_customer_disable import feedback_customer_disable
5 5 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
6 6 fcd = feedback_customer_disable()
... ...
testcase/heb/FeedbackCustomerController/test_feedback_customer_enable.py 0 → 100644
  1 +import unittest
  2 +import urllib3
  3 +from commons.MySession import heb
  4 +from commons.api.feedback_customer_enable import feedback_customer_enable
  5 +from commons.api.feedback_customer_disable import feedback_customer_disable
  6 +urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
  7 +fce = feedback_customer_enable()
  8 +fcd = feedback_customer_disable
  9 +import commons.ConfigDB as db
  10 +
  11 +"""
  12 +进门收费——返点管理——返还人管理——启用返还人
  13 +"""
  14 +@unittest.skip
  15 +class test_feedback_customer_enable(unittest.TestCase):
  16 + "哈尔滨——返还人管理——返还人启用"
  17 + @classmethod
  18 + def setUpClass(cls):
  19 + pass
  20 +
  21 + def setUp(self):
  22 + self.ids = db.mysql_selectOne('''
  23 + SELECT id FROM `dili_jmsf`.`feedback_customer` WHERE `status` = '2' and
  24 + market_id='''+str(heb.user["heb_user01"]["firmId"])+''' ORDER BY `id` DESC LIMIT 1''')[0]
  25 + print(self.ids)
  26 + def test_feedback_customer_enable_01(self):
  27 + "返还人启用"
  28 + url = fce.url.replace("49",str(self.ids))
  29 + re = heb.post(url = url, headers = fce.header)
  30 + # print(fce.url)
  31 + # print(re.headers)
  32 + # print(re.json())
  33 + self.assertTrue("操作成功" in str(re.json()))
  34 + @classmethod
  35 + def tearDownClass(cls):
  36 + pass
  37 +
  38 +
  39 +if __name__ == '__main__':
  40 + unittest.main()
... ...
testcase/heb/FeedbackCustomerController/test_feedback_customer_query.py 0 → 100644
  1 +import unittest
  2 +import urllib3
  3 +from commons.MySession import heb
  4 +from commons.api.feedback_customer_query import feedback_customer_query
  5 +urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
  6 +import datetime
  7 +import commons.ConfigDB as db
  8 +fcq = feedback_customer_query()
  9 +
  10 +"""
  11 +进门收费——返点管理——返还人管理——返还人列表查询
  12 +"""
  13 +@unittest.skip
  14 +class test_feedback_customer_query(unittest.TestCase):
  15 + "哈尔滨——返还人管理——返还人列表查询"
  16 + @classmethod
  17 + def setUpClass(cls):
  18 + pass
  19 + def setUp(self):
  20 + self.name1 = db.mysql_selectOne('''SELECT name FROM `dili_jmsf`.`feedback_customer`
  21 + WHERE market_id = ''' + str(heb.user["heb_user01"]["firmId"]) + ''' ORDER BY `id` DESC LIMIT 1''')[0]
  22 + def test_feedback_customer_query_01(self):
  23 + "返还人列表查询"
  24 + print(fcq.url)
  25 + body = fcq.body\
  26 + .replace("潘婷婷", str(self.name1))\
  27 + .replace("2021-08-11 00:00:00",(datetime.datetime.now() - datetime.timedelta(days = 30)).strftime("%Y-%m-%d %H:%M:%S")).\
  28 + replace("2021-08-11 23:59:59",datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
  29 + # print(body)
  30 + re = heb.post(url = fcq.url, data = body.replace("\n","").encode('utf-8'),headers = fcq.header)
  31 + # print(re.headers)
  32 + # print(re.text)
  33 + # print("士大夫十",str(self.name1))
  34 + self.assertTrue(str(self.name1) in str(re.text))
  35 +
  36 + @classmethod
  37 + def tearDownClass(cls):
  38 + pass
  39 +
  40 +
  41 +if __name__ == '__main__':
  42 + unittest.main()
... ...
testcase/heb/FeedbackOrderController/test_feedback_order_settlement.py 0 → 100644
  1 +import unittest
  2 +import urllib3
  3 +from commons.MySession import heb
  4 +from commons.api.feedback_order_settlement import feedback_order_settlement
  5 +urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
  6 +from commons.api.feedback_order_settlement_query import feedback_order_settlement_query
  7 +fosq = feedback_order_settlement_query()
  8 +import datetime
  9 +fos = feedback_order_settlement()
  10 +
  11 +"""
  12 +进门收费——返点管理——结账管理——选择需要返点的订单进行结账
  13 +"""
  14 +@unittest.skip
  15 +class test_feedback_order_settlement(unittest.TestCase):
  16 + "哈尔滨——结账管理——选择需要返点的订单进行结账"
  17 + @classmethod
  18 + def setUpClass(cls):
  19 + pass
  20 +
  21 + def setUp(self):
  22 + body = fosq.body.replace("feedbackCustomerId=25", "feedbackCustomerId=16").replace("2021-07-22 00:00:00", "\
  23 + 2021-07-03 00:00:00").replace("2021-08-03 23:59:59", str(datetime.datetime.now()))
  24 + re = heb.post(url = fosq.url, data = body, headers = fosq.header)
  25 +
  26 + self.Amount = re.json()["rows"][0]["unsettledAmount"]
  27 + self.ids = re.json()["rows"][0]["id"]
  28 + self.billIds = re.json()["rows"][0]["billId"]
  29 + #查询出结账金额、结算单id和与之相关联的进门单id
  30 + url = "http://test.jmsf.diligrp.com:8385/FeedbackOrderController/settleAccount.action"
  31 + header = {
  32 + "X-Requested-With": "XMLHttpRequest",
  33 + "User-Agent": "Mozilla/5.0(WindowsNT6.2;WOW64)AppleWebKit/537.36(KHTML,likeGecko)Chrome/84.0.4147.105Safari/537.36",
  34 + "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8"
  35 + }
  36 + body = "customerId=16"
  37 + re2 = heb.post(url = url,headers = header,data = body)
  38 + self.idd = re2.json()["id"]
  39 + self.name = re2.json()["name"]
  40 + self.cardNumber = re2.json()["cardNumber"]
  41 + #查询出结账单的id、name、cardnumber
  42 +
  43 + def test_feedback_order_settlement_01(self):
  44 + "选择需要返点的订单进行结账."
  45 + body = fos.body.replace("id=25","id="+str(self.idd)).\
  46 + replace("888810057654",str(self.cardNumber)).\
  47 + replace("settleAmount=2","settleAmount="+str(self.Amount)).\
  48 + replace("ids=12034","ids="+str(self.ids)).\
  49 + replace("feedbackCustomerId=25","feedbackCustomerId="+str(self.idd)).\
  50 + replace("feedbackCustomerName=验证员工推送到CRM","feedbackCustomerName="+str(self.name)).\
  51 + replace("billIds=3621","billIds="+str(self.billIds)).\
  52 + replace("settledAmounts=2","settledAmounts="+str(self.Amount))
  53 + # print(body)
  54 + re = heb.post(url = fos.url, headers = fos.header, data = body.encode('utf-8'))
  55 + # print(re.headers)
  56 +
  57 + # print(re.json())
  58 + self.assertTrue("操作成功" in str(re.json()))
  59 + return re
  60 +
  61 + @classmethod
  62 + def tearDownClass(cls):
  63 + pass
  64 +
  65 +
  66 +if __name__ == '__main__':
  67 + unittest.main()
0 68 \ No newline at end of file
... ...
testcase/heb/FeedbackOrderController/test_feedback_order_settlement_query.py 0 → 100644
  1 +import unittest
  2 +import urllib3
  3 +from commons.MySession import heb
  4 +from commons.api.feedback_order_settlement_query import feedback_order_settlement_query
  5 +urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
  6 +fosq = feedback_order_settlement_query()
  7 +import commons.ConfigDB as db
  8 +import datetime
  9 +
  10 +"""
  11 +进门收费——返点管理——结账管理——根据返还人和缴费时间进行查询
  12 +"""
  13 +@unittest.skip
  14 +class test_feedback_order_settlement_query(unittest.TestCase):
  15 + "哈尔滨——结账管理列表查询——根据返还人和缴费时间进行查询"
  16 + @classmethod
  17 + def setUpClass(cls):
  18 + pass
  19 + def setUp(self):
  20 + self.ids = db.mysql_selectOne('''SELECT id FROM `dili_jmsf`.`feedback_customer` WHERE
  21 + `status` = '1' and market_id = ''' + str(heb.user["heb_user01"]["firmId"]) + '''
  22 + ORDER BY `id` DESC LIMIT 1''')[0]
  23 + def test_feedback_order_settlement_query_01(self):
  24 + "根据返还人和缴费时间进行查询"
  25 + print(fosq.url)
  26 + body = fosq.body.replace("feedbackCustomerId=25", "feedbackCustomerId="+str(self.ids)).\
  27 + replace("2021-07-22 00:00:00", (datetime.datetime.now() - datetime.timedelta(days = 30)).strftime("%Y-%m-%d %H:%M:%S")).\
  28 + replace("2021-08-03 23:59:59", datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
  29 + # print(body)
  30 + re = heb.post(url = fosq.url, data = body,headers = fosq.header)
  31 + print(re.headers)
  32 + print(re.json())
  33 + self.assertTrue("rows" in str(re.json()))
  34 +
  35 + @classmethod
  36 + def tearDownClass(cls):
  37 + pass
  38 +
  39 +
  40 +if __name__ == '__main__':
  41 + unittest.main()
... ...
testcase/heb/entranceFeeBill_detail/test_entranceFeeBill_details.py
... ... @@ -3,7 +3,6 @@
3 3 import unittest
4 4 import urllib3
5 5 from commons import ConfigDB as db
6   -from commons import common as com
7 6 from commons.MySession import my,heb
8 7 from commons.api.entranceFeeBill_details import entranceFeeBill_details
9 8 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
... ...
testcase/heb/entranceFeeBill_proves/test_entranceFeeBill_provesPage.py
... ... @@ -3,7 +3,6 @@
3 3 import unittest
4 4 import urllib3
5 5 from commons import ConfigDB as db
6   -from commons import common as com
7 6 from commons.MySession import my,heb
8 7 from commons.api.entranceFeeBill_provesPage import entranceFeeBill_provesPage
9 8 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
... ...
testcase/heb/feedbackOrderController_settlementlist/test_feedbackOrderController_settlementlist.py
1 1 import unittest
2 2 import urllib3
3   -from commons.MySession import my,heb
  3 +from commons.MySession import heb
4 4 from commons.api.feedbackOrderController_settlementlist import feedbackOrderController_settlementlist
5 5 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
6 6 import commons.ConfigDB as db
... ...
testcase/heb/test_HP/test_HP.py
... ... @@ -9,14 +9,11 @@
9 9 回皮功能接口测试
10 10 """
11 11  
12   -import json
13 12 import unittest
14 13 from commons.scripts.readConf import rC
15   -from commons.api import zcApi as zcA
16   -from commons.api.entranceFeeBillList import entranceFeeBillList as eFBL
17   -from commons.api.entranceFeeBillList import operationDoFreeze as oDF
18   -from commons.api import hpApi
19   -import time,random
  14 +from commons.api import hpApi, zcApi as zcA
  15 +from commons.api.entranceFeeBillList import operationDoFreeze as oDF, entranceFeeBillList as eFBL
  16 +import random
20 17  
21 18 from commons.MySession import sessionHeb
22 19 session = sessionHeb
... ... @@ -48,7 +45,7 @@ class test_HPCreate(unittest.TestCase):
48 45 print(cre_res.json())
49 46 number = cre_res.json()["data"]["number"]
50 47 aa = oDF.do_freezeOrder(session=session,host=self.jmsfHost,attrValue=number,ic=self.ic)
51   - res,tareWeight = hpApi.do_backSkinWeighSave(session=session,host=self.gatewayHost,number=number)
  48 + res,tareWeight = hpApi.do_backSkinWeighSave(session=session, host=self.gatewayHost, number=number)
52 49 assert res.json()["code"]=="200","回皮失败"
53 50 assert "data" in res.text,"回皮失败"
54 51  
... ... @@ -60,7 +57,7 @@ class test_HPCreate(unittest.TestCase):
60 57 print(cre_res.json())
61 58 number = cre_res.json()["data"]["number"]
62 59 aa = oDF.do_freezeOrder(session=session,host=self.jmsfHost,attrValue=number,ic=self.ic)
63   - res = hpApi.get_listBackSkinTrucks(session=session,host=self.gatewayHost,plate=plate)
  60 + res = hpApi.get_listBackSkinTrucks(session=session, host=self.gatewayHost, plate=plate)
64 61 print(res.json())
65 62 assert res.json()["code"]=="200","车号查询失败"
66 63 assert res.json()["data"][-1]["number"]==number,"车号查询失败"
... ... @@ -73,7 +70,7 @@ class test_HPCreate(unittest.TestCase):
73 70 print(cre_res.json())
74 71 number = cre_res.json()["data"]["number"]
75 72 aa = oDF.do_freezeOrder(session=session,host=self.jmsfHost,attrValue=number,ic=self.ic)
76   - res = hpApi.get_listBackSkinTrucks(session=session,host=self.gatewayHost,number=number)
  73 + res = hpApi.get_listBackSkinTrucks(session=session, host=self.gatewayHost, number=number)
77 74 print(res.json())
78 75 assert res.json()["code"]=="200","车号查询失败"
79 76 assert res.json()["data"][-1]["number"]==number,"车号查询失败"
... ... @@ -89,7 +86,7 @@ class test_HPCreate(unittest.TestCase):
89 86 print(cre_res.json())
90 87 number = cre_res.json()["data"]["number"]
91 88 aa = oDF.do_freezeOrder(session=session,host=self.jmsfHost,attrValue=number,ic=self.ic)
92   - res = hpApi.get_listBackSkinTrucks(session=session,host=self.gatewayHost,customerName=customerName)
  89 + res = hpApi.get_listBackSkinTrucks(session=session, host=self.gatewayHost, customerName=customerName)
93 90 print(res.json())
94 91 assert res.json()["code"]=="200","车号查询失败"
95 92 assert res.json()["data"][-1]["number"]==number,"车号查询失败"
96 93 \ No newline at end of file
... ...
testcase/heb/test_SJ/test_SJ.py
... ... @@ -9,13 +9,10 @@
9 9  
10 10 """
11 11  
12   -import json
13 12 import unittest
14 13 from commons.scripts.readConf import rC
15   -from commons.api import zcApi as zcA
16   -from commons.api.entranceFeeBillList import entranceFeeBillList as eFBL
17   -from commons.api import sjApi
18   -import time,random
  14 +from commons.api import sjApi, zcApi as zcA
  15 +import random
19 16 from commons.MySession import sessionHeb
20 17 session = sessionHeb
21 18  
... ... @@ -108,15 +105,15 @@ class test_SJCreate(unittest.TestCase):
108 105 weight = int(itemWeight) * int(qty)
109 106  
110 107 # 创建进门单
111   - cre_res = sjApi.create_sparePartsWeighSave(session=session,host=self.gatewayHost, duplicateToken=duplicateToken,
112   - carTypeCode=carTypeCode, carTypeId=carTypeId,
113   - carTypeName=carTypeName, plate=plate, weight=weight,
114   - productId=productId, productName=productName, proveTypeCode=proveTypeCode,
115   - proveTypeName=proveTypeName, trailerNumber=trailerNumber,
116   - depName=feeDepName,
117   - cateId=cateId, originId=originId, origin=origin, originCode=originCode,
118   - tradeType=tradeType, tradeTypeName=tradeTypeName,
119   - productState=productState,
120   - tradeTypeId=tradeTypeId, inGreeterId=inGreeterId,
121   - inGreeterName=inGreeterName, dep=feeDepId)
  108 + cre_res = sjApi.create_sparePartsWeighSave(session=session, host=self.gatewayHost, duplicateToken=duplicateToken,
  109 + carTypeCode=carTypeCode, carTypeId=carTypeId,
  110 + carTypeName=carTypeName, plate=plate, weight=weight,
  111 + productId=productId, productName=productName, proveTypeCode=proveTypeCode,
  112 + proveTypeName=proveTypeName, trailerNumber=trailerNumber,
  113 + depName=feeDepName,
  114 + cateId=cateId, originId=originId, origin=origin, originCode=originCode,
  115 + tradeType=tradeType, tradeTypeName=tradeTypeName,
  116 + productState=productState,
  117 + tradeTypeId=tradeTypeId, inGreeterId=inGreeterId,
  118 + inGreeterName=inGreeterName, dep=feeDepId)
122 119 print(cre_res.json())
123 120 \ No newline at end of file
... ...
testcase/heb/test_ZC/demo_ZC.py
... ... @@ -9,7 +9,6 @@
9 9 整车进门测试用例
10 10 """
11 11  
12   -import json
13 12 import unittest
14 13 from commons.scripts.readConf import rC
15 14 from commons.api import zcApi as zcA
... ...
testcase/heb/test_ZC/test_ZCBasic.py
... ... @@ -9,7 +9,6 @@
9 9 整车进门基础数据获取测试
10 10 """
11 11  
12   -import json
13 12 import unittest
14 13 from commons.scripts.readConf import rC
15 14 from commons.api import zcApi as zcA
... ...
testcase/heb/test_ZC/test_ZCCreate.py
... ... @@ -9,12 +9,9 @@
9 9 整车进门但创建测试
10 10 """
11 11  
12   -import json
13 12 import unittest
14 13 from commons.scripts.readConf import rC
15 14 from commons.api import zcApi as zcA
16   -from commons.MySession import sessionHeb
17   -from commons.api.entranceFeeBillList import entranceFeeBillList as eFBL
18 15 import time,random
19 16 from commons.MySession import sessionHeb
20 17 session = sessionHeb
... ...
testcase/heb/test_listPage/test_listPageOperation.py
... ... @@ -11,17 +11,11 @@
11 11  
12 12 import unittest
13 13 from commons.scripts.readConf import rC
14   -from commons.api import zcApi as zcA
15   -from commons.api import sjApi
16   -from commons.api import hpApi
17   -from commons.api.entranceFeeBillList import operationUnfreeze as eOp
18   -from commons.api.entranceFeeBillList import entranceFeeBillList as eFBL
19   -from commons.api.entranceFeeBillList import operationDoInvalid as oDI
20   -from commons.api.entranceFeeBillList import operationDoCorrect as oDC
21   -from commons.api.entranceFeeBillList import operationDoAmend as oDA
  14 +from commons.api import sjApi, hpApi, zcApi as zcA
22 15 from commons.api.entranceFeeBillList import operationDoUndo as oDU
23   -from commons.api.entranceFeeBillList import operationDoUpdate as oDUp
24   -from commons.api.entranceFeeBillList import operationDoFreeze as oDF
  16 +from commons.api.entranceFeeBillList import operationDoFreeze as oDF, operationDoCorrect as oDC, \
  17 + operationDoInvalid as oDI, entranceFeeBillList as eFBL, operationUnfreeze as eOp, operationDoUpdate as oDUp, \
  18 + operationDoAmend as oDA
25 19 import random
26 20  
27 21 from commons.MySession import sessionHeb
... ... @@ -79,7 +73,7 @@ class test_listPage(unittest.TestCase):
79 73 """进门单列表-操作:散件进门交费测试"""
80 74 plate = f"川A{random.randint(10000,99999)}"
81 75 goods = "雪莲果"
82   - cre_res = sjApi.create_sj(session=session,host=self.gatewayHost,plate=plate,keyword=goods)
  76 + cre_res = sjApi.create_sj(session=session, host=self.gatewayHost, plate=plate, keyword=goods)
83 77 print(cre_res.json())
84 78 number = cre_res.json()["data"]["number"]
85 79 res_pay = eFBL.do_payOrder(session=session,host=self.jmsfHost,attrValue=number,ic=self.ic)
... ... @@ -96,7 +90,7 @@ class test_listPage(unittest.TestCase):
96 90 res_pay = oDF.do_freezeOrder(session=session,host=self.jmsfHost,attrValue=number,ic=self.ic)
97 91 assert res_pay.json()["code"]=="200","缴费失败"
98 92 assert res_pay.json()["message"] == "OK", "缴费失败"
99   - res,tareWeight = hpApi.do_backSkinWeighSave(session=session,host=self.gatewayHost,number=number)
  93 + res,tareWeight = hpApi.do_backSkinWeighSave(session=session, host=self.gatewayHost, number=number)
100 94 assert res.json()["code"]=="200","回皮失败"
101 95 assert "data" in res.text,"回皮失败"
102 96 resListPage = eFBL.listPage(session=session,host=self.jmsfHost,attrValue=number)
... ...
testcase/heb/test_listPage/test_searchByAttrName.py
... ... @@ -9,15 +9,13 @@
9 9 进门单列表查询
10 10 """
11 11  
12   -
13   -import json
14 12 import unittest
15 13 from commons.scripts.readConf import rC
16 14 from commons.api import zcApi as zcA
17 15 from commons import ConfigDB as CoDB
18 16 from commons.MySession import my
19 17 from commons.api.entranceFeeBillList import entranceFeeBillList as eFBL
20   -import time,random
  18 +import random
21 19 from commons.MySession import sessionHeb
22 20 session = sessionHeb
23 21  
... ...
testcase/heb/test_listPage/test_searchByOther.py
... ... @@ -9,7 +9,6 @@
9 9 进门单列表其他他查询条件
10 10 """
11 11  
12   -import json
13 12 import unittest
14 13 from bs4 import BeautifulSoup
15 14 from commons.scripts.readConf import rC
... ... @@ -17,8 +16,7 @@ from commons.api import zcApi as zcA
17 16 from commons.basic import getLookupList as gLL
18 17 from commons.ConfigDB import mysql_selectAll as msa
19 18 from commons.api.entranceFeeBillList import operationDoUndo as oDU
20   -from commons.api.entranceFeeBillList import entranceFeeBillList as eFBL
21   -from commons.api.entranceFeeBillList import operationDoUpdate as oDUp
  19 +from commons.api.entranceFeeBillList import entranceFeeBillList as eFBL, operationDoUpdate as oDUp
22 20 import time,random
23 21 from commons.MySession import sessionHeb
24 22 session = sessionHeb
... ...
testcase/sy/CZFW/test_weightBizBill_doRefund.py
... ... @@ -2,7 +2,6 @@
2 2 # -*- coding: UTF-8 -*-
3 3 import unittest
4 4 import urllib3
5   -from commons import common as com
6 5 from commons import ConfigDB as db
7 6 from commons.MySession import my,sy1
8 7 from commons.api.weightBizBill_doRefund import weightBizBill_doRefund
... ...
testcase/sy/CZFW/test_weightBizBill_listPage.py
... ... @@ -3,7 +3,6 @@
3 3 import unittest
4 4 import urllib3
5 5 import time
6   -from commons import common as com
7 6 from commons.MySession import my,sy1
8 7 from commons.api.weightBizBill_listPage import weightBizBill_listPage
9 8 from commons.api.weighingServiceSave import weighingServiceSave
... ...
testcase/sy/FeedbackCustomerController/test_fc_add.py
1 1 import unittest
2 2 import urllib3
3   -from commons.MySession import my,sy1
  3 +from commons.MySession import sy1
4 4 from commons.api.fc_add import fc_add
5 5 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
6 6 from commons.Faker import random_data
... ...
testcase/sy/FeedbackCustomerController/test_fc_edit.py
1 1 import unittest
2 2 import urllib3
3   -from commons.MySession import my,sy1
  3 +from commons.MySession import sy1
4 4 from commons.api.fc_edit import fc_edit
5 5 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
6 6 from commons.Faker import random_data
... ...
testcase/sy/FeedbackCustomerController/test_fc_view.py
1 1 import unittest
2 2 import urllib3
3 3 import commons.ConfigDB as db
4   -from commons.MySession import my,sy1
  4 +from commons.MySession import sy1
5 5 from commons.api.fc_view import fc_view
6 6 from commons.api.fc_add import fc_add
7 7 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
... ...
testcase/sy/FeedbackCustomerController/test_feedback_customer_disable.py
1 1 import unittest
2 2 import urllib3
3   -from commons.MySession import my,sy1
  3 +from commons.MySession import sy1
4 4 from commons.api.feedback_customer_disable import feedback_customer_disable
5 5 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
6 6 fcd = feedback_customer_disable()
... ...
testcase/sy/FeedbackCustomerController/test_feedback_customer_enable.py 0 → 100644
  1 +import unittest
  2 +import urllib3
  3 +from commons.MySession import sy1
  4 +from commons.api.feedback_customer_enable import feedback_customer_enable
  5 +from commons.api.feedback_customer_disable import feedback_customer_disable
  6 +urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
  7 +fce = feedback_customer_enable()
  8 +fcd = feedback_customer_disable
  9 +import commons.ConfigDB as db
  10 +
  11 +"""
  12 +进门收费——返点管理——返还人管理——启用返还人
  13 +"""
  14 +
  15 +class test_feedback_customer_enable(unittest.TestCase):
  16 + "沈阳——返还人管理——返还人启用"
  17 + @classmethod
  18 + def setUpClass(cls):
  19 + pass
  20 +
  21 + def setUp(self):
  22 + self.ids = db.mysql_selectOne('''
  23 + SELECT id FROM `dili_jmsf`.`feedback_customer` WHERE `status` = '2' and
  24 + market_id='''+str(sy1.user["sy_user01"]["firmId"])+''' ORDER BY `id` DESC LIMIT 1''')[0]
  25 + print(self.ids)
  26 + def test_feedback_customer_enable_01(self):
  27 + "返还人启用"
  28 + url = fce.url.replace("49",str(self.ids))
  29 + re = sy1.post(url = url, headers = fce.header)
  30 + # print(fce.url)
  31 + # print(re.headers)
  32 + # print(re.json())
  33 + self.assertTrue("操作成功" in str(re.json()))
  34 + @classmethod
  35 + def tearDownClass(cls):
  36 + pass
  37 +
  38 +if __name__ == '__main__':
  39 + unittest.main()
... ...
testcase/sy/FeedbackCustomerController/test_feedback_customer_query.py 0 → 100644
  1 +import unittest
  2 +import urllib3
  3 +from commons.MySession import sy1
  4 +from commons.api.feedback_customer_query import feedback_customer_query
  5 +urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
  6 +import datetime
  7 +import commons.ConfigDB as db
  8 +fcq = feedback_customer_query()
  9 +
  10 +"""
  11 +进门收费——返点管理——返还人管理——返还人列表查询
  12 +"""
  13 +
  14 +class test_feedback_customer_query(unittest.TestCase):
  15 + "沈阳——返还人管理——返还人列表查询"
  16 + @classmethod
  17 + def setUpClass(cls):
  18 + pass
  19 + def setUp(self):
  20 + self.name1 = db.mysql_selectOne('''SELECT name FROM `dili_jmsf`.`feedback_customer`
  21 + WHERE market_id = ''' + str(sy1.user["sy_user01"]["firmId"]) + ''' ORDER BY `id` DESC LIMIT 1''')[0]
  22 + def test_feedback_customer_query_01(self):
  23 + "返还人列表查询"
  24 + print(fcq.url)
  25 + body = fcq.body\
  26 + .replace("潘婷婷", str(self.name1))\
  27 + .replace("2021-08-11 00:00:00",(datetime.datetime.now() - datetime.timedelta(days = 30)).strftime("%Y-%m-%d %H:%M:%S")).\
  28 + replace("2021-08-11 23:59:59",datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
  29 + # print(body)
  30 + re = sy1.post(url = fcq.url, data = body.replace("\n","").encode('utf-8'),headers = fcq.header)
  31 + # print(re.headers)
  32 + # print(re.text)
  33 + # print("士大夫十",str(self.name1))
  34 + self.assertTrue(str(self.name1) in str(re.text))
  35 +
  36 + @classmethod
  37 + def tearDownClass(cls):
  38 + pass
  39 +
  40 +
  41 +if __name__ == '__main__':
  42 + unittest.main()
... ...
testcase/sy/FeedbackOrderController/test_feedback_order_settlement.py 0 → 100644
  1 +import unittest
  2 +import urllib3
  3 +from commons.MySession import sy1
  4 +from commons.api.feedback_order_settlement import feedback_order_settlement
  5 +urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
  6 +from commons.api.feedback_order_settlement_query import feedback_order_settlement_query
  7 +fosq = feedback_order_settlement_query()
  8 +import datetime
  9 +fos = feedback_order_settlement()
  10 +
  11 +"""
  12 +进门收费——返点管理——结账管理——选择需要返点的订单进行结账
  13 +"""
  14 +
  15 +class test_feedback_order_settlement(unittest.TestCase):
  16 + "沈阳——结账管理——选择需要返点的订单进行结账"
  17 + @classmethod
  18 + def setUpClass(cls):
  19 + pass
  20 +
  21 + def setUp(self):
  22 + body = fosq.body.replace("feedbackCustomerId=25", "feedbackCustomerId=16").replace("2021-07-22 00:00:00", "\
  23 + 2021-07-03 00:00:00").replace("2021-08-03 23:59:59", str(datetime.datetime.now()))
  24 + re = sy1.post(url = fosq.url, data = body, headers = fosq.header)
  25 +
  26 + self.Amount = re.json()["rows"][0]["unsettledAmount"]
  27 + self.ids = re.json()["rows"][0]["id"]
  28 + self.billIds = re.json()["rows"][0]["billId"]
  29 + #查询出结账金额、结算单id和与之相关联的进门单id
  30 + url = "http://test.jmsf.diligrp.com:8385/FeedbackOrderController/settleAccount.action"
  31 + header = {
  32 + "X-Requested-With": "XMLHttpRequest",
  33 + "User-Agent": "Mozilla/5.0(WindowsNT6.2;WOW64)AppleWebKit/537.36(KHTML,likeGecko)Chrome/84.0.4147.105Safari/537.36",
  34 + "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8"
  35 + }
  36 + body = "customerId=16"
  37 + re2 = sy1.post(url = url,headers = header,data = body)
  38 + self.idd = re2.json()["id"]
  39 + self.name = re2.json()["name"]
  40 + self.cardNumber = re2.json()["cardNumber"]
  41 + #查询出结账单的id、name、cardnumber
  42 +
  43 + def test_feedback_order_settlement_01(self):
  44 + "选择需要返点的订单进行结账."
  45 + body = fos.body.replace("id=25","id="+str(self.idd)).\
  46 + replace("888810057654",str(self.cardNumber)).\
  47 + replace("settleAmount=2","settleAmount="+str(self.Amount)).\
  48 + replace("ids=12034","ids="+str(self.ids)).\
  49 + replace("feedbackCustomerId=25","feedbackCustomerId="+str(self.idd)).\
  50 + replace("feedbackCustomerName=验证员工推送到CRM","feedbackCustomerName="+str(self.name)).\
  51 + replace("billIds=3621","billIds="+str(self.billIds)).\
  52 + replace("settledAmounts=2","settledAmounts="+str(self.Amount))
  53 + # print(body)
  54 + re = sy1.post(url = fos.url, headers = fos.header, data = body.encode('utf-8'))
  55 + # print(re.headers)
  56 +
  57 + # print(re.json())
  58 + self.assertTrue("操作成功" in str(re.json()))
  59 + return re
  60 +
  61 + @classmethod
  62 + def tearDownClass(cls):
  63 + pass
  64 +
  65 +
  66 +if __name__ == '__main__':
  67 + unittest.main()
0 68 \ No newline at end of file
... ...
testcase/sy/FeedbackOrderController/test_feedback_order_settlement_query.py 0 → 100644
  1 +import unittest
  2 +import urllib3
  3 +from commons.MySession import sy1
  4 +from commons.api.feedback_order_settlement_query import feedback_order_settlement_query
  5 +urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
  6 +fosq = feedback_order_settlement_query()
  7 +import commons.ConfigDB as db
  8 +import datetime
  9 +
  10 +"""
  11 +进门收费——返点管理——结账管理——根据返还人和缴费时间进行查询
  12 +"""
  13 +
  14 +class test_feedback_order_settlement_query(unittest.TestCase):
  15 + "沈阳——结账管理列表查询——根据返还人和缴费时间进行查询"
  16 + @classmethod
  17 + def setUpClass(cls):
  18 + pass
  19 + def setUp(self):
  20 + self.ids = db.mysql_selectOne('''
  21 + SELECT id FROM `dili_jmsf`.`feedback_customer` WHERE `status` = '1'
  22 + and market_id = ''' + str(sy1.user["sy_user01"]["firmId"]) + '''
  23 + ORDER BY `id` DESC LIMIT 1''')[0]
  24 + # print(self.ids)
  25 + def test_feedback_order_settlement_query_01(self):
  26 + "根据返还人和缴费时间进行查询"
  27 + print(fosq.url)
  28 + body = fosq.body.replace("feedbackCustomerId=25", "feedbackCustomerId="+str(self.ids)).\
  29 + replace("2021-07-22 00:00:00", (datetime.datetime.now() - datetime.timedelta(days = 30)).strftime("%Y-%m-%d %H:%M:%S")).\
  30 + replace("2021-08-03 23:59:59", datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
  31 + # print(body)
  32 + re = sy1.post(url = fosq.url, data = body,headers = fosq.header)
  33 + # print(re.headers)
  34 + # print(re.json())
  35 + self.assertTrue("rows" in str(re.json()))
  36 +
  37 + @classmethod
  38 + def tearDownClass(cls):
  39 + pass
  40 +
  41 +
  42 +if __name__ == '__main__':
  43 + unittest.main()
... ...
testcase/sy/entranceFeeBill_detail/test_entranceFeeBill_details.py
... ... @@ -3,7 +3,6 @@
3 3 import unittest
4 4 import urllib3
5 5 from commons import ConfigDB as db
6   -from commons import common as com
7 6 from commons.MySession import my,sy1
8 7 from commons.api.entranceFeeBill_details import entranceFeeBill_details
9 8 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
... ... @@ -147,5 +146,5 @@ class test_entranceFeeBill_details(unittest.TestCase):
147 146  
148 147 if __name__ == "__main__":
149 148  
150   - # unittest.main(verbosity=2)
151   - com.run_one(test_entranceFeeBill_details("test_entranceFeeBill_details_01"))
  149 + unittest.main(verbosity=2)
  150 + # com.run_one(test_entranceFeeBill_details("test_entranceFeeBill_details_01"))
... ...
testcase/sy/entranceFeeBill_proves/test_entranceFeeBill_provesPage.py
... ... @@ -3,7 +3,6 @@
3 3 import unittest
4 4 import urllib3
5 5 from commons import ConfigDB as db
6   -from commons import common as com
7 6 from commons.MySession import my,sy1
8 7 from commons.api.entranceFeeBill_provesPage import entranceFeeBill_provesPage
9 8 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
... ...
testcase/sy/feedbackAccounrecordController_list/test_feedbackAccounrecordController_list.py
1 1 import unittest
2 2 import urllib3
3   -from commons.MySession import my,sy1
  3 +from commons.MySession import sy1
4 4 from commons.api.feedbackAccounrecordController_list import feedbackAccounrecordController_list
5 5 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
6 6 import commons.ConfigDB as db
... ...
testcase/sy/test_HP/test_HP.py
... ... @@ -9,14 +9,11 @@
9 9 回皮功能接口测试
10 10 """
11 11  
12   -import json
13 12 import unittest
14 13 from commons.scripts.readConf import rC
15   -from commons.api import zcApi as zcA
16   -from commons.api.entranceFeeBillList import entranceFeeBillList as eFBL
17   -from commons.api.entranceFeeBillList import operationDoFreeze as oDF
18   -from commons.api import hpApi
19   -import time,random
  14 +from commons.api import hpApi, zcApi as zcA
  15 +from commons.api.entranceFeeBillList import operationDoFreeze as oDF, entranceFeeBillList as eFBL
  16 +import random
20 17  
21 18 from commons.MySession import sessionSy
22 19 session = sessionSy
... ... @@ -48,7 +45,7 @@ class test_HPCreate(unittest.TestCase):
48 45 print(cre_res.json())
49 46 number = cre_res.json()["data"]["number"]
50 47 aa = oDF.do_freezeOrder(session=session,host=self.jmsfHost,attrValue=number,ic=self.ic)
51   - res,tareWeight = hpApi.do_backSkinWeighSave(session=session,host=self.gatewayHost,number=number)
  48 + res,tareWeight = hpApi.do_backSkinWeighSave(session=session, host=self.gatewayHost, number=number)
52 49 assert res.json()["code"]=="200","回皮失败"
53 50 assert "data" in res.text,"回皮失败"
54 51  
... ... @@ -60,7 +57,7 @@ class test_HPCreate(unittest.TestCase):
60 57 print(cre_res.json())
61 58 number = cre_res.json()["data"]["number"]
62 59 aa = oDF.do_freezeOrder(session=session,host=self.jmsfHost,attrValue=number,ic=self.ic)
63   - res = hpApi.get_listBackSkinTrucks(session=session,host=self.gatewayHost,plate=plate)
  60 + res = hpApi.get_listBackSkinTrucks(session=session, host=self.gatewayHost, plate=plate)
64 61 print(res.json())
65 62 assert res.json()["code"]=="200","车号查询失败"
66 63 assert res.json()["data"][-1]["number"]==number,"车号查询失败"
... ... @@ -73,7 +70,7 @@ class test_HPCreate(unittest.TestCase):
73 70 print(cre_res.json())
74 71 number = cre_res.json()["data"]["number"]
75 72 aa = oDF.do_freezeOrder(session=session,host=self.jmsfHost,attrValue=number,ic=self.ic)
76   - res = hpApi.get_listBackSkinTrucks(session=session,host=self.gatewayHost,number=number)
  73 + res = hpApi.get_listBackSkinTrucks(session=session, host=self.gatewayHost, number=number)
77 74 print(res.json())
78 75 assert res.json()["code"]=="200","车号查询失败"
79 76 assert res.json()["data"][-1]["number"]==number,"车号查询失败"
... ... @@ -89,7 +86,7 @@ class test_HPCreate(unittest.TestCase):
89 86 print(cre_res.json())
90 87 number = cre_res.json()["data"]["number"]
91 88 aa = oDF.do_freezeOrder(session=session,host=self.jmsfHost,attrValue=number,ic=self.ic)
92   - res = hpApi.get_listBackSkinTrucks(session=session,host=self.gatewayHost,customerName=customerName)
  89 + res = hpApi.get_listBackSkinTrucks(session=session, host=self.gatewayHost, customerName=customerName)
93 90 print(res.json())
94 91 assert res.json()["code"]=="200","车号查询失败"
95 92 assert res.json()["data"][-1]["number"]==number,"车号查询失败"
96 93 \ No newline at end of file
... ...
testcase/sy/test_SJ/test_SJ.py
... ... @@ -9,13 +9,10 @@
9 9  
10 10 """
11 11  
12   -import json
13 12 import unittest
14 13 from commons.scripts.readConf import rC
15   -from commons.api import zcApi as zcA
16   -from commons.api.entranceFeeBillList import entranceFeeBillList as eFBL
17   -from commons.api import sjApi
18   -import time,random
  14 +from commons.api import sjApi, zcApi as zcA
  15 +import random
19 16  
20 17 from commons.MySession import sessionSy
21 18 session = sessionSy
... ... @@ -109,15 +106,15 @@ class test_ZCCreate(unittest.TestCase):
109 106 weight = int(itemWeight) * int(qty)
110 107  
111 108 # 创建进门单
112   - cre_res = sjApi.create_sparePartsWeighSave(session=session,host=self.gatewayHost, duplicateToken=duplicateToken,
113   - carTypeCode=carTypeCode, carTypeId=carTypeId,
114   - carTypeName=carTypeName, plate=plate, weight=weight,
115   - productId=productId, productName=productName, proveTypeCode=proveTypeCode,
116   - proveTypeName=proveTypeName, trailerNumber=trailerNumber,
117   - depName=feeDepName,
118   - cateId=cateId, originId=originId, origin=origin, originCode=originCode,
119   - tradeType=tradeType, tradeTypeName=tradeTypeName,
120   - productState=productState,
121   - tradeTypeId=tradeTypeId, goodsTagId=goodsTagId, inGreeterId=inGreeterId,
122   - inGreeterName=inGreeterName, dep=feeDepId)
  109 + cre_res = sjApi.create_sparePartsWeighSave(session=session, host=self.gatewayHost, duplicateToken=duplicateToken,
  110 + carTypeCode=carTypeCode, carTypeId=carTypeId,
  111 + carTypeName=carTypeName, plate=plate, weight=weight,
  112 + productId=productId, productName=productName, proveTypeCode=proveTypeCode,
  113 + proveTypeName=proveTypeName, trailerNumber=trailerNumber,
  114 + depName=feeDepName,
  115 + cateId=cateId, originId=originId, origin=origin, originCode=originCode,
  116 + tradeType=tradeType, tradeTypeName=tradeTypeName,
  117 + productState=productState,
  118 + tradeTypeId=tradeTypeId, goodsTagId=goodsTagId, inGreeterId=inGreeterId,
  119 + inGreeterName=inGreeterName, dep=feeDepId)
123 120 print(cre_res.json())
124 121 \ No newline at end of file
... ...
testcase/sy/test_ZC/demo_ZC.py
... ... @@ -9,7 +9,6 @@
9 9 整车进门测试用例
10 10 """
11 11  
12   -import json
13 12 import unittest
14 13 from commons.scripts.readConf import rC
15 14 from commons.api import zcApi as zcA
... ...
testcase/sy/test_ZC/test_ZCBasic.py
... ... @@ -9,7 +9,6 @@
9 9 整车进门基础数据获取测试
10 10 """
11 11  
12   -import json
13 12 import unittest
14 13 from commons.scripts.readConf import rC
15 14 from commons.api import zcApi as zcA
... ...
testcase/sy/test_ZC/test_ZCCreate.py
... ... @@ -9,11 +9,9 @@
9 9 整车进门但创建测试
10 10 """
11 11  
12   -import json
13 12 import unittest
14 13 from commons.scripts.readConf import rC
15 14 from commons.api import zcApi as zcA
16   -from commons.api.entranceFeeBillList import entranceFeeBillList as eFBL
17 15 import time,random
18 16 from commons.MySession import sessionSy
19 17 session = sessionSy
... ...
testcase/sy/test_listPage/test_listPageOperation.py
... ... @@ -11,17 +11,11 @@
11 11  
12 12 import unittest
13 13 from commons.scripts.readConf import rC
14   -from commons.api import zcApi as zcA
15   -from commons.api import sjApi
16   -from commons.api import hpApi
17   -from commons.api.entranceFeeBillList import operationUnfreeze as eOp
18   -from commons.api.entranceFeeBillList import entranceFeeBillList as eFBL
19   -from commons.api.entranceFeeBillList import operationDoInvalid as oDI
20   -from commons.api.entranceFeeBillList import operationDoCorrect as oDC
21   -from commons.api.entranceFeeBillList import operationDoAmend as oDA
  14 +from commons.api import sjApi, hpApi, zcApi as zcA
22 15 from commons.api.entranceFeeBillList import operationDoUndo as oDU
23   -from commons.api.entranceFeeBillList import operationDoUpdate as oDUp
24   -from commons.api.entranceFeeBillList import operationDoFreeze as oDF
  16 +from commons.api.entranceFeeBillList import operationDoFreeze as oDF, operationDoCorrect as oDC, \
  17 + operationDoInvalid as oDI, entranceFeeBillList as eFBL, operationUnfreeze as eOp, operationDoUpdate as oDUp, \
  18 + operationDoAmend as oDA
25 19 import random
26 20  
27 21 from commons.MySession import sessionSy
... ... @@ -80,7 +74,7 @@ class test_listPage(unittest.TestCase):
80 74 """进门单列表-操作:散件进门交费测试"""
81 75 plate = f"川A{random.randint(10000,99999)}"
82 76 goods = "雪莲果"
83   - cre_res = sjApi.create_sj(session=session,host=self.gatewayHost,plate=plate,keyword=goods)
  77 + cre_res = sjApi.create_sj(session=session, host=self.gatewayHost, plate=plate, keyword=goods)
84 78 print(cre_res.json())
85 79 number = cre_res.json()["data"]["number"]
86 80 res_pay = eFBL.do_payOrder(session=session,host=self.jmsfHost,attrValue=number,ic=self.ic)
... ... @@ -97,7 +91,7 @@ class test_listPage(unittest.TestCase):
97 91 res_pay = oDF.do_freezeOrder(session=session,host=self.jmsfHost,attrValue=number,ic=self.ic)
98 92 assert res_pay.json()["code"]=="200","缴费失败"
99 93 assert res_pay.json()["message"] == "OK", "缴费失败"
100   - res,tareWeight = hpApi.do_backSkinWeighSave(session=session,host=self.gatewayHost,number=number)
  94 + res,tareWeight = hpApi.do_backSkinWeighSave(session=session, host=self.gatewayHost, number=number)
101 95 assert res.json()["code"]=="200","回皮失败"
102 96 assert "data" in res.text,"回皮失败"
103 97 resListPage = eFBL.listPage(session=session,host=self.jmsfHost,attrValue=number)
... ...
testcase/sy/test_listPage/test_searchByAttrName.py
... ... @@ -9,15 +9,12 @@
9 9 进门单列表查询
10 10 """
11 11  
12   -
13   -import json
14 12 import unittest
15 13 from commons.scripts.readConf import rC
16 14 from commons.api import zcApi as zcA
17 15 from commons import ConfigDB as CoDB
18   -from commons.MySession import my
19 16 from commons.api.entranceFeeBillList import entranceFeeBillList as eFBL
20   -import time,random
  17 +import random
21 18 from commons.MySession import sessionSy
22 19 session = sessionSy
23 20  
... ...
testcase/sy/test_listPage/test_searchByOther.py
... ... @@ -9,7 +9,6 @@
9 9 进门单列表其他他查询条件
10 10 """
11 11  
12   -import json
13 12 import unittest
14 13 from bs4 import BeautifulSoup
15 14 from commons.scripts.readConf import rC
... ... @@ -17,8 +16,7 @@ from commons.api import zcApi as zcA
17 16 from commons.basic import getLookupList as gLL
18 17 from commons.ConfigDB import mysql_selectAll as msa
19 18 from commons.api.entranceFeeBillList import operationDoUndo as oDU
20   -from commons.api.entranceFeeBillList import entranceFeeBillList as eFBL
21   -from commons.api.entranceFeeBillList import operationDoUpdate as oDUp
  19 +from commons.api.entranceFeeBillList import entranceFeeBillList as eFBL, operationDoUpdate as oDUp
22 20 import time,random
23 21 from commons.MySession import sessionSy
24 22 session = sessionSy
... ...