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
20a9bbdd
Commit
20a9bbdd
authored
Aug 04, 2021
by
xiamengchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改动态访问记录,解决接口报错
parent
915ee51a
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
164 deletions
+38
-164
ForwardAndRead.java
...java/com/kjj/cases/assistant/whoSawMe/ForwardAndRead.java
+6
-2
MyCustomer.java
...est/java/com/kjj/cases/assistant/whoSawMe/MyCustomer.java
+5
-6
WhoSawMe.java
src/test/java/com/kjj/cases/assistant/whoSawMe/WhoSawMe.java
+27
-156
No files found.
src/test/java/com/kjj/cases/assistant/whoSawMe/ForwardAndRead.java
View file @
20a9bbdd
...
...
@@ -3,6 +3,7 @@ package com.kjj.cases.assistant.whoSawMe;
import
com.kjj.cases.admin.Authorization
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.utils.BaseUtils
;
import
com.kjj.utils.ThreadSleepUtils
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeClass
;
...
...
@@ -32,6 +33,10 @@ public class ForwardAndRead implements Authorization {
// 代理人转发素材
@Test
(
description
=
"代理人转发文章"
,
priority
=
1
)
public
void
转发文章
()
throws
IOException
{
// 转发文章前记录一个时间
forwardTime
=
new
Date
().
getTime
();
ThreadSleepUtils
.
sleep
(
5000
);
articleScId
=
getContentScId
(
BasicConfig
.
ARTICLE_CONTENTID
);
// 获取文章scId
param
=
new
HashMap
<>();
param
.
put
(
"scId"
,
articleScId
);
...
...
@@ -41,7 +46,6 @@ public class ForwardAndRead implements Authorization {
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
param
,
BasicConfig
.
FORWARD
,
"转发素材失败"
,
response
.
body
().
asString
()));
forwardTime
=
response
.
jsonPath
().
getLong
(
"timestamp"
);
}
@Test
(
description
=
"代理人转发名片"
,
priority
=
2
)
...
...
@@ -125,7 +129,7 @@ public class ForwardAndRead implements Authorization {
@Test
(
description
=
"添加访问记录"
,
priority
=
7
)
public
void
添加访问记录
()
throws
IOException
{
param
.
clear
();
param
.
put
(
"forwardTime"
,
forwardTime
+
5000
);
param
.
put
(
"forwardTime"
,
forwardTime
);
// 添加访问记录的时间要小于代理人转发时间
param
.
put
(
"scid"
,
articleScId
);
response
=
network
.
postResponse
(
param
,
BasicConfig
.
DYNAMIC_ADDVISIT
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"data"
),
network
.
message
(
param
,
BasicConfig
.
DYNAMIC_ADDVISIT
,
"添加访问记录失败"
,
response
.
body
().
asString
()));
...
...
src/test/java/com/kjj/cases/assistant/whoSawMe/MyCustomer.java
View file @
20a9bbdd
...
...
@@ -24,7 +24,7 @@ public class MyCustomer implements Authorization {
private
String
createTagId
;
private
long
visitor1UserId
;
private
String
sessionId
;
private
int
visitCount
;
private
int
visitCount
;
// 二次访客来访次数
private
String
id
;
// 自定义提醒事项id
private
long
lastMessageId
;
...
...
@@ -142,6 +142,8 @@ public class MyCustomer implements Authorization {
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
CUSTOMERSEARCH
,
"接口请求失败"
,
response
.
body
().
asString
()));
long
userId
=
response
.
jsonPath
().
getLong
(
"data.list[0].userId"
);
Assert
.
assertEquals
(
userId
,
visitor1UserId
,
network
.
message
(
param
,
BasicConfig
.
CUSTOMERSEARCH
,
"最新访问记录首位用户userId错误"
,
response
.
body
().
asString
()));
visitCount
=
response
.
jsonPath
().
getInt
(
"data.list[0].visitCount"
);
}
// 我的客户首页_获取全部客户列表_按照访问次数排列
...
...
@@ -371,11 +373,8 @@ public class MyCustomer implements Authorization {
param
.
put
(
"type"
,
2
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
CUSTSTATISTIC
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
CUSTSTATISTIC
,
"接口请求失败"
,
response
.
body
().
asString
()));
visitCount
=
response
.
jsonPath
().
getInt
(
"data.visitCount"
);
int
grassNum
=
response
.
jsonPath
().
getInt
(
"data.grassNum"
);
Assert
.
assertTrue
(
visitCount
>=
1
,
network
.
message
(
param
,
BasicConfig
.
CUSTSTATISTIC
,
"用户来访次数小于1"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
grassNum
>=
1
,
network
.
message
(
param
,
BasicConfig
.
CUSTSTATISTIC
,
"用户阅读种草文章次数小于1"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
visitCount
,
grassNum
,
network
.
message
(
param
,
BasicConfig
.
CUSTSTATISTIC
,
"用户来访次数与阅读种草文章次数不相等"
,
response
.
body
().
asString
()));
int
visitCountHere
=
response
.
jsonPath
().
getInt
(
"data.visitCount"
);
Assert
.
assertEquals
(
visitCountHere
,
visitCount
,
network
.
message
(
param
,
BasicConfig
.
CUSTSTATISTIC
,
"用户来访次数有误"
,
response
.
body
().
asString
()));
}
// 客户详情页_阅读偏好
...
...
src/test/java/com/kjj/cases/assistant/whoSawMe/WhoSawMe.java
View file @
20a9bbdd
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