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
cef646ff
Commit
cef646ff
authored
Apr 03, 2019
by
赵然
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop'
parents
34cd3713
8f587fbc
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
172 additions
and
3 deletions
+172
-3
插件场景测试_pluginTest.java
...java/http/cases/PluginActivityTest/插件场景测试_pluginTest.java
+1
-1
补给站_活动_DuibaTest.java
...t/java/http/cases/SaasDeveloperTest/补给站_活动_DuibaTest.java
+2
-2
开发者签到编辑_signTest.java
src/test/java/http/cases/SignTest/开发者签到编辑_signTest.java
+1
-0
总帐户账户正常提现.java
src/test/java/http/cases/WalletTest/总帐户账户正常提现.java
+0
-0
GlobalRewardService.java
src/test/java/http/service/Activity/GlobalRewardService.java
+168
-0
No files found.
src/test/java/http/cases/PluginActivityTest/插件场景测试_pluginTest.java
View file @
cef646ff
...
...
@@ -79,7 +79,7 @@ public class 插件场景测试_pluginTest extends DuibaTestBase {
}
else
if
(
method
.
getName
().
equals
(
"插件触发事件测试"
)){
result
=
new
Object
[][]{
//
new Object[]{1,"0","chome","插件触发事件有效期内首次访问"},
new
Object
[]{
1
,
"0"
,
"chome"
,
"插件触发事件有效期内首次访问"
},
new
Object
[]{
2
,
"4"
,
"chome"
,
"插件触发事件未登录用户访问"
},
};
...
...
src/test/java/http/cases/SaasDeveloperTest/补给站_活动_DuibaTest.java
View file @
cef646ff
...
...
@@ -70,7 +70,7 @@ public class 补给站_活动_DuibaTest extends AbstractTestNGSpringContextTests
public
void
b_
添加签到活动
()
throws
Exception
{
//查询热门活动-活动列表,获取商品ID
Response
response
=
developerBJZ
.
saasActivitys
(
"2"
,
appId
);
String
goodItemId
=
String
.
valueOf
(
response
.
jsonPath
().
getString
(
"data.saasActivitys[
1
].id"
));
String
goodItemId
=
String
.
valueOf
(
response
.
jsonPath
().
getString
(
"data.saasActivitys[
0
].id"
));
//获取商品ID,进入商品订购页面,获取SKU
Response
response2
=
developerBJZ
.
itemOrderDetail
(
goodItemId
,
appId
);
String
skuId
=
String
.
valueOf
(
response2
.
jsonPath
().
getString
(
"data.goodsItemSku[0].skuId"
));
...
...
@@ -92,7 +92,7 @@ public class 补给站_活动_DuibaTest extends AbstractTestNGSpringContextTests
public
void
c_
待处理的订单
()
throws
Exception
{
//查询热门活动-活动列表,获取商品ID
Response
response
=
developerBJZ
.
saasActivitys
(
"2"
,
appId
);
String
goodItemId
=
String
.
valueOf
(
response
.
jsonPath
().
getString
(
"data.saasActivitys[
1
].id"
));
String
goodItemId
=
String
.
valueOf
(
response
.
jsonPath
().
getString
(
"data.saasActivitys[
0
].id"
));
//获取商品ID,进入商品订购页面,获取SKU
Response
response2
=
developerBJZ
.
itemOrderDetail
(
goodItemId
,
appId
);
String
skuId
=
String
.
valueOf
(
response2
.
jsonPath
().
getString
(
"data.goodsItemSku[0].skuId"
));
...
...
src/test/java/http/cases/SignTest/开发者签到编辑_signTest.java
View file @
cef646ff
...
...
@@ -30,6 +30,7 @@ public class 开发者签到编辑_signTest extends AbstractTestNGSpringContextT
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].openToDev"
),
"false"
,
"来自Duiba的签到编辑权限失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[1].openToDev"
),
"true"
,
"来自开发者自有的签到编辑权限失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[2].openToDev"
),
"true"
,
"来自开发者自有的签到编辑权限失败"
);
logger
.
info
(
"开发者签到编辑权限校验成功"
);
}
...
...
src/test/java/http/cases/WalletTest/总帐户账户正常提现.java
0 → 100644
View file @
cef646ff
This diff is collapsed.
Click to expand it.
src/test/java/http/service/Activity/GlobalRewardService.java
0 → 100644
View file @
cef646ff
package
http
.
service
.
Activity
;
import
base.DuibaLog
;
import
http.service.Authorization
;
import
io.restassured.response.Response
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.testng.Assert
;
import
java.util.HashMap
;
import
java.util.Map
;
import
static
io
.
restassured
.
RestAssured
.
given
;
/**
* Created by zhaoran on 2019/03/29
*/
@Service
public
class
GlobalRewardService
{
@Autowired
Authorization
authorization
;
@Value
(
"${activity.host}"
)
String
activityHost
;
private
DuibaLog
logger
=
DuibaLog
.
getLogger
();
/**
* 获取红包账户
* @param cookies
* @return
* @throws Exception
*/
public
Response
getWalletAccount
(
Map
cookies
)
throws
Exception
{
logger
.
info
(
"请求getWalletAccount"
);
Response
response
=
given
().
cookies
(
cookies
).
get
(
activityHost
+
"/walletAccount/getWalletAccount"
);
try
{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
,
"/walletAccount/getWalletAccount接口失败"
);
}
catch
(
Exception
e
){
throw
new
Exception
(
"/walletAccount/getWalletAccount接口失败,返回信息:"
+
response
.
asString
());
}
catch
(
Error
er
){
throw
new
Exception
(
"/walletAccount/getWalletAccount接口失败,返回信息:"
+
response
.
asString
());
}
return
response
;
}
/**
* 红包账户提现
* @param cookies
* @param amount
* @param account
* @param username
* @return
* @throws Exception
*/
public
Response
withdraw
(
Map
cookies
,
String
amount
,
String
account
,
String
username
)
throws
Exception
{
logger
.
info
(
"请求withdraw"
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"amount"
,
amount
);
map
.
put
(
"account"
,
account
);
map
.
put
(
"username"
,
username
);
Response
response
=
given
().
contentType
(
"application/x-www-form-urlencoded;charset=UTF-8"
).
cookies
(
cookies
).
params
(
map
).
post
(
activityHost
+
"/globalReward/withdraw"
);
try
{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
,
"/walletAccount/doTakePrize接口失败"
);
}
catch
(
Exception
e
){
throw
new
Exception
(
"/globalReward/withdraw接口失败,返回信息:"
+
response
.
asString
());
}
catch
(
Error
er
){
throw
new
Exception
(
"/globalReward/withdraw接口失败,返回信息:"
+
response
.
asString
());
}
return
response
;
}
/**
* 红包账户提现
* @param cookies
* @param orderId
* @return
* @throws Exception
*/
public
Response
getOrderStatus
(
Map
cookies
,
String
orderId
)
throws
Exception
{
logger
.
info
(
"请求getOrderStatus"
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"orderId"
,
orderId
);
Response
response
=
given
().
cookies
(
cookies
).
params
(
map
).
post
(
activityHost
+
"/walletAccount/getOrderStatus"
);
try
{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
,
"/walletAccount/getOrderStatus接口失败"
);
}
catch
(
Exception
e
){
throw
new
Exception
(
"/walletAccount/getOrderStatus接口失败,返回信息:"
+
response
.
asString
());
}
catch
(
Error
er
){
throw
new
Exception
(
"/walletAccount/getOrderStatus接口失败,返回信息:"
+
response
.
asString
());
}
return
response
;
}
public
Response
getOrderStatus2
(
Map
cookies
,
String
orderId
)
throws
Exception
{
logger
.
info
(
"请求getOrderStatus"
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"orderId"
,
orderId
);
Response
response
=
given
().
cookies
(
cookies
).
params
(
map
).
post
(
activityHost
+
"/walletAccount/getOrderStatus"
);
return
response
;
}
/**
* 红包账户提现记录
* @param cookies
* @return
* @throws Exception
*/
public
Response
walletDetail
(
Map
cookies
)
throws
Exception
{
logger
.
info
(
"请求walletDetail"
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"pageNo"
,
"1"
);
map
.
put
(
"pageSize"
,
"12"
);
Response
response
=
given
().
cookies
(
cookies
).
params
(
map
).
get
(
activityHost
+
"/walletAccount/walletDetail"
);
try
{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
,
"/walletAccount/walletDetail接口失败"
);
}
catch
(
Exception
e
){
throw
new
Exception
(
"/walletAccount/walletDetail接口失败,返回信息:"
+
response
.
asString
());
}
catch
(
Error
er
){
throw
new
Exception
(
"/walletAccount/walletDetail接口失败,返回信息:"
+
response
.
asString
());
}
return
response
;
}
/**
* 红包账户修改钱包账户余额后门
* @param consumerId
* @param accountType
* @param balanceAmount
* @return
* @throws Exception
*/
public
void
updateConsumerAccount
(
String
consumerId
,
String
accountType
,
String
balanceAmount
)
throws
Exception
{
logger
.
info
(
"请求修改钱包账户余额后门:updateConsumerAccount"
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"consumerId"
,
consumerId
);
map
.
put
(
"accountType"
,
accountType
);
map
.
put
(
"balanceAmount"
,
balanceAmount
);
Response
response
=
given
().
params
(
map
).
get
(
activityHost
+
"/aaw/automated/updateConsumerAccount"
);
// try{
// Assert.assertEquals(response.jsonPath().getString("success"),"true","/walletAccount/walletDetail接口失败");
//
// }catch(Exception e){
// throw new Exception("/aaw/automated/updateConsumerAccount接口失败,返回信息:"+response.asString());
// }catch(Error er){
// throw new Exception("/aaw/automated/updateConsumerAccount接口失败,返回信息:"+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