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
9c826a5d
Commit
9c826a5d
authored
Aug 27, 2021
by
xiamengchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
覆盖秒杀互动
parent
df1e26e3
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
263 additions
and
22 deletions
+263
-22
AnchorGetKGList.java
src/test/java/com/kjj/bean/secondKill/AnchorGetKGList.java
+9
-0
AnchorGetSKList.java
src/test/java/com/kjj/bean/secondKill/AnchorGetSKList.java
+1
-1
SaveLive.java
src/test/java/com/kjj/cases/live/liveConfig/SaveLive.java
+19
-0
ConfSecondKill.java
...st/java/com/kjj/cases/live/secondKill/ConfSecondKill.java
+11
-10
SecondKill.java
src/test/java/com/kjj/cases/live/secondKill/SecondKill.java
+207
-1
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+6
-0
liveTestNG.xml
src/test/liveTestNG.xml
+10
-10
No files found.
src/test/java/com/kjj/bean/secondKill/AnchorGetKGList.java
0 → 100644
View file @
9c826a5d
package
com
.
kjj
.
bean
.
secondKill
;
import
lombok.Data
;
@Data
public
class
AnchorGetKGList
{
private
String
goodsTitle
;
private
String
id
;
}
src/test/java/com/kjj/bean/secondKill/AnchorGetSKList.java
View file @
9c826a5d
...
@@ -5,5 +5,5 @@ import lombok.Data;
...
@@ -5,5 +5,5 @@ import lombok.Data;
@Data
@Data
public
class
AnchorGetSKList
{
public
class
AnchorGetSKList
{
private
int
interactStatus
;
private
int
interactStatus
;
private
lo
ng
id
;
private
Stri
ng
id
;
}
}
src/test/java/com/kjj/cases/live/liveConfig/SaveLive.java
View file @
9c826a5d
...
@@ -2324,6 +2324,25 @@ public class SaveLive implements Authorization {
...
@@ -2324,6 +2324,25 @@ public class SaveLive implements Authorization {
Assert
.
assertNotNull
(
data
,
network
.
message
(
Params
,
BasicConfig
.
MANAGER_otherDetail
,
"查询第6轮时长红包详情失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
Params
,
BasicConfig
.
MANAGER_otherDetail
,
"查询第6轮时长红包详情失败"
,
response
.
body
().
asString
()));
}
}
/**
* 亲友抽奖券配置
*/
@Test
(
description
=
"保存亲友抽奖券配置"
,
priority
=
128
)
public
void
保存亲友抽奖券配置
(){
ssoLogin
();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Params
.
put
(
"giftedImg"
,
"https://yun.dui88.com/kjy/image/20210825/1629861430316.png"
);
Params
.
put
(
"notGiftedImg"
,
"https://yun.dui88.com/kjy/image/20210825/1629861425857.png"
);
Params
.
put
(
"popImg"
,
"https://yun.dui88.com/kjy/image/20210825/1629861435394.png"
);
Params
.
put
(
"envelopeWord"
,
"这是信封话术"
);
Params
.
put
(
"lotteryName"
,
"亲友抽奖券"
);
Params
.
put
(
"lotteryNum"
,
3
);
Params
.
put
(
"lotteryDesc"
,
"这是亲友抽奖券的说明"
);
Response
response
=
network
.
postResponse
(
Params
,
BasicConfig
.
MANAGER_relativeLottery
);
System
.
out
.
println
(
response
.
body
().
asString
());
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
Params
,
BasicConfig
.
MANAGER_relativeLottery
,
"保存亲友券配置失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"查看亲友抽奖券配置详情"
,
priority
=
129
)
@Test
(
description
=
"查看亲友抽奖券配置详情"
,
priority
=
129
)
...
...
src/test/java/com/kjj/cases/live/secondKill/ConfSecondKill.java
View file @
9c826a5d
package
com
.
kjj
.
cases
.
live
.
secondKill
;
package
com
.
kjj
.
cases
.
live
.
secondKill
;
import
com.kjj.bean.secondKill.AnchorGetKGList
;
import
com.kjj.bean.secondKill.AnchorGetSKList
;
import
com.kjj.bean.secondKill.AnchorGetSKList
;
import
com.kjj.bean.secondKill.KillGoodsList
;
import
com.kjj.bean.secondKill.SecondKillList
;
import
com.kjj.bean.secondKill.SecondKillList
;
import
com.kjj.cases.admin.Authorization
;
import
com.kjj.cases.admin.Authorization
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.config.BasicConfig
;
...
@@ -22,9 +22,10 @@ public class ConfSecondKill implements Authorization {
...
@@ -22,9 +22,10 @@ public class ConfSecondKill implements Authorization {
private
final
long
companyId
=
101
;
private
final
long
companyId
=
101
;
private
long
newSecKillId
;
// 会被删除的秒杀id
private
long
newSecKillId
;
// 会被删除的秒杀id
private
static
final
long
secKillGoodsId
=
11
1
;
// 用来配置轮次的秒杀商品ID
private
static
final
long
secKillGoodsId
=
11
5
;
// 用来配置轮次的秒杀商品ID
public
static
final
String
secKillGoodsIdEncode
=
IdMakeUtil
.
managerEncodingId
(
secKillGoodsId
);
public
static
final
String
secKillGoodsIdEncode
=
IdMakeUtil
.
managerEncodingId
(
secKillGoodsId
);
private
long
skId
;
// 秒杀id
private
String
skId
;
// 秒杀id
public
static
int
killListSize
;
@BeforeClass
@BeforeClass
public
void
setUp
(){
public
void
setUp
(){
...
@@ -99,7 +100,7 @@ public class ConfSecondKill implements Authorization {
...
@@ -99,7 +100,7 @@ public class ConfSecondKill implements Authorization {
int
goodsAmount
=
secondKillList
.
getGoodsAmount
();
int
goodsAmount
=
secondKillList
.
getGoodsAmount
();
Assert
.
assertEquals
(
goodsAmount
,
1
,
network
.
message
(
liveSecKillPar
,
BasicConfig
.
MANAGER_secondKillLists
,
"商品价格与实际添加的不符"
,
liveSecKillRes
.
body
().
asString
()));
Assert
.
assertEquals
(
goodsAmount
,
1
,
network
.
message
(
liveSecKillPar
,
BasicConfig
.
MANAGER_secondKillLists
,
"商品价格与实际添加的不符"
,
liveSecKillRes
.
body
().
asString
()));
String
goodsTitle
=
secondKillList
.
getGoodsTitle
();
String
goodsTitle
=
secondKillList
.
getGoodsTitle
();
Assert
.
assertEquals
(
goodsTitle
,
"
秒杀商品4
"
,
network
.
message
(
liveSecKillPar
,
BasicConfig
.
MANAGER_secondKillLists
,
"商品名称与实际添加的不符"
,
liveSecKillRes
.
body
().
asString
()));
Assert
.
assertEquals
(
goodsTitle
,
"
自动化专用商品
"
,
network
.
message
(
liveSecKillPar
,
BasicConfig
.
MANAGER_secondKillLists
,
"商品名称与实际添加的不符"
,
liveSecKillRes
.
body
().
asString
()));
int
interactNum
=
secondKillList
.
getInteractNum
();
int
interactNum
=
secondKillList
.
getInteractNum
();
Assert
.
assertEquals
(
interactNum
,
3
,
network
.
message
(
liveSecKillPar
,
BasicConfig
.
MANAGER_secondKillLists
,
"商品数量与实际添加的不符"
,
liveSecKillRes
.
body
().
asString
()));
Assert
.
assertEquals
(
interactNum
,
3
,
network
.
message
(
liveSecKillPar
,
BasicConfig
.
MANAGER_secondKillLists
,
"商品数量与实际添加的不符"
,
liveSecKillRes
.
body
().
asString
()));
int
surplusNum
=
secondKillList
.
getSurplusNum
();
int
surplusNum
=
secondKillList
.
getSurplusNum
();
...
@@ -164,10 +165,10 @@ public class ConfSecondKill implements Authorization {
...
@@ -164,10 +165,10 @@ public class ConfSecondKill implements Authorization {
Map
<
String
,
Object
>
skGoodsListPar
=
new
HashMap
<>();
Map
<
String
,
Object
>
skGoodsListPar
=
new
HashMap
<>();
skGoodsListPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
skGoodsListPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
skGoodsListRes
=
network
.
getResponse
(
skGoodsListPar
,
BasicConfig
.
ANCHOR_skGoodsLists
);
Response
skGoodsListRes
=
network
.
getResponse
(
skGoodsListPar
,
BasicConfig
.
ANCHOR_skGoodsLists
);
List
<
KillGoodsList
>
killGoods
Lists
;
List
<
AnchorGetKGList
>
anchorGetKG
Lists
;
try
{
try
{
killGoodsLists
=
JsonUtil
.
parseResponseToListBean
(
skGoodsListRes
,
KillGoods
List
.
class
);
anchorGetKGLists
=
JsonUtil
.
parseResponseToListBean
(
skGoodsListRes
,
AnchorGetKG
List
.
class
);
String
goodTitle
=
killGoods
Lists
.
get
(
0
).
getGoodsTitle
();
String
goodTitle
=
anchorGetKG
Lists
.
get
(
0
).
getGoodsTitle
();
Assert
.
assertEquals
(
goodTitle
,
"自动化专用商品"
,
network
.
message
(
skGoodsListPar
,
BasicConfig
.
ANCHOR_skGoodsLists
,
"商品名称不正确"
,
skGoodsListRes
.
body
().
asString
()));
Assert
.
assertEquals
(
goodTitle
,
"自动化专用商品"
,
network
.
message
(
skGoodsListPar
,
BasicConfig
.
ANCHOR_skGoodsLists
,
"商品名称不正确"
,
skGoodsListRes
.
body
().
asString
()));
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
e
.
printStackTrace
();
e
.
printStackTrace
();
...
@@ -201,8 +202,8 @@ public class ConfSecondKill implements Authorization {
...
@@ -201,8 +202,8 @@ public class ConfSecondKill implements Authorization {
List
<
AnchorGetSKList
>
secKillLists
;
List
<
AnchorGetSKList
>
secKillLists
;
try
{
try
{
secKillLists
=
JsonUtil
.
parseResponseToListBean
(
liveSecKillRes
,
AnchorGetSKList
.
class
);
secKillLists
=
JsonUtil
.
parseResponseToListBean
(
liveSecKillRes
,
AnchorGetSKList
.
class
);
skId
=
secKillLists
.
get
(-
1
).
getId
();
killListSize
=
secKillLists
.
size
();
System
.
out
.
println
(
secKillLists
);
skId
=
secKillLists
.
get
(
killListSize
-
1
).
getId
(
);
System
.
out
.
println
(
skId
);
System
.
out
.
println
(
skId
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
e
.
printStackTrace
();
e
.
printStackTrace
();
...
@@ -217,7 +218,7 @@ public class ConfSecondKill implements Authorization {
...
@@ -217,7 +218,7 @@ public class ConfSecondKill implements Authorization {
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"
,
IdMakeUtil
.
managerEncodingId
(
skId
)
);
secKillUpdatePar
.
put
(
"id"
,
skId
);
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 @
9c826a5d
This diff is collapsed.
Click to expand it.
src/test/java/com/kjj/config/BasicConfig.java
View file @
9c826a5d
...
@@ -143,6 +143,12 @@ public class BasicConfig {
...
@@ -143,6 +143,12 @@ public class BasicConfig {
public
static
final
String
ANCHOR_secondKillLists
=
MOBILE_HOST
+
"/conf/live/second/kill/goods/list"
;
public
static
final
String
ANCHOR_secondKillLists
=
MOBILE_HOST
+
"/conf/live/second/kill/goods/list"
;
public
static
final
String
ANCHOR_secondKillUpdate
=
MOBILE_HOST
+
"/conf/live/second/kill/goods/update"
;
public
static
final
String
ANCHOR_secondKillUpdate
=
MOBILE_HOST
+
"/conf/live/second/kill/goods/update"
;
public
static
final
String
ANCHOR_skGoodsLists
=
MOBILE_HOST
+
"/conf/live/second/kill/goods/goodsList"
;
public
static
final
String
ANCHOR_skGoodsLists
=
MOBILE_HOST
+
"/conf/live/second/kill/goods/goodsList"
;
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
ANCHOR_secondKillOn
=
MOBILE_HOST
+
"/conf/live/second/kill/goods/on"
;
public
static
final
String
MOBILE_secondKill_goodsFirst
=
MOBILE_HOST
+
"/clue/goods/first"
;
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
MANAGER_saveDialogue
=
MANAGER_HOST
+
"/kjy/manager/live/potential/saveDialogue"
;
public
static
final
String
MANAGER_saveDialogue
=
MANAGER_HOST
+
"/kjy/manager/live/potential/saveDialogue"
;
...
...
src/test/liveTestNG.xml
View file @
9c826a5d
...
@@ -72,11 +72,11 @@
...
@@ -72,11 +72,11 @@
<!-- </classes>-->
<!-- </classes>-->
<!-- </test>-->
<!-- </test>-->
<test
preserve-order=
"true"
name=
"亲友券"
>
<!-- <test preserve-order="true" name="亲友券">--
>
<classes
>
<!-- <classes>--
>
<class
name=
"com.kjj.cases.live.lottery.RelativeLottery"
/
>
<!-- <class name="com.kjj.cases.live.lottery.RelativeLottery"/>--
>
</classes
>
<!-- </classes>--
>
</test
>
<!-- </test>--
>
<!-- <test preserve-order="false" name="翻牌集字红包">-->
<!-- <test preserve-order="false" name="翻牌集字红包">-->
<!-- <classes>-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.flipCard.FlipCard"/>-->
<!-- <class name="com.kjj.cases.live.flipCard.FlipCard"/>-->
...
@@ -122,11 +122,11 @@
...
@@ -122,11 +122,11 @@
<!-- </classes>-->
<!-- </classes>-->
<!-- </test>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="直播中抽奖">--
>
<test
preserve-order=
"true"
name=
"直播中抽奖"
>
<!-- <classes>--
>
<classes
>
<!-- <class name="com.kjj.cases.live.lottery.Lottery"/>--
>
<class
name=
"com.kjj.cases.live.lottery.Lottery"
/
>
<!-- </classes>--
>
</classes
>
<!-- </test>--
>
</test
>
<test
preserve-order=
"true"
name=
"秒杀互动"
>
<test
preserve-order=
"true"
name=
"秒杀互动"
>
<classes>
<classes>
<class
name=
"com.kjj.cases.live.secondKill.SecondKill"
/>
<class
name=
"com.kjj.cases.live.secondKill.SecondKill"
/>
...
...
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