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
a51cc5cf
Commit
a51cc5cf
authored
Oct 19, 2021
by
龚小红
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'Feature/20211015-gxh' into 'master'
修改测试用例描述 See merge request test-group/kejiji!141
parents
284ed0e5
ba1086cd
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
99 additions
and
185 deletions
+99
-185
OpenLive.java
src/test/java/com/kjj/cases/live/anchor/OpenLive.java
+0
-49
Lottery.java
src/test/java/com/kjj/cases/live/lottery/Lottery.java
+58
-129
LotteryCode.java
...test/java/com/kjj/cases/live/lotteryCode/LotteryCode.java
+3
-7
BaseUtils.java
src/test/java/com/kjj/utils/BaseUtils.java
+38
-0
No files found.
src/test/java/com/kjj/cases/live/anchor/OpenLive.java
View file @
a51cc5cf
...
@@ -7,9 +7,6 @@ import io.restassured.response.Response;
...
@@ -7,9 +7,6 @@ import io.restassured.response.Response;
import
org.testng.Assert
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Test
;
import
org.testng.annotations.Test
;
import
java.lang.reflect.InvocationTargetException
;
import
java.lang.reflect.Method
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -86,50 +83,4 @@ public class OpenLive implements Authorization {
...
@@ -86,50 +83,4 @@ public class OpenLive implements Authorization {
}
}
public
void
connectSuccess
()
{
Map
<
String
,
Object
>
connectSuccessParam
=
new
HashMap
<>();
connectSuccessParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
,
"访客到场请求失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"用户到场"
,
priority
=
3
)
public
void
用户到场
()
throws
NoSuchMethodException
,
InvocationTargetException
,
IllegalAccessException
{
agentAuth
();
connectSuccess
();
visitorAuth1
();
connectSuccess
();
visitorAuth2
();
connectSuccess
();
visitorAuth3
();
connectSuccess
();
visitorAuth4
();
connectSuccess
();
visitorAuth5
();
connectSuccess
();
visitorAuth6
();
connectSuccess
();
visitorAuth7
();
connectSuccess
();
visitorAuth8
();
connectSuccess
();
visitorAuth9
();
connectSuccess
();
visitorAuth10
();
connectSuccess
();
visitorAuth11
();
connectSuccess
();
}
}
}
src/test/java/com/kjj/cases/live/lottery/Lottery.java
View file @
a51cc5cf
This diff is collapsed.
Click to expand it.
src/test/java/com/kjj/cases/live/lotteryCode/LotteryCode.java
View file @
a51cc5cf
...
@@ -13,6 +13,8 @@ import java.util.HashMap;
...
@@ -13,6 +13,8 @@ import java.util.HashMap;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
static
com
.
kjj
.
utils
.
BaseUtils
.
codeCount
;
public
class
LotteryCode
implements
Authorization
{
public
class
LotteryCode
implements
Authorization
{
public
String
shareSign
;
public
String
shareSign
;
...
@@ -86,13 +88,7 @@ public class LotteryCode implements Authorization {
...
@@ -86,13 +88,7 @@ public class LotteryCode implements Authorization {
@Test
(
description
=
"访客A抽奖码数量"
,
priority
=
6
)
@Test
(
description
=
"访客A抽奖码数量"
,
priority
=
6
)
public
void
访客
A
抽奖码数量
()
{
public
void
访客
A
抽奖码数量
()
{
visitorAuth1
();
visitorAuth1
();
Map
<
String
,
Object
>
myCountParam
=
new
HashMap
<>();
codeCount
(
3
);
myCountParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
myCountRes
=
network
.
getResponse
(
myCountParam
,
BasicConfig
.
USER_myCount
);
long
data
=
myCountRes
.
jsonPath
().
getLong
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
myCountParam
,
BasicConfig
.
USER_myCount
,
"获取抽奖码数量失败"
,
myCountRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客A查询抽奖券列表"
,
priority
=
7
)
@Test
(
description
=
"访客A查询抽奖券列表"
,
priority
=
7
)
...
...
src/test/java/com/kjj/utils/BaseUtils.java
View file @
a51cc5cf
package
com
.
kjj
.
utils
;
package
com
.
kjj
.
utils
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.constants.LiveConstants
;
import
com.kjj.sql.KjyUserDB
;
import
com.kjj.sql.KjyUserDB
;
import
com.kjj.sql.UserSqlFactory
;
import
com.kjj.sql.UserSqlFactory
;
import
io.restassured.response.Response
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
import
org.testng.Assert
;
import
org.testng.annotations.Test
;
import
java.sql.SQLException
;
import
java.sql.SQLException
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
...
@@ -144,4 +147,39 @@ public class BaseUtils {
...
@@ -144,4 +147,39 @@ public class BaseUtils {
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
MANAGER_updateTypeOrDate
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
MANAGER_updateTypeOrDate
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
result
,
network
.
message
(
params
,
MANAGER_updateTypeOrDate
,
"返回数据为空"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
result
,
network
.
message
(
params
,
MANAGER_updateTypeOrDate
,
"返回数据为空"
,
response
.
body
().
asString
()));
}
}
/*
* 访客到场
* */
public
static
void
connectSuccess
()
{
Map
<
String
,
Object
>
connectSuccessParam
=
new
HashMap
<>();
connectSuccessParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
,
"访客到场请求失败"
,
response
.
body
().
asString
()));
}
/*
* 关注直播间
* */
public
static
void
subscribelive
()
{
Map
<
String
,
Object
>
subscribeParam
=
new
HashMap
<>();
subscribeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
subscribeRes
=
network
.
postResponse
(
subscribeParam
,
BasicConfig
.
USER_SUBSCRIBE
);
boolean
data
=
subscribeRes
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
subscribeParam
,
BasicConfig
.
USER_SUBSCRIBE
,
"关注失败"
,
subscribeRes
.
body
().
asString
()));
}
/*
* 抽奖码数量校验
* */
public
static
void
codeCount
(
int
num
)
{
ThreadSleepUtils
.
sleep
(
500
);
Map
<
String
,
Object
>
myCountParam
=
new
HashMap
<>();
myCountParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
myCountRes
=
network
.
getResponse
(
myCountParam
,
BasicConfig
.
USER_myCount
);
int
data
=
myCountRes
.
jsonPath
().
getInt
(
"data"
);
Assert
.
assertEquals
(
data
,
num
,
network
.
message
(
myCountParam
,
BasicConfig
.
USER_myCount
,
"获取抽奖码数量失败"
,
myCountRes
.
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