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
dfe59279
Commit
dfe59279
authored
Dec 20, 2018
by
qwj-github
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
943ef4b0
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
111 additions
and
3 deletions
+111
-3
pk_押注测试_AccessTest.java
src/test/java/http/cases/PkTest/pk_押注测试_AccessTest.java
+0
-1
插件_抽奖扣积分测试_pluginTest.java
.../http/cases/PluginActivityTest/插件_抽奖扣积分测试_pluginTest.java
+24
-2
插件_插件信息获取测试.java
src/test/java/http/cases/PluginActivityTest/插件_插件信息获取测试.java
+67
-0
ActivityPlugDrawInfoService.java
...va/http/service/Activity/ActivityPlugDrawInfoService.java
+20
-0
No files found.
src/test/java/http/cases/PkTest/pk_押注测试_AccessTest.java
View file @
dfe59279
...
@@ -332,7 +332,6 @@ public class pk_押注测试_AccessTest extends DuibaTestBase {
...
@@ -332,7 +332,6 @@ public class pk_押注测试_AccessTest extends DuibaTestBase {
}
}
// @AfterMethod
@AfterClass
@AfterClass
public
void
tearDown
()
{
public
void
tearDown
()
{
...
...
src/test/java/http/cases/PluginActivityTest/插件_抽奖扣积分测试_pluginTest.java
View file @
dfe59279
...
@@ -35,7 +35,8 @@ public class 插件_抽奖扣积分测试_pluginTest extends DuibaTestBase {
...
@@ -35,7 +35,8 @@ public class 插件_抽奖扣积分测试_pluginTest extends DuibaTestBase {
private
int
uid
=
3982
;
private
int
uid
=
3982
;
private
String
consumerId
=
"100092192"
;
private
String
consumerId
=
"100092192"
;
private
Integer
user01
=
5193
;
//appid=21833
private
String
consumerId01
=
"100114050"
;
private
static
DuibaLog
logger
=
DuibaLog
.
getLogger
();
private
static
DuibaLog
logger
=
DuibaLog
.
getLogger
();
...
@@ -67,10 +68,31 @@ public class 插件_抽奖扣积分测试_pluginTest extends DuibaTestBase {
...
@@ -67,10 +68,31 @@ public class 插件_抽奖扣积分测试_pluginTest extends DuibaTestBase {
logger
.
info
(
"校验积分消耗成功,原积分值="
+
userCredit
+
",消耗后积分值为"
+
userCredit1
);
logger
.
info
(
"校验积分消耗成功,原积分值="
+
userCredit
+
",消耗后积分值为"
+
userCredit1
);
}
@Test
public
void
插件
_
实物有奖项库存无兑换项库存测试
()
throws
Exception
{
Map
<
String
,
Object
>
user
=
jdbc
.
findSimpleResult
(
"select * from dafuweng.user where id=?\n"
,
uid
);
Map
<
String
,
Object
>
consumer
=
jdbc
.
findSimpleResult
(
"select * from new_consumer.consumer_0010 where id=?\n"
,
consumerId
);
Long
userCredit
=
Long
.
parseLong
(
user
.
get
(
"credits"
).
toString
());
Long
consumerCredit
=
Long
.
parseLong
(
consumer
.
get
(
"credits"
).
toString
());
}
Response
playResponse
=
this
.
playPlugin
(
uid
,
"3355"
);
Assert
.
assertEquals
(
playResponse
.
jsonPath
().
getString
(
"lottery.type"
),
"thanks"
,
"插件抽奖的奖品类型校验失败"
);
logger
.
info
(
"插件奖品的兑换项库存不足,降级谢谢参与成功"
);
Map
<
String
,
Object
>
user1
=
jdbc
.
findSimpleResult
(
"select * from dafuweng.user where id=?\n"
,
uid
);
Map
<
String
,
Object
>
consumer1
=
jdbc
.
findSimpleResult
(
"select * from new_consumer.consumer_0010 where id=?\n"
,
consumerId
);
String
userCredit1
=
user1
.
get
(
"credits"
).
toString
();
String
consumerCredit1
=
consumer1
.
get
(
"credits"
).
toString
();
Assert
.
assertEquals
(
userCredit1
,
String
.
valueOf
(
userCredit
-
44
),
"user积分扣除校验失败"
);
Assert
.
assertEquals
(
consumerCredit1
,
String
.
valueOf
(
consumerCredit
-
44
),
"consumer积分扣除校验失败"
);
logger
.
info
(
"校验积分消耗成功,原积分值="
+
userCredit
+
",消耗后积分值为"
+
userCredit1
);
}
...
...
src/test/java/http/cases/PluginActivityTest/插件_插件信息获取测试.java
0 → 100644
View file @
dfe59279
/**
* Copyright (C), 2015-2018
* FileName: 插件_插件信息获取测试
* Author: qianwenjun
* Date: 2018/12/20 09:48
* Description:
*/
package
http
.
cases
.
PluginActivityTest
;
import
base.DuibaLog
;
import
base.DuibaTestBase
;
import
http.service.Activity.ActivityPlugDrawInfoService
;
import
io.restassured.response.Response
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.testng.Assert
;
import
org.testng.annotations.Test
;
/**
* 〈〉
*
* @author qianwenjun
* @create 2018/12/20
* @since 1.0.0
*/
public
class
插件
_
插件信息获取测试
extends
DuibaTestBase
{
@Autowired
ActivityPlugDrawInfoService
activityPlugDrawInfoService
;
private
static
DuibaLog
logger
=
DuibaLog
.
getLogger
();
private
Integer
user01
=
5416
;
//appid=21945
private
Integer
user02
=
5193
;
//appid=21833
@Test
public
void
插件
_
人民币展示
()
throws
Exception
{
Response
response
=
activityPlugDrawInfoService
.
getPrizeInfo
(
user01
,
"3354"
);
response
.
prettyPrint
();
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"needMonery"
),
"0.88"
,
"校验插件价值人民币展示错误"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"pluginLimitCount"
),
"2"
,
"校验插件限制次数错误"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"limitCount"
),
"1"
,
"校验插件免费次数错误"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"creditsPrice"
),
"88"
,
"校验插件限制次数错误"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"limitScope"
),
"1"
,
"校验插件次数维度错误"
);
}
@Test
public
void
插件
_50
汇率展示展示
()
throws
Exception
{
Response
response
=
activityPlugDrawInfoService
.
getPrizeInfo
(
user02
,
"3354"
);
response
.
prettyPrint
();
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"needMonery"
),
null
,
"校验插件价值人民币展示错误"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"pluginLimitCount"
),
"2"
,
"校验插件限制次数错误"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"limitCount"
),
"1"
,
"校验插件免费次数错误"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"creditsPrice"
),
"44"
,
"校验插件限制次数错误"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"limitScope"
),
"1"
,
"校验插件次数维度错误"
);
}
}
\ No newline at end of file
src/test/java/http/service/Activity/ActivityPlugDrawInfoService.java
View file @
dfe59279
...
@@ -142,4 +142,24 @@ public class ActivityPlugDrawInfoService {
...
@@ -142,4 +142,24 @@ public class ActivityPlugDrawInfoService {
return
response
;
return
response
;
}
}
public
Response
getPrizeInfo
(
int
uid
,
String
activityId
)
throws
Exception
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"activityId"
,
activityId
);
logger
.
info
(
"请求getPrizeInfo接口,orderId="
+
activityId
);
Response
response
=
given
().
cookies
(
authorization
.
dafuwengLogin
(
uid
)).
params
(
map
).
post
(
activityHost
+
"/plugin/getPrizeInfo"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
);
try
{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
);
}
catch
(
Exception
e
){
throw
new
Exception
(
"/activityPlugDrawInfo/getOrderStatusPlugdraw接口失败,返回信息:"
+
response
.
asString
());
}
catch
(
Error
er
){
throw
new
Exception
(
"/activityPlugDrawInfo/getOrderStatusPlugdraw接口失败,返回信息:"
+
response
.
asString
());
}
return
response
;
}
}
}
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