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
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
package
ui
.
cases
;
package
ui
.
cases
;
import
base.DuibaBaseUi
;
import
base.DuibaBases
;
import
base.DuibaBases
;
import
base.DuibaLog
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.codeborne.selenide.WebDriverRunner
;
import
com.codeborne.selenide.testng.ScreenShooter
;
import
http.service.Authorization
;
import
http.service.Authorization
;
import
io.restassured.response.Response
;
import
io.restassured.response.Response
;
import
org.apache.commons.io.FileUtils
;
import
org.openqa.selenium.By
;
import
org.openqa.selenium.OutputType
;
import
org.openqa.selenium.TakesScreenshot
;
import
org.openqa.selenium.WebDriver
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.testng.Assert
;
import
org.testng.ITestResult
;
import
org.testng.Reporter
;
import
org.testng.annotations.AfterMethod
;
import
org.testng.annotations.DataProvider
;
import
org.testng.annotations.DataProvider
;
import
org.testng.annotations.Listeners
;
import
org.testng.annotations.Test
;
import
org.testng.annotations.Test
;
import
ui.common.ProxyFactory
;
import
ui.common.StatusCheckor
;
import
java.net.MalformedURLException
;
import
ui.common.WebDriverFactory
;
import
java.rmi.Naming
;
import
ui.common.WebDriverType
;
import
java.rmi.NotBoundException
;
import
utils.MatcherString
;
import
java.rmi.RemoteException
;
import
java.io.File
;
import
java.io.IOException
;
import
java.sql.SQLException
;
import
java.sql.SQLException
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.locks.Lock
;
import
java.util.concurrent.Executor
;
import
java.util.concurrent.locks.ReentrantLock
;
import
java.util.concurrent.Executors
;
import
java.util.concurrent.ThreadPoolExecutor
;
import
static
com
.
codeborne
.
selenide
.
Condition
.
text
;
import
static
com
.
codeborne
.
selenide
.
Selenide
.
$
;
import
static
com
.
codeborne
.
selenide
.
Selenide
.
$
;
import
static
com
.
codeborne
.
selenide
.
Selenide
.
open
;
import
static
com
.
codeborne
.
selenide
.
Selenide
.
open
;
import
static
com
.
codeborne
.
selenide
.
Selenide
.
sleep
;
import
static
com
.
codeborne
.
selenide
.
Selenide
.
sleep
;
...
@@ -247,9 +230,9 @@ public class test extends DuibaBases {
...
@@ -247,9 +230,9 @@ public class test extends DuibaBases {
@Test
@Test
public
void
红包广场
(){
public
void
红包广场
(){
// Map<String,String> map = new HashMap<>();
// Map<String,String> map = new HashMap<>();
// map.put("opId","22
489
");
// map.put("opId","22
877
");
// map.put("shareCode","11n
rktm
");
// map.put("shareCode","11n
szu
");
// map.put("uid","
4885
");
// map.put("uid","
1
");
//
//
// String url = "http://activity.m.duibatest.com.cn";
// String url = "http://activity.m.duibatest.com.cn";
//
//
...
@@ -257,7 +240,10 @@ public class test extends DuibaBases {
...
@@ -257,7 +240,10 @@ public class test extends DuibaBases {
// header.put("User-Agent","windows mabo");
// header.put("User-Agent","windows mabo");
//
//
//
//
// Map<String,String> cookie = new HashMap<>(authorization.dafuwengLoginTest(4885));
// Map<String,String> cookie = new HashMap<>(authorization.dafuwengLoginTest(1));
// cookie.put("_duibaServiceGroupKey","miria-938");
//
//
// //有拦截日志,接口返回true
// //有拦截日志,接口返回true
// Response response = given().headers(header).cookies(cookie).params(map).post(url+"/aaw/lotterySquare/shareLinkClick");
// Response response = given().headers(header).cookies(cookie).params(map).post(url+"/aaw/lotterySquare/shareLinkClick");
// response.prettyPrint();
// response.prettyPrint();
...
@@ -266,9 +252,9 @@ public class test extends DuibaBases {
...
@@ -266,9 +252,9 @@ public class test extends DuibaBases {
Map
<
String
,
String
>
map
=
new
HashMap
<>();
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"opId"
,
"22
489
"
);
map
.
put
(
"opId"
,
"22
877
"
);
map
.
put
(
"shareCode"
,
"11n
rktm
"
);
map
.
put
(
"shareCode"
,
"11n
szu
"
);
map
.
put
(
"acitivityId"
,
"
59
"
);
map
.
put
(
"acitivityId"
,
"
1
"
);
String
url
=
"http://activity.m.duibatest.com.cn"
;
String
url
=
"http://activity.m.duibatest.com.cn"
;
...
@@ -276,7 +262,8 @@ public class test extends DuibaBases {
...
@@ -276,7 +262,8 @@ public class test extends DuibaBases {
header
.
put
(
"User-Agent"
,
"windows mabo"
);
header
.
put
(
"User-Agent"
,
"windows mabo"
);
Map
<
String
,
String
>
cookie
=
new
HashMap
<>(
authorization
.
dafuwengLoginTest
(
4885
));
Map
<
String
,
String
>
cookie
=
new
HashMap
<>(
authorization
.
dafuwengLoginTest
(
1
));
cookie
.
put
(
"_duibaServiceGroupKey"
,
"miria-938"
);
//有拦截日志,接口返回true
//有拦截日志,接口返回true
Response
response
=
given
().
headers
(
header
).
cookies
(
cookie
).
params
(
map
).
post
(
url
+
"/aaw/lotterySquare/bind"
);
Response
response
=
given
().
headers
(
header
).
cookies
(
cookie
).
params
(
map
).
post
(
url
+
"/aaw/lotterySquare/bind"
);
response
.
prettyPrint
();
response
.
prettyPrint
();
...
@@ -290,36 +277,37 @@ public class test extends DuibaBases {
...
@@ -290,36 +277,37 @@ public class test extends DuibaBases {
@Test
@Test
public
void
砍价
(){
public
void
砍价
(){
// Map<String,String> map = new HashMap<>();
// map.put("goodsId","6");
// map.put("activityId","1");
//
// String url = "http://activity.m.duibatest.com.cn";
//
// Map<String,String> header = new HashMap<>();
// header.put("User-Agent","windows mabo");
//
//
// Map<String,String> cookie = new HashMap<>(authorization.dafuwengLoginTest(4662));
// Response response = given().headers(header).cookies(cookie).params(map).post(url+"/aaw/bargainActivity/doBargain");
// response.prettyPrint();
Map
<
String
,
String
>
map
=
new
HashMap
<>();
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"
orderId"
,
"24
6"
);
map
.
put
(
"
goodsId"
,
"
6"
);
map
.
put
(
"activityId"
,
"1"
);
map
.
put
(
"activityId"
,
"1"
);
String
url
=
"http://activity.m.duibatest.com.cn"
;
String
url
=
"http://activity.m.duibatest.com.cn"
;
Map
<
String
,
String
>
header
=
new
HashMap
<>();
Map
<
String
,
String
>
header
=
new
HashMap
<>();
//
header.put("User-Agent","windows mabo");
header
.
put
(
"User-Agent"
,
"windows mabo"
);
Map
<
String
,
String
>
cookie
=
new
HashMap
<>(
authorization
.
dafuwengLoginTest
(
4817
));
Map
<
String
,
String
>
cookie
=
new
HashMap
<>(
authorization
.
dafuwengLoginTest
(
4662
));
Response
response
=
given
().
headers
(
header
).
cookies
(
cookie
).
params
(
map
).
post
(
url
+
"/aaw/bargainActivity/helpBargain"
);
cookie
.
put
(
"_duibaServiceGroupKey"
,
"miria-938"
);
Response
response
=
given
().
headers
(
header
).
cookies
(
cookie
).
params
(
map
).
post
(
url
+
"/aaw/bargainActivity/doBargain"
);
response
.
prettyPrint
();
response
.
prettyPrint
();
// Map<String,String> map = new HashMap<>();
// map.put("orderId","246");
// map.put("activityId","1");
//
// String url = "http://activity.m.duibatest.com.cn";
//
// Map<String,String> header = new HashMap<>();
//// header.put("User-Agent","windows mabo");
//
//
// Map<String,String> cookie = new HashMap<>(authorization.dafuwengLoginTest(4817));
// Response response = given().headers(header).cookies(cookie).params(map).post(url+"/aaw/bargainActivity/helpBargain");
// response.prettyPrint();
}
}
@Test
@Test
...
@@ -443,9 +431,28 @@ public class test extends DuibaBases {
...
@@ -443,9 +431,28 @@ public class test extends DuibaBases {
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"id"
,
"90"
);
// map.put("signDate",getTime(0));
String
url
=
"http://activity.m.duibatest.com.cn"
;
Map
<
String
,
String
>
header
=
new
HashMap
<>();
header
.
put
(
"User-Agent"
,
"windows mabo"
);
Map
<
String
,
String
>
cookie
=
new
HashMap
<>(
authorization
.
dafuwengLoginTest
(
6
));
cookie
.
put
(
"_duibaServiceGroupKey"
,
"miria-938"
);
Response
response
=
given
().
headers
(
header
).
cookies
(
cookie
).
params
(
map
).
get
(
url
+
"/signactivity/doSign"
);
response
.
prettyPrint
();
// Map<String,String> map = new HashMap<>();
// Map<String,String> map = new HashMap<>();
// map.put("id","90");
// map.put("id","90");
//
//
map.put("signDate",getTime(0));
// map.put("signDate",getTime(0));
//
//
// String url = "http://activity.m.duibatest.com.cn";
// String url = "http://activity.m.duibatest.com.cn";
//
//
...
@@ -454,43 +461,45 @@ public class test extends DuibaBases {
...
@@ -454,43 +461,45 @@ public class test extends DuibaBases {
//
//
//
//
// Map<String,String> cookie = new HashMap<>(authorization.dafuwengLoginTest(6));
// Map<String,String> cookie = new HashMap<>(authorization.dafuwengLoginTest(6));
// Response response = given().headers(header).cookies(cookie).params(map).get(url+"/signactivity/
do
Sign");
// Response response = given().headers(header).cookies(cookie).params(map).get(url+"/signactivity/
re
Sign");
// response.prettyPrint();
// response.prettyPrint();
}
Map
<
String
,
String
>
map
=
new
HashMap
<>();
@Test
map
.
put
(
"id"
,
"90"
);
public
void
契约签到
(){
map
.
put
(
"signDate"
,
getTime
(
0
));
String
url
=
"http://activity.m.duibatest.com.cn"
;
Map
<
String
,
String
>
header
=
new
HashMap
<>();
header
.
put
(
"User-Agent"
,
"windows mabo"
);
Map
<
String
,
String
>
cookie
=
new
HashMap
<>(
authorization
.
dafuwengLoginTest
(
6
));
Response
response
=
given
().
headers
(
header
).
cookies
(
cookie
).
params
(
map
).
get
(
url
+
"/signactivity/reSign"
);
response
.
prettyPrint
();
}
@Test
public
void
契约签到
(){
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"activityId"
,
"149"
);
map
.
put
(
"betAmount"
,
"100"
);
String
url
=
"http://activity.m.duibatest.com.cn"
;
Map
<
String
,
String
>
header
=
new
HashMap
<>();
header
.
put
(
"User-Agent"
,
"windows mabo"
);
Map
<
String
,
String
>
cookie
=
new
HashMap
<>(
authorization
.
dafuwengLoginTest
(
2
));
cookie
.
put
(
"_duibaServiceGroupKey"
,
"miria-938"
);
Response
response
=
given
().
headers
(
header
).
cookies
(
cookie
).
params
(
map
).
get
(
url
+
"/sign/contract/doJoin"
);
response
.
prettyPrint
();
// Map<String,String> map = new HashMap<>();
// Map<String,String> map = new HashMap<>();
// map.put("activityId","149");
// map.put("activityId","149");
// map.put("betAmount","100");
//
//
// String url = "http://activity.m.duibatest.com.cn";
// String url = "http://activity.m.duibatest.com.cn";
//
//
...
@@ -499,14 +508,13 @@ public class test extends DuibaBases {
...
@@ -499,14 +508,13 @@ public class test extends DuibaBases {
//
//
//
//
// Map<String,String> cookie = new HashMap<>(authorization.dafuwengLoginTest(2));
// Map<String,String> cookie = new HashMap<>(authorization.dafuwengLoginTest(2));
// Response response = given().headers(header).cookies(cookie).params(map).get(url+"/sign/contract/do
Joi
n");
// Response response = given().headers(header).cookies(cookie).params(map).get(url+"/sign/contract/do
Sig
n");
// response.prettyPrint();
// response.prettyPrint();
// Map<String,String> map = new HashMap<>();
// Map<String,String> map = new HashMap<>();
// map.put("
activityId","149
");
// map.put("
contractId","3123
");
//
//
// String url = "http://activity.m.duibatest.com.cn";
// String url = "http://activity.m.duibatest.com.cn";
//
//
...
@@ -514,27 +522,12 @@ public class test extends DuibaBases {
...
@@ -514,27 +522,12 @@ public class test extends DuibaBases {
// header.put("User-Agent","windows mabo");
// header.put("User-Agent","windows mabo");
//
//
//
//
// Map<String,String> cookie = new HashMap<>(authorization.dafuwengLoginTest(
2
));
// Map<String,String> cookie = new HashMap<>(authorization.dafuwengLoginTest(
5
));
// Response response = given().headers(header).cookies(cookie).params(map).get(url+"/sign/contract/
doSign
");
// Response response = given().headers(header).cookies(cookie).params(map).get(url+"/sign/contract/
getReward
");
// response.prettyPrint();
// response.prettyPrint();
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"contractId"
,
"3123"
);
String
url
=
"http://activity.m.duibatest.com.cn"
;
Map
<
String
,
String
>
header
=
new
HashMap
<>();
header
.
put
(
"User-Agent"
,
"windows mabo"
);
Map
<
String
,
String
>
cookie
=
new
HashMap
<>(
authorization
.
dafuwengLoginTest
(
5
));
Response
response
=
given
().
headers
(
header
).
cookies
(
cookie
).
params
(
map
).
get
(
url
+
"/sign/contract/getReward"
);
response
.
prettyPrint
();
...
@@ -557,6 +550,7 @@ public class test extends DuibaBases {
...
@@ -557,6 +550,7 @@ public class test extends DuibaBases {
Map
<
String
,
String
>
cookie
=
new
HashMap
<>(
authorization
.
dafuwengLoginTest
(
3580
));
Map
<
String
,
String
>
cookie
=
new
HashMap
<>(
authorization
.
dafuwengLoginTest
(
3580
));
cookie
.
put
(
"_duibaServiceGroupKey"
,
"miria-938"
);
Response
response
=
given
().
headers
(
header
).
cookies
(
cookie
).
params
(
map
).
post
(
url
+
"/signpet/adopte"
);
Response
response
=
given
().
headers
(
header
).
cookies
(
cookie
).
params
(
map
).
post
(
url
+
"/signpet/adopte"
);
response
.
prettyPrint
();
response
.
prettyPrint
();
...
@@ -820,4 +814,82 @@ public class test extends DuibaBases {
...
@@ -820,4 +814,82 @@ public class test extends DuibaBases {
@Test
public
void
日历签到补签
(){
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"id"
,
"90"
);
map
.
put
(
"signDate"
,
getTime
(
0
));
String
url
=
"http://activity.m.duibatest.com.cn"
;
Map
<
String
,
String
>
header
=
new
HashMap
<>();
// header.put("User-Agent","windows mabo");
// Map<String,String> cookie = new HashMap<>(authorization.dafuwengLoginTest(6));
Response
response
=
given
().
get
(
"http://activity.m.duibatest.com.cn/hdtool/duiba?id=35709&appKey=jlg88lyxz7siqtmr&openBs=openbs"
);
response
.
getCookies
();
response
=
given
().
headers
(
header
).
cookies
(
response
.
getCookies
()).
params
(
map
).
get
(
url
+
"/signactivity/reSign"
);
response
.
prettyPrint
();
}
@Test
public
void
契约签到
1
(){
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"activityId"
,
"131"
);
map
.
put
(
"betAmount"
,
"100"
);
String
url
=
"http://activity.m.duibatest.com.cn"
;
Response
response
=
given
().
get
(
"http://activity.m.duibatest.com.cn/hdtool/duiba?id=35709&appKey=jlg88lyxz7siqtmr&openBs=openbs"
);
Map
<
String
,
String
>
cookies
=
response
.
getCookies
();
Response
response1
=
given
().
cookies
(
cookies
).
params
(
map
).
get
(
url
+
"/sign/contract/doJoin"
);
response1
.
prettyPrint
();
Map
<
String
,
String
>
map1
=
new
HashMap
<>();
map1
.
put
(
"activityId"
,
"131"
);
// String url = "http://activity.m.duibatest.com.cn";
// Response response = given().get("http://activity.m.duibatest.com.cn/hdtool/duiba?id=35709&appKey=jlg88lyxz7siqtmr&openBs=openbs");
response
=
given
().
cookies
(
cookies
).
params
(
map1
).
get
(
url
+
"/sign/contract/doSign"
);
response
.
prettyPrint
();
// Map<String,String> map = new HashMap<>();
// map.put("contractId","3123");
//
// String url = "http://activity.m.duibatest.com.cn";
//
// Map<String,String> header = new HashMap<>();
// header.put("User-Agent","windows mabo");
//
//
// Map<String,String> cookie = new HashMap<>(authorization.dafuwengLoginTest(5));
// Response response = given().headers(header).cookies(cookie).params(map).get(url+"/sign/contract/getReward");
// 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