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
0f125bdd
Commit
0f125bdd
authored
Apr 20, 2022
by
龚小红
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改中奖逻辑,一个客户一场直播仅能实物中奖1次的逻辑
parent
ce0b8092
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
68 additions
and
44 deletions
+68
-44
Answer.java
src/test/java/com/kjj/cases/live/answer/Answer.java
+18
-10
LiveBinding.java
src/test/java/com/kjj/cases/live/liveConfig/LiveBinding.java
+8
-0
GoldenEgg.java
src/test/java/com/kjj/cases/live/treasure/GoldenEgg.java
+1
-0
Treasure.java
src/test/java/com/kjj/cases/live/treasure/Treasure.java
+4
-5
TreasureTime.java
src/test/java/com/kjj/cases/live/treasure/TreasureTime.java
+35
-27
JmeterAccountFile.java
src/test/java/com/kjj/utils/JmeterAccountFile.java
+2
-2
No files found.
src/test/java/com/kjj/cases/live/answer/Answer.java
View file @
0f125bdd
...
...
@@ -16,11 +16,19 @@ import org.testng.annotations.Test;
import
java.util.*
;
import
static
com
.
kjj
.
utils
.
BaseUtils
.
connectSuccess
;
public
class
Answer
implements
Authorization
{
@BeforeClass
public
void
setUp
()
{
BaseUtils
.
ssoLogin
();
visitorAuth20
();
connectSuccess
();
agentAuth2
();
connectSuccess
();
}
public
int
id
;
...
...
@@ -561,7 +569,7 @@ public class Answer implements Authorization {
@Test
(
description
=
"领取有奖答题福利-访客A答题正确"
,
priority
=
30
)
public
void
访客
A
领取有奖答题福利
()
{
visitorAuth
3
();
visitorAuth
20
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"quesConfId"
,
this
.
quesConfId
.
get
(
2
).
getQuesConfId
());
...
...
@@ -582,7 +590,7 @@ public class Answer implements Authorization {
@Test
(
description
=
"查询访客A领取有奖答题福利结果"
,
priority
=
31
)
public
void
查询访客
A
领取有奖答题福利结果
()
{
visitorAuth
3
();
visitorAuth
20
();
ThreadSleepUtils
.
sleep
(
3000
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
...
@@ -757,7 +765,7 @@ public class Answer implements Authorization {
@Test
(
description
=
"访客查询第二轮答题福利"
,
priority
=
40
)
public
void
访客查询第二轮答题福利
()
{
visitorAuth
3
();
visitorAuth
20
();
ThreadSleepUtils
.
sleep
(
3000
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
...
@@ -776,7 +784,7 @@ public class Answer implements Authorization {
@Test
(
description
=
"访客A第二轮领取有奖答题福利-答题正确"
,
priority
=
41
)
public
void
访客
A
第二轮领取有奖答题福利
()
{
visitorAuth
3
();
visitorAuth
20
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"quesConfId"
,
this
.
quesConfId
.
get
(
3
).
getQuesConfId
());
...
...
@@ -795,7 +803,7 @@ public class Answer implements Authorization {
@Test
(
description
=
"查询访客A第二轮有奖答题福利类型结果"
,
priority
=
42
)
public
void
查询访客
A
第二轮有奖答题福利类型结果
()
{
visitorAuth
3
();
visitorAuth
20
();
ThreadSleepUtils
.
sleep
(
3000
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
...
@@ -1155,7 +1163,7 @@ public class Answer implements Authorization {
@Test
(
description
=
"领取有奖答题福利类型-访客A答题正确"
,
priority
=
61
)
public
void
访客
A
领取有奖答题福利类型
()
{
visitorAuth
3
();
visitorAuth
20
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"quesConfId"
,
this
.
quesConfId
.
get
(
5
).
getQuesConfId
());
...
...
@@ -1173,7 +1181,7 @@ public class Answer implements Authorization {
@Test
(
description
=
"访客A领取有奖答题福利结果"
,
priority
=
62
)
public
void
访客
A
领取有奖答题福利结果
()
{
visitorAuth
3
();
visitorAuth
20
();
ThreadSleepUtils
.
sleep
(
3000
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
...
@@ -1314,7 +1322,7 @@ public class Answer implements Authorization {
@Test
(
description
=
"访客查询第四轮答题福利"
,
priority
=
70
)
public
void
代理人查询第四轮答题福利
()
{
a
dminAuth
();
a
gentAuth2
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_QuesDetail
);
...
...
@@ -1334,7 +1342,7 @@ public class Answer implements Authorization {
}
@Test
(
description
=
"代理人第四轮领取答题福利-答题正确"
,
priority
=
71
)
public
void
代理人第四轮领取答题福利
(){
agentAuth
();
agentAuth
2
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"quesConfId"
,
this
.
quesConfId
.
get
(
7
).
getQuesConfId
());
...
...
@@ -1349,7 +1357,7 @@ public class Answer implements Authorization {
@Test
(
description
=
"查询代理人第四轮有奖答题福利类型结果"
,
priority
=
72
)
public
void
查询代理人第四轮有奖答题福利类型结果
(){
//验证管理后台配置实物奖品允许代理人参与并获奖
agentAuth
();
agentAuth
2
();
ThreadSleepUtils
.
sleep
(
3000
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
...
src/test/java/com/kjj/cases/live/liveConfig/LiveBinding.java
View file @
0f125bdd
...
...
@@ -158,6 +158,14 @@ public class LiveBinding implements Authorization {
visitorAuth30
();
binding
(
this
.
shareSign
);;
token
();
visitorAuth20
();
binding
(
this
.
shareSign
);;
token
();
visitorAuth21
();
binding
(
this
.
shareSign
);;
token
();
}
@Test
(
description
=
"访客J_分享直播间"
,
priority
=
8
)
...
...
src/test/java/com/kjj/cases/live/treasure/GoldenEgg.java
View file @
0f125bdd
...
...
@@ -275,6 +275,7 @@ public class GoldenEgg implements Authorization {
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
chooseAwardParam
,
BasicConfig
.
MOBILE_goldenEgg_open
,
"砸金蛋失败"
,
response
.
body
().
asString
()));
sleep
(
2000
);
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
param
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
param
.
put
(
"treasureConfId"
,
ConfId
);
...
...
src/test/java/com/kjj/cases/live/treasure/Treasure.java
View file @
0f125bdd
...
...
@@ -533,6 +533,7 @@ public class Treasure implements Authorization {
@Test
(
description
=
"访客H第3轮开宝箱参与详情"
,
priority
=
45
)
public
void
访客
H
第
3
轮开宝箱参与详情
()
{
//直播有整体限制单个客户仅能中奖实物一次
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
...
...
@@ -541,7 +542,7 @@ public class Treasure implements Authorization {
Response
response
=
network
.
getResponse
(
infoParam
,
BasicConfig
.
MANAGER_participateInfo
);
int
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
System
.
out
.
println
(
treasureType
);
Assert
.
assertTrue
(
treasureType
==
3
,
network
.
message
(
infoParam
,
BasicConfig
.
MANAGER_participateInfo
,
"类型非实物
"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
treasureType
==
1
,
network
.
message
(
infoParam
,
BasicConfig
.
MANAGER_participateInfo
,
"类型非抽奖码
"
,
response
.
body
().
asString
()));
int
receiveStatus
=
response
.
jsonPath
().
getInt
(
"data.receiveStatus"
);
System
.
out
.
println
(
receiveStatus
);
...
...
@@ -593,8 +594,6 @@ public class Treasure implements Authorization {
Assert
.
assertTrue
(
data
,
network
.
message
(
infoParam
,
BasicConfig
.
MOBILE_assist
,
"访客R给访客M助力失败"
,
response
.
body
().
asString
()));
}
//验证实物奖品数量是否会超发
@Test
(
description
=
"访客H第4次参与详情的进度显示"
,
priority
=
53
)
public
void
访客
H
第
4
次参与详情的进度显示
()
{
visitorAuth9
();
...
...
@@ -657,7 +656,7 @@ public class Treasure implements Authorization {
Response
response
=
network
.
getResponse
(
infoParam
,
BasicConfig
.
MANAGER_participateInfo
);
int
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
System
.
out
.
println
(
treasureType
);
Assert
.
assertTrue
(
treasureType
==
3
,
network
.
message
(
infoParam
,
BasicConfig
.
MANAGER_participateInfo
,
"类型非实物
"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
treasureType
==
1
,
network
.
message
(
infoParam
,
BasicConfig
.
MANAGER_participateInfo
,
"类型非抽奖码
"
,
response
.
body
().
asString
()));
int
receiveStatus
=
response
.
jsonPath
().
getInt
(
"data.receiveStatus"
);
System
.
out
.
println
(
receiveStatus
);
...
...
@@ -669,7 +668,7 @@ public class Treasure implements Authorization {
Response
responseB
=
network
.
getResponse
(
infoParam
,
BasicConfig
.
MANAGER_participateInfo
);
int
treasureType1
=
responseB
.
jsonPath
().
getInt
(
"data.treasureType"
);
System
.
out
.
println
(
treasureType1
);
Assert
.
assertTrue
(
treasureType1
==
1
,
network
.
message
(
infoParam
,
BasicConfig
.
MANAGER_participateInfo
,
"类型非抽奖码
"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
treasureType1
==
3
,
network
.
message
(
infoParam
,
BasicConfig
.
MANAGER_participateInfo
,
"类型非实物
"
,
response
.
body
().
asString
()));
int
receiveStatus1
=
responseB
.
jsonPath
().
getInt
(
"data.receiveStatus"
);
System
.
out
.
println
(
receiveStatus1
);
...
...
src/test/java/com/kjj/cases/live/treasure/TreasureTime.java
View file @
0f125bdd
This diff is collapsed.
Click to expand it.
src/test/java/com/kjj/utils/JmeterAccountFile.java
View file @
0f125bdd
...
...
@@ -32,9 +32,9 @@ public class JmeterAccountFile {
public
static
void
otoCookieMaker
()
{
OtoTokenCookie
otoTokenCookie
=
new
OtoTokenCookie
();
otoTokenCookie
.
setExpiredTime
(
System
.
currentTimeMillis
()
+
86400
*
1000
*
150L
);
otoTokenCookie
.
setPhoneNumber
(
"1
586919513
0"
);
otoTokenCookie
.
setPhoneNumber
(
"1
783085559
0"
);
otoTokenCookie
.
setLoginId
(
IdMakeUtil
.
encodingId
(
46
L
,
IdConvertBase64Enum
.
DEF
));
otoTokenCookie
.
setLoginId
(
IdMakeUtil
.
encodingId
(
2
L
,
IdConvertBase64Enum
.
DEF
));
String
json
=
JSON
.
toJSONString
(
otoTokenCookie
);
String
otoToken
=
BlowfishUtils
.
encryptBlowfish
(
json
,
"02a16fs1b6a3"
);
...
...
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