Commit dd8e1162 authored by xiao-hesheng's avatar xiao-hesheng
Browse files

新增spd3.0外网注册企业接口测试脚本

parent 2772d0fe
...@@ -18,7 +18,7 @@ print(url) ...@@ -18,7 +18,7 @@ print(url)
# #获取请求头信息 # #获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers", commonFuc().get_business_data(module,"json_contentType")) headers = commonFuc().get_business_data(module, "json_headers", commonFuc().get_business_data(module,"json_contentType"))
print(headers) print(headers)
name=commonFuc().get_business_data(module,"name")#获取前缀name name=commonFuc().get_business_data(module,"name1")#获取前缀name
cname=name+commonFuc().randomString(5)#随机数生成拼接企业名称 cname=name+commonFuc().randomString(5)#随机数生成拼接企业名称
request_body = commonFuc().get_business_data(module, "payload",cname,cname,cname,cname,cname) request_body = commonFuc().get_business_data(module, "payload",cname,cname,cname,cname,cname)
print(request_body) print(request_body)
...@@ -29,9 +29,11 @@ print(request_body) ...@@ -29,9 +29,11 @@ print(request_body)
输出:"rtn_msg": "返回注册企业信息" 输出:"rtn_msg": "返回注册企业信息"
""" """
#发送请求 #发送请求
result = commonFuc().http_post(url, request_body, headers) result = commonFuc().http_post(url, request_body, headers)
print(result) print(result)
#获取预期结果 #获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict") check_dict = commonFuc().get_business_data(module, "checkDict")
# commonFuc().check_result(check_dict, result) print(check_dict)
\ No newline at end of file #断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
commonFuc().check_text_exist(name,result)
...@@ -339,6 +339,17 @@ class commonFuc(object): ...@@ -339,6 +339,17 @@ class commonFuc(object):
Flag = True Flag = True
assert_equal(Flag, True, '验证参数' + variable + "存在") assert_equal(Flag, True, '验证参数' + variable + "存在")
def check_text_exist(self, check_text, result):
"""
结果检查,检查文本内容是否存在于返回结果中
"""
Flag = False
# print('bbbbbbbbbbbbbbbbbbbbbbbbb'+str(result.values()))
if check_text in str(result.values()):
Flag = True
# print('aaaaaaaaaaaaaaaaaaaaaaaaaaaaa',Flag)
assert_equal(Flag, True, '验证文本' + check_text + "存在")
def enter_h5_page(self, driver, params): def enter_h5_page(self, driver, params):
""" """
:param driver: :param driver:
......
...@@ -41,6 +41,5 @@ json_headers: { ...@@ -41,6 +41,5 @@ json_headers: {
"companyRegistBizscopeVos": [], "companyRegistBizscopeVos": [],
"certVOList": [] "certVOList": []
} }
"name1": "国药集团公司"
name:"国药集团公司" checkDict: {"code": 0,'msg': None}
checkDict: {"code": 0}
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
<tr width="600"> <tr width="600">
<td class="details-col-elapsed"><a href='../log/外网企业注册-器械注册人/log.html' target='_blank'>外网企业注册-器械注册人</a></td> <td class="details-col-elapsed"><a href='../log/外网企业注册-器械注册人/log.html' target='_blank'>外网企业注册-器械注册人</a></td>
<td class="success">成功</td> <td class="success">成功</td>
<td class="details-col-elapsed">0.289</td> <td class="details-col-elapsed">0.373</td>
<td class="details-col-elapsed">xiaohesheng</td> <td class="details-col-elapsed">xiaohesheng</td>
</tr> </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