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
4bcd04ae
Commit
4bcd04ae
authored
Apr 29, 2021
by
张艳玲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
奖品签收
parent
fbdde173
Changes
11
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
294 additions
and
697 deletions
+294
-697
RewardDetail.java
src/test/java/com/kjj/bean/answer/RewardDetail.java
+0
-35
AdminAuthorization.java
...est/java/com/kjj/cases/live/admin/AdminAuthorization.java
+12
-4
Agent.java
src/test/java/com/kjj/cases/live/agent/Agent.java
+106
-6
LiveAgent.java
src/test/java/com/kjj/cases/live/agent/LiveAgent.java
+0
-6
Lottery.java
src/test/java/com/kjj/cases/live/lottery/Lottery.java
+0
-74
LiveMaterial.java
src/test/java/com/kjj/cases/live/manager/LiveMaterial.java
+1
-0
Add.java
src/test/java/com/kjj/cases/live/manager/QuesReward/Add.java
+1
-1
Limited.java
src/test/java/com/kjj/cases/live/red/Limited.java
+100
-42
QuestionAwards.java
src/test/java/com/kjj/cases/live/red/QuestionAwards.java
+0
-478
Unlimited.java
src/test/java/com/kjj/cases/live/red/Unlimited.java
+72
-51
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+2
-0
No files found.
src/test/java/com/kjj/bean/answer/RewardDetail.java
deleted
100644 → 0
View file @
fbdde173
package
com
.
kjj
.
bean
.
answer
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
RewardDetail
{
private
String
quesConfId
;
private
String
quesType
;
private
RedDetail
redDetail
;
@Data
public
static
class
RedDetail
{
private
String
redConfId
;
private
int
showAmount
;
}
private
String
welfareDetail
;
private
int
quesRewardSeconds
;
private
String
quesRewardEndTime
;
private
int
rewardStatus
;
private
String
quesId
;
private
String
questionDetail
;
private
List
<
QuestionLists
>
questionList
;
@Data
public
static
class
QuestionLists
{
private
String
id
;
private
int
optionType
;
private
String
optionDetail
;
}
}
src/test/java/com/kjj/cases/live/admin/AdminAuthorization.java
View file @
4bcd04ae
...
...
@@ -14,11 +14,10 @@ public interface AdminAuthorization {
// 创建用户 并传到network里
network
.
agentCookies
.
put
(
"authKey"
,
ADMIN_KEY
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
ADMIN_KEY
);
}
/**
* 代理人授权
* 代理人
(yl)
授权
*/
default
void
agentAuth
(){
// 创建用户 并传到network里
...
...
@@ -26,6 +25,15 @@ public interface AdminAuthorization {
System
.
out
.
println
(
"用户AUTH_KEY:"
+
AUTH_KEY
);
}
/**
* 代理人(小疙瘩人寿)授权,ID:815
*/
default
void
agentAuth1
(){
// 创建用户 并传到network里
network
.
agentCookies
.
put
(
"authKey"
,
agentAuth
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
agentAuth
);
}
/**
* 访客A(志勇)授权,代理人指定中奖用户
*/
...
...
@@ -82,14 +90,14 @@ public interface AdminAuthorization {
}
/**
* 访客
H
(喜洋洋)授权
* 访客
I
(喜洋洋)授权
*/
default
void
visitorAuth8
()
{
network
.
agentCookies
.
put
(
"authKey"
,
VISITORKEY8
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
VISITORKEY8
);
}
/**
* 访客
I
(嘿保险)授权,ID:907
* 访客
H
(嘿保险)授权,ID:907
*/
default
void
visitorAuth9
()
{
network
.
agentCookies
.
put
(
"authKey"
,
VISITORKEY9
);
...
...
src/test/java/com/kjj/cases/live/agent/Agent.java
View file @
4bcd04ae
...
...
@@ -3,9 +3,9 @@ package com.kjj.cases.live.agent;
import
com.kjj.cases.live.admin.AdminAuthorization
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.constants.LiveConstants
;
import
com.kjj.utils.ThreadSleepUtils
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Test
;
import
java.util.HashMap
;
...
...
@@ -13,13 +13,13 @@ import java.util.Map;
public
class
Agent
implements
AdminAuthorization
{
@BeforeClass
public
void
setUp
()
{
agentAuth
();
}
public
String
shareSign
;
public
String
shareSign1
;
public
String
token
;
@Test
(
description
=
"分享直播间"
,
priority
=
1
)
public
void
分享直播间
()
{
@Test
(
description
=
"代理人A分享直播间"
,
priority
=
1
)
public
void
代理人
A
分享直播间
()
{
agentAuth
();
Map
<
String
,
Object
>
signParam
=
new
HashMap
<>();
signParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
signParam
.
put
(
"shareType"
,
1
);
...
...
@@ -30,4 +30,104 @@ public class Agent implements AdminAuthorization {
LiveConstants
.
setValue
(
LiveConstants
.
StringKeyEnum
.
shareSign
.
getKey
(),
shareSign
);
Assert
.
assertNotNull
(
shareSign
,
network
.
message
(
signParam
,
BasicConfig
.
MOBILE_GETSHARESIGN
,
"分享失败"
,
signRes
.
body
().
asString
()));
}
@Test
(
description
=
"代理人B分享直播间"
,
priority
=
2
)
public
void
代理人
B
分享直播间
()
{
agentAuth1
();
Map
<
String
,
Object
>
signParam
=
new
HashMap
<>();
signParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
signParam
.
put
(
"shareType"
,
1
);
Response
signRes
=
network
.
getResponse
(
signParam
,
BasicConfig
.
MOBILE_GETSHARESIGN
);
HashMap
data
=
signRes
.
jsonPath
().
getJsonObject
(
"data"
);
this
.
shareSign1
=
(
String
)
data
.
get
(
"shareSign"
);
System
.
out
.
println
(
shareSign1
);
Assert
.
assertNotNull
(
shareSign1
,
network
.
message
(
signParam
,
BasicConfig
.
MOBILE_GETSHARESIGN
,
"分享失败"
,
signRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客H关系绑定"
,
priority
=
3
)
public
void
访客
H
关系绑定
()
{
visitorAuth9
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
bindingParam
.
put
(
"shareSign"
,
shareSign1
);
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
@Test
(
description
=
"中奖任务邀请H绑定结果和绑定凭证"
,
priority
=
4
)
public
void
获取访客
H
绑定结果和绑定凭证
()
{
visitorAuth9
();
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
HashMap
data
=
tokenRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
this
.
token
=
(
String
)
data
.
get
(
"token"
);
System
.
out
.
println
(
token
);
Object
token
=
tokenRes
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertNotNull
(
token
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
@Test
(
description
=
"中奖任务邀请H根据绑定凭证发放抽奖码"
,
priority
=
5
)
public
void
中奖任务邀请
H
根据绑定凭证发放抽奖码
()
{
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
500
);
Map
<
String
,
Object
>
codeParam
=
new
HashMap
<>();
codeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
codeParam
.
put
(
"token"
,
token
);
Response
codeRes
=
network
.
getResponse
(
codeParam
,
BasicConfig
.
MOBILE_Code
);
boolean
success
=
codeRes
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
codeParam
,
BasicConfig
.
MOBILE_Code
,
"发放抽奖码失败"
,
codeRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客I关系绑定"
,
priority
=
6
)
public
void
访客
I
关系绑定
()
{
visitorAuth8
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
bindingParam
.
put
(
"shareSign"
,
shareSign1
);
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
@Test
(
description
=
"中奖任务邀请I绑定结果和绑定凭证"
,
priority
=
7
)
public
void
获取访客
I
绑定结果和绑定凭证
()
{
visitorAuth8
();
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
HashMap
data
=
tokenRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
this
.
token
=
(
String
)
data
.
get
(
"token"
);
System
.
out
.
println
(
token
);
Object
token
=
tokenRes
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertNotNull
(
token
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
@Test
(
description
=
"邀请I根据绑定凭证发放抽奖码"
,
priority
=
8
)
public
void
邀请
I
根据绑定凭证发放抽奖码
()
{
visitorAuth8
();
ThreadSleepUtils
.
sleep
(
500
);
Map
<
String
,
Object
>
codeParam
=
new
HashMap
<>();
codeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
codeParam
.
put
(
"token"
,
token
);
Response
codeRes
=
network
.
getResponse
(
codeParam
,
BasicConfig
.
MOBILE_Code
);
boolean
success
=
codeRes
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
codeParam
,
BasicConfig
.
MOBILE_Code
,
"发放抽奖码失败"
,
codeRes
.
body
().
asString
()));
}
}
src/test/java/com/kjj/cases/live/agent/LiveAgent.java
View file @
4bcd04ae
...
...
@@ -582,10 +582,4 @@ public class LiveAgent implements AdminAuthorization {
}
\ No newline at end of file
src/test/java/com/kjj/cases/live/lottery/Lottery.java
View file @
4bcd04ae
...
...
@@ -1039,81 +1039,7 @@ public class Lottery implements AdminAuthorization {
throw
e
;
}
}
@Test
(
description
=
"代理人分享直播间"
,
priority
=
74
)
public
void
代理人分享直播间
()
{
agentAuth
();
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
signParam
=
new
HashMap
<>();
signParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
signParam
.
put
(
"shareType"
,
2
);
Response
signRes
=
network
.
getResponse
(
signParam
,
BasicConfig
.
MOBILE_GETSHARESIGN
);
HashMap
data
=
signRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
this
.
shareSign
=
(
String
)
data
.
get
(
"shareSign"
);
System
.
out
.
println
(
shareSign
);
Assert
.
assertNotNull
(
shareSign
,
network
.
message
(
signParam
,
BasicConfig
.
MOBILE_GETSHARESIGN
,
"分享失败"
,
signRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客H关系绑定"
,
priority
=
75
)
public
void
访客
H
关系绑定
()
{
visitorAuth9
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
bindingParam
.
put
(
"shareSign"
,
shareSign
);
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
@Test
(
description
=
"中奖任务邀请H绑定结果和绑定凭证"
,
priority
=
76
)
public
void
获取访客
H
绑定结果和绑定凭证
()
{
visitorAuth9
();
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
HashMap
data
=
tokenRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
this
.
token
=
(
String
)
data
.
get
(
"token"
);
System
.
out
.
println
(
token
);
Object
token
=
tokenRes
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertNotNull
(
token
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
@Test
(
description
=
"中奖任务邀请H根据绑定凭证发放抽奖码"
,
priority
=
77
)
public
void
中奖任务邀请
H
根据绑定凭证发放抽奖码
()
{
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
500
);
Map
<
String
,
Object
>
codeParam
=
new
HashMap
<>();
codeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
codeParam
.
put
(
"token"
,
token
);
Response
codeRes
=
network
.
getResponse
(
codeParam
,
BasicConfig
.
MOBILE_Code
);
boolean
success
=
codeRes
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
codeParam
,
BasicConfig
.
MOBILE_Code
,
"发放抽奖码失败"
,
codeRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客H到场"
,
priority
=
78
)
public
void
访客
H
到场
()
{
visitorAuth9
();
Map
<
String
,
Object
>
connectSuccessParam
=
new
HashMap
<>();
connectSuccessParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
connectSuccessoRes
=
network
.
getResponse
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
);
boolean
success
=
connectSuccessoRes
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
,
"访客到场请求失败"
,
connectSuccessoRes
.
body
().
asString
()));
}
}
src/test/java/com/kjj/cases/live/manager/LiveMaterial.java
View file @
4bcd04ae
...
...
@@ -220,6 +220,7 @@ public class LiveMaterial implements AdminAuthorization {
saveOrUpdateLinkParam
.
put
(
"companyId"
,
101
);
saveOrUpdateLinkParam
.
put
(
"resourceTitle"
,
"图文资料2"
);
saveOrUpdateLinkParam
.
put
(
"resourceButtonTitle"
,
"我要报名"
);
saveOrUpdateLinkParam
.
put
(
"outLinkType"
,
2
);
saveOrUpdateLinkParam
.
put
(
"outLink"
,
"http://www.baidu.com"
);
saveOrUpdateLinkParam
.
put
(
"resourceImg"
,
"https://yun.dui88.com/kjy/image/20210306/1615026240244.jpeg"
);
...
...
src/test/java/com/kjj/cases/live/manager/QuesReward/Add.java
View file @
4bcd04ae
...
...
@@ -236,7 +236,7 @@ public class Add implements AdminAuthorization {
add1Param
.
put
(
"questionConf"
,
bean1
);
add1Param
.
put
(
"redConf"
,
null
);
AddWelfareConf
welfareConf1
=
new
AddWelfareConf
();
welfareConf1
.
setWelfareId
(
19
0
);
welfareConf1
.
setWelfareId
(
19
1
);
welfareConf1
.
setNum
(
100
);
add1Param
.
put
(
"welfareConf"
,
welfareConf1
);
Response
add1Res
=
network
.
postResponse
(
add1Param
,
BasicConfig
.
MANAGER_add
);
...
...
src/test/java/com/kjj/cases/live/red/Limited.java
View file @
4bcd04ae
This diff is collapsed.
Click to expand it.
src/test/java/com/kjj/cases/live/red/QuestionAwards.java
deleted
100644 → 0
View file @
fbdde173
This diff is collapsed.
Click to expand it.
src/test/java/com/kjj/cases/live/red/Unlimited.java
View file @
4bcd04ae
This diff is collapsed.
Click to expand it.
src/test/java/com/kjj/config/BasicConfig.java
View file @
4bcd04ae
...
...
@@ -12,6 +12,8 @@ public class BasicConfig {
public
static
String
ADMIN_KEY
=
"LEH7epeHVDJWzhZ6DiexTHnsy28ubjrAPGJYU3yPhwb8v3QC3S7b3s2kv18XVBS3CMLT1cmiLu1BdrrC3xbx1EHzWNbcL"
;
// 直播代理人 (艳玲)
public
static
String
AUTH_KEY
=
"LEH7epeHVDJWzhZ6DiexTHnfZY2NrKorVWS9R85xTeuUZzyc2boHSYWYU56ttSUbcAb9ngEb3LJBB3qZ7a9eCkEoPV5yu"
;
// 直播代理人 (小疙瘩人寿)
public
static
String
agentAuth
=
"LEH7epeHVDJWzhZ6DiexTHnsaPwVcYuMTJoYBwNRVTjB7uoajfndh6tsKxDJtDvxrpqcVjD3AUENBnMSmqdPjtjyZrTG8"
;
//直播访客 (志勇)
public
static
String
VISITORKEY
=
"zFNkBc7JtvLPL6ifAfXbcgYH7WruadyTs58VQNVezBEHURWFkb861yA3TQfkngLojnBnDenawiYNbNADYRdv1vFcDi"
;
//直播访客 (茶仔)
...
...
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