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
3b69493a
Commit
3b69493a
authored
Dec 06, 2018
by
赵然
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zr
parent
879fdeb1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
5 deletions
+58
-5
补给站_商品_DuibaTest.java
...t/java/http/cases/SaasDeveloperTest/补给站_商品_DuibaTest.java
+2
-2
预览单品抽奖_AccessTest.java
.../java/http/cases/SingleLotteryTest/预览单品抽奖_AccessTest.java
+33
-0
DeveloperBJZ.java
src/test/java/http/service/Saas/DeveloperBJZ.java
+3
-3
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 @
3b69493a
...
@@ -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/SingleLotteryTest/预览单品抽奖_AccessTest.java
0 → 100644
View file @
3b69493a
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/Saas/DeveloperBJZ.java
View file @
3b69493a
...
@@ -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/hd/SigninService.java
View file @
3b69493a
...
@@ -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