Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
test-platform
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
马博
test-platform
Commits
e932ba16
Commit
e932ba16
authored
Dec 18, 2018
by
赵然
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'zr' into develop
parents
a7ac9222
7bf4c28b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
96 additions
and
0 deletions
+96
-0
瓜分红包_实际瓜分_AccessTest.java
...st/java/http/cases/PkMoudleTest/瓜分红包_实际瓜分_AccessTest.java
+4
-0
配置测试_AccessTest.java
src/test/java/http/cases/PkMoudleTest/配置测试_AccessTest.java
+73
-0
PkService.java
src/test/java/http/service/Activity/PkService.java
+19
-0
No files found.
src/test/java/http/cases/PkMoudleTest/瓜分红包_实际瓜分_AccessTest.java
View file @
e932ba16
...
...
@@ -202,6 +202,10 @@ public class 瓜分红包_实际瓜分_AccessTest extends DuibaTestBase {
Assert
.
assertEquals
(
response2
.
jsonPath
().
getString
(
"data.show"
),
"false"
,
"展示弹窗校验失败"
);
}
@Test
(
dependsOnMethods
=
{
"出奖弹层校验"
})
public
void
战绩页校验
()
throws
Exception
{
}
public
void
modifyOpenPrizeTime
(
String
betId
,
int
x
)
throws
Exception
{
DateTime
time1
=
new
DateTime
();
...
...
src/test/java/http/cases/PkMoudleTest/配置测试_AccessTest.java
View file @
e932ba16
...
...
@@ -16,10 +16,14 @@ import io.restassured.response.Response;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.testng.Assert
;
import
org.testng.annotations.DataProvider
;
import
org.testng.annotations.Test
;
import
utils.ExcelDataProvider
;
import
java.lang.reflect.Method
;
import
java.math.BigDecimal
;
import
java.util.HashMap
;
import
java.util.Iterator
;
import
java.util.Map
;
import
static
io
.
restassured
.
RestAssured
.
given
;
...
...
@@ -38,6 +42,17 @@ public class 配置测试_AccessTest extends DuibaTestBase {
private
static
Integer
uid
=
5028
;
//
@DataProvider
public
Object
[][]
providerMethod
(
Method
method
){
Object
[][]
result
=
null
;
if
(
method
.
getName
().
equals
(
"重复投注测试"
))
{
result
=
new
Object
[][]{
new
Object
[]{
"3758"
},
new
Object
[]{
"3757"
},
};
}
return
result
;
}
@Test
public
void
配置测试
()
throws
Exception
{
...
...
@@ -110,6 +125,44 @@ public class 配置测试_AccessTest extends DuibaTestBase {
Assert
.
assertEquals
(
optionImg4
,
"//yun.dui88.com/images/201812/ifh1kvaq9m.jpg"
,
"校验选项2 图片失败"
);
Assert
.
assertEquals
(
optionName4
,
"分红包选项二"
,
"校验选项2 title失败"
);
//已投注配置
String
betType3
=
response
.
jsonPath
().
getString
(
"data.betedList[0].betConfig.betType"
);
String
bonusType3
=
response
.
jsonPath
().
getString
(
"data.betedList[0].betConfig.bonusType"
);
String
configStatus3
=
response
.
jsonPath
().
getString
(
"data.betedList[0].betConfig.configStatus"
);
String
creditsValue3
=
response
.
jsonPath
().
getString
(
"data.betedList[0].betConfig.creditsValue"
);
String
id3
=
response
.
jsonPath
().
getString
(
"data.betedList[0].betConfig.id"
);
String
shareExp3
=
response
.
jsonPath
().
getString
(
"data.betedList[0].betConfig.shareExp"
);
String
title3
=
response
.
jsonPath
().
getString
(
"data.betedList[0].betConfig.title"
);
String
unitName3
=
response
.
jsonPath
().
getString
(
"data.betedList[0].betConfig.unitName"
);
//选项获取
String
optionId5
=
response
.
jsonPath
().
getString
(
"data.betedList[0].options[0].optionId"
);
String
optionImg5
=
response
.
jsonPath
().
getString
(
"data.betedList[0].options[0].optionImg"
);
String
optionName5
=
response
.
jsonPath
().
getString
(
"data.betedList[0].options[0].optionName"
);
String
chooseThisOption5
=
response
.
jsonPath
().
getString
(
"data.betedList[0].options[0].chooseThisOption"
);
String
optionId6
=
response
.
jsonPath
().
getString
(
"data.betedList[0].options[1].optionId"
);
String
optionImg6
=
response
.
jsonPath
().
getString
(
"data.betedList[0].options[1].optionImg"
);
String
optionName6
=
response
.
jsonPath
().
getString
(
"data.betedList[0].options[1].optionName"
);
String
chooseThisOption6
=
response
.
jsonPath
().
getString
(
"data.betedList[0].options[1].chooseThisOption"
);
Assert
.
assertEquals
(
betType3
,
"1"
,
"校验押注类型失败"
);
//'押注类型 1-单选单次,2-多选无限制'
Assert
.
assertEquals
(
bonusType3
,
"4"
,
"校验瓜分类型失败"
);
//'瓜分类型1瓜分经验2瓜分红包3发奖品4瓜分积分'
Assert
.
assertEquals
(
configStatus3
,
"3"
,
"校验投注活动的状态失败"
);
//'投注活动的状态:1关闭不可见2关闭可见3开启4结束'
Assert
.
assertEquals
(
creditsValue3
,
"0"
,
"校验积分价值失败"
);
//积分价值
Assert
.
assertEquals
(
id3
,
"1799"
,
"校验pk id失败"
);
Assert
.
assertTrue
(
new
BigDecimal
(
shareExp3
).
compareTo
(
new
BigDecimal
(
"50"
))==
0
,
"校验瓜分的经验池失败"
);
//瓜分的经验池
Assert
.
assertEquals
(
title3
,
"待投注"
,
"校验投注活动标题失败"
);
//投注活动标题
Assert
.
assertEquals
(
unitName3
,
"元宝"
,
"校验消耗类型失败"
);
Assert
.
assertEquals
(
optionId5
,
"3757"
,
"校验选项1 id失败"
);
Assert
.
assertEquals
(
optionImg5
,
"//yun.dui88.com/images/201812/2sv582lhyo.png"
,
"校验选项1 图片失败"
);
Assert
.
assertEquals
(
optionName5
,
"1"
,
"校验选项1 title失败"
);
Assert
.
assertEquals
(
chooseThisOption5
,
"false"
,
"校验选项1选择情况失败"
);
Assert
.
assertEquals
(
optionId6
,
"3758"
,
"校验选项2 id失败"
);
Assert
.
assertEquals
(
optionImg6
,
"//yun.dui88.com/images/201812/hyhd36w6be.png"
,
"校验选项2 图片失败"
);
Assert
.
assertEquals
(
optionName6
,
"2"
,
"校验选项2 title失败"
);
Assert
.
assertEquals
(
chooseThisOption6
,
"true"
,
"校验选项2选择情况失败"
);
logger
.
info
(
"pk组件分红包、分积分配置校验正确!"
);
}
...
...
@@ -130,6 +183,23 @@ public class 配置测试_AccessTest extends DuibaTestBase {
logger
.
info
(
"投注积分不足校验成功!"
);
}
@Test
(
dataProvider
=
"providerMethod"
)
public
void
重复投注测试
(
String
optionId
){
String
url
=
activityHost
+
"/betActivity2/doJoin"
;
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"betId"
,
"1799"
);
map
.
put
(
"optionId"
,
optionId
);
Response
response
=
given
().
cookies
(
authorization
.
dafuwengLogin
(
uid
)).
params
(
map
).
post
(
url
);
response
.
prettyPrint
();
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"false"
,
"校验success失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"code"
),
"100011"
,
"校验错误码失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"desc"
),
"活动已参加"
,
"校验desc失败"
);
logger
.
info
(
"重复投注校验成功!"
);
}
@Test
public
void
未登录投注
(){
//获取未登录场景cookie
...
...
@@ -151,4 +221,6 @@ public class 配置测试_AccessTest extends DuibaTestBase {
logger
.
info
(
"未登录投注校验成功!"
);
}
}
\ No newline at end of file
src/test/java/http/service/Activity/PkService.java
View file @
e932ba16
...
...
@@ -59,6 +59,25 @@ public class PkService {
}
public
Response
list
(
Integer
uid
)
throws
Exception
{
String
url
=
activityHost
+
"/betRecord2/list"
;
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"pageNo"
,
"1"
);
map
.
put
(
"pageSize"
,
"6"
);
Response
response
=
given
().
cookies
(
authorization
.
dafuwengLogin
(
uid
)).
params
(
map
).
get
(
url
);
try
{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
);
}
catch
(
Exception
e
){
throw
new
Exception
(
"战绩页接口失败,返回信息:"
+
response
.
asString
());
}
catch
(
Error
er
){
throw
new
Exception
(
"战绩页接口失败,返回信息:"
+
response
.
asString
());
}
return
response
;
}
public
Response
getBetList
(
Integer
uid
)
throws
Exception
{
String
url
=
activityHost
+
"/betActivity2/list"
;
...
...
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