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
84115892
Commit
84115892
authored
Oct 30, 2019
by
马博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
fdecc52f
Changes
8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
244 additions
and
107 deletions
+244
-107
新集卡_直接出奖.xls
data/duiba/新集卡_直接出奖.xls
+0
-0
修改兑吧商品_ExchangeTest.java
...ava/http/cases/GoodsAndTradeTest/修改兑吧商品_ExchangeTest.java
+1
-0
新集卡_开奖流程_DuibaTest.java
...http/cases/NewCollectActivityTest/新集卡_开奖流程_DuibaTest.java
+5
-0
秒杀自有老虚拟商品_兑换限制_SeckillTest.java
...va/http/cases/SeckillTest/秒杀自有老虚拟商品_兑换限制_SeckillTest.java
+1
-0
ContractSign_Cash_signTest.java
.../java/http/cases/SignTest/ContractSign_Cash_signTest.java
+42
-8
ContractSign_Multi_signTest.java
...java/http/cases/SignTest/ContractSign_Multi_signTest.java
+28
-4
ContractSignService.java
src/test/java/http/service/Activity/ContractSignService.java
+7
-7
test.java
src/test/java/ui/cases/test.java
+160
-88
No files found.
data/duiba/新集卡_直接出奖.xls
View file @
84115892
No preview for this file type
src/test/java/http/cases/GoodsAndTradeTest/修改兑吧商品_ExchangeTest.java
View file @
84115892
...
@@ -71,6 +71,7 @@ public class 修改兑吧商品_ExchangeTest extends DuibaTestBase {
...
@@ -71,6 +71,7 @@ public class 修改兑吧商品_ExchangeTest extends DuibaTestBase {
//编辑
//编辑
doUpdateAppItemService
.
doUpdateAppItem
(
appId
,
appItemId
,
title
,
"10"
,
"coupon"
,
"31658"
);
doUpdateAppItemService
.
doUpdateAppItem
(
appId
,
appItemId
,
title
,
"10"
,
"coupon"
,
"31658"
);
Response
response2
=
developerObjectService
.
editAppItem2
(
appItemId
);
Response
response2
=
developerObjectService
.
editAppItem2
(
appItemId
);
System
.
out
.
println
(
response2
.
asString
());
Assert
.
assertEquals
(
response2
.
jsonPath
().
getString
(
"data.title"
),
"【SaaS-自动化测试】优惠券勿动"
,
"校验兑吧优惠券商品标题失败"
);
Assert
.
assertEquals
(
response2
.
jsonPath
().
getString
(
"data.title"
),
"【SaaS-自动化测试】优惠券勿动"
,
"校验兑吧优惠券商品标题失败"
);
Assert
.
assertEquals
(
response2
.
jsonPath
().
getString
(
"data.credits"
),
"10"
,
"校验兑吧优惠券商品失败"
);
Assert
.
assertEquals
(
response2
.
jsonPath
().
getString
(
"data.credits"
),
"10"
,
"校验兑吧优惠券商品失败"
);
...
...
src/test/java/http/cases/NewCollectActivityTest/新集卡_开奖流程_DuibaTest.java
View file @
84115892
...
@@ -489,6 +489,11 @@ public class 新集卡_开奖流程_DuibaTest extends DuibaTestBase {
...
@@ -489,6 +489,11 @@ public class 新集卡_开奖流程_DuibaTest extends DuibaTestBase {
}
}
return
statusResponse
;
return
statusResponse
;
}
}
// @Test
public
void
test
()
throws
Exception
{
Response
response
=
openPrize
(
"5193"
,
2691
,
"nomal"
);
response
.
prettyPrint
();
}
...
...
src/test/java/http/cases/SeckillTest/秒杀自有老虚拟商品_兑换限制_SeckillTest.java
View file @
84115892
...
@@ -171,6 +171,7 @@ public class 秒杀自有老虚拟商品_兑换限制_SeckillTest extends DuibaT
...
@@ -171,6 +171,7 @@ public class 秒杀自有老虚拟商品_兑换限制_SeckillTest extends DuibaT
queryResponse
.
prettyPrint
();
queryResponse
.
prettyPrint
();
// if(queryResponse.asString().contains("好可惜,没抢到"))return;
String
orderId
=
MatcherString
.
getString
(
queryResponse
.
asString
(),
"orderId: '(.*?)'"
,
1
);
String
orderId
=
MatcherString
.
getString
(
queryResponse
.
asString
(),
"orderId: '(.*?)'"
,
1
);
...
...
src/test/java/http/cases/SignTest/ContractSign_Cash_signTest.java
View file @
84115892
package
http
.
cases
.
SignTest
;
package
http
.
cases
.
SignTest
;
import
base.DuibaTestBase
;
import
base.DuibaTestBase
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
http.service.Activity.ManagerService
;
import
http.service.Activity.ManagerService
;
import
http.service.Authorization
;
import
http.service.Authorization
;
import
http.service.hd.SigninService
;
import
http.service.hd.SigninService
;
...
@@ -12,10 +14,9 @@ import org.testng.annotations.BeforeClass;
...
@@ -12,10 +14,9 @@ import org.testng.annotations.BeforeClass;
import
org.testng.annotations.Test
;
import
org.testng.annotations.Test
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.Calendar
;
import
java.util.*
;
import
java.util.Date
;
import
java.util.concurrent.CopyOnWriteArrayList
;
import
java.util.HashMap
;
import
java.util.concurrent.CountDownLatch
;
import
java.util.Map
;
public
class
ContractSign_Cash_signTest
extends
DuibaTestBase
{
public
class
ContractSign_Cash_signTest
extends
DuibaTestBase
{
@Autowired
@Autowired
...
@@ -175,11 +176,44 @@ public class ContractSign_Cash_signTest extends DuibaTestBase {
...
@@ -175,11 +176,44 @@ public class ContractSign_Cash_signTest extends DuibaTestBase {
Assert
.
assertEquals
(
doneStatus
,
"WAIT_REWARD"
,
"当前期次完成状态不正确"
);
Assert
.
assertEquals
(
doneStatus
,
"WAIT_REWARD"
,
"当前期次完成状态不正确"
);
String
winCount
=
recordRes
.
jsonPath
().
getString
(
"data.list[0].winCount"
);
String
winCount
=
recordRes
.
jsonPath
().
getString
(
"data.list[0].winCount"
);
Assert
.
assertEquals
(
winCount
,
"33333"
,
"瓜分奖励金额不正确"
);
Assert
.
assertEquals
(
winCount
,
"33333"
,
"瓜分奖励金额不正确"
);
//领奖
//领奖-并发
CountDownLatch
latch
=
new
CountDownLatch
(
5
);
List
<
String
>
list
=
new
CopyOnWriteArrayList
();
for
(
int
i
=
0
;
i
<
5
;
i
++)
{
new
Thread
(()
->
{
try
{
Response
rewardRes
=
ContractSignService
.
getReward
(
contractId1
,
uid1
);
Response
rewardRes
=
ContractSignService
.
getReward
(
contractId1
,
uid1
);
String
rewardStatus
=
rewardRes
.
jsonPath
().
getString
(
"success"
);
list
.
add
(
rewardRes
.
asString
());
String
rewardAmount
=
rewardRes
.
jsonPath
().
getString
(
"data"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
latch
.
countDown
();
}).
start
();
}
latch
.
await
();
int
fail
=
0
,
success
=
0
;
JSONObject
json
=
null
;
for
(
String
s:
list
)
{
if
(
s
.
contains
(
"操作太频繁啦,稍后再试"
)){
fail
++;
}
else
{
success
++;
json
=
JSON
.
parseObject
(
s
);
}
}
String
rewardAmount
=
json
.
getString
(
"data"
);
String
rewardStatus
=
json
.
getString
(
"success"
);
Assert
.
assertEquals
(
rewardStatus
,
"true"
,
"领取奖励结果不正确"
);
Assert
.
assertEquals
(
rewardStatus
,
"true"
,
"领取奖励结果不正确"
);
Assert
.
assertEquals
(
rewardAmount
,
winCount
,
"领取奖励金额不正确"
);
Assert
.
assertEquals
(
rewardAmount
,
winCount
,
"领取奖励金额不正确"
);
Assert
.
assertEquals
(
fail
,
4
);
}
}
}
}
src/test/java/http/cases/SignTest/ContractSign_Multi_signTest.java
View file @
84115892
...
@@ -14,10 +14,8 @@ import io.restassured.response.Response;
...
@@ -14,10 +14,8 @@ import io.restassured.response.Response;
import
java.net.SocketImpl
;
import
java.net.SocketImpl
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.Calendar
;
import
java.util.*
;
import
java.util.Date
;
import
java.util.concurrent.CopyOnWriteArrayList
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.concurrent.ExecutionException
;
import
java.util.concurrent.ExecutionException
;
import
utils.RedisUtil
;
import
utils.RedisUtil
;
...
@@ -361,7 +359,27 @@ public class ContractSign_Multi_signTest extends DuibaTestBase {
...
@@ -361,7 +359,27 @@ public class ContractSign_Multi_signTest extends DuibaTestBase {
rewardRes
=
ContractSignService
.
getReward
(
contractId4
,
uid4
);
rewardRes
=
ContractSignService
.
getReward
(
contractId4
,
uid4
);
rewardCount
=
rewardRes
.
jsonPath
().
getInt
(
"data"
);
rewardCount
=
rewardRes
.
jsonPath
().
getInt
(
"data"
);
Assert
.
assertEquals
(
rewardCount
,
4125
,
"uid4领取奖励数不正确"
);
Assert
.
assertEquals
(
rewardCount
,
4125
,
"uid4领取奖励数不正确"
);
List
<
String
>
list
=
new
CopyOnWriteArrayList
<>();
// uid6领奖
// uid6领奖
// for (int i = 0; i < 20; i++) {
// new Thread(() -> {
// try {
// Response rewardRess = ContractSignService.getReward(contractId6, uid6);
// list.add(rewardRess.asString());
// } catch (Exception e) {
// e.printStackTrace();
// }
//
//
// }).start();
//
// }
// Thread.sleep(20000);
// for (String s:
// list) {
// System.out.println(s);
// }
rewardRes
=
ContractSignService
.
getReward
(
contractId6
,
uid6
);
rewardRes
=
ContractSignService
.
getReward
(
contractId6
,
uid6
);
rewardCount
=
rewardRes
.
jsonPath
().
getInt
(
"data"
);
rewardCount
=
rewardRes
.
jsonPath
().
getInt
(
"data"
);
Assert
.
assertEquals
(
rewardCount
,
825
,
"uid6领取奖励数不正确"
);
Assert
.
assertEquals
(
rewardCount
,
825
,
"uid6领取奖励数不正确"
);
...
@@ -373,6 +391,12 @@ public class ContractSign_Multi_signTest extends DuibaTestBase {
...
@@ -373,6 +391,12 @@ public class ContractSign_Multi_signTest extends DuibaTestBase {
String
desc
=
rewardRes
.
jsonPath
().
getString
(
"desc"
);
String
desc
=
rewardRes
.
jsonPath
().
getString
(
"desc"
);
Assert
.
assertEquals
(
success
,
"false"
,
"uid1领取结果不正确"
);
Assert
.
assertEquals
(
success
,
"false"
,
"uid1领取结果不正确"
);
Assert
.
assertEquals
(
desc
,
"领奖处理失败"
,
"uid1领取描述不正确"
);
Assert
.
assertEquals
(
desc
,
"领奖处理失败"
,
"uid1领取描述不正确"
);
rewardRes
=
ContractSignService
.
getReward
(
contractId6
,
uid6
);
rewardRes
.
prettyPrint
();
}
}
//@Test(description = "多梯度中奖轮播",priority = 7,dependsOnMethods = { "多梯度领奖" })
//@Test(description = "多梯度中奖轮播",priority = 7,dependsOnMethods = { "多梯度领奖" })
...
...
src/test/java/http/service/Activity/ContractSignService.java
View file @
84115892
...
@@ -207,13 +207,13 @@ public class ContractSignService {
...
@@ -207,13 +207,13 @@ public class ContractSignService {
map
.
put
(
"contractId"
,
ContractId
);
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"
);
Response
response
=
given
().
cookies
(
authorization
.
dafuwengLogin
(
uid
)).
params
(
map
).
post
(
activityHost
+
"/sign/contract/getReward"
);
try
{
//
try{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
,
"/sign/contract/getReward接口请求失败"
);
//
Assert.assertEquals(response.jsonPath().getString("success"), "true", "/sign/contract/getReward接口请求失败");
}
catch
(
Exception
e
)
{
//
} catch (Exception e) {
throw
new
Exception
(
"/sign/contract/getReward接口失败,返回信息"
+
response
.
asString
());
//
throw new Exception("/sign/contract/getReward接口失败,返回信息" + response.asString());
}
catch
(
Error
er
)
{
//
} catch (Error er) {
throw
new
Exception
(
"/sign/contract/getReward接口失败,返回信息:"
+
response
.
asString
());
//
throw new Exception("/sign/contract/getReward接口失败,返回信息:" + response.asString());
}
//
}
return
response
;
return
response
;
}
}
...
...
src/test/java/ui/cases/test.java
View file @
84115892
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