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
943ef4b0
Commit
943ef4b0
authored
Dec 19, 2018
by
qwj-github
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into qwj_181029
parents
4bd06986
d6af2220
Changes
15
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
505 additions
and
37 deletions
+505
-37
自有活动出奖_DuibaTest.java
src/test/java/http/cases/DeveloperTest/自有活动出奖_DuibaTest.java
+1
-1
出奖订单测试_DuibaTest.java
...est/java/http/cases/NewActivityTest/出奖订单测试_DuibaTest.java
+1
-1
瓜分积分_作弊瓜分_AccessTest.java
...st/java/http/cases/PkMoudleTest/瓜分积分_作弊瓜分_AccessTest.java
+61
-0
瓜分积分_实际瓜分_AccessTest.java
...st/java/http/cases/PkMoudleTest/瓜分积分_实际瓜分_AccessTest.java
+64
-1
瓜分积分_实际瓜分_主胜方_AccessTest.java
...ava/http/cases/PkMoudleTest/瓜分积分_实际瓜分_主胜方_AccessTest.java
+61
-0
瓜分红包_作弊瓜分_AccessTest.java
...st/java/http/cases/PkMoudleTest/瓜分红包_作弊瓜分_AccessTest.java
+61
-0
瓜分红包_实际瓜分_AccessTest.java
...st/java/http/cases/PkMoudleTest/瓜分红包_实际瓜分_AccessTest.java
+61
-0
配置测试_AccessTest.java
src/test/java/http/cases/PkMoudleTest/配置测试_AccessTest.java
+73
-0
天天秒杀_秒杀详情测试.java
src/test/java/http/cases/SeckillTest/天天秒杀_秒杀详情测试.java
+2
-2
ContractSignCommon.java
src/test/java/http/cases/SignTest/ContractSignCommon.java
+16
-0
ContractSign_signTest.java
src/test/java/http/cases/SignTest/ContractSign_signTest.java
+57
-26
SingleLottery_AccessTest.java
...ttp/cases/SingleLotteryTest/SingleLottery_AccessTest.java
+1
-1
ContractSignService.java
src/test/java/http/service/Activity/ContractSignService.java
+23
-1
PkService.java
src/test/java/http/service/Activity/PkService.java
+19
-0
Authorization.java
src/test/java/http/service/Authorization.java
+4
-4
No files found.
src/test/java/http/cases/DeveloperTest/自有活动出奖_DuibaTest.java
View file @
943ef4b0
...
...
@@ -88,7 +88,7 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase {
j
--;
}
Assert
.
assertEquals
(
flowWork
,
"SupplierExchange-started"
,
"数据库主订单流程节点校验失败"
);
Assert
.
assertEquals
(
String
.
valueOf
(
selectResult2
.
get
(
"biz_params"
)),
"胡梦新:18258853242:浙江
省:杭州市:西湖区:数娱大厦
"
,
"数据库主订单biz_params校验失败"
);
Assert
.
assertEquals
(
String
.
valueOf
(
selectResult2
.
get
(
"biz_params"
)),
"胡梦新:18258853242:浙江
:杭州市:西湖区:西溪街道:数娱大厦
"
,
"数据库主订单biz_params校验失败"
);
Assert
.
assertEquals
(
String
.
valueOf
(
selectResult2
.
get
(
"pay_status"
)),
"none"
,
"数据库主订单pay_status校验失败"
);
Assert
.
assertEquals
(
String
.
valueOf
(
selectResult2
.
get
(
"status"
)),
"consume_success"
,
"数据库主订单status校验失败"
);
...
...
src/test/java/http/cases/NewActivityTest/出奖订单测试_DuibaTest.java
View file @
943ef4b0
...
...
@@ -170,7 +170,7 @@ public class 出奖订单测试_DuibaTest extends DuibaTestBase {
}
Assert
.
assertEquals
(
flowWork
,
"SupplierExchange-started"
,
"数据库主订单流程节点校验失败"
);
Assert
.
assertEquals
(
String
.
valueOf
(
selectResult2
.
get
(
"item_id"
)),
"27131"
,
"数据库主订单奖项id校验失败"
);
Assert
.
assertEquals
(
String
.
valueOf
(
selectResult2
.
get
(
"biz_params"
)),
"胡梦新:18258853242:浙江
省:杭州市:西湖区:数娱大厦
"
,
"数据库主订单biz_params校验失败"
);
Assert
.
assertEquals
(
String
.
valueOf
(
selectResult2
.
get
(
"biz_params"
)),
"胡梦新:18258853242:浙江
:杭州市:西湖区:西溪街道:数娱大厦
"
,
"数据库主订单biz_params校验失败"
);
Assert
.
assertEquals
(
String
.
valueOf
(
selectResult2
.
get
(
"pay_status"
)),
"prereduce"
,
"数据库主订单pay_status校验失败"
);
Assert
.
assertEquals
(
String
.
valueOf
(
selectResult2
.
get
(
"status"
)),
"consume_success"
,
"数据库主订单status校验失败"
);
...
...
src/test/java/http/cases/PkMoudleTest/瓜分积分_作弊瓜分_AccessTest.java
View file @
943ef4b0
...
...
@@ -20,8 +20,10 @@ import org.joda.time.format.DateTimeFormat;
import
org.joda.time.format.DateTimeFormatter
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.testng.Assert
;
import
org.testng.annotations.AfterClass
;
import
org.testng.annotations.Test
;
import
java.sql.SQLException
;
import
java.util.Map
;
...
...
@@ -200,6 +202,65 @@ public class 瓜分积分_作弊瓜分_AccessTest extends DuibaTestBase {
Assert
.
assertEquals
(
response2
.
jsonPath
().
getString
(
"data.show"
),
"false"
,
"展示弹窗校验失败"
);
}
@Test
(
dependsOnMethods
=
{
"出奖弹层校验"
})
public
void
战绩页校验
()
throws
Exception
{
Response
response
=
pkService
.
list
(
uid1
);
response
.
prettyPrint
();
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].userWin"
),
"true"
,
"中奖记录校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].betConfig.id"
),
betId
,
"活动id校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].betConfig.shareExp"
),
"30"
,
"活动瓜分金额校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].betConfig.configStatus"
),
"4"
,
"活动状态校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].betConfig.creditsValue"
),
"1.00"
,
"活动消耗校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].betConfig.betType"
),
"1"
,
"活动押注类型校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].betConfig.bonusType"
),
"4"
,
"活动瓜分类型校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[0].betId"
),
betId
,
"活动id校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[0].resultStatus"
),
"4"
,
"活动选项结果状态校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[0].optionId"
),
optionId1
,
"活动投注id1校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[0].rank"
),
"1"
,
"活动投注结果校验失败"
);
// Assert.assertEquals(response.jsonPath().getString("data.list[0].options[0].betTimes"),"4","活动投注人数校验失败");
// Assert.assertEquals(response.jsonPath().getString("data.list[0].options[0].scale"),"66.7","活动投注人数比例校验失败");
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[1].betId"
),
betId
,
"活动id校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[1].resultStatus"
),
"4"
,
"活动选项结果状态校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[1].optionId"
),
optionId2
,
"活动投注id1校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[1].rank"
),
"2"
,
"活动投注结果校验失败"
);
// Assert.assertEquals(response.jsonPath().getString("data.list[0].options[1].betTimes"),"2","活动投注人数校验失败");
// Assert.assertEquals(response.jsonPath().getString("data.list[0].options[1].scale"),"33.3","活动投注人数比例校验失败");
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].record.betId"
),
betId
,
"活动id校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].record.optionId"
),
optionId1
,
"活动id校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].record.bonus"
),
"0.01"
,
"活动id校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].record.exchangeStatus"
),
"1"
,
"兑换状态校验失败"
);
response
=
pkService
.
list
(
uid3
);
response
.
prettyPrint
();
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].userWin"
),
"false"
,
"中奖记录校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].record.betId"
),
betId
,
"活动id校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].record.optionId"
),
optionId2
,
"活动id校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].record.bonus"
),
"0.0"
,
"活动id校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].record.exchangeStatus"
),
"0"
,
"兑换状态校验失败"
);
}
@AfterClass
public
void
afterclass
()
{
try
{
Boolean
result1
=
jdbc
.
update
(
"delete from act_com_conf.tb_bet_option where bet_id = ?"
,
betId
);
Boolean
result4
=
jdbc
.
update
(
"delete from act_record.tb_bet_record where bet_id = ?"
,
betId
);
Boolean
result5
=
jdbc
.
update
(
"delete from bet_activity.tb_bet_result where bet_id = ?"
,
betId
);
Boolean
result2
=
jdbc
.
update
(
"delete from act_com_conf.tb_bet_group_relation where bet_id = ?"
,
betId
);
Boolean
result3
=
jdbc
.
update
(
"delete from act_com_conf.tb_bet_config where id = ?"
,
betId
);
}
catch
(
SQLException
e
)
{
e
.
printStackTrace
();
}
catch
(
Exception
e
){
e
.
printStackTrace
();
}
}
public
void
modifyOpenPrizeTime
(
String
betId
,
int
x
)
throws
Exception
{
DateTime
time1
=
new
DateTime
();
...
...
src/test/java/http/cases/PkMoudleTest/瓜分积分_实际瓜分_AccessTest.java
View file @
943ef4b0
...
...
@@ -3,7 +3,7 @@
* FileName: 瓜分积分测试_AccessTest
* Author: zhaoran
* Date: 2018/12/10 19:45
* Description:
* Description:
"appId": 21771
*/
package
http
.
cases
.
PkMoudleTest
;
...
...
@@ -21,8 +21,10 @@ import org.joda.time.format.DateTimeFormat;
import
org.joda.time.format.DateTimeFormatter
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.testng.Assert
;
import
org.testng.annotations.AfterClass
;
import
org.testng.annotations.Test
;
import
java.sql.SQLException
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -202,6 +204,64 @@ public class 瓜分积分_实际瓜分_AccessTest extends DuibaTestBase {
Assert
.
assertEquals
(
response2
.
jsonPath
().
getString
(
"data.show"
),
"false"
,
"展示弹窗校验失败"
);
}
@Test
(
dependsOnMethods
=
{
"出奖弹层校验"
})
public
void
战绩页校验
()
throws
Exception
{
Response
response
=
pkService
.
list
(
uid1
);
response
.
prettyPrint
();
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].userWin"
),
"true"
,
"中奖记录校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].betConfig.id"
),
betId
,
"活动id校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].betConfig.shareExp"
),
"30"
,
"活动瓜分金额校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].betConfig.configStatus"
),
"4"
,
"活动状态校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].betConfig.creditsValue"
),
"1.00"
,
"活动消耗校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].betConfig.betType"
),
"1"
,
"活动押注类型校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].betConfig.bonusType"
),
"4"
,
"活动瓜分类型校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[0].betId"
),
betId
,
"活动id校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[0].resultStatus"
),
"4"
,
"活动选项结果状态校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[0].optionId"
),
optionId1
,
"活动投注id1校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[0].rank"
),
"1"
,
"活动投注结果校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[0].betTimes"
),
"4"
,
"活动投注人数校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[0].scale"
),
"66.7"
,
"活动投注人数比例校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[1].betId"
),
betId
,
"活动id校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[1].resultStatus"
),
"4"
,
"活动选项结果状态校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[1].optionId"
),
optionId2
,
"活动投注id1校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[1].rank"
),
"2"
,
"活动投注结果校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[1].betTimes"
),
"2"
,
"活动投注人数校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[1].scale"
),
"33.3"
,
"活动投注人数比例校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].record.betId"
),
betId
,
"活动id校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].record.optionId"
),
optionId1
,
"活动id校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].record.bonus"
),
"0.07"
,
"活动id校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].record.exchangeStatus"
),
"1"
,
"兑换状态校验失败"
);
response
=
pkService
.
list
(
uid3
);
response
.
prettyPrint
();
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].userWin"
),
"false"
,
"中奖记录校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].record.betId"
),
betId
,
"活动id校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].record.optionId"
),
optionId2
,
"活动id校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].record.bonus"
),
"0.0"
,
"活动id校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].record.exchangeStatus"
),
"0"
,
"兑换状态校验失败"
);
}
@AfterClass
public
void
afterclass
()
{
try
{
Boolean
result1
=
jdbc
.
update
(
"delete from act_com_conf.tb_bet_option where bet_id = ?"
,
betId
);
Boolean
result4
=
jdbc
.
update
(
"delete from act_record.tb_bet_record where bet_id = ?"
,
betId
);
Boolean
result5
=
jdbc
.
update
(
"delete from bet_activity.tb_bet_result where bet_id = ?"
,
betId
);
Boolean
result2
=
jdbc
.
update
(
"delete from act_com_conf.tb_bet_group_relation where bet_id = ?"
,
betId
);
Boolean
result3
=
jdbc
.
update
(
"delete from act_com_conf.tb_bet_config where id = ?"
,
betId
);
}
catch
(
SQLException
e
)
{
e
.
printStackTrace
();
}
catch
(
Exception
e
){
e
.
printStackTrace
();
}
}
public
void
modifyOpenPrizeTime
(
String
betId
,
int
x
)
throws
Exception
{
DateTime
time1
=
new
DateTime
();
...
...
@@ -216,4 +276,6 @@ public class 瓜分积分_实际瓜分_AccessTest extends DuibaTestBase {
Boolean
result2
=
jdbc
.
update
(
"update act_com_conf.tb_bet_group_relation set end_time = ? where bet_id = ?\n"
,
endTimeStr
,
betId
);
}
}
\ No newline at end of file
src/test/java/http/cases/PkMoudleTest/瓜分积分_实际瓜分_主胜方_AccessTest.java
View file @
943ef4b0
...
...
@@ -20,8 +20,10 @@ import org.joda.time.format.DateTimeFormat;
import
org.joda.time.format.DateTimeFormatter
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.testng.Assert
;
import
org.testng.annotations.AfterClass
;
import
org.testng.annotations.Test
;
import
java.sql.SQLException
;
import
java.util.Map
;
...
...
@@ -199,6 +201,65 @@ public class 瓜分积分_实际瓜分_主胜方_AccessTest extends DuibaTestBas
Assert
.
assertEquals
(
response2
.
jsonPath
().
getString
(
"data.show"
),
"false"
,
"展示弹窗校验失败"
);
}
@Test
(
dependsOnMethods
=
{
"出奖弹层校验"
})
public
void
战绩页校验
()
throws
Exception
{
Response
response
=
pkService
.
list
(
uid3
);
response
.
prettyPrint
();
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].userWin"
),
"true"
,
"中奖记录校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].betConfig.id"
),
betId
,
"活动id校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].betConfig.shareExp"
),
"30"
,
"活动瓜分金额校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].betConfig.configStatus"
),
"4"
,
"活动状态校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].betConfig.creditsValue"
),
"1.00"
,
"活动消耗校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].betConfig.betType"
),
"1"
,
"活动押注类型校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].betConfig.bonusType"
),
"4"
,
"活动瓜分类型校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[0].betId"
),
betId
,
"活动id校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[0].resultStatus"
),
"4"
,
"活动选项结果状态校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[0].optionId"
),
optionId1
,
"活动投注id1校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[0].rank"
),
"2"
,
"活动投注结果校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[0].betTimes"
),
"3"
,
"活动投注人数校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[0].scale"
),
"37.5"
,
"活动投注人数比例校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[1].betId"
),
betId
,
"活动id校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[1].resultStatus"
),
"4"
,
"活动选项结果状态校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[1].optionId"
),
optionId2
,
"活动投注id1校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[1].rank"
),
"1"
,
"活动投注结果校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[1].betTimes"
),
"5"
,
"活动投注人数校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[1].scale"
),
"62.5"
,
"活动投注人数比例校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].record.betId"
),
betId
,
"活动id校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].record.optionId"
),
optionId2
,
"活动id校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].record.bonus"
),
"0.06"
,
"活动id校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].record.exchangeStatus"
),
"1"
,
"兑换状态校验失败"
);
response
=
pkService
.
list
(
uid1
);
response
.
prettyPrint
();
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].userWin"
),
"false"
,
"中奖记录校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].record.betId"
),
betId
,
"活动id校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].record.optionId"
),
optionId1
,
"活动id校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].record.bonus"
),
"0.0"
,
"活动id校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].record.exchangeStatus"
),
"0"
,
"兑换状态校验失败"
);
}
@AfterClass
public
void
afterclass
()
{
try
{
Boolean
result1
=
jdbc
.
update
(
"delete from act_com_conf.tb_bet_option where bet_id = ?"
,
betId
);
Boolean
result4
=
jdbc
.
update
(
"delete from act_record.tb_bet_record where bet_id = ?"
,
betId
);
Boolean
result5
=
jdbc
.
update
(
"delete from bet_activity.tb_bet_result where bet_id = ?"
,
betId
);
Boolean
result2
=
jdbc
.
update
(
"delete from act_com_conf.tb_bet_group_relation where bet_id = ?"
,
betId
);
Boolean
result3
=
jdbc
.
update
(
"delete from act_com_conf.tb_bet_config where id = ?"
,
betId
);
}
catch
(
SQLException
e
)
{
e
.
printStackTrace
();
}
catch
(
Exception
e
){
e
.
printStackTrace
();
}
}
public
void
modifyOpenPrizeTime
(
String
betId
,
int
x
)
throws
Exception
{
DateTime
time1
=
new
DateTime
();
...
...
src/test/java/http/cases/PkMoudleTest/瓜分红包_作弊瓜分_AccessTest.java
View file @
943ef4b0
...
...
@@ -20,9 +20,11 @@ import org.joda.time.format.DateTimeFormat;
import
org.joda.time.format.DateTimeFormatter
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.testng.Assert
;
import
org.testng.annotations.AfterClass
;
import
org.testng.annotations.Test
;
import
java.math.BigDecimal
;
import
java.sql.SQLException
;
import
java.text.DecimalFormat
;
import
java.util.Map
;
...
...
@@ -197,6 +199,65 @@ public class 瓜分红包_作弊瓜分_AccessTest extends DuibaTestBase {
Assert
.
assertEquals
(
response2
.
jsonPath
().
getString
(
"data.show"
),
"false"
,
"展示弹窗校验失败"
);
}
@Test
(
dependsOnMethods
=
{
"出奖弹层校验"
})
public
void
战绩页校验
()
throws
Exception
{
Response
response
=
pkService
.
list
(
uid1
);
response
.
prettyPrint
();
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].userWin"
),
"true"
,
"中奖记录校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].betConfig.id"
),
betId
,
"活动id校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].betConfig.shareExp"
),
"10"
,
"活动瓜分金额校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].betConfig.configStatus"
),
"4"
,
"活动状态校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].betConfig.creditsValue"
),
"0"
,
"活动消耗校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].betConfig.betType"
),
"1"
,
"活动押注类型校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].betConfig.bonusType"
),
"2"
,
"活动瓜分类型校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[0].betId"
),
betId
,
"活动id校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[0].resultStatus"
),
"4"
,
"活动选项结果状态校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[0].optionId"
),
optionId1
,
"活动投注id1校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[0].rank"
),
"1"
,
"活动投注结果校验失败"
);
// Assert.assertEquals(response.jsonPath().getString("data.list[0].options[0].betTimes"),"544","活动投注人数校验失败");
// Assert.assertEquals(response.jsonPath().getString("data.list[0].options[0].scale"),"66.9","活动投注人数比例校验失败");
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[1].betId"
),
betId
,
"活动id校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[1].resultStatus"
),
"4"
,
"活动选项结果状态校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[1].optionId"
),
optionId2
,
"活动投注id1校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[1].rank"
),
"2"
,
"活动投注结果校验失败"
);
// Assert.assertEquals(response.jsonPath().getString("data.list[0].options[1].betTimes"),"269","活动投注人数校验失败");
// Assert.assertEquals(response.jsonPath().getString("data.list[0].options[1].scale"),"33.1","活动投注人数比例校验失败");
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].record.betId"
),
betId
,
"活动id校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].record.optionId"
),
optionId1
,
"活动id校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].record.bonus"
),
"0.01"
,
"活动id校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].record.exchangeStatus"
),
"2"
,
"兑换状态校验失败"
);
response
=
pkService
.
list
(
uid3
);
response
.
prettyPrint
();
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].userWin"
),
"false"
,
"中奖记录校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].record.betId"
),
betId
,
"活动id校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].record.optionId"
),
optionId2
,
"活动id校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].record.bonus"
),
"0.0"
,
"活动id校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].record.exchangeStatus"
),
"0"
,
"兑换状态校验失败"
);
}
@AfterClass
public
void
afterclass
()
{
try
{
Boolean
result1
=
jdbc
.
update
(
"delete from act_com_conf.tb_bet_option where bet_id = ?"
,
betId
);
Boolean
result4
=
jdbc
.
update
(
"delete from act_record.tb_bet_record where bet_id = ?"
,
betId
);
Boolean
result5
=
jdbc
.
update
(
"delete from bet_activity.tb_bet_result where bet_id = ?"
,
betId
);
Boolean
result2
=
jdbc
.
update
(
"delete from act_com_conf.tb_bet_group_relation where bet_id = ?"
,
betId
);
Boolean
result3
=
jdbc
.
update
(
"delete from act_com_conf.tb_bet_config where id = ?"
,
betId
);
}
catch
(
SQLException
e
)
{
e
.
printStackTrace
();
}
catch
(
Exception
e
){
e
.
printStackTrace
();
}
}
public
void
modifyOpenPrizeTime
(
String
betId
,
int
x
)
throws
Exception
{
DateTime
time1
=
new
DateTime
();
...
...
src/test/java/http/cases/PkMoudleTest/瓜分红包_实际瓜分_AccessTest.java
View file @
943ef4b0
...
...
@@ -20,9 +20,11 @@ import org.joda.time.format.DateTimeFormat;
import
org.joda.time.format.DateTimeFormatter
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.testng.Assert
;
import
org.testng.annotations.AfterClass
;
import
org.testng.annotations.Test
;
import
java.math.BigDecimal
;
import
java.sql.SQLException
;
import
java.text.DecimalFormat
;
import
java.util.Map
;
...
...
@@ -202,6 +204,65 @@ public class 瓜分红包_实际瓜分_AccessTest extends DuibaTestBase {
Assert
.
assertEquals
(
response2
.
jsonPath
().
getString
(
"data.show"
),
"false"
,
"展示弹窗校验失败"
);
}
@Test
(
dependsOnMethods
=
{
"出奖弹层校验"
})
public
void
战绩页校验
()
throws
Exception
{
Response
response
=
pkService
.
list
(
uid1
);
response
.
prettyPrint
();
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].userWin"
),
"true"
,
"中奖记录校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].betConfig.id"
),
betId
,
"活动id校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].betConfig.shareExp"
),
"30"
,
"活动瓜分金额校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].betConfig.configStatus"
),
"4"
,
"活动状态校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].betConfig.creditsValue"
),
"1.00"
,
"活动消耗校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].betConfig.betType"
),
"1"
,
"活动押注类型校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].betConfig.bonusType"
),
"2"
,
"活动瓜分类型校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[0].betId"
),
betId
,
"活动id校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[0].resultStatus"
),
"4"
,
"活动选项结果状态校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[0].optionId"
),
optionId1
,
"活动投注id1校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[0].rank"
),
"1"
,
"活动投注结果校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[0].betTimes"
),
"4"
,
"活动投注人数校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[0].scale"
),
"66.7"
,
"活动投注人数比例校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[1].betId"
),
betId
,
"活动id校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[1].resultStatus"
),
"4"
,
"活动选项结果状态校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[1].optionId"
),
optionId2
,
"活动投注id1校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[1].rank"
),
"2"
,
"活动投注结果校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[1].betTimes"
),
"2"
,
"活动投注人数校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].options[1].scale"
),
"33.3"
,
"活动投注人数比例校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].record.betId"
),
betId
,
"活动id校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].record.optionId"
),
optionId1
,
"活动id校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].record.bonus"
),
"7.5"
,
"活动id校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].record.exchangeStatus"
),
"2"
,
"兑换状态校验失败"
);
response
=
pkService
.
list
(
uid3
);
response
.
prettyPrint
();
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].userWin"
),
"false"
,
"中奖记录校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].record.betId"
),
betId
,
"活动id校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].record.optionId"
),
optionId2
,
"活动id校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].record.bonus"
),
"0.0"
,
"活动id校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].record.exchangeStatus"
),
"0"
,
"兑换状态校验失败"
);
}
@AfterClass
public
void
afterclass
()
{
try
{
Boolean
result1
=
jdbc
.
update
(
"delete from act_com_conf.tb_bet_option where bet_id = ?"
,
betId
);
Boolean
result4
=
jdbc
.
update
(
"delete from act_record.tb_bet_record where bet_id = ?"
,
betId
);
Boolean
result5
=
jdbc
.
update
(
"delete from bet_activity.tb_bet_result where bet_id = ?"
,
betId
);
Boolean
result2
=
jdbc
.
update
(
"delete from act_com_conf.tb_bet_group_relation where bet_id = ?"
,
betId
);
Boolean
result3
=
jdbc
.
update
(
"delete from act_com_conf.tb_bet_config where id = ?"
,
betId
);
}
catch
(
SQLException
e
)
{
e
.
printStackTrace
();
}
catch
(
Exception
e
){
e
.
printStackTrace
();
}
}
public
void
modifyOpenPrizeTime
(
String
betId
,
int
x
)
throws
Exception
{
DateTime
time1
=
new
DateTime
();
...
...
src/test/java/http/cases/PkMoudleTest/配置测试_AccessTest.java
View file @
943ef4b0
...
...
@@ -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/cases/SeckillTest/天天秒杀_秒杀详情测试
_SeckillTest
.java
→
src/test/java/http/cases/SeckillTest/天天秒杀_秒杀详情测试.java
View file @
943ef4b0
/**
* Copyright (C), 2015-2018
* FileName: 天天秒杀_秒杀详情测试
_SeckillTest
* FileName: 天天秒杀_秒杀详情测试
* Author: qianwenjun
* Date: 2018/6/20 11:46
* Description:
...
...
@@ -36,7 +36,7 @@ import static io.restassured.RestAssured.given;
* @create 2018/6/20
* @since 1.0.0
*/
public
class
天天秒杀
_
秒杀详情测试
_SeckillTest
extends
DuibaTestBase
{
public
class
天天秒杀
_
秒杀详情测试
extends
DuibaTestBase
{
@Autowired
SeckillService
seckillService
;
...
...
src/test/java/http/cases/SignTest/ContractSignCommon.java
View file @
943ef4b0
...
...
@@ -12,6 +12,7 @@ import http.service.Authorization;
import
http.service.hd.SigninService
;
import
io.restassured.response.Response
;
import
org.apache.commons.lang.StringUtils
;
import
org.junit.Test
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
...
...
@@ -38,6 +39,21 @@ public class ContractSignCommon extends DuibaTestBase{
String
activityHost
;
private
DuibaLog
logger
=
DuibaLog
.
getLogger
();
public
Response
queryRewardResult
(
String
ContractId
,
int
uid
)
throws
Exception
{
Response
response
=
ContractSignService
.
queryRewardStatus
(
ContractId
,
uid
);;
String
rewardStatus
=
response
.
jsonPath
().
getString
(
"data.rewardStatus"
);
int
num
=
10
;
while
(
rewardStatus
.
equals
(
"0"
)
&&
num
>
0
)
{
response
=
ContractSignService
.
queryRewardStatus
(
ContractId
,
uid
);
rewardStatus
=
response
.
jsonPath
().
getString
(
"data.rewardStatus"
);
if
(
rewardStatus
.
equals
(
"2"
))
{
break
;
}
num
--;
Thread
.
sleep
(
1000
);
}
return
response
;
}
public
Map
<
String
,
String
>
doJoinResult
(
String
activityId
,
String
betAmount
,
int
uid
)
throws
Exception
{
Response
doJoinRes
=
ContractSignService
.
doJoin
(
activityId
,
betAmount
,
uid
);
String
contractId
=
doJoinRes
.
jsonPath
().
getString
(
"data.contractId"
);
...
...
src/test/java/http/cases/SignTest/ContractSign_signTest.java
View file @
943ef4b0
This diff is collapsed.
Click to expand it.
src/test/java/http/cases/SingleLotteryTest/SingleLottery_AccessTest.java
View file @
943ef4b0
...
...
@@ -173,7 +173,7 @@ public class SingleLottery_AccessTest extends DuibaTestBase {
}
Assert
.
assertEquals
(
flowWork
,
"SupplierExchange-started"
,
"数据库主订单流程节点校验失败"
);
Assert
.
assertEquals
(
String
.
valueOf
(
selectResult2
.
get
(
"item_id"
)),
"27131"
,
"数据库主订单奖项id校验失败"
);
Assert
.
assertEquals
(
String
.
valueOf
(
selectResult2
.
get
(
"biz_params"
)),
"胡梦新:18258853242:浙江
省:杭州市:西湖区:数娱大厦
"
,
"数据库主订单biz_params校验失败"
);
Assert
.
assertEquals
(
String
.
valueOf
(
selectResult2
.
get
(
"biz_params"
)),
"胡梦新:18258853242:浙江
:杭州市:西湖区:西溪街道:数娱大厦
"
,
"数据库主订单biz_params校验失败"
);
Assert
.
assertEquals
(
String
.
valueOf
(
selectResult2
.
get
(
"pay_status"
)),
"prereduce"
,
"数据库主订单pay_status校验失败"
);
Assert
.
assertEquals
(
String
.
valueOf
(
selectResult2
.
get
(
"status"
)),
"consume_success"
,
"数据库主订单status校验失败"
);
...
...
src/test/java/http/service/Activity/ContractSignService.java
View file @
943ef4b0
...
...
@@ -205,7 +205,7 @@ public class ContractSignService {
public
Response
getReward
(
String
ContractId
,
int
uid
)
throws
Exception
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"contractId"
,
ContractId
);
logger
.
info
(
"请求getReward接口,
签到活动
id="
+
ContractId
);
logger
.
info
(
"请求getReward接口,
契约
id="
+
ContractId
);
Response
response
=
given
().
cookies
(
authorization
.
dafuwengLogin
(
uid
)).
params
(
map
).
post
(
activityHost
+
"/sign/contract/getReward"
);
try
{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
,
"/sign/contract/getReward接口请求失败"
);
...
...
@@ -216,4 +216,26 @@ public class ContractSignService {
}
return
response
;
}
/**
* 针对瓜分积分的模式
* @param ContractId
* @param uid
* @return
* @throws Exception
*/
public
Response
queryRewardStatus
(
String
ContractId
,
int
uid
)
throws
Exception
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"contractId"
,
ContractId
);
logger
.
info
(
"请求queryRewardStatus接口,契约id="
+
ContractId
);
Response
response
=
given
().
cookies
(
authorization
.
dafuwengLogin
(
uid
)).
params
(
map
).
get
(
activityHost
+
"/sign/contract/queryRewardStatus"
);
try
{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
,
"/sign/contract/queryRewardStatus接口请求失败"
);
}
catch
(
Exception
e
){
throw
new
Exception
(
"/sign/contract/queryRewardStatus接口失败,返回信息"
+
response
.
asString
());
}
catch
(
Error
er
)
{
throw
new
Exception
(
"/sign/contract/queryRewardStatus接口失败,返回信息"
+
response
.
asString
());
}
return
response
;
}
}
src/test/java/http/service/Activity/PkService.java
View file @
943ef4b0
...
...
@@ -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"
;
...
...
src/test/java/http/service/Authorization.java
View file @
943ef4b0
...
...
@@ -281,7 +281,7 @@ public class Authorization {
Map
<
String
,
String
>
map
=
response
.
getCookies
();
logger
.
info
(
"cookies:"
+
map
.
toString
());
hdCookies
=
new
HashMap
<>(
response
.
getCookies
());
if
(
!
hdCookies
.
isEmpty
()||!
hdCookies
.
equals
(
""
)||!
hdCookies
.
equals
(
null
)
)
{
if
(
hdCookies
!=
null
&&
hdCookies
.
size
()!=
0
)
{
//取消安全校验
hdCookies
.
remove
(
"csrf_token"
);
hdCookies
.
put
(
"appId"
,
appId
);
...
...
@@ -317,7 +317,7 @@ public class Authorization {
Map
<
String
,
String
>
map
=
response
.
getCookies
();
logger
.
info
(
"cookies:"
+
map
.
toString
());
hdCookies
=
new
HashMap
<>(
response
.
getCookies
());
if
(
hdCookies
!=
null
||
hdCookies
.
size
()!=
0
)
{
if
(
hdCookies
!=
null
&&
hdCookies
.
size
()!=
0
)
{
//取消安全校验
hdCookies
.
remove
(
"csrf_token"
);
hdCookies
.
put
(
"appId"
,
appId
);
...
...
@@ -347,7 +347,7 @@ public class Authorization {
paras
.
put
(
"isAutoLogin"
,
"true"
);
Response
response
=
given
().
cookies
(
cookies
).
params
(
paras
).
post
(
url
);
hdCookies
=
new
HashMap
<>(
response
.
getCookies
());
if
(
hdCookies
!=
null
||
hdCookies
.
size
()!=
0
){
if
(
hdCookies
!=
null
&&
hdCookies
.
size
()!=
0
){
hdCookies
.
remove
(
"csrf_token"
);
hdCookiesCommon
.
put
(
email
,
hdCookies
);
}
...
...
@@ -377,7 +377,7 @@ public class Authorization {
Response
response
=
given
().
cookies
(
cookies
).
params
(
paras
).
post
(
url
);
response
.
prettyPrint
();
hdCookies
=
new
HashMap
<>(
response
.
getCookies
());
if
(
hdCookies
!=
null
||
hdCookies
.
size
()!=
0
){
if
(
hdCookies
!=
null
&&
hdCookies
.
size
()!=
0
){
hdCookies
.
remove
(
"csrf_token"
);
hdCookiesCommon
.
put
(
account
,
hdCookies
);
}
...
...
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