Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oto
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
龚小红
oto
Commits
640fea81
Commit
640fea81
authored
Apr 26, 2020
by
Su-Yi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新maven配置 13.07
parent
5dab1de5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
542 additions
and
1581 deletions
+542
-1581
pom.xml
pom.xml
+6
-4
Home.java
src/test/java/com/kjj/qa/cases/Home.java
+80
-80
report.html
test-output/report.html
+456
-1497
No files found.
pom.xml
View file @
640fea81
...
...
@@ -121,19 +121,21 @@
<artifactId>
maven-surefire-plugin
</artifactId>
<version>
2.22.2
</version>
<configuration>
<testFailureIgnore>
true
</testFailureIgnore>
<suiteXmlFiles>
<!-- -->
<suiteXmlFile>
src/test/testNG.xml
</suiteXmlFile>
</suiteXmlFiles>
<properties>
<!--即使测试失败,也继续下面的测试-->
<property>
<name>
usedefaultlisteners
</name>
<value>
false
</value>
</property>
<property>
<name>
listener
</name>
<value>
com.kjj.qa.config.ExtentTestNGIReporterListener
</value>
</property>
</properties>
<!--即使测试失败,也继续下面的测试-->
<testFailureIgnore>
true
</testFailureIgnore>
</configuration>
</plugin>
...
...
src/test/java/com/kjj/qa/cases/Home.java
View file @
640fea81
...
...
@@ -44,86 +44,86 @@ public class Home {
Assert
.
assertEquals
(
result
,
true
,
"获取jssdk失败"
);
}
@Test
(
description
=
"早中晚日报列表"
,
priority
=
2
)
public
void
早中晚日报列表
()
throws
IOException
{
Response
response
=
network
.
getResponse
(
"/kjy/mp/content/getInitDailyList"
);
int
status
=
response
.
jsonPath
().
get
(
"data[0].status"
);
Assert
.
assertEquals
(
status
,
2
,
"获取早中晚日报列表信息失败"
);
}
@Test
(
description
=
"精准素材库"
,
priority
=
3
)
public
void
精准素材库
()
throws
IOException
{
Response
response
=
network
.
getResponse
(
"/kjy/mp/accurate/usrDetail"
);
int
result
=
response
.
jsonPath
().
get
(
"data.companyId"
);
Assert
.
assertEquals
(
result
,
5
,
"获取精准素材成功"
);
// Reporter.log("用例执行失败:服务器错误!");
}
@Test
(
description
=
"今日访问"
,
priority
=
4
)
public
void
今日访问
()
throws
IOException
{
//获取旧的今日访问数量
Response
response
=
network
.
getResponse
(
"/kjy/mp/seller/todayVisit"
);
int
oldTodayCount
=
response
.
jsonPath
().
get
(
"data.todayCount"
);
//访问名片 具体啥接口得问开发
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"contentId"
,
79040
);
params
.
put
(
"scId"
,
"7703312855"
);
params
.
put
(
"comefrom"
,
1
);
params
.
put
(
"fromUserId"
,
"2477770"
);
Response
vistorRes
=
network
.
visitorBehavior
(
params
,
"/kjy/mp/sellerCard/visit"
);
//获取新的今日访问数量
response
=
network
.
getResponse
(
"/kjy/mp/seller/todayVisit"
);
int
newTodayCOunt
=
response
.
jsonPath
().
get
(
"data.todayCount"
);
Assert
.
assertEquals
(
oldTodayCount
+
1
,
newTodayCOunt
,
"今日访问量统计有误"
);
}
@Test
(
description
=
"分类列表"
,
priority
=
5
)
public
void
分类列表
()
throws
IOException
{
Response
response
=
network
.
getResponse
(
"/kjy/mp/classify/list"
);
String
classifyName
=
response
.
jsonPath
().
get
(
"data.list[0].classifyName"
);
Assert
.
assertEquals
(
classifyName
,
"推荐"
,
"获取列表信息失败"
);
// 检验是否有公司专区
}
@Test
(
description
=
"推荐分类下的内容列表"
,
priority
=
6
)
//首頁-信息
public
void
推荐分类下的内容列表
()
throws
IOException
{
//穿的分页参数
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"classfiyId"
,
"1"
);
params
.
put
(
"pageIndex"
,
"1"
);
params
.
put
(
"pageSize"
,
"10"
);
Response
response
=
network
.
getResponse
(
params
,
"/kjy/mp/classify/contentList"
);
int
pageSize
=
response
.
jsonPath
().
get
(
"data.pageSize"
);
Assert
.
assertEquals
(
pageSize
,
10
,
"获取分类下的内容列表失败"
);
}
@Test
(
description
=
"用户信息"
,
priority
=
7
)
public
void
用户信息
()
throws
IOException
{
//获取旧的今日访问数量
Response
response
=
network
.
getResponse
(
"/kjy/mp/user/info"
);
String
wxName
=
response
.
jsonPath
().
get
(
"data.wxName"
);
Assert
.
assertEquals
(
wxName
,
"小葡萄"
,
"获取用户信息失败"
);
}
@Test
(
description
=
"销售员公司资料总数"
,
priority
=
8
)
//首頁-信息
public
void
销售员公司资料总数
()
throws
IOException
{
Response
response
=
network
.
getResponse
(
"/kjy/mp/companyDocument/count"
);
boolean
result
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertEquals
(
result
,
true
,
"获取销售员公司资料总数失败"
);
// Reporter.log("用例执行失败:服务器错误!");
}
@AfterSuite
public
void
testSuite
()
throws
IOException
{
}
//
@Test (description = "早中晚日报列表",priority = 2)
//
public void 早中晚日报列表() throws IOException {
//
Response response = network.getResponse("/kjy/mp/content/getInitDailyList");
//
int status = response.jsonPath().get("data[0].status");
//
Assert.assertEquals(status,2,"获取早中晚日报列表信息失败");
//
}
//
//
@Test (description = "精准素材库",priority = 3)
//
public void 精准素材库() throws IOException {
//
Response response = network.getResponse("/kjy/mp/accurate/usrDetail");
//
int result = response.jsonPath().get("data.companyId");
//
Assert.assertEquals(result,5,"获取精准素材成功");
//
//
Reporter.log("用例执行失败:服务器错误!");
//
}
//
//
@Test (description = "今日访问",priority = 4)
//
public void 今日访问() throws IOException {
//
//获取旧的今日访问数量
//
Response response = network.getResponse("/kjy/mp/seller/todayVisit");
//
int oldTodayCount = response.jsonPath().get("data.todayCount");
//
//
//访问名片 具体啥接口得问开发
//
Map<String, Object> params = new HashMap<String, Object>();
//
params.put("contentId",79040);
//
params.put("scId","7703312855");
//
params.put("comefrom",1);
//
params.put("fromUserId","2477770");
//
Response vistorRes = network.visitorBehavior(params,"/kjy/mp/sellerCard/visit");
//
//
//获取新的今日访问数量
//
response = network.getResponse("/kjy/mp/seller/todayVisit");
//
int newTodayCOunt = response.jsonPath().get("data.todayCount");
//
//
Assert.assertEquals(oldTodayCount + 1,newTodayCOunt,"今日访问量统计有误");
//
}
//
//
@Test (description = "分类列表",priority = 5)
//
public void 分类列表() throws IOException {
//
Response response = network.getResponse("/kjy/mp/classify/list");
//
String classifyName = response.jsonPath().get("data.list[0].classifyName");
//
Assert.assertEquals(classifyName ,"推荐","获取列表信息失败");
//
//
// 检验是否有公司专区
//
}
//
//
@Test (description = "推荐分类下的内容列表",priority = 6)
//
//首頁-信息
//
public void 推荐分类下的内容列表() throws IOException {
//
//穿的分页参数
//
Map<String, Object> params = new HashMap<String, Object>();
//
params.put("classfiyId","1");
//
params.put("pageIndex","1");
//
params.put("pageSize","10");
//
//
Response response = network.getResponse(params,"/kjy/mp/classify/contentList");
//
int pageSize = response.jsonPath().get("data.pageSize");
//
Assert.assertEquals(pageSize,10,"获取分类下的内容列表失败");
//
}
//
//
@Test (description = "用户信息",priority = 7)
//
public void 用户信息() throws IOException {
//
//获取旧的今日访问数量
//
Response response = network.getResponse("/kjy/mp/user/info");
//
String wxName = response.jsonPath().get("data.wxName");
//
Assert.assertEquals(wxName ,"小葡萄","获取用户信息失败");
//
}
//
//
@Test (description = "销售员公司资料总数",priority = 8)
//
//首頁-信息
//
public void 销售员公司资料总数() throws IOException {
//
Response response = network.getResponse("/kjy/mp/companyDocument/count");
//
boolean result = response.jsonPath().getBoolean("success");
//
Assert.assertEquals(result, true, "获取销售员公司资料总数失败");
//
//
Reporter.log("用例执行失败:服务器错误!");
//
}
//
//
@AfterSuite
//
public void testSuite() throws IOException {
//
//
}
}
test-output/report.html
View file @
640fea81
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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