Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
InterfaceAutoTest
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TestAuto
InterfaceAutoTest
Commits
ba316f1a
Commit
ba316f1a
authored
May 06, 2021
by
jiaqiying
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug
parent
722dcb8d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
run.py
+9
-7
No files found.
run.py
View file @
ba316f1a
...
@@ -7,22 +7,24 @@ from common.tools import get_case_dir
...
@@ -7,22 +7,24 @@ from common.tools import get_case_dir
def
get_parser
():
def
get_parser
():
parser
=
argparse
.
ArgumentParser
(
description
=
"
Demo of
argparse"
)
parser
=
argparse
.
ArgumentParser
(
description
=
"argparse"
)
parser
.
add_argument
(
'--product'
,
type
=
str
,
default
=
BaseConfig
.
current_product
)
parser
.
add_argument
(
'--product'
,
type
=
str
,
default
=
BaseConfig
.
current_product
)
return
parser
return
parser
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
parser
=
get_parser
()
parser
=
get_parser
()
args
=
get_parser
()
args
=
parser
.
parse_args
()
BaseConfig
.
current_product
=
args
.
product
# 获取要执行的产品的用例目录
# 获取要执行的产品的用例目录
test_case_dir
=
get_case_dir
(
args
.
product
)
test_case_dir
=
get_case_dir
(
args
.
product
)
print
(
"********此次执行的产品测试用例是:
%
s********"
%
test_case_dir
)
#删除之前报告
#删除之前报告
for
one
in
os
.
listdir
(
'.
.
/report/tmp'
):
for
one
in
os
.
listdir
(
'./report/tmp'
):
if
'json'
in
one
:
if
'json'
in
one
:
os
.
remove
(
f
'.
.
/report/tmp/{one}'
)
os
.
remove
(
f
'./report/tmp/{one}'
)
# 生成报告数据
# 生成报告数据
pytest
.
main
([
'-v'
,
'-s'
,
test_case_dir
,
'--alluredir'
,
'.
.
/report/tmp'
])
pytest
.
main
([
'-v'
,
'-s'
,
test_case_dir
,
'--alluredir'
,
'./report/tmp'
])
# 打开报告
# 打开报告
os
.
system
(
'allure serve ../report/tmp'
)
os
.
system
(
'allure serve ./report/tmp'
)
\ No newline at end of file
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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