Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
test
autotest-airtest-web-spd
Commits
2c6f67aa
Commit
2c6f67aa
authored
Jan 10, 2024
by
xiao-hesheng
Browse files
优化脚本
parent
090f6193
Changes
5
Hide whitespace changes
Inline
Side-by-side
air_case/b2_herp3_bs/g8_8修改产品价格_暂存.air/g8_8修改产品价格_暂存.py
View file @
2c6f67aa
...
...
@@ -63,7 +63,7 @@ def test1():
code
=
commonFuc
().
analysis_json
(
'code'
,
result
)
data
=
commonFuc
().
analysis_json
(
'data'
,
result
)
checkDict
=
commonFuc
().
get_business_data
(
module
,
'checkDict10'
)
if
code
>
=
0
:
if
code
=
=
0
:
print
(
code
)
commonFuc
().
check_text_exist
(
0
,
result
)
commonFuc
().
check_result
(
checkDict
,
result
)
...
...
air_case/b2_herp3_bs/g8_9调价管理列表_查询_暂存状态数据.air/g8_9调价管理列表_查询_暂存状态数据.py
0 → 100644
View file @
2c6f67aa
# -*- encoding=utf8 -*-
import
sys
from
airtest.core.helper
import
using
from
common.db.sql.sql_del_branch_info
import
delByBranchId
from
common.db.sql.sql_del_kind_goodsinfo
import
delKindGoodsinfo
from
common.db.sql.sql_del_notices_info
import
delByNoticeName
from
common.fileUtls
import
FileUtils
from
common.timeUtils
import
timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,g8_9调价管理列表_查询_暂存状态数据,id2263,id2263-77,sit,on
内网:g8_9调价管理列表_查询_暂存状态数据
"""
from
common.common_func
import
commonFuc
from
air_case.b1_herp3_login.登录内网系统.登录内网系统
import
login_system
module
=
"b2_herp3_bs"
def
test1
():
"""
场景:g8_5调价管理列表_查询
用例名称:g8_5调价管理列表_查询
输入:无
输出:"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)
#g8_5调价管理列表_查询
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"pricePage_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"
))
# #请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload50_4"
)
print
(
request_body
)
# # # 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'resultaaaaaaaaaaaaaaaaaaaaaaaaaaa'
,
result
)
#断言
# checkDict=commonFuc().get_business_data(module,'checkDict10')
# commonFuc().check_result(checkDict,result)
code
=
commonFuc
().
analysis_json
(
'code'
,
result
)
data
=
commonFuc
().
analysis_json
(
'data'
,
result
)
total
=
commonFuc
().
analysis_json
(
'total'
,
data
)
data1
=
commonFuc
().
analysis_json
(
'data'
,
data
)
if
code
>=
0
and
total
>=
0
:
# print(code)
GChid
=
commonFuc
().
analysis_json
(
'id'
,
data1
[
0
])
print
(
GChid
)
commonFuc
().
check_text_exist
(
0
,
result
)
return
GChid
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
test1
()
air_case/b2_herp3_bs/g9_1修改产品价格_提交.air/g9_1修改产品价格_提交.py
0 → 100644
View file @
2c6f67aa
# -*- encoding=utf8 -*-
import
sys
from
airtest.core.helper
import
using
from
common.dateUtils
import
dateUtils
from
common.db.sql.sql_del_branch_info
import
delByBranchId
from
common.db.sql.sql_del_kind_goodsinfo
import
delKindGoodsinfo
from
common.db.sql.sql_del_notices_info
import
delByNoticeName
from
common.fileUtls
import
FileUtils
from
common.timeUtils
import
timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,g8_9修改产品价格_提交,id2263,id2263-78,sit,on
内网:g8_9修改产品价格_提交
"""
from
common.common_func
import
commonFuc
from
air_case.b1_herp3_login.登录内网系统.登录内网系统
import
login_system
module
=
"b2_herp3_bs"
def
test1
():
"""
场景:g8_8修改产品价格_暂存
用例名称:g8_8修改产品价格_暂存
输入:无
输出:"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)
#g8_8修改产品价格_暂存
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"goodsChgMain_insert_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"
))
# # 获取hosGoodsId
pro_path
=
commonFuc
().
get_pro_path
()
sys
.
path
.
append
(
pro_path
+
r
'\\air_case\\b2_herp3_bs\\g8_6添加产品列表_查询.air'
)
using
(
pro_path
+
r
'\\air_case\\b2_herp3_bs\\g8_6添加产品列表_查询.air'
)
from
g8_6添加产品列表_查询
import
select1
hosGoodsId
,
provGoodsId
=
select1
()
#获取GChid
sys
.
path
.
append
(
pro_path
+
r
'\\air_case\\b2_herp3_bs\\g8_9调价管理列表_查询_暂存状态数据.air'
)
using
(
pro_path
+
r
'\\air_case\\b2_herp3_bs\\g8_9调价管理列表_查询_暂存状态数据.air'
)
from
g8_9调价管理列表_查询_暂存状态数据
import
test1
GChid
=
test1
()
#获取日期
currentdate
=
dateUtils
().
get_current_date
()
# print(currentdate)
#请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload50_5"
,
hosGoodsId
,
provGoodsId
,
currentdate
,
GChid
)
print
(
request_body
)
# # # 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'resultaaaaaaaaaaaaaaaaaaaaaaaaaaa'
,
result
)
#断言
# checkDict=commonFuc().get_business_data(module,'checkDict10')
# commonFuc().check_result(checkDict,result)
code
=
commonFuc
().
analysis_json
(
'code'
,
result
)
data
=
commonFuc
().
analysis_json
(
'data'
,
result
)
checkDict
=
commonFuc
().
get_business_data
(
module
,
'checkDict10'
)
if
code
>=
0
:
print
(
code
)
commonFuc
().
check_text_exist
(
0
,
result
)
commonFuc
().
check_result
(
checkDict
,
result
)
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
test1
()
data/b2_herp3_bs/data
View file @
2c6f67aa
...
...
@@ -238,6 +238,9 @@ json_headers2: {
"payload50_1": {"queryObject":{"provId":"p10d95","hosId":"h0347","subProvId":"p10d95","goodsMfrsName":"","goodsName":"","sphgIds":[]},"pageNum":1,"pageSize":50}
"payload50_2": {"hosGoodsIds": ["%s"],"hosId": "h0347"}
"payload50_3": {"attachments":[{"fileName":"","filePath":""}],"changeDetails":[{"hosGoodsId":"%s","newValue":2659,"oldValue":2658,"supplyProvId":"%s"}],"chgType":"GOODS_COLLECT_CHANGE_PRICE","provId":"p10d95","subProvId":"p10d95","hosId":"h0347","planEffectiveDate":"%s 00:00:00","remark":"","id":"","submit":false}
"payload50_4": {"pageNum":1,"pageSize":50,"orderBy":"mgcm.create_time desc","queryObject":{"startDate":null,"endDate":null,"goodsName":"","hosId":"h0347", "tbStatus":"0"}}
"payload50_5": {"attachments":[{"fileName": "","filePath": ""}],"changeDetails": [{"hosGoodsId": "%s","newValue": 2659,"oldValue": 2658,"supplyProvId": "%s"}],"chgType": "GOODS_COLLECT_CHANGE_PRICE","provId": "p10d95","subProvId":"p10d95","hosId": "h0347","planEffectiveDate": "%s 00:00:00","remark": "","id": "%s","submit": true}
checkDict: {"code": 0,'msg': None,'data': True}
checkDict1: {
...
...
report/summary.html
View file @
2c6f67aa
...
...
@@ -56,7 +56,7 @@
<tr
width=
"600"
>
<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分
3
秒
</td>
<td
class=
"details-col-elapsed"
>
100.0%
</td>
</tr>
</table>
...
...
@@ -72,9 +72,9 @@
</tr>
<tr
width=
"600"
>
<td
class=
"details-col-elapsed"
><a
href=
'../log/
b6_删除公告
/log.html'
target=
'_blank'
>
b6_删除公告
</a></td>
<td
class=
"details-col-elapsed"
><a
href=
'../log/
g9_1修改产品价格_提交
/log.html'
target=
'_blank'
>
g9_1修改产品价格_提交
</a></td>
<td
class=
"success"
>
成功
</td>
<td
class=
"details-col-elapsed"
>
0.886
</td>
<td
class=
"details-col-elapsed"
>
3.625
</td>
<td
class=
"details-col-elapsed"
>
xiaohesheng
</td>
</tr>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment