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-cmdc
Commits
6af1e53a
Commit
6af1e53a
authored
Mar 14, 2024
by
liguangyu06
Browse files
优化
parent
7d20a129
Changes
1
Hide whitespace changes
Inline
Side-by-side
air_case/cmdc_trade/查询条件验证_发票清单列表.air/查询条件验证_发票清单列表.py
View file @
6af1e53a
...
@@ -28,10 +28,11 @@ request_body = commonFuc().get_business_data(module, "payload35")
...
@@ -28,10 +28,11 @@ request_body = commonFuc().get_business_data(module, "payload35")
# 发送请求
# 发送请求
result
=
requests
.
post
(
url
,
json
=
request_body
,
headers
=
headers
)
result
=
requests
.
post
(
url
,
json
=
request_body
,
headers
=
headers
)
result
=
json
.
loads
(
result
.
content
)
result
=
json
.
loads
(
result
.
content
)
print
(
result
)
# 生成随机数
# 生成随机数
invoice_random
=
random
.
randint
(
0
,
len
(
result
[
"data"
][
"list"
])
-
1
)
invoice_random
=
random
.
randint
(
2
,
len
(
result
[
"data"
][
"list"
])
-
1
)
# 获取发票信息
# 获取发票信息
# print(invoice_random)
invoice_no
=
result
[
"data"
][
"list"
][
invoice_random
][
"invoiceNo"
]
invoice_no
=
result
[
"data"
][
"list"
][
invoice_random
][
"invoiceNo"
]
invoice_time_begin
=
result
[
"data"
][
"list"
][
invoice_random
][
"invoiceTime"
].
replace
(
"/"
,
"-"
)
+
" 00:00:00"
invoice_time_begin
=
result
[
"data"
][
"list"
][
invoice_random
][
"invoiceTime"
].
replace
(
"/"
,
"-"
)
+
" 00:00:00"
invoice_time_end
=
datetime
.
datetime
.
now
().
strftime
(
"%Y-%m-%d 23:59:59"
)
invoice_time_end
=
datetime
.
datetime
.
now
().
strftime
(
"%Y-%m-%d 23:59:59"
)
...
@@ -42,7 +43,7 @@ demand_parent_code = result["data"]["list"][invoice_random]["demandParentCode"]
...
@@ -42,7 +43,7 @@ demand_parent_code = result["data"]["list"][invoice_random]["demandParentCode"]
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"url36"
)
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"url36"
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload36"
,
invoice_no
,
invoice_time_begin
,
invoice_time_end
,
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload36"
,
invoice_no
,
invoice_time_begin
,
invoice_time_end
,
company_ode
,
demand_parent_code
)
company_ode
,
demand_parent_code
)
# print(request_body)
"""
"""
场景: 查询条件验证_发票清单列表
场景: 查询条件验证_发票清单列表
...
@@ -56,6 +57,7 @@ result = requests.post(url, json=request_body, headers=headers)
...
@@ -56,6 +57,7 @@ result = requests.post(url, json=request_body, headers=headers)
api_time
=
float
(
result
.
elapsed
.
total_seconds
())
api_time
=
float
(
result
.
elapsed
.
total_seconds
())
# 获取查询结果中invoiceNo
# 获取查询结果中invoiceNo
result
=
json
.
loads
(
result
.
content
)
result
=
json
.
loads
(
result
.
content
)
# print(result)
result
=
{
"invoiceNo"
:
result
[
"data"
][
"list"
][
0
][
"invoiceNo"
]}
result
=
{
"invoiceNo"
:
result
[
"data"
][
"list"
][
0
][
"invoiceNo"
]}
result
[
"api_time"
]
=
api_time
result
[
"api_time"
]
=
api_time
...
...
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