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
b18226ad
Commit
b18226ad
authored
Nov 30, 2021
by
龚小红
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.增加秒杀资格的0元支付下单流程。
2.增加秒杀退款。
parent
9d6b2408
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
201 additions
and
83 deletions
+201
-83
Authorization.java
src/test/java/com/kjj/cases/admin/Authorization.java
+6
-0
LiveLater.java
src/test/java/com/kjj/cases/live/agent/LiveLater.java
+0
-1
CloseLive.java
src/test/java/com/kjj/cases/live/anchor/CloseLive.java
+6
-5
OpenLive.java
src/test/java/com/kjj/cases/live/anchor/OpenLive.java
+11
-16
LiveBinding.java
src/test/java/com/kjj/cases/live/liveConfig/LiveBinding.java
+4
-0
ConfSecondKill.java
...st/java/com/kjj/cases/live/secondKill/ConfSecondKill.java
+1
-4
SecondKill.java
src/test/java/com/kjj/cases/live/secondKill/SecondKill.java
+161
-42
GoldenEgg.java
src/test/java/com/kjj/cases/live/treasure/GoldenEgg.java
+4
-15
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+8
-0
No files found.
src/test/java/com/kjj/cases/admin/Authorization.java
View file @
b18226ad
...
...
@@ -241,4 +241,10 @@ public interface Authorization {
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth27
);
}
//自动化假用户
// 用户ID:4054
default
void
visitorAuto1
()
{
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuto1
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuto1
);
}
}
src/test/java/com/kjj/cases/live/agent/LiveLater.java
View file @
b18226ad
...
...
@@ -286,7 +286,6 @@ public class LiveLater implements Authorization {
Assert
.
assertEquals
(
evaLists
.
size
(),
1
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_getClueDetail
,
"用户参与测试数量错误"
,
response
.
body
().
asString
()));
String
evaTitle
=
(
String
)
evaLists
.
get
(
0
).
get
(
"resourceTitle"
);
Assert
.
assertEquals
(
evaTitle
,
"编辑后修改标题"
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_getClueDetail
,
"用户参与测试标题错误"
,
response
.
body
().
asString
()));
}
...
...
src/test/java/com/kjj/cases/live/anchor/CloseLive.java
View file @
b18226ad
...
...
@@ -21,18 +21,19 @@ public class CloseLive implements Authorization {
adminAuth
();
}
@Test
(
description
=
"结束直播"
,
priority
=
1
)
public
void
closeLive
()
{
public
static
void
closeLive
(
String
liveId
)
{
Map
<
String
,
Object
>
closeParam
=
new
HashMap
<>();
closeParam
.
put
(
"liveid"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
())
);
closeParam
.
put
(
"liveid"
,
liveId
);
closeParam
.
put
(
"cid"
,
101
);
Response
closeRes
=
network
.
postResponse
(
closeParam
,
BasicConfig
.
ANCHOR_CLOSE
);
Object
data
=
closeRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
closeParam
,
BasicConfig
.
ANCHOR_CLOSE
,
"结束直播失败"
,
closeRes
.
body
().
asString
()));
}
@Test
(
description
=
"结束直播"
,
priority
=
1
)
public
void
结束直播
()
{
closeLive
(
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
}
}
src/test/java/com/kjj/cases/live/anchor/OpenLive.java
View file @
b18226ad
...
...
@@ -10,6 +10,7 @@ import org.testng.annotations.Test;
import
java.util.HashMap
;
import
java.util.Map
;
import
static
com
.
kjj
.
cases
.
live
.
anchor
.
CloseLive
.
closeLive
;
import
static
com
.
kjj
.
utils
.
BaseUtils
.
ssoLogin
;
public
class
OpenLive
implements
Authorization
{
...
...
@@ -22,7 +23,7 @@ public class OpenLive implements Authorization {
@Test
(
description
=
"结束直直播中或断流中的场次"
,
priority
=
1
)
public
void
结束直直播中或断流中的场次
()
{
int
totalCount2
=
0
;
long
liveId
=
0L
;
String
liveId
=
null
;
Map
<
String
,
Object
>
ConfDetailParam
=
new
HashMap
<>();
ConfDetailParam
.
put
(
"companyId"
,
101
);
ConfDetailParam
.
put
(
"liveStatus"
,
3
);
...
...
@@ -40,21 +41,15 @@ public class OpenLive implements Authorization {
totalCount2
=
ConfDetailRes
.
jsonPath
().
getInt
(
"data.totalCount"
);
if
(
totalCount2
==
1
)
{
System
.
out
.
println
(
"有一场直播正在直播中"
);
liveId
=
ConfDetailRes
.
jsonPath
().
get
Lo
ng
(
"data.list.get(0).id"
);
liveId
=
ConfDetailRes
.
jsonPath
().
get
Stri
ng
(
"data.list.get(0).id"
);
}
}
else
{
System
.
out
.
println
(
"有一场直播正在断流中"
);
liveId
=
ConfDetailRes
.
jsonPath
().
get
Lo
ng
(
"data.list.get(0).id"
);
liveId
=
ConfDetailRes
.
jsonPath
().
get
Stri
ng
(
"data.list.get(0).id"
);
}
if
(
totalCount1
==
1
||
totalCount2
==
1
){
adminAuth
();
Map
<
String
,
Object
>
closeParam
=
new
HashMap
<>();
closeParam
.
put
(
"liveid"
,
liveId
);
closeParam
.
put
(
"cid"
,
101
);
Response
closeRes
=
network
.
postResponse
(
closeParam
,
BasicConfig
.
ANCHOR_CLOSE
);
Object
data
=
closeRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
closeParam
,
BasicConfig
.
ANCHOR_CLOSE
,
"结束直播失败"
,
closeRes
.
body
().
asString
()));
closeLive
(
liveId
);
}
}
...
...
@@ -69,11 +64,9 @@ public class OpenLive implements Authorization {
Assert
.
assertNotNull
(
data
,
network
.
message
(
ConfDetailParam
,
BasicConfig
.
ANCHOR_getConfDetail
,
"获取直播配置详情失败"
,
ConfDetailRes
.
body
().
asString
()));
}
@Test
(
description
=
"开始直播"
,
priority
=
3
)
public
void
开启直播
()
{
public
static
void
openLive
(
String
liveId
)
{
Map
<
String
,
Object
>
openParam
=
new
HashMap
<>();
openParam
.
put
(
"liveid"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
())
);
openParam
.
put
(
"liveid"
,
liveId
);
openParam
.
put
(
"cid"
,
101
);
Response
openRes
=
network
.
postResponse
(
openParam
,
BasicConfig
.
ANCHOR_OPEN
);
Object
data
=
openRes
.
jsonPath
().
getJsonObject
(
"data"
);
...
...
@@ -81,6 +74,8 @@ public class OpenLive implements Authorization {
Assert
.
assertNotNull
(
data
,
network
.
message
(
openParam
,
BasicConfig
.
ANCHOR_OPEN
,
"开启直播失败"
,
openRes
.
body
().
asString
()));
ThreadSleepUtils
.
sleep
(
10000
);
}
@Test
(
description
=
"开始直播"
,
priority
=
3
)
public
void
开启直播
()
{
openLive
(
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
}
}
src/test/java/com/kjj/cases/live/liveConfig/LiveBinding.java
View file @
b18226ad
...
...
@@ -145,6 +145,10 @@ public class LiveBinding implements Authorization {
binding
(
this
.
shareSign
);;
token
();
visitorAuto1
();
binding
(
this
.
shareSign
);;
token
();
}
@Test
(
description
=
"访客J_分享直播间"
,
priority
=
8
)
...
...
src/test/java/com/kjj/cases/live/secondKill/ConfSecondKill.java
View file @
b18226ad
...
...
@@ -65,7 +65,7 @@ public class ConfSecondKill implements Authorization {
@Test
(
description
=
"秒杀轮次上限限制"
,
priority
=
2
)
public
void
秒杀轮次上限限制
()
{
Map
<
String
,
Object
>
secKillAddPar
=
new
HashMap
<>();
secKillAddPar
.
put
(
"goodsId"
,
115
);
secKillAddPar
.
put
(
"goodsId"
,
secKillGoodsId
);
secKillAddPar
.
put
(
"goodsAmount"
,
1
);
// 1 == 0.01
secKillAddPar
.
put
(
"interactNum"
,
3
);
secKillAddPar
.
put
(
"ableAgent"
,
0
);
...
...
@@ -330,7 +330,6 @@ public class ConfSecondKill implements Authorization {
Map
<
String
,
Object
>
liveSecKillPar
=
new
HashMap
<>();
liveSecKillPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
liveSecKillRes
=
network
.
getResponse
(
liveSecKillPar
,
BasicConfig
.
ANCHOR_secondKillLists
);
System
.
out
.
println
(
liveSecKillRes
.
body
().
asString
());
List
<
AnchorGetSKList
>
secKillLists
;
try
{
secKillLists
=
JsonUtil
.
parseResponseToListBean
(
liveSecKillRes
,
AnchorGetSKList
.
class
);
...
...
@@ -345,7 +344,6 @@ public class ConfSecondKill implements Authorization {
e
.
printStackTrace
();
Assert
.
fail
(
network
.
message
(
liveSecKillPar
,
BasicConfig
.
ANCHOR_secondKillLists
,
"未获取到数据"
,
liveSecKillRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"助播端编辑秒杀轮次"
,
priority
=
14
)
...
...
@@ -461,7 +459,6 @@ public class ConfSecondKill implements Authorization {
Map
<
String
,
Object
>
getLiveAwardListParam
=
new
HashMap
<>();
getLiveAwardListParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
getLiveAwardListParam
,
BasicConfig
.
ANCHOR_secondKillLists_goodsList
);
System
.
out
.
println
(
response
.
body
().
asString
());
try
{
int
size
=
response
.
jsonPath
().
getInt
(
"data.size()"
);
int
isAppoint
=
response
.
jsonPath
().
getInt
(
"data.get(0).isAppoint"
);
...
...
src/test/java/com/kjj/cases/live/secondKill/SecondKill.java
View file @
b18226ad
This diff is collapsed.
Click to expand it.
src/test/java/com/kjj/cases/live/treasure/GoldenEgg.java
View file @
b18226ad
...
...
@@ -22,6 +22,8 @@ import java.util.HashMap;
import
java.util.List
;
import
java.util.Map
;
import
static
com
.
kjj
.
cases
.
live
.
anchor
.
CloseLive
.
closeLive
;
import
static
com
.
kjj
.
cases
.
live
.
anchor
.
OpenLive
.
openLive
;
import
static
com
.
kjj
.
utils
.
BaseUtils
.
ssoLogin
;
import
static
com
.
kjj
.
utils
.
ThreadSleepUtils
.
sleep
;
...
...
@@ -882,23 +884,10 @@ public class GoldenEgg implements Authorization {
@Test
(
description
=
"开始直播"
,
priority
=
53
)
public
void
开启直播
()
{
Map
<
String
,
Object
>
openParam
=
new
HashMap
<>();
openParam
.
put
(
"liveid"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
openParam
.
put
(
"cid"
,
101
);
Response
openRes
=
network
.
postResponse
(
openParam
,
BasicConfig
.
ANCHOR_OPEN
);
Object
data
=
openRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
openParam
,
BasicConfig
.
ANCHOR_OPEN
,
"开启直播失败"
,
openRes
.
body
().
asString
()));
ThreadSleepUtils
.
sleep
(
10000
);
openLive
(
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
}
@Test
(
description
=
"结束直播"
,
priority
=
54
)
public
void
结束直播
()
{
Map
<
String
,
Object
>
closeParam
=
new
HashMap
<>();
closeParam
.
put
(
"liveid"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
closeParam
.
put
(
"cid"
,
101
);
Response
closeRes
=
network
.
postResponse
(
closeParam
,
BasicConfig
.
ANCHOR_CLOSE
);
Object
data
=
closeRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
closeParam
,
BasicConfig
.
ANCHOR_CLOSE
,
"结束直播失败"
,
closeRes
.
body
().
asString
()));
closeLive
(
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
}
}
src/test/java/com/kjj/config/BasicConfig.java
View file @
b18226ad
...
...
@@ -69,6 +69,9 @@ public class BasicConfig {
//直播访客 (兑吧集团)ID:947
public
static
String
visitorAuth27
=
"LEH7epeHVDJWzhZ6DiexTHnfbvr9gocGu9ExJDb9xHoegrcNGiGyvUPrCXu5VECCsW6HDaVZMFu1Rph5WvdbB3jbkGcM9"
;
//自动化假用户 UserID:4055 ,liveUserID;81
public
static
String
visitorAuto1
=
"5MgSyboxqzAQZZJEsTf43nVX4vbZ5hG86sgJ5fSN7NzKxCH5WfE2XDHGMFm785nWo1pHKu5V5GPuQZHz3AfUEPenT5jh"
;
/**
* 集客助手授权key
*/
...
...
@@ -164,6 +167,11 @@ public class BasicConfig {
public
static
final
String
MOBILE_receiveStatus
=
MOBILE_HOST
+
"/clue/goods/receive/status"
;
public
static
final
String
MANAGER_goodsProgress
=
MANAGER_HOST
+
"/kjy/manager/live/second/kill/goods/progress"
;
public
static
final
String
MOBILE_goodsProgress
=
MOBILE_HOST
+
"/clue/goods/progress"
;
public
static
final
String
MANAGER_order_detail
=
MANAGER_HOST
+
"/kjy/manager/live/second/kill/order/detail"
;
public
static
final
String
MANAGER_order_refund
=
MANAGER_HOST
+
"/kjy/manager/live/second/kill/order/refund"
;
public
static
final
String
MOBILE_secondKill_getList
=
MOBILE_HOST
+
"/kjy/live/user/goods/getList"
;
public
static
final
String
MOBILE_secondKill_findDetailByRecordId
=
MOBILE_HOST
+
"/kjy/live/user/goods/findDetailByRecordId"
;
//客户承诺话术配置
public
static
final
String
MANAGER_saveDialogue
=
MANAGER_HOST
+
"/kjy/manager/live/potential/saveDialogue"
;
public
static
final
String
MANAGER_findDialogue
=
MANAGER_HOST
+
"/kjy/manager/live/potential/findDialogue"
;
...
...
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