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
6a07135d
Commit
6a07135d
authored
Dec 06, 2018
by
赵然
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'zr' into develop
parents
53c3b4ee
7827738e
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
61 additions
and
7 deletions
+61
-7
补给站_商品_DuibaTest.java
...t/java/http/cases/SaasDeveloperTest/补给站_商品_DuibaTest.java
+2
-2
设置_应用信息_DuibaTest.java
.../java/http/cases/SaasDeveloperTest/设置_应用信息_DuibaTest.java
+1
-0
预览单品抽奖_AccessTest.java
.../java/http/cases/SingleLotteryTest/预览单品抽奖_AccessTest.java
+33
-0
Authorization.java
src/test/java/http/service/Authorization.java
+1
-1
DeveloperBJZ.java
src/test/java/http/service/Saas/DeveloperBJZ.java
+3
-3
UpdateAppInfoService.java
src/test/java/http/service/Saas/UpdateAppInfoService.java
+1
-1
SigninService.java
src/test/java/http/service/hd/SigninService.java
+20
-0
No files found.
src/test/java/http/cases/SaasDeveloperTest/补给站_商品_DuibaTest.java
View file @
6a07135d
...
@@ -19,9 +19,9 @@ public class 补给站_商品_DuibaTest extends AbstractTestNGSpringContextTests
...
@@ -19,9 +19,9 @@ public class 补给站_商品_DuibaTest extends AbstractTestNGSpringContextTests
private
DuibaLog
logger
=
DuibaLog
.
getLogger
();
private
DuibaLog
logger
=
DuibaLog
.
getLogger
();
//至尊版app
//至尊版app
String
appId
=
"19515"
;
private
static
String
appId
=
"19515"
;
//旗舰版app
//旗舰版app
String
appId2
=
"21695"
;
private
static
String
appId2
=
"21695"
;
@Test
(
description
=
"至尊版app添加、上架至尊版实物"
)
@Test
(
description
=
"至尊版app添加、上架至尊版实物"
)
...
...
src/test/java/http/cases/SaasDeveloperTest/设置_应用信息_DuibaTest.java
View file @
6a07135d
...
@@ -31,6 +31,7 @@ public class 设置_应用信息_DuibaTest extends AbstractTestNGSpringContextTe
...
@@ -31,6 +31,7 @@ public class 设置_应用信息_DuibaTest extends AbstractTestNGSpringContextTe
String
unitName
=
isDecimalOpen
?
"元"
:
"积分"
;
String
unitName
=
isDecimalOpen
?
"元"
:
"积分"
;
updateAppInfoService
.
UpdateAppInfo
(
appId
,
unitName
,
earnCreditsUrl
,
creditsDetailUrl
,
isDecimalOpen
);
updateAppInfoService
.
UpdateAppInfo
(
appId
,
unitName
,
earnCreditsUrl
,
creditsDetailUrl
,
isDecimalOpen
);
Thread
.
sleep
(
1000
);
Response
response2
=
updateAppInfoService
.
appInfo
(
appId
);
Response
response2
=
updateAppInfoService
.
appInfo
(
appId
);
Assert
.
assertEquals
(
response2
.
jsonPath
().
getString
(
"data.name"
),
"(saas自动化)至尊版"
,
"校验应用名称失败"
);
Assert
.
assertEquals
(
response2
.
jsonPath
().
getString
(
"data.name"
),
"(saas自动化)至尊版"
,
"校验应用名称失败"
);
Assert
.
assertEquals
(
response2
.
jsonPath
().
getString
(
"data.earnCreditsLetter"
),
"积分文案&2"
,
"校验积分文案失败"
);
Assert
.
assertEquals
(
response2
.
jsonPath
().
getString
(
"data.earnCreditsLetter"
),
"积分文案&2"
,
"校验积分文案失败"
);
...
...
src/test/java/http/cases/SingleLotteryTest/预览单品抽奖_AccessTest.java
0 → 100644
View file @
6a07135d
package
http
.
cases
.
SingleLotteryTest
;
import
base.DuibaLog
;
import
base.DuibaTestBase
;
import
http.service.hd.SigninService
;
import
io.restassured.internal.assertion.Assertion
;
import
io.restassured.response.Response
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.testng.Assert
;
import
org.testng.annotations.Test
;
import
utils.MatcherString
;
/**
* Created by zhaoran on 2018/6/8.
*/
public
class
预览单品抽奖
_AccessTest
extends
DuibaTestBase
{
@Autowired
SigninService
signinService
;
private
static
DuibaLog
logger
=
DuibaLog
.
getLogger
();
@Test
public
void
预览单抽
()
throws
Exception
{
Response
response
=
signinService
.
preview
(
"18714"
,
"3"
,
"2772"
,
"36732"
,
"zhaoran@duiba.com.cn"
);
String
url
=
response
.
jsonPath
().
getString
(
"data.url"
);
logger
.
info
(
"预览url为:"
+
url
);
Assert
.
assertEquals
(
url
.
contains
(
"http://activity.m.duibatest.com.cn/autoLogin/autologin?appKey=BDqysEMghRqpDWAaQu9S4rLihHm&uid=duiba-preview-user"
),
true
,
"校验是否展示马上使用失败"
);
}
}
\ No newline at end of file
src/test/java/http/service/Authorization.java
View file @
6a07135d
...
@@ -275,7 +275,7 @@ public class Authorization {
...
@@ -275,7 +275,7 @@ public class Authorization {
i
--;
i
--;
}
}
logger
.
info
(
"hdCookiesSaasByApp cookies集合:"
+
hdCookiesSaasByApp
.
toString
());
return
hdCookies
;
return
hdCookies
;
}
}
//密码为duibaduiba123
//密码为duibaduiba123
...
...
src/test/java/http/service/Saas/DeveloperBJZ.java
View file @
6a07135d
...
@@ -124,12 +124,12 @@ public class DeveloperBJZ {
...
@@ -124,12 +124,12 @@ public class DeveloperBJZ {
}
}
//旗舰版app上架:至尊特权商品
//旗舰版app上架:至尊特权商品
public
Response
ajaxDirectUp2
(
String
appId
2
,
String
itemIds
)
throws
Exception
{
public
Response
ajaxDirectUp2
(
String
appId
,
String
itemIds
)
throws
Exception
{
String
url
=
"http://"
+
hdHost
+
"/devRepo/ajaxDirectUp"
;
String
url
=
"http://"
+
hdHost
+
"/devRepo/ajaxDirectUp"
;
Map
<
String
,
String
>
map
=
new
HashMap
<>();
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"appId"
,
appId
2
);
map
.
put
(
"appId"
,
appId
);
map
.
put
(
"itemIds"
,
itemIds
);
map
.
put
(
"itemIds"
,
itemIds
);
Response
response
=
given
().
contentType
(
"application/x-www-form-urlencoded;charset=UTF-8"
).
cookies
(
authorization
.
hdLoginSaas
(
appId
2
)).
params
(
map
).
post
(
url
);
Response
response
=
given
().
contentType
(
"application/x-www-form-urlencoded;charset=UTF-8"
).
cookies
(
authorization
.
hdLoginSaas
(
appId
)).
params
(
map
).
post
(
url
);
response
.
prettyPrint
();
response
.
prettyPrint
();
try
{
try
{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"desc"
),
"至尊版专享"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"desc"
),
"至尊版专享"
);
...
...
src/test/java/http/service/Saas/UpdateAppInfoService.java
View file @
6a07135d
...
@@ -34,7 +34,7 @@ public class UpdateAppInfoService {
...
@@ -34,7 +34,7 @@ public class UpdateAppInfoService {
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"appId"
,
appId
);
map
.
put
(
"appId"
,
appId
);
map
.
put
(
"creditsRate"
,
"100"
);
map
.
put
(
"creditsRate"
,
"100"
);
map
.
put
(
"appName"
,
"(saas
)接口自动化应用
"
);
map
.
put
(
"appName"
,
"(saas
自动化)至尊版
"
);
map
.
put
(
"appTitle"
,
"自动化测试使用"
);
map
.
put
(
"appTitle"
,
"自动化测试使用"
);
map
.
put
(
"logoVal"
,
"//yun.dui88.com/images/201809/svieibjtn0.png"
);
map
.
put
(
"logoVal"
,
"//yun.dui88.com/images/201809/svieibjtn0.png"
);
map
.
put
(
"unitName"
,
unitName
);
map
.
put
(
"unitName"
,
unitName
);
...
...
src/test/java/http/service/hd/SigninService.java
View file @
6a07135d
...
@@ -82,4 +82,24 @@ public class SigninService {
...
@@ -82,4 +82,24 @@ public class SigninService {
}
}
return
response
;
return
response
;
}
}
//活动预览
public
Response
preview
(
String
appId
,
String
type
,
String
sourceId
,
String
activityId
,
String
email
)
throws
Exception
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"appId"
,
appId
);
map
.
put
(
"type"
,
type
);
map
.
put
(
"sourceId"
,
sourceId
);
map
.
put
(
"activityId"
,
activityId
);
Response
response
=
given
().
cookies
(
authorization
.
hdLoginCommon
(
email
)).
params
(
map
).
post
(
"http://"
+
hdHost
+
"/activity/preview"
);
response
.
prettyPrint
();
try
{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
);
}
catch
(
Exception
e
){
throw
new
Exception
(
"/activity/preview接口失败,返回信息:"
+
response
.
asString
());
}
catch
(
Error
er
){
throw
new
Exception
(
"/activity/preview接口失败,返回信息:"
+
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