Commit 4768b0fa authored by xiao-hesheng's avatar xiao-hesheng
Browse files

新增角色管理脚本

No related merge requests found
Showing with 9 additions and 16 deletions
+9 -16
...@@ -50,7 +50,7 @@ def test1(): ...@@ -50,7 +50,7 @@ def test1():
print('request_body', request_body) print('request_body', request_body)
# # # # 发送请求 # # # # 发送请求
result = commonFuc().http_post(url, request_body, headers) result = commonFuc().http_post(url, request_body, headers)
print('resultccccccccccccccc', result) print('resultaaaaaaaaaaaaaaaaaaa', result)
# 断言 # 断言
code = commonFuc().analysis_json('code', result) code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result) data = commonFuc().analysis_json('data', result)
...@@ -58,11 +58,11 @@ def test1(): ...@@ -58,11 +58,11 @@ def test1():
if code == 0 and len(data) >= 1: if code == 0 and len(data) >= 1:
for i in data: for i in data:
cname = commonFuc().analysis_json('cname', i) cname = commonFuc().analysis_json('cname', i)
if cname == '自动化测试': if cname == '自动化测试'or cname=='自动化测试2':
id1 = commonFuc().analysis_json('id', i) id1 = commonFuc().analysis_json('id', i)
break break
commonFuc().check_text_exist(0, result) commonFuc().check_text_exist(0, result)
print(id1) print('id1',id1)
#r_e5用户管理_角色管理_编辑角色名称 #r_e5用户管理_角色管理_编辑角色名称
...@@ -74,24 +74,17 @@ def test1(): ...@@ -74,24 +74,17 @@ def test1():
commonFuc().get_business_data(module, "X-APP-CODE")) commonFuc().get_business_data(module, "X-APP-CODE"))
# # 请求体 # # 请求体
request_body = commonFuc().get_business_data(module, 'payload63_4',id1) request_body = commonFuc().get_business_data(module, 'payload63_4',id1)
# request_body=str(request_body)
new_request_body = request_body.replace("'", '"')
# new_request_body = new_request_body.replace("None", 'null')
# print(new_request_body)
import json
request_body_json = json.loads(new_request_body)
print('request_body_json',request_body_json)
# print('request_body', request_body) # print('request_body', request_body)
# # # # # 发送请求 # # # # # 发送请求
result = commonFuc().http_post(url, request_body_json, headers) result = commonFuc().http_post(url, request_body, headers)
print('resultccccccccccccccc', result) print('resultccccccccccccccc', result)
# #断言 # #断言
code = commonFuc().analysis_json('code', result) code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result) data = commonFuc().analysis_json('data', result)
roleCode="" roleCode=""
if code == 0 and len(data) >= 1: if code == 0 and data == 1:
commonFuc().check_text_exist(0, result) commonFuc().check_text_exist(0, result)
......
...@@ -55,9 +55,9 @@ ...@@ -55,9 +55,9 @@
<tr width="600"> <tr width="600">
<td class='details-col-elapsed'>1</td> <td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>0</td> <td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>0分2秒</td> <td class='details-col-elapsed'>0分2秒</td>
<td class="details-col-elapsed">0.0%</td> <td class="details-col-elapsed">100.0%</td>
</tr> </tr>
</table> </table>
...@@ -73,8 +73,8 @@ ...@@ -73,8 +73,8 @@
<tr width="600"> <tr width="600">
<td class="details-col-elapsed"><a href='../log/r_e5用户管理_角色管理_编辑角色名称/log.html' target='_blank'>r_e5用户管理_角色管理_编辑角色名称</a></td> <td class="details-col-elapsed"><a href='../log/r_e5用户管理_角色管理_编辑角色名称/log.html' target='_blank'>r_e5用户管理_角色管理_编辑角色名称</a></td>
<td class="fail">失败</td> <td class="success">成功</td>
<td class="details-col-elapsed">2.798</td> <td class="details-col-elapsed">2.839</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