Commit 38ccd7f9 authored by liguangyu06's avatar liguangyu06
Browse files

优化

1 merge request!6Master|代码更新归档
Showing with 39 additions and 39 deletions
+39 -39
......@@ -15,8 +15,8 @@ import json
module = "cmdc_product"
# 第一步登录获取登录所需账号密码
username = commonFuc().get_business_data(module, "username1")
password = commonFuc().get_business_data(module, "password1")
username = commonFuc().get_business_data(module, "username2")
password = commonFuc().get_business_data(module, "password2")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
......
......@@ -16,19 +16,19 @@ import json
module = "cmdc_product"
# 获取登录所需账号密码
username = commonFuc().get_business_data(module, "username1")
password = commonFuc().get_business_data(module, "password1")
username = commonFuc().get_business_data(module, "username2")
password = commonFuc().get_business_data(module, "password2")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
# 获取产品线列表
# 获取商品列表
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url20")
request_body = commonFuc().get_business_data(module, "payload20")
# 发送请求
result = requests.post(url, json=request_body, headers=headers)
result = json.loads(result.content)
# print(result)
# 生成一个随机数字,用于后续随机选择某一条商品属性信息
rebate_random = random.randint(0, len(result["data"]["list"]) - 1)
# 获取商品信息
......
......@@ -17,8 +17,8 @@ module = "cmdc_product"
# 第一步登录后台运营平台获取cmdc_access_token
# 获取登录所需账号密码
username = commonFuc().get_business_data(module, "username1")
password = commonFuc().get_business_data(module, "password1")
username = commonFuc().get_business_data(module, "username2")
password = commonFuc().get_business_data(module, "password2")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
......
......@@ -16,8 +16,8 @@ import json
module = "cmdc_product"
# 获取登录所需账号密码
username = commonFuc().get_business_data(module, "username1")
password = commonFuc().get_business_data(module, "password1")
username = commonFuc().get_business_data(module, "username2")
password = commonFuc().get_business_data(module, "password2")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
......
......@@ -15,8 +15,8 @@ import json
module = "cmdc_product"
# 获取登录所需账号密码
username = commonFuc().get_business_data(module, "username1")
password = commonFuc().get_business_data(module, "password1")
username = commonFuc().get_business_data(module, "username2")
password = commonFuc().get_business_data(module, "password2")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
......
......@@ -15,8 +15,8 @@ import json
module = "cmdc_product"
# 获取登录所需账号密码
username = commonFuc().get_business_data(module, "username1")
password = commonFuc().get_business_data(module, "password1")
username = commonFuc().get_business_data(module, "username2")
password = commonFuc().get_business_data(module, "password2")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
......
......@@ -15,8 +15,8 @@ import json
module = "cmdc_product"
# 获取登录所需账号密码
username = commonFuc().get_business_data(module, "username1")
password = commonFuc().get_business_data(module, "password1")
username = commonFuc().get_business_data(module, "username2")
password = commonFuc().get_business_data(module, "password2")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
......
......@@ -15,8 +15,8 @@ import json
module = "cmdc_product"
# 获取登录所需账号密码
username = commonFuc().get_business_data(module, "username1")
password = commonFuc().get_business_data(module, "password1")
username = commonFuc().get_business_data(module, "username2")
password = commonFuc().get_business_data(module, "password2")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
......@@ -27,7 +27,7 @@ request_body = commonFuc().get_business_data(module, "payload41")
# 发送请求
result = requests.get(url, params=request_body, headers=headers)
result = json.loads(result.content)
# print(result)
# 生成随机数
product_random = random.randint(0, len(result["data"]["list"]) - 1)
# 获取商品限购信息
......
......@@ -15,14 +15,14 @@ import json
module = "cmdc_product"
# 获取登录所需账号密码
username = commonFuc().get_business_data(module, "username1")
password = commonFuc().get_business_data(module, "password1")
username = commonFuc().get_business_data(module, "username2")
password = commonFuc().get_business_data(module, "password2")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
# 模糊查询字段
customer_msg = "湖南"
customer_msg = "广州"
# 进行客户信息模糊查询
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url15")
request_body = commonFuc().get_business_data(module, "payload15", customer_msg)
......
......@@ -17,8 +17,8 @@ module = "cmdc_product"
# 第一步登录
# 获取登录所需账号密码
username = commonFuc().get_business_data(module, "username1")
password = commonFuc().get_business_data(module, "password1")
username = commonFuc().get_business_data(module, "username2")
password = commonFuc().get_business_data(module, "password2")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
......@@ -65,7 +65,7 @@ host, port, user, pwd = mysql_handle.getConf(db="cmdc_db")
# 查询数据库中产品线对应制单员数量
sql = "SELECT count(t.id) FROM `cmdc-product`.ic_marker_member t " \
"WHERE userId = 2795 and productLineCode = '{}'".format(product_line_code)
"WHERE userId = 114378 and productLineCode = '{}'".format(product_line_code)
total = mysql_handle.selectSql(host, port, user, pwd, "cmdc-product", sql)[0][0]
# 获取预期结果
......
......@@ -16,8 +16,8 @@ import json
module = "cmdc_product"
# 获取登录所需账号密码
username = commonFuc().get_business_data(module, "username1")
password = commonFuc().get_business_data(module, "password1")
username = commonFuc().get_business_data(module, "username2")
password = commonFuc().get_business_data(module, "password2")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
......@@ -51,7 +51,7 @@ host, port, user, pwd = mysql_handle.getConf(db="cmdc_db")
# 查询数据库中对应制单员数量
sql = "SELECT count(t.userId) FROM `cmdc-user`.cmdc_user t " \
"WHERE userType = 1 and companyId =6 and deleteSign = 0 in" \
"WHERE userType = 1 and companyId =7 and deleteSign = 0 in" \
"(SELECT t.userId FROM `cmdc-user`.cmdc_manager_user t)"
total = mysql_handle.selectSql(host, port, user, pwd, "cmdc-user", sql)[0][0]
......
......@@ -16,8 +16,8 @@ import json
module = "cmdc_product"
# 获取登录所需账号密码
username = commonFuc().get_business_data(module, "username1")
password = commonFuc().get_business_data(module, "password1")
username = commonFuc().get_business_data(module, "username2")
password = commonFuc().get_business_data(module, "password2")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
......@@ -47,7 +47,7 @@ result = {"total": result["data"]["total"]}
result["api_time"] = api_time
# print(result)
# 查询数据库中对应公司对应的商品属性数量
sql = "SELECT count(t.productId) FROM `cmdc-product`.ic_product_properties t WHERE companyCode = 00111 and deleteSign = 0"
sql = "SELECT count(t.productId) FROM `cmdc-product`.ic_product_properties t WHERE companyCode = 00102 and deleteSign = 0"
total = mysql_handle.selectSql(host, port, user, pwd, "cmdc-product", sql)[0][0]
# 获取预期结果
......
......@@ -15,8 +15,8 @@ import json
module = "cmdc_product"
# 获取登录所需账号密码
username = commonFuc().get_business_data(module, "username1")
password = commonFuc().get_business_data(module, "password1")
username = commonFuc().get_business_data(module, "username2")
password = commonFuc().get_business_data(module, "password2")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
......
......@@ -16,8 +16,8 @@ import json
module = "cmdc_product"
# 获取登录所需账号密码
username = commonFuc().get_business_data(module, "username1")
password = commonFuc().get_business_data(module, "password1")
username = commonFuc().get_business_data(module, "username2")
password = commonFuc().get_business_data(module, "password2")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
......
......@@ -159,13 +159,13 @@ checkDict19: {"lineCode":"%s"}
#测试场景二十:获取商品列表_库存配置
"url20": "/product/public/getListed"
"payload20": {"pageNumber":10,"pageStart":1,"productCode":"","productName":"","userNo":"","companyCode":"00111","pageSize":10,"pageNum":1,"specifications":""}
"payload20": {"pageNumber":10,"pageStart":1,"productCode":"","productName":"","userNo":"","companyCode":"00102","pageSize":10,"pageNum":1,"specifications":""}
#预期结果
checkDict20: {"success":true,"code":"200","message":"OK"}
#测试场景二十一:列表查询条件验证_商品列表_库存配置
"url21": "/product/public/getListed"
"payload21": {"pageNumber":10,"pageStart":1,"productCode":"%s","productName":"%s","userNo":"","companyCode":"00111","pageSize":10,"pageNum":1,"specifications":"","total":1629}
"payload21": {"pageNumber":10,"pageStart":1,"productCode":"%s","productName":"%s","userNo":"","companyCode":"00102","pageSize":10,"pageNum":1,"specifications":"","total":1629}
#预期结果
checkDict21: {"productCode":"%s"}
......@@ -556,13 +556,13 @@ checkDict76: {"success":false,"code":"200","message":"操作成功!","data":null
#测试场景七十七:获取产品线详情
"url77": "/product/back/queryProductLineDetail"
"payload77": {"productCode":"","productName":"","specifications":"","materialCode":"","manufacturer":"","pageNum":1,"pageSize":10,"productLineCode":"3041"}
"payload77": {"productCode":"","productName":"","specifications":"","materialCode":"","manufacturer":"","pageNum":1,"pageSize":10,"productLineCode":"10052433"}
#预期结果
checkDict77: {"success":true,"code":"200","message":"OK"}
#测试场景七十八:查询条件验证_产品线详情
"url78": "/product/back/queryProductLineDetail"
"payload78": {"productCode":"%s","productName":"%s","specifications":"%s","materialCode":"%s","manufacturer":"%s","pageNum":1,"pageSize":10,"productLineCode":"3041"}
"payload78": {"productCode":"%s","productName":"%s","specifications":"%s","materialCode":"%s","manufacturer":"%s","pageNum":1,"pageSize":10,"productLineCode":"10052433"}
#预期结果
checkDict78: {"productCode":"%s"}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment