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

新增公告相关脚本

parent 80385be8
# -*- encoding=utf8 -*-
from common.db.sql.sql_del_branch_info import delByBranchId
from common.timeUtils import timeUtils
__author__ = "xiaohesheng"
"""
case_tag:api,herp-web,a10_新增公告_中心库,id2263,id2263-10,sit,on
主数据平台:a10_新增公告_中心库
"""
from common.common_func import commonFuc
from air_case.a1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "a2_herp3_bs"
def add_notices():
"""
场景:a10_新增公告_中心库
用例名称:a10_新增公告_中心库
输入:无
输出:"rtn_msg": {"code": 0, "msg": null, "data": 1}
"""
#内网登录
username = commonFuc().get_business_data(module, "username")
# print('医院名称',username)
password = commonFuc().get_business_data(module, "password")
# print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
# 获取token和projectCode
token,projectCode,uxid,corpId,info= login_system(username, password).get_token()
# print( token,projectCode,uxid,corpId,info)
#a10_新增公告_中心库
url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "save_url")
print(url)
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
commonFuc().get_business_data(module, "X-APP-CODE"))
expireDate=timeUtils().get_time_add(30)
# print(expireDate)
#请求体
request_body=commonFuc().get_business_data(module, "payload5",expireDate)
# 发送请求
result = commonFuc().http_post(url, request_body,headers)
print('result', result)
#断言
check_dict = commonFuc().get_business_data(module, "checkDict2")
commonFuc().check_result(check_dict, result)
add_notices()
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
__author__ = "xiaohesheng" __author__ = "xiaohesheng"
""" """
case_tag:api,mdm-herp,a1_医院信息登记,id2263,id2263-1,sit,on case_tag:api,herp-web,a1_医院信息登记,id2263,id2263-1,sit,on
主数据平台:a1_医院信息登记 主数据平台:a1_医院信息登记
""" """
......
# -*- encoding=utf8 -*- # -*- encoding=utf8 -*-
from common.db.sql.sql_del_branch_info import delByBranchId
__author__ = "xiaohesheng" __author__ = "xiaohesheng"
...@@ -47,4 +48,6 @@ def enable_branch(): ...@@ -47,4 +48,6 @@ def enable_branch():
#断言 #断言
check_dict = commonFuc().get_business_data(module, "checkDict") check_dict = commonFuc().get_business_data(module, "checkDict")
commonFuc().check_result(check_dict, result) commonFuc().check_result(check_dict, result)
enable_branch() return branch_id
\ No newline at end of file branch_id=enable_branch()
delByBranchId().Delete_branch_by_id(branch_id)
\ No newline at end of file
# -*- encoding=utf8 -*-
from common.db.sql.sql_del_branch_info import delByBranchId
from common.timeUtils import timeUtils
__author__ = "xiaohesheng"
"""
case_tag:api,herp-web,a8_新增公告_全部,id2263,id2263-8,sit,on
主数据平台:a8_新增公告_全部
"""
from common.common_func import commonFuc
from air_case.a1_herp3_login.登录内网系统.登录内网系统 import login_system
from airtest.core.api import using
import sys
from common.fileUtls import FileUtils
module = "a2_herp3_bs"
def add_notices():
"""
场景:a8_新增公告_全部
用例名称:a8_新增公告_全部
输入:无
输出:"rtn_msg": {"code": 0, "msg": null, "data": 1}
"""
#内网登录
username = commonFuc().get_business_data(module, "username")
# print('医院名称',username)
password = commonFuc().get_business_data(module, "password")
# print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
# 获取token和projectCode
token,projectCode,uxid,corpId,info= login_system(username, password).get_token()
# print( token,projectCode,uxid,corpId,info)
#a8_新增公告_全部
url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "save_url")
print(url)
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
commonFuc().get_business_data(module, "X-APP-CODE"))
expireDate=timeUtils().get_time_add(30)
# print(expireDate)
#请求体
request_body=commonFuc().get_business_data(module, "payload3",expireDate)
# 发送请求
result = commonFuc().http_post(url, request_body,headers)
print('result', result)
#断言
check_dict = commonFuc().get_business_data(module, "checkDict2")
commonFuc().check_result(check_dict, result)
add_notices()
# -*- encoding=utf8 -*-
from common.db.sql.sql_del_branch_info import delByBranchId
from common.fileUtls import FileUtils
from common.timeUtils import timeUtils
__author__ = "xiaohesheng"
"""
case_tag:api,herp-web,a9_新增公告_全院,id2263,id2263-9,sit,on
主数据平台:a9_新增公告_全院
"""
from common.common_func import commonFuc
from air_case.a1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "a2_herp3_bs"
def add_notices():
"""
场景:a9_新增公告_全院
用例名称:a9_新增公告_全院
输入:无
输出:"rtn_msg": {"code": 0, "msg": null, "data": 1}
"""
#内网登录
username = commonFuc().get_business_data(module, "username")
# print('医院名称',username)
password = commonFuc().get_business_data(module, "password")
# print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
# 获取token和projectCode
token,projectCode,uxid,corpId,info= login_system(username, password).get_token()
# print( token,projectCode,uxid,corpId,info)
#a9_新增公告_全院
url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "save_url")
print(url)
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
commonFuc().get_business_data(module, "X-APP-CODE"))
expireDate=timeUtils().get_time_add(30)
# print(expireDate)
#请求体
request_body=commonFuc().get_business_data(module, "payload4",expireDate)
# 发送请求
result = commonFuc().http_post(url, request_body,headers)
print('result', result)
#断言
check_dict = commonFuc().get_business_data(module, "checkDict2")
commonFuc().check_result(check_dict, result)
add_notices()
...@@ -5,7 +5,7 @@ import pymysql ...@@ -5,7 +5,7 @@ import pymysql
class delByBranchId(object): class delByBranchId(object):
def Delete_branch_by_name(self,id): def Delete_branch_by_id(self,id):
connection = pymysql.connect(host="10.17.65.108", user="root", password="Gyxc.2023", database="spd3_herp_test2", connection = pymysql.connect(host="10.17.65.108", user="root", password="Gyxc.2023", database="spd3_herp_test2",
charset="utf8") charset="utf8")
cursor = connection.cursor() cursor = connection.cursor()
......
from common.db.db import dbOP from common.db.db import dbOP
import datetime import datetime
from datetime import timedelta, date
# 数据读入和写入文件 # 数据读入和写入文件
class timeUtils(object): class timeUtils(object):
...@@ -9,4 +9,10 @@ class timeUtils(object): ...@@ -9,4 +9,10 @@ class timeUtils(object):
'''2023-05-06 09:39:30''' '''2023-05-06 09:39:30'''
import time import time
t = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) t = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
return t
def get_time_add(self,days_aa):
import time
# t = time.strftime("%Y-%m-%d", datetime.datetime.now())
t = (date.today() + timedelta(days=days_aa)).strftime("%Y-%m-%d %H:%M:%S")
return t return t
\ No newline at end of file
...@@ -18,7 +18,7 @@ json_headers2: { ...@@ -18,7 +18,7 @@ json_headers2: {
"passwd": "%s", "passwd": "%s",
"verifyCodeId": "%s", "verifyCodeId": "%s",
"verifyCode": "", "verifyCode": "",
"projectCode": "hdi.pc" "projectCode": "herp.pc"
} }
"payload2": { "payload2": {
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
"insert_url": "/hospitaltest2api/platformService/basic/branch/insert/" "insert_url": "/hospitaltest2api/platformService/basic/branch/insert/"
"page_url": "/hospitaltest2api/platformService/basic/branch/page/" "page_url": "/hospitaltest2api/platformService/basic/branch/page/"
"edit_url": "/hospitaltest2api/platformService/basic/branch/edit/" "edit_url": "/hospitaltest2api/platformService/basic/branch/edit/"
"save_url": "/hospitaltest2api/platformService/basic/notice/save"
"username": "xhs1009" "username": "xhs1009"
"password": "1qaz!QAZ" "password": "1qaz!QAZ"
"X-APP-CODE": "herp.pc" "X-APP-CODE": "herp.pc"
...@@ -62,6 +63,12 @@ json_headers2: { ...@@ -62,6 +63,12 @@ json_headers2: {
"ybFlag": "0", "ybFlag": "0",
"address": "东土城路院区" "address": "东土城路院区"
} }
"payload3": {"content":"<p>test</p>","corpId":"h0347","expireDate":"%s","id":"","mgrRangeId":"","mgrRangeKind":"0","noticeType":1,"title":"test","topFlag":"0"}
"payload4": {"content":"<p>test</p>","corpId":"h0347","expireDate":"%s","id":"","mgrRangeId":"","mgrRangeKind":"1","noticeType":1,"title":"test","topFlag":"0"}
"payload5": {"content":"<p>test</p>","corpId":"h0347","expireDate":"%s","id":"","mgrRangeId":"","mgrRangeKind":"2","noticeType":1,"title":"test","topFlag":"0"}
checkDict: {"code": 0,'msg': None,'data': True} checkDict: {"code": 0,'msg': None,'data': True}
checkDict1: { checkDict1: {
"code": 0, "code": 0,
...@@ -121,8 +128,8 @@ checkDict1: { ...@@ -121,8 +128,8 @@ checkDict1: {
checkDict: {"code": 0,'msg': None,'data':1} checkDict2: {"code": 0,'msg': None,'data':1}
checkDict1: {"code": 400,'msg': '供销关系已存在!请勿重复添加','data':None} checkDict3: {"code": 400,'msg': '供销关系已存在!请勿重复添加','data':None}
checkDict2: {"code": 400,'msg': None,'data':None} checkDict4: {"code": 400,'msg': None,'data':None}
checkDict3: {'code': 400, 'msg': '数据更新不成功,可能数据的版本不一致!请刷新页面重试', 'data': None} checkDict5: {'code': 400, 'msg': '数据更新不成功,可能数据的版本不一致!请刷新页面重试', 'data': None}
checkDict4: {'code': 0, 'msg': None, 'data': []} checkDict6: {'code': 0, 'msg': None, 'data': []}
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
<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'>1</td> <td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>0分0</td> <td class='details-col-elapsed'>0分1</td>
<td class="details-col-elapsed">100.0%</td> <td class="details-col-elapsed">100.0%</td>
</tr> </tr>
</table> </table>
...@@ -72,9 +72,9 @@ ...@@ -72,9 +72,9 @@
</tr> </tr>
<tr width="600"> <tr width="600">
<td class="details-col-elapsed"><a href='../log/a7_启用院区/log.html' target='_blank'>a7_启用院区</a></td> <td class="details-col-elapsed"><a href='../log/a10_新增公告_中心库/log.html' target='_blank'>a10_新增公告_中心库</a></td>
<td class="success">成功</td> <td class="success">成功</td>
<td class="details-col-elapsed">0.799</td> <td class="details-col-elapsed">1.066</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