Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xm-autotest-live
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
xiamai-test
xm-autotest-live
Commits
09d36e59
Commit
09d36e59
authored
Feb 02, 2021
by
fangyuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add 获取api 个数方法
parent
4b8eda1d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
+11
-7
src/main/java/com/live/client/ExtentTestNGIReporterListener.java
+5
-1
src/main/java/com/live/utils/GetFilesNum.java
+6
-6
No files found.
src/main/java/com/live/client/ExtentTestNGIReporterListener.java
View file @
09d36e59
...
@@ -8,6 +8,7 @@ import com.aventstack.extentreports.model.TestAttribute;
...
@@ -8,6 +8,7 @@ import com.aventstack.extentreports.model.TestAttribute;
import
com.aventstack.extentreports.reporter.ExtentHtmlReporter
;
import
com.aventstack.extentreports.reporter.ExtentHtmlReporter
;
import
com.aventstack.extentreports.reporter.configuration.ChartLocation
;
import
com.aventstack.extentreports.reporter.configuration.ChartLocation
;
import
com.aventstack.extentreports.reporter.configuration.Theme
;
import
com.aventstack.extentreports.reporter.configuration.Theme
;
import
com.live.utils.GetFilesNum
;
import
org.testng.*
;
import
org.testng.*
;
import
org.testng.xml.XmlSuite
;
import
org.testng.xml.XmlSuite
;
...
@@ -112,7 +113,10 @@ public class ExtentTestNGIReporterListener implements IReporter {
...
@@ -112,7 +113,10 @@ public class ExtentTestNGIReporterListener implements IReporter {
//怎么样解决cdn.rawgit.com访问不了的情况
//怎么样解决cdn.rawgit.com访问不了的情况
htmlReporter
.
config
().
setResourceCDN
(
ResourceCDN
.
EXTENTREPORTS
);
htmlReporter
.
config
().
setResourceCDN
(
ResourceCDN
.
EXTENTREPORTS
);
htmlReporter
.
config
().
setDocumentTitle
(
"自动化测试报告"
);
htmlReporter
.
config
().
setDocumentTitle
(
"自动化测试报告"
);
htmlReporter
.
config
().
setReportName
(
"小麦自动化测试报告"
);
// 递归获取所有api数
int
apiNum
=
GetFilesNum
.
show
(
new
File
(
"src/main/java/com/live/cases"
));
htmlReporter
.
config
().
setReportName
(
"本报告覆盖"
+
apiNum
+
"个API"
);
htmlReporter
.
config
().
setChartVisibilityOnOpen
(
true
);
htmlReporter
.
config
().
setChartVisibilityOnOpen
(
true
);
htmlReporter
.
config
().
setTestViewChartLocation
(
ChartLocation
.
TOP
);
htmlReporter
.
config
().
setTestViewChartLocation
(
ChartLocation
.
TOP
);
htmlReporter
.
config
().
setTheme
(
Theme
.
STANDARD
);
htmlReporter
.
config
().
setTheme
(
Theme
.
STANDARD
);
...
...
src/main/java/com/live/utils/GetFilesNum.java
View file @
09d36e59
package
com
.
live
.
utils
;
package
com
.
live
.
utils
;
import
com.google.gson.internal.
$Gson$Preconditions
;
import
java.io.File
;
import
java.io.File
;
/**
/**
...
@@ -10,12 +12,11 @@ public class GetFilesNum {
...
@@ -10,12 +12,11 @@ public class GetFilesNum {
public
static
int
num
=
0
;
public
static
int
num
=
0
;
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
// TODO Auto-generated method stub
// TODO Auto-generated method stub
File
file
=
new
File
(
"src/main/java/com/sow/cases"
);
show
(
file
);
System
.
out
.
println
(
show
(
new
File
(
"src/main/java/com/live/cases"
)));
System
.
out
.
println
(
"有"
+
num
+
"个Jar文件"
);
}
}
public
static
void
show
(
File
file
)
{
public
static
int
show
(
File
file
)
{
// TODO Auto-generated method stub
// TODO Auto-generated method stub
for
(
File
f
:
file
.
listFiles
())
{
for
(
File
f
:
file
.
listFiles
())
{
if
(
f
.
isFile
())
{
if
(
f
.
isFile
())
{
...
@@ -26,8 +27,7 @@ public class GetFilesNum {
...
@@ -26,8 +27,7 @@ public class GetFilesNum {
show
(
f
);
show
(
f
);
}
}
}
}
return
num
;
}
}
}
}
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