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
b8d7bf77
Commit
b8d7bf77
authored
Jul 05, 2021
by
张艳玲
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'featrue/20210702-zhangyl' into 'master'
Featrue/20210702 zhangyl See merge request test-group/kejiji!57
parents
3647d1da
646c5ee7
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
178 additions
and
24 deletions
+178
-24
PassQues.java
src/test/java/com/kjj/bean/manager/PassQues.java
+10
-0
Article.java
src/test/java/com/kjj/cases/basics/Article.java
+17
-15
CircleFriends.java
src/test/java/com/kjj/cases/basics/CircleFriends.java
+6
-6
Pay.java
src/test/java/com/kjj/cases/basics/Pay.java
+1
-1
SaveLive.java
src/test/java/com/kjj/cases/live/liveConfig/SaveLive.java
+132
-0
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+12
-2
No files found.
src/test/java/com/kjj/bean/manager/PassQues.java
0 → 100644
View file @
b8d7bf77
package
com
.
kjj
.
bean
.
manager
;
import
lombok.Data
;
@Data
public
class
PassQues
{
private
String
optionDetail
;
public
Integer
optionType
;
private
Integer
id
;
}
src/test/java/com/kjj/cases/basics/Article.java
View file @
b8d7bf77
...
...
@@ -3,6 +3,9 @@ package com.kjj.cases.basics;
import
static
com
.
kjj
.
config
.
BasicConfig
.*;
import
com.kjj.cases.admin.Authorization
;
import
com.kjj.utils.BaseUtils
;
import
com.kjj.utils.NetworkUtils
;
import
com.kjj.utils.ThreadSleepUtils
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
...
...
@@ -13,8 +16,8 @@ import java.io.IOException;
import
java.util.HashMap
;
import
java.util.Map
;
public
class
Article
implements
Authorization
{
//
private static final NetworkUtils network = NetworkUtils.getInstance();
public
class
Article
{
private
static
final
NetworkUtils
network
=
NetworkUtils
.
getInstance
();
public
String
sid
;
// 加密的销售ID
public
String
articleContentId
;
// 文章的contentId
public
String
scid
;
// getScid后的文章id
...
...
@@ -23,8 +26,15 @@ public class Article implements Authorization {
@BeforeClass
public
void
setUp
()
{
agentTku
();
userTku
();
// 创建用户 并传到network里
AGENT_TKU
=
BaseUtils
.
createTku
();
network
.
agentCookies
.
put
(
"tku"
,
AGENT_TKU
);
System
.
out
.
println
(
"代理人tku:"
+
AGENT_TKU
);
// 获取访客tku
VISITOR_TKU
=
BaseUtils
.
getTku
(
VISITOR_USERID
);
System
.
out
.
println
(
"访客tku:"
+
VISITOR_TKU
);
}
//文章内容页
...
...
@@ -216,21 +226,12 @@ public class Article implements Authorization {
boolean
isOpen
=
response
.
jsonPath
().
getBoolean
(
"data.find {it.code == 'personal_document_switch'}.val"
);
Assert
.
assertTrue
(
isOpen
,
network
.
message
(
params
,
ARTICLE_GETENHANCEDCOLUMNCONFIG
,
"获取代理人日常精准素材个人专栏开关有误"
,
response
.
body
().
asString
()));
//
关闭
代理人个人专栏开关
//
开启
代理人个人专栏开关
Map
<
String
,
Object
>
configParams
=
new
HashMap
<
String
,
Object
>();
configParams
.
put
(
"configKey"
,
"personal_document_switch"
);
configParams
.
put
(
"configValue"
,
false
);
response
=
network
.
postResponse
(
configParams
,
SELLERCONFIG_EDITCONFIG
);
//再获取代理人个人专栏
response
=
network
.
getResponse
(
params
,
ARTICLE_GETENHANCEDCOLUMNCONFIG
);
isOpen
=
response
.
jsonPath
().
getBoolean
(
"data.find {it.code == 'personal_document_switch'}.val"
);
Assert
.
assertFalse
(
isOpen
,
network
.
message
(
params
,
ARTICLE_GETENHANCEDCOLUMNCONFIG
,
"获取代理人日常精准素材个人专栏开关有误"
,
response
.
body
().
asString
()));
//再次开启 代理人个人专栏开关
configParams
.
put
(
"configKey"
,
"personal_document_switch"
);
configParams
.
put
(
"configValue"
,
true
);
response
=
network
.
postResponse
(
configParams
,
SELLERCONFIG_EDITCONFIG
);
}
// 获取代理人个人专栏
...
...
@@ -350,6 +351,7 @@ public class Article implements Authorization {
Assert
.
assertTrue
(
favourResult
,
network
.
message
(
likeParams
,
HASALREADYLIKE
,
"访客-头部名片点赞数量显示有误"
,
response
.
body
().
asString
()));
// 点赞名片
ThreadSleepUtils
.
sleep
(
500
);
likeParams
.
put
(
"visitTableId"
,
visitId
);
response
=
network
.
postResponse
(
likeParams
,
INTERACTION_LIKE
);
boolean
isLike
=
(
response
.
jsonPath
().
getInt
(
"data.favourTimes"
)
-
favourTimes
)
>
0
;
...
...
src/test/java/com/kjj/cases/basics/CircleFriends.java
View file @
b8d7bf77
package
com
.
kjj
.
cases
.
basics
;
import
com.kjj.utils.NetworkUtils
;
import
com.kjj.utils.ThreadSleepUtils
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
...
...
@@ -28,8 +29,7 @@ public class CircleFriends {
}
@Test
(
description
=
"是否首次进入"
,
priority
=
1
)
public
void
是否首次进入
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
public
void
是否首次进入
()
{
Response
response
=
network
.
getResponse
(
FRIENDS_ISUSERFIRSTENTERANDCOLLECT
);
String
desc
=
response
.
jsonPath
().
getString
(
"desc"
);
Assert
.
assertEquals
(
desc
,
"OK"
,
network
.
message
(
FRIENDS_ISUSERFIRSTENTERANDCOLLECT
,
"是否首次进入和首次收藏发圈素材列表-接口有误"
,
response
.
body
().
asString
()));
...
...
@@ -37,7 +37,7 @@ public class CircleFriends {
// tab列表 后端根据tku自行判断
@Test
(
description
=
"获取tab列表"
,
priority
=
2
)
public
void
获取
tab
列表
()
throws
IOException
{
public
void
获取
tab
列表
()
{
Response
response
=
network
.
getResponse
(
FRIENDS_GETMATERIALTAGS
);
boolean
hasList
=
response
.
jsonPath
().
getInt
(
"data.size()"
)
>
0
;
int
id
=
response
.
jsonPath
().
getInt
(
"data.find {it.name == '保险'}.id"
);
//标签tab
...
...
@@ -55,7 +55,7 @@ public class CircleFriends {
contentId
=
response
.
jsonPath
().
getString
(
"data[0].contentId"
);
//素材ID
tagId
=
response
.
jsonPath
().
getString
(
"data[0].materialTag"
);
//素材频道ID
tagName
=
response
.
jsonPath
().
getString
(
"data[0].tagName"
);
//素材频道名称
Assert
.
assert
Equals
(
count
,
30
,
network
.
message
(
params
,
FRIENDS_GETUNREADTIMELINSLIST
,
"获取推荐列表有误"
,
response
.
body
().
asString
()));
Assert
.
assert
True
(
count
>
1
,
network
.
message
(
params
,
FRIENDS_GETUNREADTIMELINSLIST
,
"获取推荐列表有误"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取全部列表"
,
priority
=
4
)
...
...
@@ -80,8 +80,7 @@ public class CircleFriends {
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
FRIENDS_ASYNCMARKTIMELINEREAD
,
"标记已读-接口有误"
,
response
.
body
().
asString
()));
//延迟2秒,存入ES
Thread
.
sleep
(
2000
);
ThreadSleepUtils
.
sleep
(
5000
);
//重新获取未读列表
response
=
network
.
getResponse
(
params
,
FRIENDS_GETUNREADTIMELINSLIST
);
List
<
String
>
contentList
=
response
.
jsonPath
().
getList
(
"data.contentId"
);
...
...
@@ -115,6 +114,7 @@ public class CircleFriends {
@Test
(
description
=
"素材频道页"
,
priority
=
7
)
public
void
素材频道页
()
throws
IOException
{
//频道页 头部
ThreadSleepUtils
.
sleep
(
500
);
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"tagId"
,
tagId
);
Response
response
=
network
.
getResponse
(
params
,
FRIENDS_CHANNELDETAIL
);
...
...
src/test/java/com/kjj/cases/basics/Pay.java
View file @
b8d7bf77
...
...
@@ -60,7 +60,7 @@ public class Pay {
}
@Test
(
description
=
"默认付费_待支付"
,
priority
=
2
)
public
void
默认付费
_
待支付
()
throws
IOException
{
public
void
默认付费
_
待支付
()
{
//创建支付
Map
<
String
,
Object
>
payParams
=
new
HashMap
<
String
,
Object
>();
payParams
.
put
(
"userVersion"
,
1
);
...
...
src/test/java/com/kjj/cases/live/liveConfig/SaveLive.java
View file @
b8d7bf77
...
...
@@ -1733,8 +1733,140 @@ public class SaveLive implements Authorization {
Assert
.
assertTrue
(
data
,
network
.
message
(
Params
,
BasicConfig
.
MANAGER_redSwitchStatus
,
"开启攒现金红包配置失败"
,
response
.
body
().
asString
()));
}
/**
* 闯关答题
*/
@Test
(
description
=
"新增闯关答题配置"
,
priority
=
94
)
public
void
新增闯关答题配置
()
{
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Params
.
put
(
"openTime"
,
10
);
List
<
PassQues
>
optionLists
=
new
ArrayList
<>();
PassQues
optionList
=
new
PassQues
();
optionList
.
setOptionDetail
(
"正确选项"
);
optionList
.
setOptionType
(
1
);
optionLists
.
add
(
optionList
);
PassQues
optionList1
=
new
PassQues
();
optionList1
.
setOptionDetail
(
"错误选项"
);
optionList1
.
setOptionType
(
2
);
optionLists
.
add
(
optionList1
);
Params
.
put
(
"optionList"
,
optionLists
);
Params
.
put
(
"passQuestion"
,
"闯关答题配置"
);
Response
response
=
network
.
postResponse
(
Params
,
BasicConfig
.
MANAGER_addOrUpdateQues
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
Params
,
BasicConfig
.
MANAGER_addOrUpdateQues
,
"新增闯关答题配置失败"
,
response
.
body
().
asString
()));
Map
<
String
,
Object
>
addPassParam
=
new
HashMap
<>();
addPassParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
addPassParam
.
put
(
"openTime"
,
10
);
List
<
PassQues
>
optionLists1
=
new
ArrayList
<>();
PassQues
optionList2
=
new
PassQues
();
optionList2
.
setOptionDetail
(
"正确选项"
);
optionList2
.
setOptionType
(
1
);
optionLists1
.
add
(
optionList2
);
PassQues
optionList3
=
new
PassQues
();
optionList3
.
setOptionDetail
(
"错误选项"
);
optionList3
.
setOptionType
(
2
);
optionLists1
.
add
(
optionList3
);
addPassParam
.
put
(
"optionList"
,
optionLists1
);
addPassParam
.
put
(
"passQuestion"
,
"闯关答题配置"
);
Response
passRes
=
network
.
postResponse
(
addPassParam
,
BasicConfig
.
MANAGER_addOrUpdateQues
);
boolean
data1
=
passRes
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data1
);
Assert
.
assertTrue
(
data1
,
network
.
message
(
addPassParam
,
BasicConfig
.
MANAGER_addOrUpdateQues
,
"新增闯关答题配置失败"
,
passRes
.
body
().
asString
()));
}
public
List
<
PassQues
>
quesId
;
@Test
(
description
=
"获取问题列表"
,
priority
=
95
)
public
void
获取问题列表
()
{
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
Params
,
BasicConfig
.
MANAGER_quesList
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
List
<
PassQues
>
list
=
JsonUtil
.
parseResponseToListBean
(
response
,
PassQues
.
class
);
this
.
quesId
=
list
;
Assert
.
assertNotNull
(
list
,
network
.
message
(
Params
,
BasicConfig
.
MANAGER_quesList
,
"查询问题列表失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取问题详情"
,
priority
=
96
)
public
void
获取问题详情
()
{
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"quesId"
,
this
.
quesId
.
get
(
0
).
getId
());
Response
response
=
network
.
getResponse
(
Params
,
BasicConfig
.
MANAGER_quesInfo
);
int
id
=
response
.
jsonPath
().
getInt
(
"data.id"
);
System
.
out
.
println
(
id
);
Assert
.
assertTrue
(
id
==
this
.
quesId
.
get
(
0
).
getId
(),
network
.
message
(
Params
,
BasicConfig
.
MANAGER_quesInfo
,
"获取问题详情失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"删除闯关答题配置"
,
priority
=
97
)
public
void
删除闯关答题配置
()
{
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Params
.
put
(
"quesId"
,
this
.
quesId
.
get
(
1
).
getId
());
Response
response
=
network
.
postResponse
(
Params
,
BasicConfig
.
MANAGER_deleteQues
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
Params
,
BasicConfig
.
MANAGER_deleteQues
,
"删除闯关答题配置失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取直播红包配置"
,
priority
=
98
)
public
void
获取直播红包配置
()
{
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
Params
,
BasicConfig
.
MANAGER_getSurplusAmount
);
int
data
=
response
.
jsonPath
().
getInt
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
>
0
,
network
.
message
(
Params
,
BasicConfig
.
MANAGER_getSurplusAmount
,
"获取直播红包配置失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"新增闯关红包配置"
,
priority
=
99
)
public
void
新增闯关红包配置
()
{
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Params
.
put
(
"amount"
,
1000
);
Params
.
put
(
"carveTime"
,
1
);
Params
.
put
(
"showAmount"
,
1000
);
Response
response
=
network
.
postResponse
(
Params
,
BasicConfig
.
MANAGER_addOrUpdateConf
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
Params
,
BasicConfig
.
MANAGER_addOrUpdateConf
,
"新增闯关红包配置失败"
,
response
.
body
().
asString
()));
}
public
int
redConfId
;
@Test
(
description
=
"获取红包配置详情"
,
priority
=
100
)
public
void
获取红包配置详情
()
{
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
Params
,
BasicConfig
.
MANAGER_redConfInfo
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
PassQues
confId
=
JsonUtil
.
parseResponseToBean
(
response
,
PassQues
.
class
);
redConfId
=
confId
.
getId
();
Assert
.
assertNotNull
(
confId
,
network
.
message
(
Params
,
BasicConfig
.
MANAGER_redConfInfo
,
"获取红包配置详情失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"开启闯关红包配置"
,
priority
=
101
)
public
void
开启闯关红包配置
()
{
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"id"
,
redConfId
);
Params
.
put
(
"openStatus"
,
1
);
Response
response
=
network
.
postResponse
(
Params
,
BasicConfig
.
MANAGER_switchOpen
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
Params
,
BasicConfig
.
MANAGER_switchOpen
,
"获取红包配置详情失败"
,
response
.
body
().
asString
()));
}
...
...
src/test/java/com/kjj/config/BasicConfig.java
View file @
b8d7bf77
...
...
@@ -61,8 +61,8 @@ public class BasicConfig {
//***********************************************************************
// 基础线代理人 TKU,
ID:
public
static
String
AGENT_TKU
=
"T3gM31f18jCFEcf
oYxvVk1LsF5T1YkcBNDbUaryi3TgvwatuP6mroJjZ2k7iCHjC9Srujh7k311i3vFuZm
"
;
// 基础线代理人 TKU,
sid:2991
public
static
String
AGENT_TKU
=
"T3gM31f18jCFEcf
TyJdjfJAfSjDmKNMHfH7CvpLDC6UCQd8X84RJEiiPHRHPqbrJYL3KL7tLsZEM5LjN4z
"
;
// 基础线访客 TKU
public
static
String
VISITOR_TKU
=
"T3gM31f18jCGvqvoyJRzyMTdpcPDJWUJJP4VQje7p9sfHcRNmyhTEzEbfmwrGFy5doVEinb1k3SVwreYQE"
;
// 访客的sids
...
...
@@ -90,6 +90,16 @@ public class BasicConfig {
public
static
final
String
ANCHOR_getConfDetail
=
MOBILE_HOST
+
"/conf/pre/getConfDetail"
;
public
static
final
String
ANCHOR_CLOSE
=
MOBILE_HOST
+
"/conf/live/close"
;
// *************** 闯关答题 ***************
public
static
final
String
MANAGER_addOrUpdateQues
=
MANAGER_HOST
+
"/kjy/manager/pass/ques/addOrUpdateQues"
;
public
static
final
String
MANAGER_deleteQues
=
MANAGER_HOST
+
"/kjy/manager/pass/ques/deleteQues"
;
public
static
final
String
MANAGER_quesList
=
MANAGER_HOST
+
"/kjy/manager/pass/ques/quesList"
;
public
static
final
String
MANAGER_quesInfo
=
MANAGER_HOST
+
"/kjy/manager/pass/ques/quesInfo"
;
public
static
final
String
MANAGER_addOrUpdateConf
=
MANAGER_HOST
+
"/kjy/manager/pass/ques/addOrUpdateConf"
;
public
static
final
String
MANAGER_redConfInfo
=
MANAGER_HOST
+
"/kjy/manager/pass/ques/redConfInfo"
;
public
static
final
String
MANAGER_switchOpen
=
MANAGER_HOST
+
"/kjy/manager/pass/ques/switchOpen"
;
// *************** 看直播攒现金红包 ***************
public
static
final
String
MANAGER_timeRed
=
MANAGER_HOST
+
"/kjy/manager/live/time/red/saveOrUpdateFirst"
;
public
static
final
String
MANAGER_timeRedList
=
MANAGER_HOST
+
"/kjy/manager/live/time/red/list"
;
...
...
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