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
6c519b7b
Commit
6c519b7b
authored
Sep 01, 2021
by
xiamengchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
秒杀互动支付成功前流程
parent
f8da03ea
Changes
9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
604 additions
and
405 deletions
+604
-405
AnchorGetSKList.java
src/test/java/com/kjj/bean/secondKill/AnchorGetSKList.java
+1
-0
Answer.java
src/test/java/com/kjj/cases/live/answer/Answer.java
+0
-10
RelativeLottery.java
...test/java/com/kjj/cases/live/lottery/RelativeLottery.java
+141
-141
ConfSecondKill.java
...st/java/com/kjj/cases/live/secondKill/ConfSecondKill.java
+27
-6
SecondKill.java
src/test/java/com/kjj/cases/live/secondKill/SecondKill.java
+238
-80
Treasure.java
src/test/java/com/kjj/cases/live/treasure/Treasure.java
+13
-0
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+2
-0
IdMakeUtil.java
src/test/java/com/kjj/utils/IdMakeUtil.java
+14
-0
liveTestNG.xml
src/test/liveTestNG.xml
+168
-168
No files found.
src/test/java/com/kjj/bean/secondKill/AnchorGetSKList.java
View file @
6c519b7b
...
@@ -7,4 +7,5 @@ public class AnchorGetSKList {
...
@@ -7,4 +7,5 @@ public class AnchorGetSKList {
private
int
interactStatus
;
private
int
interactStatus
;
private
String
id
;
private
String
id
;
private
int
surplusNum
;
private
int
surplusNum
;
private
String
goodsId
;
}
}
src/test/java/com/kjj/cases/live/answer/Answer.java
View file @
6c519b7b
...
@@ -229,16 +229,6 @@ public class Answer implements Authorization {
...
@@ -229,16 +229,6 @@ public class Answer implements Authorization {
//访客端
//访客端
/*查询访客端有奖答题配置详情*/
/*查询访客端有奖答题配置详情*/
@Test
(
description
=
"代理人关系绑定"
,
priority
=
11
)
public
void
代理人关系绑定
()
{
agentAuth
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
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
=
"访客A查询答题红包配置"
,
priority
=
12
)
@Test
(
description
=
"访客A查询答题红包配置"
,
priority
=
12
)
public
void
访客
A
查询答题红包配置
()
public
void
访客
A
查询答题红包配置
()
{
{
...
...
src/test/java/com/kjj/cases/live/lottery/RelativeLottery.java
View file @
6c519b7b
This diff is collapsed.
Click to expand it.
src/test/java/com/kjj/cases/live/secondKill/ConfSecondKill.java
View file @
6c519b7b
...
@@ -24,7 +24,8 @@ public class ConfSecondKill implements Authorization {
...
@@ -24,7 +24,8 @@ public class ConfSecondKill implements Authorization {
private
long
newSecKillId
;
// 会被删除的秒杀id
private
long
newSecKillId
;
// 会被删除的秒杀id
private
static
final
long
secKillGoodsId
=
115
;
// 用来配置轮次的秒杀商品ID
private
static
final
long
secKillGoodsId
=
115
;
// 用来配置轮次的秒杀商品ID
public
static
final
String
secKillGoodsIdEncode
=
IdMakeUtil
.
managerEncodingId
(
secKillGoodsId
);
public
static
final
String
secKillGoodsIdEncode
=
IdMakeUtil
.
managerEncodingId
(
secKillGoodsId
);
private
String
skId
;
// 秒杀id
public
static
String
skIdFirst
;
// 第一轮秒杀id
public
static
String
skIdSecond
;
// 第二轮秒杀ID
public
static
int
killListSize
;
public
static
int
killListSize
;
@BeforeClass
@BeforeClass
...
@@ -194,7 +195,25 @@ public class ConfSecondKill implements Authorization {
...
@@ -194,7 +195,25 @@ public class ConfSecondKill implements Authorization {
}
}
}
}
@Test
(
description
=
"助播端获取秒杀轮次列表"
,
priority
=
8
)
@Test
(
description
=
"新增第二轮秒杀"
,
priority
=
8
)
public
void
新增第二轮秒杀
()
{
Map
<
String
,
Object
>
secKillAddPar
=
new
HashMap
<>();
secKillAddPar
.
put
(
"goodsId"
,
secKillGoodsIdEncode
);
secKillAddPar
.
put
(
"goodsAmount"
,
1
);
// 1 == 0.01
secKillAddPar
.
put
(
"interactNum"
,
1
);
secKillAddPar
.
put
(
"ableAgent"
,
1
);
// 代理人可参与
secKillAddPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
secKillAddRes
=
network
.
postResponse
(
secKillAddPar
,
BasicConfig
.
ANCHOR_secondKillSave
);
try
{
boolean
data
=
secKillAddRes
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
secKillAddPar
,
BasicConfig
.
ANCHOR_secondKillSave
,
"新增轮次失败"
,
secKillAddRes
.
body
().
asString
()));
}
catch
(
NullPointerException
e
){
e
.
printStackTrace
();
Assert
.
fail
(
network
.
message
(
secKillAddPar
,
BasicConfig
.
ANCHOR_secondKillSave
,
"未获取到数据"
,
secKillAddRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"助播端获取秒杀轮次列表"
,
priority
=
9
)
public
void
助播端获取秒杀轮次列表
()
{
public
void
助播端获取秒杀轮次列表
()
{
Map
<
String
,
Object
>
liveSecKillPar
=
new
HashMap
<>();
Map
<
String
,
Object
>
liveSecKillPar
=
new
HashMap
<>();
liveSecKillPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
liveSecKillPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
@@ -203,8 +222,10 @@ public class ConfSecondKill implements Authorization {
...
@@ -203,8 +222,10 @@ public class ConfSecondKill implements Authorization {
try
{
try
{
secKillLists
=
JsonUtil
.
parseResponseToListBean
(
liveSecKillRes
,
AnchorGetSKList
.
class
);
secKillLists
=
JsonUtil
.
parseResponseToListBean
(
liveSecKillRes
,
AnchorGetSKList
.
class
);
killListSize
=
secKillLists
.
size
();
killListSize
=
secKillLists
.
size
();
skId
=
secKillLists
.
get
(
killListSize
-
1
).
getId
();
String
goodsId
=
secKillLists
.
get
(
0
).
getGoodsId
();
System
.
out
.
println
(
skId
);
Assert
.
assertEquals
(
goodsId
,
secKillGoodsIdEncode
,
network
.
message
(
liveSecKillPar
,
BasicConfig
.
ANCHOR_secondKillLists
,
"轮次对应商品ID错误"
,
liveSecKillRes
.
body
().
asString
()));
skIdFirst
=
secKillLists
.
get
(
0
).
getId
();
skIdSecond
=
secKillLists
.
get
(
1
).
getId
();
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
e
.
printStackTrace
();
e
.
printStackTrace
();
Assert
.
fail
(
network
.
message
(
liveSecKillPar
,
BasicConfig
.
ANCHOR_secondKillLists
,
"未获取到数据"
,
liveSecKillRes
.
body
().
asString
()));
Assert
.
fail
(
network
.
message
(
liveSecKillPar
,
BasicConfig
.
ANCHOR_secondKillLists
,
"未获取到数据"
,
liveSecKillRes
.
body
().
asString
()));
...
@@ -212,13 +233,13 @@ public class ConfSecondKill implements Authorization {
...
@@ -212,13 +233,13 @@ public class ConfSecondKill implements Authorization {
}
}
@Test
(
description
=
"助播端编辑秒杀轮次"
,
priority
=
9
)
@Test
(
description
=
"助播端编辑秒杀轮次"
,
priority
=
10
)
public
void
助播端编辑秒杀轮次
()
{
public
void
助播端编辑秒杀轮次
()
{
Map
<
String
,
Object
>
secKillUpdatePar
=
new
HashMap
<>();
Map
<
String
,
Object
>
secKillUpdatePar
=
new
HashMap
<>();
secKillUpdatePar
.
put
(
"goodsId"
,
secKillGoodsIdEncode
);
secKillUpdatePar
.
put
(
"goodsId"
,
secKillGoodsIdEncode
);
secKillUpdatePar
.
put
(
"goodsAmount"
,
1
);
secKillUpdatePar
.
put
(
"goodsAmount"
,
1
);
secKillUpdatePar
.
put
(
"interactNum"
,
3
);
secKillUpdatePar
.
put
(
"interactNum"
,
3
);
secKillUpdatePar
.
put
(
"id"
,
skId
);
secKillUpdatePar
.
put
(
"id"
,
skId
First
);
secKillUpdatePar
.
put
(
"ableAgent"
,
0
);
secKillUpdatePar
.
put
(
"ableAgent"
,
0
);
Response
secKillUpdateRes
=
network
.
postResponse
(
secKillUpdatePar
,
BasicConfig
.
ANCHOR_secondKillUpdate
);
Response
secKillUpdateRes
=
network
.
postResponse
(
secKillUpdatePar
,
BasicConfig
.
ANCHOR_secondKillUpdate
);
try
{
try
{
...
...
src/test/java/com/kjj/cases/live/secondKill/SecondKill.java
View file @
6c519b7b
This diff is collapsed.
Click to expand it.
src/test/java/com/kjj/cases/live/treasure/Treasure.java
View file @
6c519b7b
...
@@ -1055,6 +1055,19 @@ public class Treasure implements Authorization {
...
@@ -1055,6 +1055,19 @@ public class Treasure implements Authorization {
}
}
/**
* 添加代理人绑定关系
*/
@Test
(
description
=
"代理人绑定"
,
priority
=
70
)
public
void
代理人绑定
()
{
agentAuth
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
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
()));
}
...
...
src/test/java/com/kjj/config/BasicConfig.java
View file @
6c519b7b
...
@@ -146,7 +146,9 @@ public class BasicConfig {
...
@@ -146,7 +146,9 @@ public class BasicConfig {
public
static
final
String
MOBILE_secondKill_getGoodsList
=
MOBILE_HOST
+
"/clue/goods/list"
;
public
static
final
String
MOBILE_secondKill_getGoodsList
=
MOBILE_HOST
+
"/clue/goods/list"
;
public
static
final
String
MOBILE_secondKill_getGoodsDetail
=
MOBILE_HOST
+
"/clue/goods/detail"
;
public
static
final
String
MOBILE_secondKill_getGoodsDetail
=
MOBILE_HOST
+
"/clue/goods/detail"
;
public
static
final
String
ANCHOR_secondKillOn
=
MOBILE_HOST
+
"/conf/live/second/kill/goods/on"
;
public
static
final
String
ANCHOR_secondKillOn
=
MOBILE_HOST
+
"/conf/live/second/kill/goods/on"
;
public
static
final
String
ANCHOR_secondKillOff
=
MOBILE_HOST
+
"/conf/live/second/kill/goods/off"
;
public
static
final
String
MOBILE_secondKill_goodsFirst
=
MOBILE_HOST
+
"/clue/goods/first"
;
public
static
final
String
MOBILE_secondKill_goodsFirst
=
MOBILE_HOST
+
"/clue/goods/first"
;
public
static
final
String
MOBILE_secondKill_downgradeGoodsFirst
=
MOBILE_HOST
+
"/clue/downgrade/goods"
;
public
static
final
String
MOBILE_secondKill_goodsOrder
=
MOBILE_HOST
+
"/clue/goods/order"
;
public
static
final
String
MOBILE_secondKill_goodsOrder
=
MOBILE_HOST
+
"/clue/goods/order"
;
public
static
final
String
MOBILE_secondKill_goodsOrderResult
=
MOBILE_HOST
+
"/clue/goods/order/result"
;
public
static
final
String
MOBILE_secondKill_goodsOrderResult
=
MOBILE_HOST
+
"/clue/goods/order/result"
;
public
static
final
String
MOBILE_secondKill_killGoods
=
MOBILE_HOST
+
"/clue/goods/killGoods"
;
public
static
final
String
MOBILE_secondKill_killGoods
=
MOBILE_HOST
+
"/clue/goods/killGoods"
;
...
...
src/test/java/com/kjj/utils/IdMakeUtil.java
View file @
6c519b7b
...
@@ -62,5 +62,19 @@ public class IdMakeUtil implements Authorization {
...
@@ -62,5 +62,19 @@ public class IdMakeUtil implements Authorization {
return
encodeId
;
return
encodeId
;
}
}
public
static
long
managerDecodeingId
(
String
code
)
{
BaseUtils
.
ssoLogin
();
Map
<
String
,
Object
>
decodePar
=
new
HashMap
<>();
decodePar
.
put
(
"code"
,
code
);
Response
decodeRes
=
network
.
getResponse
(
decodePar
,
BasicConfig
.
MANAGER_ID_DECODE
);
long
decodeId
=
0
;
try
{
decodeId
=
decodeRes
.
jsonPath
().
getLong
(
"data"
);
}
catch
(
NullPointerException
e
){
e
.
printStackTrace
();
}
return
decodeId
;
}
}
}
src/test/liveTestNG.xml
View file @
6c519b7b
This diff is collapsed.
Click to expand it.
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