Commit 882008e6 authored by 周念东's avatar 周念东
Browse files

用例优化

parent f9a12b3c
......@@ -2,7 +2,7 @@
__author__ = "zhouniandong"
"""
case_tag:cmdc_api,cmdc属性值配置,2293,2293-7,sit,bs
case_tag:cmdc_api,cmdc属性值配置,2003-7,2003-7-2,sit,bs
主数据平台:运营后台管理系统属性值配置接口
"""
......
# -*- encoding=utf8 -*-
__author__ = "zhouniandong"
"""
case_tag:cmdc_api,cmdc属性值配置编辑属性值,2003-7,2003-7-3,sit,bs
主数据平台:运营后台管理系统属性值配置接口
"""
from common.common_func import commonFuc
from air_case.cmdc_login.后台管理系统登录.后台管理系统登录 import CmdcDoLogin
import requests
import json
module = "cmdc_product_dirtvalue_config"
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url3")
print(url)
# 获取登录所需账号密码
username = commonFuc().get_business_data(module, "username")
password = commonFuc().get_business_data(module, "password")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
request_body = commonFuc().get_business_data(module, "payload3")
"""
场景:属性值配置()
用例名称:属性值配置编辑属性值(属性值配置)
输出:{"success":true,"code":"200","message":"OK"}
"""
# 发送请求
result = requests.post(url, json=request_body, headers=headers)
result = json.loads(result.content)
# print(result)
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict3")
print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
\ No newline at end of file
......@@ -2,7 +2,7 @@
__author__ = "zhouniandong"
"""
case_tag:cmdc_api,cmdc属性值配置属性列表,2293,2293-7,sit,bs
case_tag:cmdc_api,cmdc属性值配置属性列表,2003-7,2003-7-1,sit,bs
主数据平台:运营后台管理系统属性值配置接口
"""
......
......@@ -19,4 +19,11 @@ checkDict1: {"success":true,"code":"200","message":"OK"}
"payload2": {"dirtCode":null,"dirtValueName":null,"dirtValueCode":null,"pageStart":1,"pageSize":10,"pageTotal":0}
#预期结果
checkDict2: {"success":true,"code":"200","message":"OK"}
\ No newline at end of file
checkDict2: {"success":true,"code":"200","message":"OK"}
#属性值配置编辑属性值 post
"url3": "/product/updateDirtValue"
"payload3": {"dirtId":768,"dirtValueCode":"LC","dirtValueName":"圣洛西亚"}
#预期结果
checkDict3: {"success":true,"code":"200","message":"OK"}
a_商品标签管理取消标记 1718935700722 1718935702137 zhouniandong
属性值配置新增属性值 1718939182659 1718939183946 zhouniandong
......@@ -73,9 +73,9 @@
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/a_商品标签管理取消标记/log.html' target='_blank'>a_商品标签管理取消标记</a></td>
<td class="details-col-elapsed"><a href='../log/属性值配置新增属性值/log.html' target='_blank'>属性值配置新增属性值</a></td>
<td class="fail">失败</td>
<td class="details-col-elapsed">1.415</td>
<td class="details-col-elapsed">1.287</td>
<td class="details-col-elapsed">zhouniandong</td>
<td class="details-col-elapsed">0</td>
</tr>
......
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