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
7c8a0b40
Commit
7c8a0b40
authored
Dec 11, 2018
by
赵然
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zr
parent
86458923
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
83 deletions
+37
-83
瓜分积分_AccessTest.java
src/test/java/http/cases/PkMoudleTest/瓜分积分_AccessTest.java
+34
-8
配置测试_AccessTest.java
src/test/java/http/cases/PkMoudleTest/配置测试_AccessTest.java
+3
-12
PkMoudleService.java
src/test/java/http/service/Activity/PkMoudleService.java
+0
-63
No files found.
src/test/java/http/cases/PkMoudleTest/瓜分积分_AccessTest.java
View file @
7c8a0b40
...
...
@@ -10,34 +10,59 @@ package http.cases.PkMoudleTest;
import
base.DuibaLog
;
import
base.DuibaTestBase
;
import
http.service.Activity.Pk
Moudle
Service
;
import
http.service.Activity.PkService
;
import
http.service.hd.PkDevelopService
;
import
io.restassured.response.Response
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.testng.Assert
;
import
org.testng.annotations.Test
;
import
java.math.BigDecimal
;
public
class
瓜分积分
_AccessTest
extends
DuibaTestBase
{
@Autowired
PkMoudleService
pkMoudleService
;
@Autowired
PkDevelopService
pkDevelopService
;
@Autowired
PkService
pkService
;
private
DuibaLog
logger
=
DuibaLog
.
getLogger
();
private
static
Integer
uid
=
5029
;
//
private
static
Integer
uid
=
5029
;
private
static
String
betId
;
private
static
String
optionId1
;
private
static
String
optionId2
;
//
@Test
@Test
public
void
创建
PK
活动
()
throws
Exception
{
Response
response
=
pkDevelopService
.
betEditor
(
"21771"
,
"4"
,
null
,
"30"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"desc"
),
"成功"
,
"创建组件化pk活动失败"
);
response
=
pkService
.
getBetList
(
uid
);
response
.
print
();
int
i
=
30
;
while
(
i
>
0
&&(
response
.
jsonPath
().
getString
(
"data.unbetList"
).
equals
(
"[]"
))){
Thread
.
sleep
(
5000
);
response
=
pkService
.
getBetList
(
uid
);
response
.
print
();
i
--;
}
betId
=
response
.
jsonPath
().
getString
(
"data.unbetList[0].betConfig.id"
);
optionId1
=
response
.
jsonPath
().
getString
(
"data.unbetList[0].options[0].optionId"
);
optionId2
=
response
.
jsonPath
().
getString
(
"data.unbetList[0].options[1].optionId"
);
if
(
betId
.
equals
(
null
)){
throw
new
Exception
(
"楼层查询pk组件活动失败!"
);
}
else
{
logger
.
info
(
"pk活动id 为:"
+
betId
+
",投注id1为:"
+
optionId1
+
",投注id2为:"
+
optionId2
);
}
}
@Test
(
dependsOnMethods
=
{
"创建PK活动"
})
public
void
投注
()
throws
Exception
{
// Response res1 = pkService.doJoin(user01,newBetId,optionsIds.get(0));
// Response res2 = pkService.doJoin(user02,newBetId,optionsIds.get(1));
}
}
\ No newline at end of file
src/test/java/http/cases/PkMoudleTest/配置测试_AccessTest.java
View file @
7c8a0b40
...
...
@@ -10,27 +10,18 @@ package http.cases.PkMoudleTest;
import
base.DuibaLog
;
import
base.DuibaTestBase
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
http.model.BetMobileVo
;
import
http.service.Activity.PkMoudleService
;
import
http.service.Activity.PkService
;
import
io.restassured.response.Response
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.testng.Assert
;
import
org.testng.annotations.Test
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
public
class
配置测试
_AccessTest
extends
DuibaTestBase
{
@Autowired
PkMoudleService
pkMoudleService
;
PkService
pkService
;
private
DuibaLog
logger
=
DuibaLog
.
getLogger
();
private
static
Integer
uid
=
5028
;
//
...
...
@@ -39,7 +30,7 @@ public class 配置测试_AccessTest extends DuibaTestBase {
@Test
public
void
配置测试
()
throws
Exception
{
Response
response
=
pk
Moudle
Service
.
getBetList
(
uid
);
Response
response
=
pkService
.
getBetList
(
uid
);
response
.
print
();
//分积分配置获取
...
...
src/test/java/http/service/Activity/PkMoudleService.java
deleted
100644 → 0
View file @
86458923
/**
* Copyright (C), 2015-2018
* FileName: PkService
* Author: qianwenjun
* Date: 2018/8/5 11:37
* Description:
*/
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
;
/**
* @author zhaoran
* @create 2018/12/10
* @since 1.0.0
*/
@Service
public
class
PkMoudleService
{
@Autowired
Authorization
authorization
;
@Value
(
"${activity.host}"
)
String
activityHost
;
private
DuibaLog
logger
=
DuibaLog
.
getLogger
();
public
Response
getBetList
(
Integer
uid
)
throws
Exception
{
String
url
=
activityHost
+
"/betActivity2/list"
;
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"pageNo"
,
"1"
);
map
.
put
(
"pageSize"
,
"6"
);
Response
response
=
given
().
cookies
(
authorization
.
dafuwengLogin
(
uid
)).
params
(
map
).
get
(
url
);
// response.prettyPrint();
try
{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
);
}
catch
(
Exception
e
){
throw
new
Exception
(
"手机端获取pk列表接口失败,返回信息:"
+
response
.
asString
());
}
catch
(
Error
er
){
throw
new
Exception
(
"手机端获取pk列表接口失败,返回信息:"
+
response
.
asString
());
}
return
response
;
}
}
\ No newline at end of file
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