Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oto
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
龚小红
oto
Commits
9aea1576
Commit
9aea1576
authored
Aug 04, 2021
by
龚小红
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更改xml文件
parent
eb1a8b4c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
0 deletions
+74
-0
NoviceGuidance.java
...est/java/com/kjj/cases/assistant/menu/NoviceGuidance.java
+74
-0
No files found.
src/test/java/com/kjj/cases/assistant/menu/NoviceGuidance.java
0 → 100644
View file @
9aea1576
package
com
.
kjj
.
cases
.
assistant
.
menu
;
import
com.kjj.cases.admin.Authorization
;
import
com.kjj.utils.NetworkUtils
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
import
org.testng.annotations.*
;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLEncoder
;
import
java.util.HashMap
;
import
java.util.Map
;
import
static
com
.
kjj
.
config
.
BasicConfig
.*;
import
static
com
.
kjj
.
utils
.
BaseUtils
.*;
public
class
NoviceGuidance
implements
Authorization
{
private
int
userId
;
//小葡萄的用户id
private
int
sellerId
;
//小葡萄的销售id
private
static
final
NetworkUtils
network
=
NetworkUtils
.
getInstance
();
@BeforeClass
public
void
setUp
(){
ssoLogin
();
}
@Test
(
description
=
"禁用代理人小葡萄"
,
priority
=
1
)
public
void
禁用代理人小葡萄
()
throws
UnsupportedEncodingException
{
//找到小葡萄的用户id
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
String
name
=
URLEncoder
.
encode
(
"小葡萄"
,
"utf-8"
);
params
.
put
(
"sellerName"
,
name
);
params
.
put
(
"sellerId"
,
""
);
params
.
put
(
"pageNo"
,
1
);
params
.
put
(
"pageSize"
,
10
);
params
.
put
(
"agentId"
,
""
);
params
.
put
(
"phoneNumber"
,
""
);
Response
response
=
network
.
getResponse
(
params
,
MANAGER_vipList
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
MANAGER_vipList
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
MANAGER_vipList
,
"返回数据为空"
,
response
.
body
().
asString
()));
userId
=
response
.
jsonPath
().
getInt
(
"data.list.get(0).userId"
);
sellerId
=
response
.
jsonPath
().
getInt
(
"data.list.get(0).userVersionList.get(0).sellerId"
);
int
userVersion
=
response
.
jsonPath
().
getInt
(
"data.list.get(0).userVersionList.get(0).userVersion"
);
long
vipBeginTime
=
response
.
jsonPath
().
getLong
(
"data.list.get(0).userVersionList.get(0).vipBeginTime"
);
long
vipEndTime
=
response
.
jsonPath
().
getLong
(
"data.list.get(0).userVersionList.get(0).vipEndTime"
);
//禁用账号
params
.
put
(
"userId"
,
userId
);
response
=
network
.
postResponse
(
params
,
MANAGER_updateTypeOrDate
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
boolean
result
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
USINGSTRATAGY_strategyDetail
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
result
,
network
.
message
(
params
,
USINGSTRATAGY_strategyDetail
,
"返回数据为空"
,
response
.
body
().
asString
()));
//切换会员
params
.
put
(
"reason"
,
"测试账号"
);
params
.
put
(
"sellerId"
,
sellerId
);
params
.
put
(
"userVersion"
,
userVersion
);
params
.
put
(
"vipEndDate"
,
10
);
params
.
put
(
"vipStartDate"
,
""
);
params
.
put
(
"vipType"
,
2
);
response
=
network
.
getResponse
(
params
,
MANAGER_updateTypeOrDate
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
result
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
USINGSTRATAGY_strategyDetail
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
result
,
network
.
message
(
params
,
USINGSTRATAGY_strategyDetail
,
"返回数据为空"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"小葡萄进入首页"
,
priority
=
2
)
public
void
小葡萄进入首页
(){
}
}
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