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
a2339be4
Commit
a2339be4
authored
Dec 14, 2018
by
qwj-github
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
http://gitlab2.dui88.com/mabo/test-platform
into develop
parents
c39e4608
a7549de4
Changes
21
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
145 additions
and
46 deletions
+145
-46
Postman.java
src/test/java/base/Postman.java
+14
-13
ActiveGroup_FloorTest.java
...test/java/http/cases/FloorTest/ActiveGroup_FloorTest.java
+2
-2
Banner_FloorTest.java
src/test/java/http/cases/FloorTest/Banner_FloorTest.java
+2
-2
Coupon_FloorTest.java
src/test/java/http/cases/FloorTest/Coupon_FloorTest.java
+2
-2
Game_FloorTest.java
src/test/java/http/cases/FloorTest/Game_FloorTest.java
+2
-2
Icon_FloorTest.java
src/test/java/http/cases/FloorTest/Icon_FloorTest.java
+4
-4
Item_FloorTest.java
src/test/java/http/cases/FloorTest/Item_FloorTest.java
+2
-2
Seckill_FloorTest.java
src/test/java/http/cases/FloorTest/Seckill_FloorTest.java
+2
-2
Showcase_FloorTest.java
src/test/java/http/cases/FloorTest/Showcase_FloorTest.java
+2
-2
Sign_FloorTest.java
src/test/java/http/cases/FloorTest/Sign_FloorTest.java
+2
-2
瓜分积分_作弊瓜分_AccessTest.java
...st/java/http/cases/PkMoudleTest/瓜分积分_作弊瓜分_AccessTest.java
+1
-1
瓜分积分_实际瓜分_AccessTest.java
...st/java/http/cases/PkMoudleTest/瓜分积分_实际瓜分_AccessTest.java
+1
-1
瓜分积分_实际瓜分_主胜方_AccessTest.java
...ava/http/cases/PkMoudleTest/瓜分积分_实际瓜分_主胜方_AccessTest.java
+0
-0
瓜分红包_作弊瓜分_AccessTest.java
...st/java/http/cases/PkMoudleTest/瓜分红包_作弊瓜分_AccessTest.java
+1
-1
瓜分红包_实际瓜分_AccessTest.java
...st/java/http/cases/PkMoudleTest/瓜分红包_实际瓜分_AccessTest.java
+1
-1
Authorization.java
src/test/java/http/service/Authorization.java
+41
-2
PkDevelopService.java
src/test/java/http/service/hd/PkDevelopService.java
+58
-2
优惠券_ExchangeTest_ui.java
src/test/java/ui/cases/Exchange/优惠券_ExchangeTest_ui.java
+1
-1
实物_ExchangeTest_ui.java
src/test/java/ui/cases/Exchange/实物_ExchangeTest_ui.java
+2
-2
支付宝_ExchangeTest_ui.java
src/test/java/ui/cases/Exchange/支付宝_ExchangeTest_ui.java
+2
-2
WebDriverFactory.java
src/test/java/ui/common/WebDriverFactory.java
+3
-0
No files found.
src/test/java/base/Postman.java
View file @
a2339be4
...
@@ -22,13 +22,14 @@ import static io.restassured.RestAssured.given;
...
@@ -22,13 +22,14 @@ import static io.restassured.RestAssured.given;
*/
*/
public
class
Postman
{
public
class
Postman
{
final
static
String
dingdingUrl
=
"https://shark.dui88.com/test/integration"
;
final
static
String
dingdingUrl
=
"https://shark.dui88.com/test/integration"
;
final
static
String
testPlatformUrl
=
"http://
101.37.27.82:8080
/insert"
;
final
static
String
testPlatformUrl
=
"http://
test-run.duibatest.com.cn
/insert"
;
final
static
String
miriaUrl
=
"http://miria-aliyun.duibatest.com.cn/autoTest/finish"
;
final
static
String
miriaUrl
=
"http://miria-aliyun.duibatest.com.cn/autoTest/finish"
;
final
static
String
miriaUrlTesting
=
"http://miria-aliyun.duibatest.com.cn/autoTest/testing"
;
final
static
String
miriaUrlTesting
=
"http://miria-aliyun.duibatest.com.cn/autoTest/testing"
;
final
static
String
miriaUrlFindTestApp
=
"http://miria-aliyun.duibatest.com.cn/autoTest/findTestApp"
;
final
static
String
miriaUrlFindTestApp
=
"http://miria-aliyun.duibatest.com.cn/autoTest/findTestApp"
;
//dingdingUrl="http://www.json.cn/";
//dingdingUrl="http://www.json.cn/";
private
static
Logger
logger
=
LogManager
.
getLogger
(
Postman
.
class
);
// private static Logger logger = LogManager.getLogger(Postman.class);
public
static
DuibaLog
logger
=
DuibaLog
.
getLogger
();
public
static
void
send2Dingding
(
Map
result
){
public
static
void
send2Dingding
(
Map
result
){
System
.
out
.
println
(
"Dingding:"
+
result
);
System
.
out
.
println
(
"Dingding:"
+
result
);
RestAssuredConfig
config
=
RestAssured
.
config
();
RestAssuredConfig
config
=
RestAssured
.
config
();
...
@@ -44,7 +45,7 @@ public class Postman {
...
@@ -44,7 +45,7 @@ public class Postman {
String
[]
name
=
DingdingResult
.
name
;
String
[]
name
=
DingdingResult
.
name
;
result
.
put
(
"names"
,
name
);
result
.
put
(
"names"
,
name
);
response
=
given
().
contentType
(
ContentType
.
JSON
).
body
(
result
).
post
(
dingdingUrl
);
response
=
given
().
contentType
(
ContentType
.
JSON
).
body
(
result
).
post
(
dingdingUrl
);
System
.
out
.
println
(
"钉钉重试响应数据:"
+
response
.
asString
());
logger
.
info
(
"钉钉重试响应数据:"
+
response
.
asString
());
}
}
...
@@ -52,28 +53,28 @@ public class Postman {
...
@@ -52,28 +53,28 @@ public class Postman {
public
static
void
sendTestPlatform
(
Map
result
){
public
static
void
sendTestPlatform
(
Map
result
){
Response
response
=
given
().
contentType
(
ContentType
.
JSON
).
body
(
result
).
post
(
testPlatformUrl
);
Response
response
=
given
().
contentType
(
ContentType
.
JSON
).
body
(
result
).
post
(
testPlatformUrl
);
System
.
out
.
println
(
"自动化数据收集平台响应数据:"
+
response
.
asString
());
logger
.
info
(
"自动化数据收集平台响应数据:"
+
response
.
asString
());
}
}
public
static
void
sendFinish
(
Map
result
){
public
static
void
sendFinish
(
Map
result
){
Response
response
=
given
().
params
(
result
).
get
(
miriaUrl
);
Response
response
=
given
().
params
(
result
).
get
(
miriaUrl
);
System
.
out
.
println
(
"jobName:"
+
result
.
get
(
"jobName"
));
logger
.
info
(
"jobName:"
+
result
.
get
(
"jobName"
));
System
.
out
.
println
(
"miriaUrl:"
+
miriaUrl
);
logger
.
info
(
"miriaUrl:"
+
miriaUrl
);
System
.
out
.
println
(
"miria响应结果:"
+
response
.
asString
());
logger
.
info
(
"miria响应结果:"
+
response
.
asString
());
}
}
public
static
void
sendTesting
(
Map
result
){
public
static
void
sendTesting
(
Map
result
){
Response
response
=
given
().
params
(
result
).
get
(
miriaUrlTesting
);
Response
response
=
given
().
params
(
result
).
get
(
miriaUrlTesting
);
System
.
out
.
println
(
"jobName:"
+
result
.
get
(
"jobName"
));
logger
.
info
(
"jobName:"
+
result
.
get
(
"jobName"
));
System
.
out
.
println
(
"miriaUrl:"
+
miriaUrlTesting
);
logger
.
info
(
"miriaUrl:"
+
miriaUrlTesting
);
System
.
out
.
println
(
"miria响应结果:"
+
response
.
asString
());
logger
.
info
(
"miria响应结果:"
+
response
.
asString
());
}
}
public
static
String
sendFindTestApp
(
Map
result
){
public
static
String
sendFindTestApp
(
Map
result
){
Response
response
=
given
().
params
(
result
).
get
(
miriaUrlFindTestApp
);
Response
response
=
given
().
params
(
result
).
get
(
miriaUrlFindTestApp
);
System
.
out
.
println
(
"jobName:"
+
result
.
get
(
"jobName"
));
logger
.
info
(
"jobName:"
+
result
.
get
(
"jobName"
));
System
.
out
.
println
(
"miriaUrl:"
+
miriaUrlTesting
);
logger
.
info
(
"miriaUrl:"
+
miriaUrlFindTestApp
);
System
.
out
.
println
(
"miria响应结果:"
+
response
.
asString
());
logger
.
info
(
"miria响应结果:"
+
response
.
asString
());
String
value
=
response
.
jsonPath
().
getString
(
"value"
);
String
value
=
response
.
jsonPath
().
getString
(
"value"
);
return
value
;
return
value
;
}
}
...
...
src/test/java/http/cases/FloorTest/ActiveGroup_FloorTest.java
View file @
a2339be4
...
@@ -387,7 +387,7 @@ public class ActiveGroup_FloorTest extends DuibaTestBase {
...
@@ -387,7 +387,7 @@ public class ActiveGroup_FloorTest extends DuibaTestBase {
}
}
@Test
@Test
(
dependsOnMethods
=
{
"A_创建活动楼层皮肤"
})
public
void
B_
手机端活动
()
throws
Exception
{
public
void
B_
手机端活动
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
logger
.
info
(
df
.
format
(
new
Date
()));
...
@@ -444,7 +444,7 @@ public class ActiveGroup_FloorTest extends DuibaTestBase {
...
@@ -444,7 +444,7 @@ public class ActiveGroup_FloorTest extends DuibaTestBase {
}
}
@Test
@Test
(
dependsOnMethods
=
{
"B_手机端活动"
})
public
void
C_
删除活动楼层皮肤
()
throws
Exception
{
public
void
C_
删除活动楼层皮肤
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
...
...
src/test/java/http/cases/FloorTest/Banner_FloorTest.java
View file @
a2339be4
...
@@ -154,7 +154,7 @@ public class Banner_FloorTest extends DuibaTestBase {
...
@@ -154,7 +154,7 @@ public class Banner_FloorTest extends DuibaTestBase {
}
}
@Test
@Test
(
dependsOnMethods
=
{
"A_创建banner楼层皮肤"
})
public
void
B_banner
楼层活动校验
()
throws
Exception
{
public
void
B_banner
楼层活动校验
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
...
@@ -212,7 +212,7 @@ public class Banner_FloorTest extends DuibaTestBase {
...
@@ -212,7 +212,7 @@ public class Banner_FloorTest extends DuibaTestBase {
}
}
@Test
@Test
(
dependsOnMethods
=
{
"B_banner楼层活动校验"
})
public
void
C_banner
商品校验
()
throws
Exception
{
public
void
C_banner
商品校验
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
...
...
src/test/java/http/cases/FloorTest/Coupon_FloorTest.java
View file @
a2339be4
...
@@ -342,7 +342,7 @@ public class Coupon_FloorTest extends DuibaTestBase {
...
@@ -342,7 +342,7 @@ public class Coupon_FloorTest extends DuibaTestBase {
}
}
@Test
@Test
(
dependsOnMethods
=
{
"A_创建优惠券楼层皮肤"
})
public
void
B_
优惠券手机端
()
throws
Exception
{
public
void
B_
优惠券手机端
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
logger
.
info
(
df
.
format
(
new
Date
()));
...
@@ -392,7 +392,7 @@ public class Coupon_FloorTest extends DuibaTestBase {
...
@@ -392,7 +392,7 @@ public class Coupon_FloorTest extends DuibaTestBase {
}
}
@Test
@Test
(
dependsOnMethods
=
{
"B_优惠券手机端"
})
public
void
C_
删除优惠券楼层皮肤
()
throws
Exception
{
public
void
C_
删除优惠券楼层皮肤
()
throws
Exception
{
...
...
src/test/java/http/cases/FloorTest/Game_FloorTest.java
View file @
a2339be4
...
@@ -230,7 +230,7 @@ public class Game_FloorTest extends DuibaTestBase {
...
@@ -230,7 +230,7 @@ public class Game_FloorTest extends DuibaTestBase {
}
}
@Test
@Test
(
dependsOnMethods
=
{
"A_创建游戏楼层皮肤"
})
public
void
B_
游戏手机端
()
throws
Exception
{
public
void
B_
游戏手机端
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
logger
.
info
(
df
.
format
(
new
Date
()));
...
@@ -272,7 +272,7 @@ public class Game_FloorTest extends DuibaTestBase {
...
@@ -272,7 +272,7 @@ public class Game_FloorTest extends DuibaTestBase {
}
}
@Test
@Test
(
dependsOnMethods
=
{
"B_游戏手机端"
})
public
void
C_
删除游戏楼层皮肤
()
throws
Exception
{
public
void
C_
删除游戏楼层皮肤
()
throws
Exception
{
...
...
src/test/java/http/cases/FloorTest/Icon_FloorTest.java
View file @
a2339be4
...
@@ -222,7 +222,7 @@ public class Icon_FloorTest extends DuibaTestBase {
...
@@ -222,7 +222,7 @@ public class Icon_FloorTest extends DuibaTestBase {
}
}
@Test
@Test
(
dependsOnMethods
=
{
"A_创建icon楼层皮肤"
})
public
void
B_icon
添加图标
()
throws
Exception
{
public
void
B_icon
添加图标
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
...
@@ -296,7 +296,7 @@ public class Icon_FloorTest extends DuibaTestBase {
...
@@ -296,7 +296,7 @@ public class Icon_FloorTest extends DuibaTestBase {
}
}
@Test
@Test
(
dependsOnMethods
=
{
"B_icon添加图标"
})
public
void
C_icon
编辑图标
()
throws
Exception
{
public
void
C_icon
编辑图标
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
logger
.
info
(
df
.
format
(
new
Date
()));
...
@@ -352,7 +352,7 @@ public class Icon_FloorTest extends DuibaTestBase {
...
@@ -352,7 +352,7 @@ public class Icon_FloorTest extends DuibaTestBase {
Assert
.
assertEquals
(
map
.
get
(
"logo"
),
"//yun.dui88.com/images/201806/9lz5ifre0h.png"
,
"今日必抢logo校验错误"
);
Assert
.
assertEquals
(
map
.
get
(
"logo"
),
"//yun.dui88.com/images/201806/9lz5ifre0h.png"
,
"今日必抢logo校验错误"
);
}
}
@Test
@Test
(
dependsOnMethods
=
{
"C_icon编辑图标"
})
public
void
D_icon
删除图标
()
throws
Exception
{
public
void
D_icon
删除图标
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
logger
.
info
(
df
.
format
(
new
Date
()));
...
@@ -388,7 +388,7 @@ public class Icon_FloorTest extends DuibaTestBase {
...
@@ -388,7 +388,7 @@ public class Icon_FloorTest extends DuibaTestBase {
}
}
@Test
@Test
(
dependsOnMethods
=
{
"D_icon删除图标"
})
public
void
E_
删除
icon
楼层皮肤
()
throws
Exception
{
public
void
E_
删除
icon
楼层皮肤
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
logger
.
info
(
df
.
format
(
new
Date
()));
...
...
src/test/java/http/cases/FloorTest/Item_FloorTest.java
View file @
a2339be4
...
@@ -362,7 +362,7 @@ public class Item_FloorTest extends DuibaTestBase {
...
@@ -362,7 +362,7 @@ public class Item_FloorTest extends DuibaTestBase {
}
}
@Test
@Test
(
dependsOnMethods
=
{
"A_item创建楼层皮肤"
})
public
void
B_item
手机端
()
throws
Exception
{
public
void
B_item
手机端
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
...
@@ -404,7 +404,7 @@ public class Item_FloorTest extends DuibaTestBase {
...
@@ -404,7 +404,7 @@ public class Item_FloorTest extends DuibaTestBase {
}
}
@Test
@Test
(
dependsOnMethods
=
{
"B_item手机端"
})
public
void
C_item
删除楼层皮肤
()
throws
Exception
{
public
void
C_item
删除楼层皮肤
()
throws
Exception
{
...
...
src/test/java/http/cases/FloorTest/Seckill_FloorTest.java
View file @
a2339be4
...
@@ -806,7 +806,7 @@ public class Seckill_FloorTest extends DuibaTestBase {
...
@@ -806,7 +806,7 @@ public class Seckill_FloorTest extends DuibaTestBase {
response
=
floorService
.
switchOpenState
(
authorization
.
ssoLogin
(),
skinId
,
"true"
);
response
=
floorService
.
switchOpenState
(
authorization
.
ssoLogin
(),
skinId
,
"true"
);
}
}
@Test
@Test
(
dependsOnMethods
=
{
"A_Seckill创建楼层皮肤"
})
public
void
B_Seckill
手机端
()
throws
Exception
{
public
void
B_Seckill
手机端
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
logger
.
info
(
df
.
format
(
new
Date
()));
...
@@ -849,7 +849,7 @@ public class Seckill_FloorTest extends DuibaTestBase {
...
@@ -849,7 +849,7 @@ public class Seckill_FloorTest extends DuibaTestBase {
}
}
@Test
@Test
(
dependsOnMethods
=
{
"B_Seckill手机端"
})
public
void
C_Seckill
删除楼层皮肤
()
throws
Exception
{
public
void
C_Seckill
删除楼层皮肤
()
throws
Exception
{
...
...
src/test/java/http/cases/FloorTest/Showcase_FloorTest.java
View file @
a2339be4
...
@@ -244,7 +244,7 @@ public class Showcase_FloorTest extends DuibaTestBase {
...
@@ -244,7 +244,7 @@ public class Showcase_FloorTest extends DuibaTestBase {
}
}
@Test
@Test
(
dependsOnMethods
=
{
"A_Showcase创建楼层皮肤"
})
public
void
B_Showcase
手机端
()
throws
Exception
{
public
void
B_Showcase
手机端
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
...
@@ -289,7 +289,7 @@ public class Showcase_FloorTest extends DuibaTestBase {
...
@@ -289,7 +289,7 @@ public class Showcase_FloorTest extends DuibaTestBase {
}
}
@Test
@Test
(
dependsOnMethods
=
{
"B_Showcase手机端"
})
public
void
C_Showcase
删除楼层皮肤
()
throws
Exception
{
public
void
C_Showcase
删除楼层皮肤
()
throws
Exception
{
...
...
src/test/java/http/cases/FloorTest/Sign_FloorTest.java
View file @
a2339be4
...
@@ -510,7 +510,7 @@ public class Sign_FloorTest extends DuibaTestBase {
...
@@ -510,7 +510,7 @@ public class Sign_FloorTest extends DuibaTestBase {
}
}
@Test
@Test
(
dependsOnMethods
=
{
"A_sign创建楼层皮肤"
})
public
void
B_sign
手机端
()
throws
Exception
{
public
void
B_sign
手机端
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
logger
.
info
(
df
.
format
(
new
Date
()));
...
@@ -545,7 +545,7 @@ public class Sign_FloorTest extends DuibaTestBase {
...
@@ -545,7 +545,7 @@ public class Sign_FloorTest extends DuibaTestBase {
}
}
@Test
@Test
(
dependsOnMethods
=
{
"B_sign手机端"
})
public
void
C_sign
删除楼层皮肤
()
throws
Exception
{
public
void
C_sign
删除楼层皮肤
()
throws
Exception
{
...
...
src/test/java/http/cases/PkMoudleTest/瓜分积分_作弊瓜分.java
→
src/test/java/http/cases/PkMoudleTest/瓜分积分_作弊瓜分
_AccessTest
.java
View file @
a2339be4
...
@@ -25,7 +25,7 @@ import org.testng.annotations.Test;
...
@@ -25,7 +25,7 @@ import org.testng.annotations.Test;
import
java.util.Map
;
import
java.util.Map
;
public
class
瓜分积分
_
作弊瓜分
extends
DuibaTestBase
{
public
class
瓜分积分
_
作弊瓜分
_AccessTest
extends
DuibaTestBase
{
@Autowired
@Autowired
PkDevelopService
pkDevelopService
;
PkDevelopService
pkDevelopService
;
...
...
src/test/java/http/cases/PkMoudleTest/瓜分积分_实际瓜分.java
→
src/test/java/http/cases/PkMoudleTest/瓜分积分_实际瓜分
_AccessTest
.java
View file @
a2339be4
...
@@ -27,7 +27,7 @@ import java.util.List;
...
@@ -27,7 +27,7 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Map
;
public
class
瓜分积分
_
实际瓜分
extends
DuibaTestBase
{
public
class
瓜分积分
_
实际瓜分
_AccessTest
extends
DuibaTestBase
{
@Autowired
@Autowired
PkDevelopService
pkDevelopService
;
PkDevelopService
pkDevelopService
;
...
...
src/test/java/http/cases/PkMoudleTest/瓜分积分_实际瓜分_主胜方_AccessTest.java
0 → 100644
View file @
a2339be4
This diff is collapsed.
Click to expand it.
src/test/java/http/cases/PkMoudleTest/瓜分红包_作弊瓜分.java
→
src/test/java/http/cases/PkMoudleTest/瓜分红包_作弊瓜分
_AccessTest
.java
View file @
a2339be4
...
@@ -27,7 +27,7 @@ import java.text.DecimalFormat;
...
@@ -27,7 +27,7 @@ import java.text.DecimalFormat;
import
java.util.Map
;
import
java.util.Map
;
public
class
瓜分红包
_
作弊瓜分
extends
DuibaTestBase
{
public
class
瓜分红包
_
作弊瓜分
_AccessTest
extends
DuibaTestBase
{
@Autowired
@Autowired
PkDevelopService
pkDevelopService
;
PkDevelopService
pkDevelopService
;
...
...
src/test/java/http/cases/PkMoudleTest/瓜分红包_实际瓜分.java
→
src/test/java/http/cases/PkMoudleTest/瓜分红包_实际瓜分
_AccessTest
.java
View file @
a2339be4
...
@@ -27,7 +27,7 @@ import java.text.DecimalFormat;
...
@@ -27,7 +27,7 @@ import java.text.DecimalFormat;
import
java.util.Map
;
import
java.util.Map
;
public
class
瓜分红包
_
实际瓜分
extends
DuibaTestBase
{
public
class
瓜分红包
_
实际瓜分
_AccessTest
extends
DuibaTestBase
{
@Autowired
@Autowired
PkDevelopService
pkDevelopService
;
PkDevelopService
pkDevelopService
;
...
...
src/test/java/http/service/Authorization.java
View file @
a2339be4
...
@@ -56,6 +56,7 @@ public class Authorization {
...
@@ -56,6 +56,7 @@ public class Authorization {
private
static
Map
<
String
,
String
>
hdCookiesMabo
;
private
static
Map
<
String
,
String
>
hdCookiesMabo
;
private
static
Map
<
String
,
String
>
hdCookiesSaas
;
private
static
Map
<
String
,
String
>
hdCookiesSaas
;
private
static
Map
<
String
,
Map
>
hdCookiesSaasByApp
=
new
ConcurrentHashMap
<>();
private
static
Map
<
String
,
Map
>
hdCookiesSaasByApp
=
new
ConcurrentHashMap
<>();
private
static
Map
<
String
,
Map
>
hdCookiesSaasNew
=
new
ConcurrentHashMap
<>();
private
static
Map
<
String
,
Map
>
hdCookiesCommon
=
new
ConcurrentHashMap
<>();
private
static
Map
<
String
,
Map
>
hdCookiesCommon
=
new
ConcurrentHashMap
<>();
private
static
Map
<
String
,
String
>
openbsCookies
;
private
static
Map
<
String
,
String
>
openbsCookies
;
private
Map
<
String
,
String
>
ssoCookies
=
null
;
private
Map
<
String
,
String
>
ssoCookies
=
null
;
...
@@ -241,6 +242,7 @@ public class Authorization {
...
@@ -241,6 +242,7 @@ public class Authorization {
return
hdCookiesMabo
;
return
hdCookiesMabo
;
}
}
//密码为wxs123456 (支持账号 wxs@duiba.com.cn,尽量不要用)
public
Map
hdLoginSaas
(){
public
Map
hdLoginSaas
(){
int
i
=
10
;
int
i
=
10
;
while
((
hdCookiesSaas
==
null
||
hdCookiesSaas
.
size
()==
0
)&&
i
>
0
)
{
while
((
hdCookiesSaas
==
null
||
hdCookiesSaas
.
size
()==
0
)&&
i
>
0
)
{
...
@@ -261,6 +263,7 @@ public class Authorization {
...
@@ -261,6 +263,7 @@ public class Authorization {
return
hdCookiesSaas
;
return
hdCookiesSaas
;
}
}
//密码为wxs123456 (支持 账号为wxs@duiba.com.cn 下的任意appId)
public
Map
hdLoginSaas
(
String
appId
){
public
Map
hdLoginSaas
(
String
appId
){
int
i
=
10
;
int
i
=
10
;
logger
.
info
(
"hdCookiesSaasByApp cookies:"
+
hdCookiesSaasByApp
.
toString
());
logger
.
info
(
"hdCookiesSaasByApp cookies:"
+
hdCookiesSaasByApp
.
toString
());
...
@@ -292,7 +295,44 @@ public class Authorization {
...
@@ -292,7 +295,44 @@ public class Authorization {
logger
.
info
(
"hdCookiesSaasByApp cookies集合:"
+
hdCookiesSaasByApp
.
toString
());
logger
.
info
(
"hdCookiesSaasByApp cookies集合:"
+
hdCookiesSaasByApp
.
toString
());
return
hdCookies
;
return
hdCookies
;
}
}
//密码为duibaduiba123
//密码为duibaduiba123(支持任意手机账号下的任意APPId)
public
Map
hdLoginSaasNew
(
String
account
,
String
appId
){
String
path
=
"/doLoginNew"
;
int
i
=
10
;
logger
.
info
(
"hdCookiesSaasByApp cookies:"
+
hdCookiesSaasNew
.
toString
());
Map
<
String
,
String
>
hdCookies
=
hdCookiesSaasNew
.
get
(
appId
);
while
((
hdCookies
==
null
||
hdCookies
.
size
()==
0
)&&
i
>
0
)
{
Response
token
=
this
.
hdGetToken
();
String
url
=
PROTOCOL
+
hdHost
+
path
;
Map
<
String
,
String
>
cookies
=
token
.
getCookies
();
Map
<
String
,
String
>
paras
=
new
HashMap
<>();
paras
.
put
(
"account"
,
account
);
paras
.
put
(
"password"
,
SecurityUtils
.
getMD5
(
"Dct7xTdGPvbUL1eOtSWoB9ySZNY="
+
from
(
token
.
asString
()).
getString
(
"data.loginsToken"
)));
paras
.
put
(
"redirect"
,
"/redirectApp"
);
paras
.
put
(
"isAutoLogin"
,
"true"
);
paras
.
put
(
"validate"
,
"22"
);
Response
response
=
given
().
cookies
(
cookies
).
params
(
paras
).
post
(
url
);
response
.
prettyPrint
();
Map
<
String
,
String
>
map
=
response
.
getCookies
();
logger
.
info
(
"cookies:"
+
map
.
toString
());
hdCookies
=
new
HashMap
<>(
response
.
getCookies
());
if
(
hdCookies
!=
null
||
hdCookies
.
size
()!=
0
)
{
//取消安全校验
hdCookies
.
remove
(
"csrf_token"
);
hdCookies
.
put
(
"appId"
,
appId
);
hdCookies
.
put
(
"duibaAppId"
,
appId
);
logger
.
info
(
"cookies2:"
+
hdCookies
.
toString
());
hdCookiesSaasNew
.
put
(
appId
,
hdCookies
);
}
i
--;
}
logger
.
info
(
"hdCookiesSaasByApp cookies集合:"
+
hdCookiesSaasNew
.
toString
());
return
hdCookies
;
}
//密码为duibaduiba123 (支持任意邮箱账号)
public
Map
hdLoginCommon
(
String
email
){
public
Map
hdLoginCommon
(
String
email
){
int
i
=
10
;
int
i
=
10
;
Map
<
String
,
String
>
hdCookies
=
hdCookiesCommon
.
get
(
email
);
Map
<
String
,
String
>
hdCookies
=
hdCookiesCommon
.
get
(
email
);
...
@@ -344,7 +384,6 @@ public class Authorization {
...
@@ -344,7 +384,6 @@ public class Authorization {
i
--;
i
--;
}
}
//取消安全校验
//取消安全校验
// logger.info(hdCookies);
// logger.info(hdCookies);
return
hdCookies
;
return
hdCookies
;
}
}
...
...
src/test/java/http/service/hd/PkDevelopService.java
View file @
a2339be4
...
@@ -40,8 +40,6 @@ public class PkDevelopService {
...
@@ -40,8 +40,6 @@ public class PkDevelopService {
@Autowired
@Autowired
Authorization
authorization
;
Authorization
authorization
;
private
DuibaLog
logger
=
DuibaLog
.
getLogger
();
public
Response
betEditor
(
String
appId
,
String
bonusType
,
String
bonusAmount
,
String
creditsValue
,
String
shareExp
)
throws
Exception
{
public
Response
betEditor
(
String
appId
,
String
bonusType
,
String
bonusAmount
,
String
creditsValue
,
String
shareExp
)
throws
Exception
{
String
data
=
PublicMethod
.
data
();
String
data
=
PublicMethod
.
data
();
...
@@ -100,6 +98,64 @@ public class PkDevelopService {
...
@@ -100,6 +98,64 @@ public class PkDevelopService {
return
betResponse
;
return
betResponse
;
}
}
public
Response
betEditor_right
(
String
account
,
String
appId
,
String
bonusType
,
String
bonusAmount
,
String
creditsValue
,
String
shareExp
,
String
loser
,
String
winner
)
throws
Exception
{
String
data
=
PublicMethod
.
data
();
String
url
=
"http://"
+
hdHost
+
"/visual-editor/bet/post"
;
//创建投注项
List
<
BetOptionVo
>
betOptionVoList
=
new
ArrayList
<>();
BetOptionVo
betOptionVo1
=
new
BetOptionVo
();
BetOptionVo
betOptionVo2
=
new
BetOptionVo
();
betOptionVo1
.
setOptionImg
(
"//yun.dui88.com/images/201812/75j84chnkg.jpg"
);
betOptionVo1
.
setOptionName
(
"1"
);
betOptionVo1
.
setRightAnswer
(
loser
);
betOptionVo2
.
setOptionImg
(
"//yun.dui88.com/images/201812/4f51vmzfpu.png"
);
betOptionVo2
.
setOptionName
(
"2"
);
betOptionVo2
.
setRightAnswer
(
winner
);
betOptionVoList
.
add
(
betOptionVo1
);
betOptionVoList
.
add
(
betOptionVo2
);
//创建活动配置
List
<
BetDevelopVo
>
betDevelopVoList
=
new
ArrayList
<>();
BetDevelopVo
betDevelopVo
=
new
BetDevelopVo
();
betDevelopVo
.
setBetOptionDtoList
(
betOptionVoList
);
betDevelopVo
.
setBetType
(
"1"
);
betDevelopVo
.
setBonusType
(
bonusType
);
if
(
bonusType
.
equals
(
"2"
)){
betDevelopVo
.
setTitle
(
"【自动化】组件pk_瓜分红包"
+
data
);
}
else
if
(
bonusType
.
equals
(
"4"
)){
betDevelopVo
.
setTitle
(
"【自动化】组件pk_瓜分积分"
+
data
);
}
betDevelopVo
.
setBonusAmount
(
bonusAmount
);
betDevelopVo
.
setConfigStatus
(
"3"
);
betDevelopVo
.
setCreditsValue
(
creditsValue
);
betDevelopVo
.
setEndTime
(
"2029-12-31 00:00"
);
betDevelopVo
.
setShareExp
(
shareExp
);
betDevelopVoList
.
add
(
betDevelopVo
);
Map
<
String
,
Object
>
para
=
new
HashMap
<>();
para
.
put
(
"list"
,
betDevelopVoList
);
para
.
put
(
"rules"
,
"自动化规则自动化规则"
);
para
.
put
(
"title"
,
"组件pk自动化_主胜方"
);
JSONObject
jsonParam
=
JSONObject
.
parseObject
(
JSON
.
toJSONString
(
para
));
Response
betResponse
=
given
().
contentType
(
"application/json;charset=UTF-8"
).
cookies
(
authorization
.
hdLoginSaasNew
(
account
,
appId
)).
body
(
jsonParam
).
post
(
url
);
betResponse
.
prettyPrint
();
try
{
Assert
.
assertEquals
(
betResponse
.
jsonPath
().
getString
(
"success"
),
"true"
);
}
catch
(
Exception
e
){
throw
new
Exception
(
"创建pk活动接口失败,返回信息:"
+
betResponse
.
asString
());
}
catch
(
Error
er
){
throw
new
Exception
(
"创建pk活动接口失败,返回信息:"
+
betResponse
.
asString
());
}
return
betResponse
;
}
public
Response
doDraw
()
throws
Exception
{
public
Response
doDraw
()
throws
Exception
{
String
url
=
"http://"
+
ManagerHost
+
"/newmanager/betOpenPrize/doDraw"
;
String
url
=
"http://"
+
ManagerHost
+
"/newmanager/betOpenPrize/doDraw"
;
Map
<
String
,
Object
>
para
=
new
HashMap
<>();
Map
<
String
,
Object
>
para
=
new
HashMap
<>();
...
...
src/test/java/ui/cases/Exchange/优惠券_ExchangeTest_ui.java
View file @
a2339be4
...
@@ -14,7 +14,7 @@ public class 优惠券_ExchangeTest_ui extends DuibaBaseUi{
...
@@ -14,7 +14,7 @@ public class 优惠券_ExchangeTest_ui extends DuibaBaseUi{
@Test
@Test
public
void
优惠券兑换
_
正常流程
()
throws
Exception
{
public
void
优惠券兑换
_
正常流程
()
throws
Exception
{
open
(
"http://dafuweng.duibatest.com.cn/user/index"
);
open
(
"http://dafuweng.duibatest.com.cn/user/index"
);
clickByTextEqual
(
"
4762
"
);
clickByTextEqual
(
"
5074
"
);
switchWindow
();
switchWindow
();
sleep
(
2
);
sleep
(
2
);
clickByClass
(
"btn-close"
);
clickByClass
(
"btn-close"
);
...
...
src/test/java/ui/cases/Exchange/实物_ExchangeTest_ui.java
View file @
a2339be4
...
@@ -11,8 +11,8 @@ import static com.codeborne.selenide.Selenide.open;
...
@@ -11,8 +11,8 @@ import static com.codeborne.selenide.Selenide.open;
public
class
实物
_ExchangeTest_ui
extends
DuibaBaseUi
{
public
class
实物
_ExchangeTest_ui
extends
DuibaBaseUi
{
@Test
@Test
public
void
实物兑换
_
正常流程
()
throws
Exception
{
public
void
实物兑换
_
正常流程
()
throws
Exception
{
open
(
"http://
47.97.214.108
/user/index"
);
open
(
"http://
dafuweng.duibatest.com.cn
/user/index"
);
clickByTextEqual
(
"
4762
"
);
clickByTextEqual
(
"
5074
"
);
switchWindow
();
switchWindow
();
sleep
(
2
);
sleep
(
2
);
clickByClass
(
"btn-close"
);
clickByClass
(
"btn-close"
);
...
...
src/test/java/ui/cases/Exchange/支付宝_ExchangeTest_ui.java
View file @
a2339be4
...
@@ -11,8 +11,8 @@ import static com.codeborne.selenide.Selenide.open;
...
@@ -11,8 +11,8 @@ import static com.codeborne.selenide.Selenide.open;
public
class
支付宝
_ExchangeTest_ui
extends
DuibaBaseUi
{
public
class
支付宝
_ExchangeTest_ui
extends
DuibaBaseUi
{
@Test
@Test
public
void
支付宝
_
正常流程
()
throws
Exception
{
public
void
支付宝
_
正常流程
()
throws
Exception
{
open
(
"http://
47.97.214.108
/user/index"
);
open
(
"http://
dafuweng.duibatest.com.cn
/user/index"
);
clickByTextEqual
(
"
4762
"
);
clickByTextEqual
(
"
5074
"
);
switchWindow
();
switchWindow
();
sleep
(
2
);
sleep
(
2
);
clickByClass
(
"btn-close"
);
clickByClass
(
"btn-close"
);
...
...
src/test/java/ui/common/WebDriverFactory.java
View file @
a2339be4
...
@@ -71,6 +71,9 @@ public class WebDriverFactory {
...
@@ -71,6 +71,9 @@ public class WebDriverFactory {
String
OS
=
prop
.
getProperty
(
"os.name"
);
String
OS
=
prop
.
getProperty
(
"os.name"
);
boolean
bl
=
OS
.
startsWith
(
"Mac"
);
boolean
bl
=
OS
.
startsWith
(
"Mac"
);
String
basePath
=
WebDriverType
.
class
.
getClassLoader
().
getResource
(
""
).
getPath
();
String
basePath
=
WebDriverType
.
class
.
getClassLoader
().
getResource
(
""
).
getPath
();
basePath
=
basePath
.
replaceAll
(
"%20"
,
" "
);
//repaceAll("%20",'');
File
directory
=
new
File
(
""
);
System
.
out
.
println
(
"-----路径:"
+
directory
.
getAbsolutePath
());
RemoteWebDriver
browser
=
null
;
RemoteWebDriver
browser
=
null
;
String
driverPath
=
null
;
String
driverPath
=
null
;
switch
(
driverType
){
switch
(
driverType
){
...
...
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