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
c0956140
Commit
c0956140
authored
Dec 11, 2018
by
周松波
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update /sign/contract/save
parent
84b6032d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
45 deletions
+24
-45
ContractSignCommon.java
src/test/java/http/cases/SignTest/ContractSignCommon.java
+0
-33
ContractSign_signTest.java
src/test/java/http/cases/SignTest/ContractSign_signTest.java
+24
-12
No files found.
src/test/java/http/cases/SignTest/ContractSignCommon.java
View file @
c0956140
...
...
@@ -95,39 +95,6 @@ public class ContractSignCommon extends DuibaTestBase{
}
}
public
void
modifyJoinTime
(
String
actId
,
String
date
,
String
startTime
,
String
endTime
)
throws
Exception
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"title"
,
"自动化_报名截止时间"
);
map
.
put
(
"betCount"
,
"1000"
);
map
.
put
(
"bonusType"
,
"0"
);
map
.
put
(
"betType"
,
"2"
);
map
.
put
(
"bankerBonus"
,
"10000"
);
map
.
put
(
"ruleDesc:"
,
"<p>bao ming 截止时间</p>"
);
map
.
put
(
"contractCycle"
,
"7"
);
map
.
put
(
"joinTimeLimit"
,
false
);
map
.
put
(
"fakeLimit"
,
false
);
map
.
put
(
"rankPeriod"
,
"1"
);
map
.
put
(
"joinTimeStart"
,
startTime
);
map
.
put
(
"joinTimeEnd"
,
endTime
);
map
.
put
(
"joinDeadLine"
,
date
);
map
.
put
(
"actId"
,
actId
);
map
.
put
(
"openStatus"
,
true
);
map
.
put
(
"gradientAmountList"
,
""
);
map
.
put
(
"freeJoinLimit"
,
"0"
);
map
.
put
(
"enableAmpifyCard"
,
false
);
map
.
put
(
"openType"
,
"0"
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
JSON
.
toJSONString
(
map
));
Response
response
=
given
().
contentType
(
"application/json;charset=UTF-8"
).
cookies
(
authorization
.
ssoLogin
()).
body
(
jsonObject
).
post
(
"https://mng.duibatest.com.cn/newmanager/signContract/save"
);
response
.
prettyPrint
();
try
{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
,
"/signContract/save接口失败"
);
}
catch
(
Exception
e
)
{
throw
new
Exception
(
"/signContract/save接口失败,返回信息:"
+
response
.
asString
());
}
catch
(
Error
er
)
{
throw
new
Exception
(
"/signContract/save接口失败,返回信息:"
+
response
.
asString
());
}
}
public
void
modifyIssuePeriod
(
String
issueId
,
int
num
)
throws
Exception
{
String
sql
=
"select start_time,end_time from credits_sign.tb_sign_contract_issue where id="
+
issueId
;
Map
<
String
,
Object
>
result
=
jdbc
.
findSimpleResult
(
sql
);
...
...
src/test/java/http/cases/SignTest/ContractSign_signTest.java
View file @
c0956140
...
...
@@ -357,17 +357,21 @@ public class ContractSign_signTest extends DuibaTestBase {
Response
rewardResponse
=
ContractSignService
.
getContractRank
(
actId
,
10
,
2
,
uid3
);
String
status2
=
rewardResponse
.
jsonPath
().
getString
(
"success"
);
Assert
.
assertEquals
(
status2
,
"true"
,
"打卡次数排行榜查询失败"
);
String
rank2
=
rewardResponse
.
jsonPath
().
getString
(
"data.rankList[1]"
);
String
userInfo2
=
rewardResponse
.
jsonPath
().
getString
(
"data.user"
);
int
userRank2
=
rewardResponse
.
jsonPath
().
getInt
(
"data.user.rank"
);
int
userAmount2
=
rewardResponse
.
jsonPath
().
getInt
(
"data.user.amount"
);
int
userId2
=
rewardResponse
.
jsonPath
().
getInt
(
"data.user.consumerId"
);
String
nickName2
=
rewardResponse
.
jsonPath
().
getString
(
"data.user.nickName"
);
Assert
.
assertEquals
(
userInfo2
,
rank2
);
Assert
.
assertEquals
(
userRank2
,
2
,
"用户收益排名不正确"
);
//Assert.assertEquals(userAmount2, 6000, "收益金额不正确");
Assert
.
assertEquals
(
userId2
,
100085019
,
"consumerId不正确"
);
Assert
.
assertEquals
(
nickName2
,
"Auto3720"
,
"用户名不正确"
);
int
rankNum1
=
rewardResponse
.
jsonPath
().
getInt
(
"data.rankList[0].rank"
);
int
rankNum2
=
rewardResponse
.
jsonPath
().
getInt
(
"data.rankList[1].rank"
);
nickName1
=
rewardResponse
.
jsonPath
().
getString
(
"data.rankList[0].nickName"
);
String
nickName2
=
rewardResponse
.
jsonPath
().
getString
(
"data.rankList[1].nickName"
);
Assert
.
assertEquals
(
rankNum1
,
1
,
"排行榜第一名显示不正确"
);
Assert
.
assertEquals
(
rankNum2
,
2
,
"排行榜第二名显示不正确"
);
// String userInfo2 = rewardResponse.jsonPath().getString("data.user");
// int userRank2 = rewardResponse.jsonPath().getInt("data.user.rank");
// int userAmount2 = rewardResponse.jsonPath().getInt("data.user.amount");
// int userId2 = rewardResponse.jsonPath().getInt("data.user.consumerId");
String
nickName3
=
rewardResponse
.
jsonPath
().
getString
(
"data.user.nickName"
);
String
arr
[]
=
{
nickName1
,
nickName2
};
Assert
.
assertTrue
(
isInArrray
(
arr
,
nickName3
),
"用户不在排行榜上"
);
}
@Test
(
description
=
"中奖轮播"
,
priority
=
9
)
...
...
@@ -389,7 +393,13 @@ public class ContractSign_signTest extends DuibaTestBase {
Assert
.
assertEquals
(
nickname1
,
"Auto3721"
);
Assert
.
assertEquals
(
winCount1
,
"7000"
);
}
public
static
boolean
isInArrray
(
String
[]
arr
,
String
targetValue
){
for
(
String
s:
arr
){
if
(
s
.
equals
(
targetValue
))
return
true
;
}
return
false
;
}
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"
);
...
...
@@ -458,6 +468,8 @@ public class ContractSign_signTest extends DuibaTestBase {
map
.
put
(
"freeJoinLimit"
,
"0"
);
map
.
put
(
"enableAmpifyCard"
,
false
);
map
.
put
(
"openType"
,
"0"
);
map
.
put
(
"skinType"
,
"0"
);
map
.
put
(
"skinId"
,
"46"
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
JSON
.
toJSONString
(
map
));
Response
response
=
given
().
contentType
(
"application/json;charset=UTF-8"
).
cookies
(
authorization
.
ssoLogin
()).
body
(
jsonObject
).
post
(
"https://mng.duibatest.com.cn/newmanager/signContract/save"
);
//response.prettyPrint();
...
...
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