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
e71ee492
Commit
e71ee492
authored
Jan 16, 2024
by
liguangyu06
Browse files
优化和调整模板
parent
6426fd8a
Changes
3
Hide whitespace changes
Inline
Side-by-side
common/run_case_conditions.py
View file @
e71ee492
...
@@ -184,13 +184,14 @@ class CustomAirTestCase(AirtestCase):
...
@@ -184,13 +184,14 @@ class CustomAirTestCase(AirtestCase):
f
.
close
()
f
.
close
()
start_time
=
float
(
re
.
findall
(
'.*"start_time": (.*), "ret".*'
,
lines
[
0
])[
0
])
start_time
=
float
(
re
.
findall
(
'.*"start_time": (.*), "ret".*'
,
lines
[
0
])[
0
])
start_time
=
int
(
start_time
*
1000
)
start_time
=
int
(
start_time
*
1000
)
api_time
=
re
.
findall
(
'"api_time":(.*)}, "second"'
,
lines
[
0
])[
0
]
try
:
try
:
end_time
=
float
(
re
.
findall
(
'.*"end_time": (.*)}}.*'
,
lines
[
-
1
])[
0
])
end_time
=
float
(
re
.
findall
(
'.*"end_time": (.*)}}.*'
,
lines
[
-
1
])[
0
])
except
:
except
:
# case执行失败的话没打end_time
# case执行失败的话没打end_time
end_time
=
float
(
re
.
findall
(
'.*"time": (.*), "data".*'
,
lines
[
-
2
])[
0
])
end_time
=
float
(
re
.
findall
(
'.*"time": (.*), "data".*'
,
lines
[
-
2
])[
0
])
end_time
=
int
(
end_time
*
1000
)
end_time
=
int
(
end_time
*
1000
)
return
start_time
,
end_time
return
start_time
,
end_time
,
api_time
def
assign_tasks
(
self
,
task_list
,
num
):
def
assign_tasks
(
self
,
task_list
,
num
):
"""
"""
...
@@ -436,6 +437,8 @@ class CustomAirTestCase(AirtestCase):
...
@@ -436,6 +437,8 @@ class CustomAirTestCase(AirtestCase):
result
[
"result"
]
=
flag
result
[
"result"
]
=
flag
result
[
"author"
]
=
author
result
[
"author"
]
=
author
result
[
"time"
]
=
(
end
-
start
)
/
1000
if
end
>
start
else
0
result
[
"time"
]
=
(
end
-
start
)
/
1000
if
end
>
start
else
0
start_time
,
end_time
,
api_time
=
self
.
get_case_runtime
(
log
)
result
[
"api_time"
]
=
api_time
case_results
.
append
(
result
)
case_results
.
append
(
result
)
if
flag
==
False
:
if
flag
==
False
:
msg
=
confOP
().
getYamlValue
(
"msg"
)
msg
=
confOP
().
getYamlValue
(
"msg"
)
...
...
data/cmdc_special_fresenius_group/data
View file @
e71ee492
...
@@ -242,9 +242,9 @@ checkDict31: {"groupCode": "%s"}
...
@@ -242,9 +242,9 @@ checkDict31: {"groupCode": "%s"}
#测试场景:获取特殊套包详情
#测试场景:获取特殊套包详情
#获取特殊套包详情接口信息
#获取特殊套包详情接口信息
"url38": "/order/public/getDetailFreseniusGroup"
"url38": "/order/public/getDetailFreseniusGroup"
"payload38": {"productCode":"1
4037826
","companyCode":"00111"}
"payload38": {"productCode":"1
0173127
","companyCode":"00111"}
#预期结果
#预期结果
checkDict38: {"productCode": "1
4037826
"}
checkDict38: {"productCode": "1
0173127
"}
#切换站点信息
#切换站点信息
"url_website": "/user/mall/switchWebsite"
"url_website": "/user/mall/switchWebsite"
...
...
templates/summary_template.html
View file @
e71ee492
...
@@ -69,6 +69,7 @@
...
@@ -69,6 +69,7 @@
<th
class=
'details-col-msg'
>
执行结果
</th>
<th
class=
'details-col-msg'
>
执行结果
</th>
<th
class=
'details-col-msg'
>
执行时间(秒)
</th>
<th
class=
'details-col-msg'
>
执行时间(秒)
</th>
<th
class=
'details-col-msg'
>
用例作者
</th>
<th
class=
'details-col-msg'
>
用例作者
</th>
<th
class=
'details-col-msg'
>
接口响应时间(秒)
</th>
</tr>
</tr>
{% for r in case_results %}
{% for r in case_results %}
<tr
width=
"600"
>
<tr
width=
"600"
>
...
@@ -76,6 +77,7 @@
...
@@ -76,6 +77,7 @@
<td
class=
"{{'success' if r.result else 'fail'}}"
>
{{"成功" if r.result else "失败"}}
</td>
<td
class=
"{{'success' if r.result else 'fail'}}"
>
{{"成功" if r.result else "失败"}}
</td>
<td
class=
"details-col-elapsed"
>
{{r.time}}
</td>
<td
class=
"details-col-elapsed"
>
{{r.time}}
</td>
<td
class=
"details-col-elapsed"
>
{{r.author}}
</td>
<td
class=
"details-col-elapsed"
>
{{r.author}}
</td>
<td
class=
"details-col-elapsed"
>
{{r.api_time}}
</td>
</tr>
</tr>
{% endfor %}
{% endfor %}
</table>
</table>
...
...
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