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
7867093d
Commit
7867093d
authored
Oct 15, 2018
by
马博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sign update
parent
436a7ffe
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
24 deletions
+17
-24
Signin_signTest.java
src/test/java/http/cases/SignTest/Signin_signTest.java
+17
-24
补签测试_signTest.java
src/test/java/http/cases/SignTest/补签测试_signTest.java
+0
-0
No files found.
src/test/java/http/cases/SignTest/Signin_signTest.java
View file @
7867093d
...
...
@@ -36,14 +36,11 @@ public class Signin_signTest extends DuibaTestBase {
DuibaLog
logger
=
DuibaLog
.
getLogger
();
//指定用户
private
int
uid
=
2722
;
private
static
int
uid
=
2722
;
private
Map
<
String
,
Object
>
maptest
;
@BeforeClass
public
void
beforeclass
(){
// jdbc = new MysqlUtils("");
maptest
=
authorization
.
dafuwengLogin
(
uid
);
logger
.
info
(
"_ac:"
+
maptest
.
get
(
"_ac"
));
try
{
jdbc
.
update
(
"delete from sign_record.tb_sign_log where consumer_id=100028002 and source_relation_id=69"
);
jdbc
.
update
(
"delete from sign_record.tb_sign_statics where consumer_id=100028002 and source_relation_id=69"
);
...
...
@@ -68,16 +65,15 @@ public class Signin_signTest extends DuibaTestBase {
String
url
=
MatcherString
.
getString
(
response
.
asString
(),
"\"resultUrl\": \"(.*?)\""
,
1
);
System
.
out
.
println
(
url
);
response
=
given
().
cookies
(
maptest
).
get
(
url
);
response
=
given
().
cookies
(
authorization
.
dafuwengLogin
(
uid
)
).
get
(
url
);
response
.
prettyPrint
();
System
.
out
.
println
(
response
.
getDetailedCookies
());
}
@Test
public
void
签到
_
今日签到
()
throws
Exception
{
logger
.
info
(
"Current Thread Id: "
+
Thread
.
currentThread
().
getId
());
//签到信息查询
Response
response
=
signactivityService
.
getSignInfo
(
maptest
,
"65"
);
Response
response
=
signactivityService
.
getSignInfo
(
authorization
.
dafuwengLogin
(
uid
)
,
"65"
);
//今日奖励抽奖次数
String
activityCount
=
response
.
jsonPath
().
getString
(
"signInfoVO.activityCount"
);
//明天签到奖励抽奖次数
...
...
@@ -94,7 +90,7 @@ public class Signin_signTest extends DuibaTestBase {
//签到
response
=
signactivityService
.
doSign
(
maptest
,
"65"
);
response
=
signactivityService
.
doSign
(
authorization
.
dafuwengLogin
(
uid
)
,
"65"
);
//今日是否签到
todaySigned
=
response
.
jsonPath
().
getString
(
"signInfoVO.todaySigned"
);
//连续签到天数
...
...
@@ -103,14 +99,14 @@ public class Signin_signTest extends DuibaTestBase {
Assert
.
assertEquals
(
continueDay
,
"1"
,
"连续签到天数不正确"
);
//获取签到logId
String
logId
=
response
.
jsonPath
().
getString
(
"logId"
);
response
=
signactivityService
.
getSignResult
(
maptest
,
logId
);
response
=
signactivityService
.
getSignResult
(
authorization
.
dafuwengLogin
(
uid
)
,
logId
);
//签到状态
String
status
=
response
.
jsonPath
().
getString
(
"status"
);
//接口异步处理
int
i
=
3
;
while
(
status
.
equals
(
"0"
)&&
i
>
0
){
Thread
.
sleep
(
1000
);
response
=
signactivityService
.
getSignResult
(
maptest
,
logId
);
response
=
signactivityService
.
getSignResult
(
authorization
.
dafuwengLogin
(
uid
)
,
logId
);
status
=
response
.
jsonPath
().
getString
(
"status"
);
i
--;
}
...
...
@@ -119,19 +115,16 @@ public class Signin_signTest extends DuibaTestBase {
}
@Test
public
void
补签
()
throws
Exception
{
logger
.
info
(
"Current Thread Id: "
+
Thread
.
currentThread
().
getId
());
// Map<String,String> map = authorization.dafuwengLogin(uid);
Map
consumerCredits
=
jdbc
.
findSimpleResult
(
"select * from consumer.consumer_0010 where id=100028002"
);
Map
consumerCredits
=
jdbc
.
findSimpleResult
(
"select * from
new_
consumer.consumer_0010 where id=100028002"
);
logger
.
info
(
"数据库积分:"
+
consumerCredits
.
get
(
"credits"
));
//签到信息查询
logger
.
info
(
"_ac1:"
+
maptest
.
get
(
"_ac"
));
Response
response
=
signactivityService
.
getSignInfo
(
maptest
,
"69"
);
Response
response
=
signactivityService
.
getSignInfo
(
authorization
.
dafuwengLogin
(
uid
),
"69"
);
//获取当前用户积分
String
credits
=
response
.
jsonPath
().
getString
(
"credits"
);
//补签前一天
response
=
signactivityService
.
reSign
(
maptest
,
"69"
,
null
,
getTime
(-
1
));
response
=
signactivityService
.
reSign
(
authorization
.
dafuwengLogin
(
uid
)
,
"69"
,
null
,
getTime
(-
1
));
//补签加抽奖次数
String
activityCount
=
response
.
jsonPath
().
getString
(
"data.activityCount"
);
//补签加积分
...
...
@@ -146,14 +139,14 @@ public class Signin_signTest extends DuibaTestBase {
Assert
.
assertEquals
(
creditsFirst
,
"1"
,
"补签加积分不正确"
);
Assert
.
assertEquals
(
hasConsume
,
"true"
,
"补签消耗与否不正确"
);
Assert
.
assertEquals
(
reSignConsumeCount
,
"1"
,
"补签消耗数量不正确"
);
response
=
signactivityService
.
getSignResult
(
maptest
,
logId
);
response
=
signactivityService
.
getSignResult
(
authorization
.
dafuwengLogin
(
uid
)
,
logId
);
//签到状态
String
status
=
response
.
jsonPath
().
getString
(
"status"
);
//接口异步处理
int
i
=
3
;
while
(
status
.
equals
(
"0"
)&&
i
>
0
){
Thread
.
sleep
(
1000
);
response
=
signactivityService
.
getSignResult
(
maptest
,
logId
);
response
=
signactivityService
.
getSignResult
(
authorization
.
dafuwengLogin
(
uid
)
,
logId
);
status
=
response
.
jsonPath
().
getString
(
"status"
);
i
--;
}
...
...
@@ -171,14 +164,14 @@ public class Signin_signTest extends DuibaTestBase {
Assert
.
assertEquals
(
act
,
exp
,
"积分与预期不符"
);
//校验consumer和user表的积分
Thread
.
sleep
(
2000
);
consumerCredits
=
jdbc
.
findSimpleResult
(
"select * from consumer.consumer_0010 where id=100028002"
);
consumerCredits
=
jdbc
.
findSimpleResult
(
"select * from
new_
consumer.consumer_0010 where id=100028002"
);
Map
userCredits
=
jdbc
.
findSimpleResult
(
"select * from dafuweng.user where id ="
+
uid
);
Assert
.
assertEquals
(
consumerCredits
.
get
(
"credits"
).
toString
().
trim
(),
String
.
valueOf
(
exp
),
"consumer积分与预期不符"
);
Assert
.
assertEquals
(
userCredits
.
get
(
"credits"
).
toString
().
trim
(),
String
.
valueOf
(
exp
),
"user积分与预期不符"
);
//补签前两天
response
=
signactivityService
.
reSign
(
maptest
,
"69"
,
null
,
getTime
(-
2
));
response
=
signactivityService
.
reSign
(
authorization
.
dafuwengLogin
(
uid
)
,
"69"
,
null
,
getTime
(-
2
));
//补签加抽奖次数
activityCount
=
response
.
jsonPath
().
getString
(
"data.activityCount"
);
//补签加积分
...
...
@@ -193,14 +186,14 @@ public class Signin_signTest extends DuibaTestBase {
Assert
.
assertEquals
(
reSignConsumeCount
,
"1"
,
"补签消耗数量不正确"
);
//补签logid
logId
=
response
.
jsonPath
().
getString
(
"data.logId"
);
response
=
signactivityService
.
getSignResult
(
maptest
,
logId
);
response
=
signactivityService
.
getSignResult
(
authorization
.
dafuwengLogin
(
uid
)
,
logId
);
//签到状态
status
=
response
.
jsonPath
().
getString
(
"status"
);
//接口异步处理
i
=
3
;
while
(
status
.
equals
(
"0"
)&&
i
>
0
){
Thread
.
sleep
(
1000
);
response
=
signactivityService
.
getSignResult
(
maptest
,
logId
);
response
=
signactivityService
.
getSignResult
(
authorization
.
dafuwengLogin
(
uid
)
,
logId
);
status
=
response
.
jsonPath
().
getString
(
"status"
);
i
--;
}
...
...
@@ -218,14 +211,14 @@ public class Signin_signTest extends DuibaTestBase {
Assert
.
assertEquals
(
act
,
exp
,
"积分与预期不符"
);
//校验consumer和user表的积分
Thread
.
sleep
(
2000
);
consumerCredits
=
jdbc
.
findSimpleResult
(
"select * from consumer.consumer_0010 where id=100028002"
);
consumerCredits
=
jdbc
.
findSimpleResult
(
"select * from
new_
consumer.consumer_0010 where id=100028002"
);
userCredits
=
jdbc
.
findSimpleResult
(
"select * from dafuweng.user where id ="
+
uid
);
Assert
.
assertEquals
(
consumerCredits
.
get
(
"credits"
).
toString
().
trim
(),
String
.
valueOf
(
exp
),
"consumer积分与预期不符"
);
Assert
.
assertEquals
(
userCredits
.
get
(
"credits"
).
toString
().
trim
(),
String
.
valueOf
(
exp
),
"user积分与预期不符"
);
//补签前三天
response
=
signactivityService
.
reSign
(
maptest
,
"69"
,
null
,
getTime
(-
3
));
response
=
signactivityService
.
reSign
(
authorization
.
dafuwengLogin
(
uid
)
,
"69"
,
null
,
getTime
(-
3
));
// response.prettyPrint();
String
message
=
response
.
jsonPath
().
getString
(
"message"
);
...
...
src/test/java/http/cases/SignTest/补签测试_signTest.java
View file @
7867093d
This diff is collapsed.
Click to expand it.
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