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
13d0000b
Commit
13d0000b
authored
Oct 28, 2021
by
龚小红
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'Feature/20211022-gxh' into 'master'
修改时长宝箱的校验条件 See merge request test-group/kejiji!150
parents
1eb2dfd2
4d2d9dc5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
39 deletions
+28
-39
TreasureTime.java
src/test/java/com/kjj/cases/live/treasure/TreasureTime.java
+28
-39
No files found.
src/test/java/com/kjj/cases/live/treasure/TreasureTime.java
View file @
13d0000b
...
@@ -104,11 +104,9 @@ public class TreasureTime implements Authorization {
...
@@ -104,11 +104,9 @@ public class TreasureTime implements Authorization {
params
.
put
(
"treasureConfId"
,
this
.
treasureConfId
.
get
(
0
).
getTreasureConfId
());
params
.
put
(
"treasureConfId"
,
this
.
treasureConfId
.
get
(
0
).
getTreasureConfId
());
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_joinResult
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_joinResult
);
Integer
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
Integer
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
System
.
out
.
println
(
treasureType
);
Assert
.
assertTrue
(
treasureType
==
1
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinResult
,
"中奖结果非抽奖码类型"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
treasureType
==
1
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinResult
,
"中奖结果非抽奖码类型"
,
response
.
body
().
asString
()));
Integer
receiveStatus
=
response
.
jsonPath
().
getInt
(
"data.receiveStatus"
);
Integer
receiveStatus
=
response
.
jsonPath
().
getInt
(
"data.receiveStatus"
);
System
.
out
.
println
(
receiveStatus
);
Assert
.
assertTrue
(
receiveStatus
==
2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinResult
,
"领取失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
receiveStatus
==
2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinResult
,
"领取失败"
,
response
.
body
().
asString
()));
}
}
...
@@ -127,14 +125,12 @@ public class TreasureTime implements Authorization {
...
@@ -127,14 +125,12 @@ public class TreasureTime implements Authorization {
ThreadSleepUtils
.
sleep
(
1000
);
ThreadSleepUtils
.
sleep
(
1000
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_finish
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_finish
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_finish
,
"访客H获取宝箱参与情况失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_finish
,
"访客H获取宝箱参与情况失败"
,
response
.
body
().
asString
()));
visitorAuth9
();
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
1000
);
ThreadSleepUtils
.
sleep
(
1000
);
Response
response1
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_finish
);
Response
response1
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_finish
);
boolean
data1
=
response
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data1
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data1
);
Assert
.
assertTrue
(
data1
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_finish
,
"访客H获取宝箱参与情况失败"
,
response1
.
body
().
asString
()));
Assert
.
assertTrue
(
data1
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_finish
,
"访客H获取宝箱参与情况失败"
,
response1
.
body
().
asString
()));
//红包发完降级抽奖码
//红包发完降级抽奖码
...
@@ -142,7 +138,6 @@ public class TreasureTime implements Authorization {
...
@@ -142,7 +138,6 @@ public class TreasureTime implements Authorization {
ThreadSleepUtils
.
sleep
(
1000
);
ThreadSleepUtils
.
sleep
(
1000
);
Response
response2
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_finish
);
Response
response2
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_finish
);
boolean
data2
=
response
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data2
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data2
);
Assert
.
assertTrue
(
data2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_finish
,
"访客H获取宝箱参与情况失败"
,
response2
.
body
().
asString
()));
Assert
.
assertTrue
(
data2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_finish
,
"访客H获取宝箱参与情况失败"
,
response2
.
body
().
asString
()));
}
}
...
@@ -159,7 +154,6 @@ public class TreasureTime implements Authorization {
...
@@ -159,7 +154,6 @@ public class TreasureTime implements Authorization {
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_joinDetail1
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_joinDetail1
);
List
<
CondDetail
>
treasureList
=
JsonUtil
.
parseResponseToListBean
(
response
,
CondDetail
.
class
,
"condDetail"
);
List
<
CondDetail
>
treasureList
=
JsonUtil
.
parseResponseToListBean
(
response
,
CondDetail
.
class
,
"condDetail"
);
boolean
finishFlag
=
treasureList
.
get
(
1
).
isFinishFlag
();
boolean
finishFlag
=
treasureList
.
get
(
1
).
isFinishFlag
();
System
.
out
.
println
(
finishFlag
);
Assert
.
assertTrue
(
finishFlag
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinDetail1
,
"访客H获取第2个宝箱参与情况失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
finishFlag
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinDetail1
,
"访客H获取第2个宝箱参与情况失败"
,
response
.
body
().
asString
()));
visitorAuth9
();
visitorAuth9
();
...
@@ -167,7 +161,6 @@ public class TreasureTime implements Authorization {
...
@@ -167,7 +161,6 @@ public class TreasureTime implements Authorization {
Response
response1
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_joinDetail1
);
Response
response1
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_joinDetail1
);
List
<
CondDetail
>
treasureList1
=
JsonUtil
.
parseResponseToListBean
(
response1
,
CondDetail
.
class
,
"condDetail"
);
List
<
CondDetail
>
treasureList1
=
JsonUtil
.
parseResponseToListBean
(
response1
,
CondDetail
.
class
,
"condDetail"
);
boolean
finishFlag1
=
treasureList1
.
get
(
1
).
isFinishFlag
();
boolean
finishFlag1
=
treasureList1
.
get
(
1
).
isFinishFlag
();
System
.
out
.
println
(
finishFlag1
);
Assert
.
assertTrue
(
finishFlag1
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinDetail1
,
"访客H获取第2个宝箱参与情况失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
finishFlag1
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinDetail1
,
"访客H获取第2个宝箱参与情况失败"
,
response
.
body
().
asString
()));
//红包发完降级抽奖码
//红包发完降级抽奖码
...
@@ -176,7 +169,6 @@ public class TreasureTime implements Authorization {
...
@@ -176,7 +169,6 @@ public class TreasureTime implements Authorization {
Response
response2
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_joinDetail1
);
Response
response2
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_joinDetail1
);
List
<
CondDetail
>
treasureList2
=
JsonUtil
.
parseResponseToListBean
(
response2
,
CondDetail
.
class
,
"condDetail"
);
List
<
CondDetail
>
treasureList2
=
JsonUtil
.
parseResponseToListBean
(
response2
,
CondDetail
.
class
,
"condDetail"
);
boolean
finishFlag2
=
treasureList2
.
get
(
1
).
isFinishFlag
();
boolean
finishFlag2
=
treasureList2
.
get
(
1
).
isFinishFlag
();
System
.
out
.
println
(
finishFlag2
);
Assert
.
assertTrue
(
finishFlag2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinDetail1
,
"访客H获取第2个宝箱参与情况失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
finishFlag2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinDetail1
,
"访客H获取第2个宝箱参与情况失败"
,
response
.
body
().
asString
()));
...
@@ -224,25 +216,27 @@ public class TreasureTime implements Authorization {
...
@@ -224,25 +216,27 @@ public class TreasureTime implements Authorization {
visitorAuth7
();
visitorAuth7
();
ThreadSleepUtils
.
sleep
(
1000
);
ThreadSleepUtils
.
sleep
(
1000
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_joinResult
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_joinResult
);
Integer
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertTrue
(
treasureType
==
1
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinResult
,
"中奖结果非抽奖码类型"
,
response
.
body
().
asString
())
);
System
.
out
.
println
(
data
);
Integer
receiveStatus
=
response
.
jsonPath
().
getInt
(
"data.receiveStatus"
);
Assert
.
assert
NotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinResult
,
"访客H获取宝箱参与情况
失败"
,
response
.
body
().
asString
()));
Assert
.
assert
True
(
receiveStatus
==
2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinResult
,
"领取
失败"
,
response
.
body
().
asString
()));
visitorAuth9
();
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
1000
);
ThreadSleepUtils
.
sleep
(
1000
);
Response
response1
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_joinResult
);
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_joinResult
);
Object
data1
=
response1
.
jsonPath
().
getJsonObject
(
"data"
);
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
treasureType
==
2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinResult
,
"中奖结果非抽奖码类型"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data1
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinResult
,
"访客H获取宝箱参与情况失败"
,
response1
.
body
().
asString
()));
receiveStatus
=
response
.
jsonPath
().
getInt
(
"data.receiveStatus"
);
Assert
.
assertTrue
(
receiveStatus
==
2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinResult
,
"领取失败"
,
response
.
body
().
asString
()));
//红包发完降级抽奖码
//红包发完降级抽奖码
visitorAuth13
();
visitorAuth13
();
ThreadSleepUtils
.
sleep
(
1000
);
ThreadSleepUtils
.
sleep
(
1000
);
Response
response2
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_joinResult
);
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_joinResult
);
Object
data2
=
response2
.
jsonPath
().
getJsonObject
(
"data"
);
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
treasureType
==
1
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinResult
,
"中奖结果非抽奖码类型"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinResult
,
"访客H获取宝箱参与情况失败"
,
response2
.
body
().
asString
()));
receiveStatus
=
response
.
jsonPath
().
getInt
(
"data.receiveStatus"
);
Assert
.
assertTrue
(
receiveStatus
==
2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinResult
,
"领取失败"
,
response
.
body
().
asString
()));
}
}
...
@@ -358,24 +352,27 @@ public class TreasureTime implements Authorization {
...
@@ -358,24 +352,27 @@ public class TreasureTime implements Authorization {
visitorAuth7
();
visitorAuth7
();
ThreadSleepUtils
.
sleep
(
1000
);
ThreadSleepUtils
.
sleep
(
1000
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_joinResult
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_joinResult
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Integer
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
treasureType
==
1
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinResult
,
"中奖结果非抽奖码类型"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinResult
,
"访客H获取宝箱参与情况失败"
,
response
.
body
().
asString
()));
Integer
receiveStatus
=
response
.
jsonPath
().
getInt
(
"data.receiveStatus"
);
Assert
.
assertTrue
(
receiveStatus
==
2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinResult
,
"领取失败"
,
response
.
body
().
asString
()));
visitorAuth9
();
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
1000
);
ThreadSleepUtils
.
sleep
(
1000
);
Response
response1
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_joinResult
);
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_joinResult
);
Object
data1
=
response1
.
jsonPath
().
getJsonObject
(
"data"
);
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
treasureType
==
3
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinResult
,
"中奖结果非抽奖码类型"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data1
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinResult
,
"访客H获取宝箱参与情况失败"
,
response1
.
body
().
asString
()));
receiveStatus
=
response
.
jsonPath
().
getInt
(
"data.receiveStatus"
);
Assert
.
assertTrue
(
receiveStatus
==
2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinResult
,
"领取失败"
,
response
.
body
().
asString
()));
//红包发完降级抽奖码
//红包发完降级抽奖码
visitorAuth13
();
visitorAuth13
();
ThreadSleepUtils
.
sleep
(
1000
);
ThreadSleepUtils
.
sleep
(
1000
);
Response
response2
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_joinResult
);
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_joinResult
);
Object
data2
=
response2
.
jsonPath
().
getJsonObject
(
"data"
);
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
treasureType
==
1
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinResult
,
"中奖结果非抽奖码类型"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinResult
,
"访客H获取宝箱参与情况失败"
,
response2
.
body
().
asString
()));
receiveStatus
=
response
.
jsonPath
().
getInt
(
"data.receiveStatus"
);
Assert
.
assertTrue
(
receiveStatus
==
2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinResult
,
"领取失败"
,
response
.
body
().
asString
()));
}
}
...
@@ -441,13 +438,5 @@ public class TreasureTime implements Authorization {
...
@@ -441,13 +438,5 @@ public class TreasureTime implements Authorization {
int
receiveStatus
=
response
.
jsonPath
().
getInt
(
"data.receiveStatus"
);
int
receiveStatus
=
response
.
jsonPath
().
getInt
(
"data.receiveStatus"
);
System
.
out
.
println
(
receiveStatus
);
System
.
out
.
println
(
receiveStatus
);
Assert
.
assertTrue
(
receiveStatus
==
2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinResult
,
"领取失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
receiveStatus
==
2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinResult
,
"领取失败"
,
response
.
body
().
asString
()));
}
}
}
}
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