Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
libin
workspace-ui-test
Commits
3c696c48
Commit
3c696c48
authored
5 years ago
by
libin
Browse files
Options
Download
Email Patches
Plain Diff
test
parent
33302e71
test
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/run.py
+16
-20
src/run.py
with
16 additions
and
20 deletions
+16
-20
src/run.py
+
16
-
20
View file @
3c696c48
...
...
@@ -3,35 +3,31 @@
import
os
import
time
import
unittest
from
dep
import
HTMLTestRunner
from
src.common
import
web_client
testunit
=
unittest
.
TestSuite
()
test_dir
=
'testcases'
from
src.datalib
import
init_data
from
src.dep
import
HTMLTestRunner
from
src.common
import
web_client
init_data
.
init
()
testunit
=
unittest
.
TestSuite
()
test_dir
=
'../testcase_for_test'
tests
=
unittest
.
defaultTestLoader
.
discover
(
test_dir
,
pattern
=
'
testcase
*.py'
,
tests
=
unittest
.
defaultTestLoader
.
discover
(
test_dir
,
pattern
=
'*.py'
,
top_level_dir
=
None
)
test_report
=
'./report/'
test_report
=
'.
.
/report/'
now
=
time
.
strftime
(
"%Y_%m_%d_%H_%M_%S"
)
# 获取当前时间
#定义个报告存放路径
#
定义个报告存放路径
filename
=
test_report
+
now
+
'_result.html'
fp
=
open
(
filename
,
'wb'
)
#定义测试报告
runner
=
HTMLTestRunner
.
HTMLTestRunner
(
stream
=
fp
,
title
=
u
'智能工位系统测试报告'
,
description
=
u
'用例执行情况:'
)
#运行测试用例
runner
.
run
(
tests
)
fp
.
close
()
cwdpath
=
os
.
getcwd
()
report
=
web_client
.
WebClient
(
'file:////'
+
cwdpath
+
filename
[
1
:])
report
.
run_chrome
()
# 定义测试报告
runner
=
HTMLTestRunner
.
HTMLTestRunner
(
stream
=
fp
,
verbosity
=
2
,
title
=
u
'智能工位系统测试报告'
,
description
=
u
'用例执行情况:'
)
# 运行测试用例
runner
.
run
(
tests
)
fp
.
close
()
report
=
web_client
.
WebClient
(
'file:////'
+
os
.
path
.
abspath
(
filename
))
report
.
run_chrome
()
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help