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
826f229d
Commit
826f229d
authored
Dec 06, 2018
by
赵然
Browse files
Options
Browse Files
Download
Plain Diff
zr
parents
027eeafe
81f452ba
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
256 additions
and
97 deletions
+256
-97
补给站.java
src/test/java/http/cases/SaasDeveloperTest/补给站.java
+0
-0
设置_应用信息_DuibaTest.java
.../java/http/cases/SaasDeveloperTest/设置_应用信息_DuibaTest.java
+1
-1
Authorization.java
src/test/java/http/service/Authorization.java
+14
-8
DeveloperBJZ.java
src/test/java/http/service/Saas/DeveloperBJZ.java
+241
-88
No files found.
src/test/java/http/cases/SaasDeveloperTest/补给站.java
View file @
826f229d
This diff is collapsed.
Click to expand it.
src/test/java/http/cases/SaasDeveloperTest/设置_应用信息_DuibaTest.java
View file @
826f229d
...
...
@@ -32,7 +32,7 @@ public class 设置_应用信息_DuibaTest extends AbstractTestNGSpringContextTe
updateAppInfoService
.
UpdateAppInfo
(
appId
,
unitName
,
earnCreditsUrl
,
creditsDetailUrl
,
isDecimalOpen
);
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.creditsDetailUrl"
),
"https://www.baidu.com/s?ie=utf-8&f=8&rsv_bp=1&tn=baidu&wd=www.baidu.com"
,
"校验积分明细链接失败"
);
logger
.
info
(
"保存应用信息成功"
);
...
...
src/test/java/http/service/Authorization.java
View file @
826f229d
...
...
@@ -249,6 +249,7 @@ public class Authorization {
public
Map
hdLoginSaas
(
String
appId
){
int
i
=
10
;
logger
.
info
(
"hdCookiesSaasByApp cookies:"
+
hdCookiesSaasByApp
.
toString
());
Map
<
String
,
String
>
hdCookies
=
hdCookiesSaasByApp
.
get
(
appId
);
while
((
hdCookies
==
null
||
hdCookies
.
size
()==
0
)&&
i
>
0
)
{
Response
token
=
this
.
hdGetToken
();
...
...
@@ -260,16 +261,21 @@ public class Authorization {
paras
.
put
(
"redirect"
,
"/redirectApp"
);
paras
.
put
(
"isAutoLogin"
,
"true"
);
Response
response
=
given
().
cookies
(
cookies
).
params
(
paras
).
post
(
url
);
Map
<
String
,
String
>
map
=
response
.
getCookies
();
logger
.
info
(
"cookies:"
+
map
.
toString
());
hdCookies
=
new
HashMap
<>(
response
.
getCookies
());
//取消安全校验
hdCookies
.
remove
(
"csrf_token"
);
hdCookies
.
put
(
"appId"
,
appId
);
hdCookies
.
put
(
"duibaAppId"
,
appId
);
hdCookiesSaasByApp
.
put
(
appId
,
hdCookies
);
if
(
hdCookies
!=
null
||
hdCookies
.
size
()!=
0
)
{
//取消安全校验
hdCookies
.
remove
(
"csrf_token"
);
hdCookies
.
put
(
"appId"
,
appId
);
hdCookies
.
put
(
"duibaAppId"
,
appId
);
logger
.
info
(
"cookies2:"
+
hdCookies
.
toString
());
hdCookiesSaasByApp
.
put
(
appId
,
hdCookies
);
}
i
--;
}
return
hdCookies
;
}
//密码为duibaduiba123
...
...
@@ -287,7 +293,7 @@ public class Authorization {
paras
.
put
(
"isAutoLogin"
,
"true"
);
Response
response
=
given
().
cookies
(
cookies
).
params
(
paras
).
post
(
url
);
hdCookies
=
new
HashMap
<>(
response
.
getCookies
());
if
(
hdCookies
==
null
||
hdCookies
.
size
()=
=
0
){
if
(
hdCookies
!=
null
||
hdCookies
.
size
()!
=
0
){
hdCookies
.
remove
(
"csrf_token"
);
hdCookiesCommon
.
put
(
email
,
hdCookies
);
}
...
...
@@ -317,7 +323,7 @@ public class Authorization {
Response
response
=
given
().
cookies
(
cookies
).
params
(
paras
).
post
(
url
);
response
.
prettyPrint
();
hdCookies
=
new
HashMap
<>(
response
.
getCookies
());
if
(
hdCookies
==
null
||
hdCookies
.
size
()=
=
0
){
if
(
hdCookies
!=
null
||
hdCookies
.
size
()!
=
0
){
hdCookies
.
remove
(
"csrf_token"
);
hdCookiesCommon
.
put
(
account
,
hdCookies
);
}
...
...
src/test/java/http/service/Saas/DeveloperBJZ.java
View file @
826f229d
This diff is collapsed.
Click to expand it.
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