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
16cf5618
Commit
16cf5618
authored
Sep 26, 2021
by
郭姣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
翻牌红包等级优化接口
parent
ac4118c7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
20 deletions
+52
-20
FlipCard.java
src/test/java/com/kjj/cases/live/flipCard/FlipCard.java
+52
-20
No files found.
src/test/java/com/kjj/cases/live/flipCard/FlipCard.java
View file @
16cf5618
...
...
@@ -114,7 +114,7 @@ public class FlipCard implements Authorization {
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
//Params.put("liveId",6441);
Params
.
put
(
"freeNum"
,
3
);
Params
.
put
(
"freeNum"
,
1
);
Params
.
put
(
"helpNum"
,
1
);
List
<
RedLevelBean
>
RedLevels
=
new
ArrayList
<>();
RedLevelBean
redLevel1
=
new
RedLevelBean
();
...
...
@@ -149,7 +149,7 @@ public class FlipCard implements Authorization {
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
//Params.put("liveId",6451);
Params
.
put
(
"freeNum"
,
3
);
Params
.
put
(
"freeNum"
,
1
);
Params
.
put
(
"helpNum"
,
1
);
List
<
RedLevelBean
>
RedLevels
=
new
ArrayList
<>();
RedLevelBean
redLevel1
=
new
RedLevelBean
();
...
...
@@ -280,7 +280,7 @@ public class FlipCard implements Authorization {
infoParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
infoParam
.
put
(
"shareSign"
,
shareSign
);
infoParam
.
put
(
"shareType"
,
12
);
infoParam
.
put
(
"confId"
,
this
.
redConfId
);
//
infoParam.put("confId",this.redConfId);
visitorAuth22
();
Response
response
=
network
.
getResponse
(
infoParam
,
BasicConfig
.
MOBILE_info
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
...
...
@@ -312,7 +312,7 @@ public class FlipCard implements Authorization {
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"shareSign"
,
shareSign
);
params
.
put
(
"shareType"
,
12
);
params
.
put
(
"confId"
,
this
.
redConfId
);
//
params.put("confId",this.redConfId);
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_assist
);
System
.
out
.
println
(
response
.
body
().
asString
());
...
...
@@ -349,7 +349,7 @@ public class FlipCard implements Authorization {
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"shareSign"
,
shareSign
);
params
.
put
(
"shareType"
,
12
);
params
.
put
(
"confId"
,
this
.
redConfId
);
//
params.put("confId",this.redConfId);
visitorAuth9
();
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_assist
);
...
...
@@ -580,18 +580,18 @@ public class FlipCard implements Authorization {
}
@Test
(
description
=
"放弃开红包"
,
priority
=
23
)
public
void
放弃开红包
()
{
visitorAuth22
();
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_abort
);
System
.
out
.
println
(
response
.
body
().
asString
());
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_abort
,
"放弃开红包报异常"
,
response
.
body
().
asString
()));
}
//
@Test(description = "放弃开红包", priority = 23)
//
public void 放弃开红包() {
//
visitorAuth22();
//
ThreadSleepUtils.sleep(1000);
//
Map<String, Object> params = new HashMap<>();
//
params.put("liveId",LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
//
Response response = network.postResponse(params, BasicConfig.MOBILE_abort);
//
System.out.println(response.body().asString());
//
boolean data =response.jsonPath().getBoolean("data");
//
Assert.assertTrue(data, network.message(params, BasicConfig.MOBILE_abort, "放弃开红包报异常", response.body().asString()));
//
//
}
@Test
(
description
=
"开红包"
,
priority
=
24
)
...
...
@@ -604,6 +604,13 @@ public class FlipCard implements Authorization {
System
.
out
.
println
(
response
.
body
().
asString
());
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_redOpen
,
"开红包失败"
,
response
.
body
().
asString
()));
visitorAuth22
();
ThreadSleepUtils
.
sleep
(
1000
);
Response
response2
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_redOpen
);
System
.
out
.
println
(
response2
.
body
().
asString
());
boolean
data2
=
response2
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_redOpen
,
"开红包失败"
,
response2
.
body
().
asString
()));
}
@Test
(
description
=
"用户开红包状态查询"
,
priority
=
25
)
...
...
@@ -624,13 +631,17 @@ public class FlipCard implements Authorization {
Response
finishRes
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_finishStatus
);
System
.
out
.
println
(
finishRes
.
body
().
asString
());
int
status1
=
finishRes
.
jsonPath
().
getInt
(
"data.status"
);
Assert
.
assertTrue
(
status1
==
4
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_finishStatus
,
"集字状态不对"
,
finishRes
.
body
().
asString
()));
Assert
.
assertTrue
(
status1
==
3
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_finishStatus
,
"集字状态不对"
,
finishRes
.
body
().
asString
()));
int
redStatus2
=
response
.
jsonPath
().
getInt
(
"data.redStatus"
);
Assert
.
assertTrue
(
redStatus2
==
4
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_finishStatus
,
"发钱异常"
,
finishRes
.
body
().
asString
()));
}
//开启不同等级的红包
@Test
(
description
=
"开红包结果"
,
priority
=
26
)
public
void
开红包结果
()
{
//红包等级I
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
...
...
@@ -640,9 +651,30 @@ public class FlipCard implements Authorization {
int
redStatus
=
response
.
jsonPath
().
getInt
(
"data.redStatus"
);
Assert
.
assertTrue
(
redStatus
==
4
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_redOpenState
,
"红包领取状态不对"
,
response
.
body
().
asString
()));
int
redAmount
=
response
.
jsonPath
().
getInt
(
"data.redAmount"
);
Assert
.
assertTrue
(
redAmount
==
100
0
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_redOpenState
,
"红包金额不对"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
redAmount
==
3
0
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_redOpenState
,
"红包金额不对"
,
response
.
body
().
asString
()));
}
//红包等级II
visitorAuth22
();
ThreadSleepUtils
.
sleep
(
1000
);
Response
response2
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_redOpenState
);
System
.
out
.
println
(
response2
.
body
().
asString
());
int
redStatus2
=
response2
.
jsonPath
().
getInt
(
"data.redStatus"
);
Assert
.
assertTrue
(
redStatus2
==
4
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_redOpenState
,
"红包领取状态不对"
,
response2
.
body
().
asString
()));
int
redAmount2
=
response2
.
jsonPath
().
getInt
(
"data.redAmount"
);
System
.
out
.
println
(
redAmount2
);
Assert
.
assertTrue
(
redAmount2
==
40
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_redOpenState
,
"红包金额不对"
,
response2
.
body
().
asString
()));
}
@Test
(
description
=
"翻牌集字配置详情"
,
priority
=
27
)
public
void
翻牌集字配置详情
(){
visitorAuth9
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_confV2
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
String
titleImage
=
response
.
jsonPath
().
getString
(
"data.titleImage"
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_confV2
,
"翻牌配置详情查询失败"
,
response
.
body
().
asString
()));
Assert
.
assertNull
(
titleImage
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_confV2
,
"获取默认标题配图失败"
,
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