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
cae7e4cf
Commit
cae7e4cf
authored
Apr 08, 2022
by
龚小红
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'Feature/20220408-gxh' into 'master'
增加权限管理的相关用例 See merge request test-group/kejiji!240
parents
9a2d4c9e
63d06560
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
119 additions
and
18 deletions
+119
-18
Test.xml
src/test/Test.xml
+15
-10
Manager.java
src/test/java/com/kjj/cases/otoseller/Manager.java
+9
-0
Phone.java
src/test/java/com/kjj/cases/otoseller/Phone.java
+19
-0
Work.java
src/test/java/com/kjj/cases/otoseller/Work.java
+48
-1
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+24
-3
BaseUtils.java
src/test/java/com/kjj/utils/BaseUtils.java
+2
-2
JmeterAccountFile.java
src/test/java/com/kjj/utils/JmeterAccountFile.java
+2
-2
No files found.
src/test/Test.xml
View file @
cae7e4cf
...
@@ -15,10 +15,9 @@
...
@@ -15,10 +15,9 @@
<class
name=
"com.kjj.cases.live.liveConfig.SaveLive"
/>
<class
name=
"com.kjj.cases.live.liveConfig.SaveLive"
/>
</classes>
</classes>
</test>
</test>
<test
preserve-order=
"true"
name=
"配置代理人邀约奖励"
>
<test
preserve-order=
"true"
name=
"配置秒杀轮次及秒杀预告"
>
<classes>
<classes>
<class
name=
"com.kjj.cases.live.secondKill.ConfSecondKill
"
/>
<class
name=
"com.kjj.cases.live.inviteReward.ManagerRewardConf
"
/>
</classes>
</classes>
</test>
</test>
...
@@ -28,21 +27,27 @@
...
@@ -28,21 +27,27 @@
</classes>
</classes>
</test>
</test>
<test
preserve-order=
"true"
name=
"助播-开启直播"
>
<test
preserve-order=
"true"
name=
"代理人首页"
>
<classes>
<class
name=
"com.kjj.cases.live.agent.Agent"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"小程序分享"
>
<classes>
<classes>
<class
name=
"com.kjj.cases.live.
anchor.OpenLiv
e"
/>
<class
name=
"com.kjj.cases.live.
liveConfig.Shar
e"
/>
</classes>
</classes>
</test>
</test>
<test
preserve-order=
"true"
name=
"
秒杀到场
"
>
<test
preserve-order=
"true"
name=
"
获取抽奖码校验
"
>
<classes>
<classes>
<class
name=
"com.kjj.cases.live.l
iveConfig.ConnectLiv
e"
/>
<class
name=
"com.kjj.cases.live.l
otteryCode.LotteryCod
e"
/>
</classes>
</classes>
</test>
</test>
<test
preserve-order=
"true"
name=
"
秒杀互动
"
>
<test
preserve-order=
"true"
name=
"
亲友券
"
>
<classes>
<classes>
<class
name=
"com.kjj.cases.live.
secondKill.SecondKill
"
/>
<class
name=
"com.kjj.cases.live.
lottery.RelativeLottery
"
/>
</classes>
</classes>
</test>
</test>
...
...
src/test/java/com/kjj/cases/otoseller/Manager.java
View file @
cae7e4cf
...
@@ -31,7 +31,13 @@ public class Manager {
...
@@ -31,7 +31,13 @@ public class Manager {
Assert
.
assertTrue
(
size
>
0
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_oto_sellerList
,
"销售列表为空"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
size
>
0
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_oto_sellerList
,
"销售列表为空"
,
response
.
body
().
asString
()));
int
workStatus
=
response
.
jsonPath
().
getInt
(
"data.list.find{it.id == "
+
42
+
"}.workStatus"
);
int
workStatus
=
response
.
jsonPath
().
getInt
(
"data.list.find{it.id == "
+
42
+
"}.workStatus"
);
int
assignNewCustPermission
=
response
.
jsonPath
().
getInt
(
"data.list.find{it.id == "
+
42
+
"}.assignNewCustPermission"
);
int
assignRecycleCustPermission
=
response
.
jsonPath
().
getInt
(
"data.list.find{it.id == "
+
42
+
"}.assignRecycleCustPermission"
);
int
callPermission
=
response
.
jsonPath
().
getInt
(
"data.list.find{it.id == "
+
42
+
"}.callPermission"
);
Assert
.
assertEquals
(
workStatus
,
1
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_oto_searchSeller
,
"工作状态错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
workStatus
,
1
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_oto_searchSeller
,
"工作状态错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
assignNewCustPermission
,
1
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_oto_searchSeller
,
"认领新客户及强制分配权限错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
assignRecycleCustPermission
,
1
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_oto_searchSeller
,
"认领回收客户权限错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
callPermission
,
1
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_oto_searchSeller
,
"呼叫权限错误"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"通过销售名称查找销售"
,
priority
=
2
)
@Test
(
description
=
"通过销售名称查找销售"
,
priority
=
2
)
...
@@ -102,6 +108,9 @@ public class Manager {
...
@@ -102,6 +108,9 @@ public class Manager {
params
.
put
(
"sellerStatus"
,
1
);
params
.
put
(
"sellerStatus"
,
1
);
params
.
put
(
"companyId"
,
1
);
params
.
put
(
"companyId"
,
1
);
params
.
put
(
"sellerLevel"
,
1
);
params
.
put
(
"sellerLevel"
,
1
);
params
.
put
(
"workStatus"
,
1
);
params
.
put
(
"assignNewCustPermission"
,
1
);
params
.
put
(
"assignRecycleCustPermission"
,
1
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_oto_saveSeller
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_oto_saveSeller
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertFalse
(
success
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_oto_saveSeller
,
"新增同一手机号销售成功"
,
response
.
body
().
asString
()));
Assert
.
assertFalse
(
success
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_oto_saveSeller
,
"新增同一手机号销售成功"
,
response
.
body
().
asString
()));
...
...
src/test/java/com/kjj/cases/otoseller/Phone.java
0 → 100644
View file @
cae7e4cf
package
com
.
kjj
.
cases
.
otoseller
;
import
com.kjj.cases.admin.Authorization
;
import
com.kjj.utils.NetworkUtils
;
import
org.testng.annotations.BeforeTest
;
import
static
com
.
kjj
.
utils
.
BaseUtils
.
ssoLogin
;
//手机端
public
class
Phone
implements
Authorization
{
private
static
final
NetworkUtils
network
=
NetworkUtils
.
getInstance
();
private
int
sellerId
;
//销售ID
@BeforeTest
public
void
setUp
(){
}
}
src/test/java/com/kjj/cases/otoseller/Work.java
View file @
cae7e4cf
...
@@ -14,8 +14,8 @@ import java.util.Date;
...
@@ -14,8 +14,8 @@ import java.util.Date;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Map
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
SELLER_ID
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
LEADER_ID
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
LEADER_ID
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
SELLER_ID
;
import
static
com
.
kjj
.
utils
.
BaseUtils
.*;
import
static
com
.
kjj
.
utils
.
BaseUtils
.*;
import
static
com
.
kjj
.
utils
.
ThreadSleepUtils
.
sleep
;
import
static
com
.
kjj
.
utils
.
ThreadSleepUtils
.
sleep
;
...
@@ -791,6 +791,53 @@ public class Work implements Authorization {
...
@@ -791,6 +791,53 @@ public class Work implements Authorization {
int
logSize
=
logRes
.
jsonPath
().
getInt
(
"data.list.size()"
);
int
logSize
=
logRes
.
jsonPath
().
getInt
(
"data.list.size()"
);
Assert
.
assertTrue
(
logSize
>
0
,
network
.
message
(
BasicConfig
.
WORK_operation
,
"客户动态隔离失败"
,
logRes
.
body
().
asString
()));
Assert
.
assertTrue
(
logSize
>
0
,
network
.
message
(
BasicConfig
.
WORK_operation
,
"客户动态隔离失败"
,
logRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"关闭总监的新客户认领权限和回收客户认领权限"
,
priority
=
59
)
public
void
关闭总监的新客户认领权限和回收客户认领权限
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"sellerId"
,
LEADER_ID
);
params
.
put
(
"sellerStatus"
,
1
);
params
.
put
(
"callPermission"
,
1
);
params
.
put
(
"workassignNewCustPermissionStatus"
,
0
);
params
.
put
(
"assignRecycleCustPermission"
,
0
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_oto_updatePermission
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
BasicConfig
.
MANAGER_oto_updatePermission
,
"关闭总监的新客户认领权限和回收客户认领权限失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"无新客户认领权限不可查看新客户列表"
,
priority
=
60
)
public
void
无新客户认领权限不可查看新客户列表
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
20
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
WORK_freshList
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertFalse
(
success
,
network
.
message
(
BasicConfig
.
WORK_logout
,
"无新客户认领权限可查看新客户列表"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"无回收客户认领权限不可查看回收客户列表"
,
priority
=
61
)
public
void
无回收客户认领权限不可查看回收客户列表
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
20
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
WORK_recycleList
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertFalse
(
success
,
network
.
message
(
BasicConfig
.
WORK_logout
,
"无回收客户认领权限可查看回收客户列表"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"开启总监的新客户认领权限和回收客户认领权限"
,
priority
=
62
)
public
void
开启总监的新客户认领权限和回收客户认领权限
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"sellerId"
,
LEADER_ID
);
params
.
put
(
"sellerStatus"
,
1
);
params
.
put
(
"callPermission"
,
1
);
params
.
put
(
"workassignNewCustPermissionStatus"
,
1
);
params
.
put
(
"assignRecycleCustPermission"
,
1
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_oto_updatePermission
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
BasicConfig
.
MANAGER_oto_updatePermission
,
"开启总监的新客户认领权限和回收客户认领权限失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"删除客户"
,
priority
=
79
)
@Test
(
description
=
"删除客户"
,
priority
=
79
)
public
void
删除客户
(){
public
void
删除客户
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
...
...
src/test/java/com/kjj/config/BasicConfig.java
View file @
cae7e4cf
...
@@ -1324,9 +1324,9 @@ public class BasicConfig {
...
@@ -1324,9 +1324,9 @@ public class BasicConfig {
public
static
final
String
MANAGER_oto_customerPhone
=
MANAGER_HOST
+
"/kjy/manager/pub/form/customer/customerPhone"
;
public
static
final
String
MANAGER_oto_customerPhone
=
MANAGER_HOST
+
"/kjy/manager/pub/form/customer/customerPhone"
;
public
static
final
String
MANAGER_oto_qaDetail
=
MANAGER_HOST
+
"/kjy/manager/pub/form/customer/qaDetail"
;
public
static
final
String
MANAGER_oto_qaDetail
=
MANAGER_HOST
+
"/kjy/manager/pub/form/customer/qaDetail"
;
public
static
final
String
MANAGER_oto_channelList
=
MANAGER_HOST
+
"/kjy/manager/pub/form/channelList"
;
public
static
final
String
MANAGER_oto_channelList
=
MANAGER_HOST
+
"/kjy/manager/pub/form/channelList"
;
public
static
final
String
MANAGER_oto_updatePermission
=
MANAGER_HOST
+
"/kjy/manager/oto/seller/updatePermission"
;
public
static
final
String
MANAGER_oto_switchDimissionStatus
=
MANAGER_HOST
+
"/kjy/manager/oto/seller/switchDimissionStatus"
;
public
static
final
String
MANAGER_oto_switchDimissionStatus
=
MANAGER_HOST
+
"/kjy/manager/oto/seller/switchDimissionStatus"
;
public
static
final
String
WORK_getCaptcha
=
WORK_HOST
+
"/kjy/oto/manager/auth/captcha"
;
public
static
final
String
WORK_getCaptcha
=
WORK_HOST
+
"/kjy/oto/manager/auth/captcha"
;
public
static
final
String
WORK_login
=
WORK_HOST
+
"/kjy/oto/manager/auth/login"
;
public
static
final
String
WORK_login
=
WORK_HOST
+
"/kjy/oto/manager/auth/login"
;
public
static
final
String
WORK_userInfo
=
WORK_HOST
+
"/kjy/oto/manager/auth/userInfo"
;
public
static
final
String
WORK_userInfo
=
WORK_HOST
+
"/kjy/oto/manager/auth/userInfo"
;
...
@@ -1363,7 +1363,28 @@ public class BasicConfig {
...
@@ -1363,7 +1363,28 @@ public class BasicConfig {
public
static
final
String
WORK_attendanceList
=
WORK_HOST
+
"/kjy/oto/manager/attendance/list"
;
public
static
final
String
WORK_attendanceList
=
WORK_HOST
+
"/kjy/oto/manager/attendance/list"
;
public
static
final
String
WORK_switchWorkStatus
=
WORK_HOST
+
"/kjy/oto/manager/attendance/switchWorkStatus"
;
public
static
final
String
WORK_switchWorkStatus
=
WORK_HOST
+
"/kjy/oto/manager/attendance/switchWorkStatus"
;
public
static
final
String
WORK_verifyCodet
=
WORK_HOST
+
"/kjy/oto/auto/test/verifyCode"
;
public
static
final
String
PHONE_customerList
=
MOBILE_HOST
+
"kjy/oto/customer/list"
;
public
static
final
String
PHONE_customerSave
=
MOBILE_HOST
+
"kjy/oto/customer/introduce/save"
;
public
static
final
String
PHONE_appointmentDetail
=
MOBILE_HOST
+
"/kjy/oto/interview/appointment/detail"
;
public
static
final
String
PHONE_fuzzyList
=
MOBILE_HOST
+
"/kjy/oto/cust/fuzzy/list"
;
public
static
final
String
PHONE_interviewSave
=
MOBILE_HOST
+
"/kjy/oto/interview/save"
;
public
static
final
String
PHONE_interviewUpdate
=
MOBILE_HOST
+
"/kjy/oto/interview/appointment/update"
;
public
static
final
String
PHONE_interviewList
=
MOBILE_HOST
+
"/kjy/oto/interview/list"
;
public
static
final
String
PHONE_interviewCancel
=
MOBILE_HOST
+
"/kjy/oto/interview/cancel"
;
public
static
final
String
PHONE_interviewCode
=
MOBILE_HOST
+
"/kjy/oto/h5/interview/code"
;
public
static
final
String
PHONE_interviewStatus
=
MOBILE_HOST
+
"/kjy/oto/h5/interview/status"
;
public
static
final
String
PHONE_interviewPhone
=
MOBILE_HOST
+
"/kjy/oto/h5/interview/phone"
;
public
static
final
String
PHONE_interviewBind
=
MOBILE_HOST
+
"/kjy/oto/h5/interview/bind"
;
public
static
final
String
PHONE_bindCancel
=
MOBILE_HOST
+
"/kjy/oto/h5/interview/cancel"
;
public
static
final
String
PHONE_feedbackDetail
=
MOBILE_HOST
+
"/kjy/oto/interview/feedback/detail"
;
public
static
final
String
PHONE_custExtDetail
=
MOBILE_HOST
+
"/kjy/oto/interview/custExtDetail"
;
public
static
final
String
PHONE_interviewFeedback
=
MOBILE_HOST
+
"/kjy/oto/interview/feedback"
;
public
static
final
String
PHONE_interviewDetail
=
MOBILE_HOST
+
"/kjy/oto/interview/edit/detail"
;
public
static
final
String
PHONE_authPhone
=
MOBILE_HOST
+
"/auth/oto/authPhone"
;
public
static
final
String
PHONE_getAuthPhone
=
MOBILE_HOST
+
"/auth/oto/getAuthPhone"
;
public
static
final
String
PHONE_submitEvaluate
=
MOBILE_HOST
+
"/kjy/oto/interview/submitEvaluate"
;
public
static
final
String
WORK_verifyCode
=
WORK_HOST
+
"/kjy/oto/auto/test/verifyCode"
;
public
static
final
String
WORK_delCust
=
WORK_HOST
+
"/kjy/oto/auto/test/delCust"
;
public
static
final
String
WORK_delCust
=
WORK_HOST
+
"/kjy/oto/auto/test/delCust"
;
}
}
src/test/java/com/kjj/utils/BaseUtils.java
View file @
cae7e4cf
...
@@ -408,7 +408,7 @@ public class BaseUtils {
...
@@ -408,7 +408,7 @@ public class BaseUtils {
//专用于自动化获取验证码
//专用于自动化获取验证码
params
.
clear
();
params
.
clear
();
params
.
put
(
"phoneNumber"
,
"18248405155"
);
params
.
put
(
"phoneNumber"
,
"18248405155"
);
Response
autoTestRes
=
network
.
getResponse
(
params
,
BasicConfig
.
WORK_verifyCode
t
);
Response
autoTestRes
=
network
.
getResponse
(
params
,
BasicConfig
.
WORK_verifyCode
);
String
captcha
=
autoTestRes
.
jsonPath
().
getString
(
"data"
);
String
captcha
=
autoTestRes
.
jsonPath
().
getString
(
"data"
);
System
.
out
.
println
(
captcha
);
System
.
out
.
println
(
captcha
);
...
@@ -450,7 +450,7 @@ public class BaseUtils {
...
@@ -450,7 +450,7 @@ public class BaseUtils {
//专用于自动化获取验证码
//专用于自动化获取验证码
params
.
clear
();
params
.
clear
();
params
.
put
(
"phoneNumber"
,
"13454131091"
);
params
.
put
(
"phoneNumber"
,
"13454131091"
);
Response
autoTestRes
=
network
.
getResponse
(
params
,
BasicConfig
.
WORK_verifyCode
t
);
Response
autoTestRes
=
network
.
getResponse
(
params
,
BasicConfig
.
WORK_verifyCode
);
String
captcha
=
autoTestRes
.
jsonPath
().
getString
(
"data"
);
String
captcha
=
autoTestRes
.
jsonPath
().
getString
(
"data"
);
System
.
out
.
println
(
captcha
);
System
.
out
.
println
(
captcha
);
...
...
src/test/java/com/kjj/utils/JmeterAccountFile.java
View file @
cae7e4cf
...
@@ -32,9 +32,9 @@ public class JmeterAccountFile {
...
@@ -32,9 +32,9 @@ public class JmeterAccountFile {
public
static
void
otoCookieMaker
()
{
public
static
void
otoCookieMaker
()
{
OtoTokenCookie
otoTokenCookie
=
new
OtoTokenCookie
();
OtoTokenCookie
otoTokenCookie
=
new
OtoTokenCookie
();
otoTokenCookie
.
setExpiredTime
(
System
.
currentTimeMillis
()
+
86400
*
1000
*
150L
);
otoTokenCookie
.
setExpiredTime
(
System
.
currentTimeMillis
()
+
86400
*
1000
*
150L
);
otoTokenCookie
.
setPhoneNumber
(
"1
8909890978
"
);
otoTokenCookie
.
setPhoneNumber
(
"1
3454131091
"
);
otoTokenCookie
.
setLoginId
(
IdMakeUtil
.
encodingId
(
21
L
,
IdConvertBase64Enum
.
DEF
));
otoTokenCookie
.
setLoginId
(
IdMakeUtil
.
encodingId
(
43
L
,
IdConvertBase64Enum
.
DEF
));
String
json
=
JSON
.
toJSONString
(
otoTokenCookie
);
String
json
=
JSON
.
toJSONString
(
otoTokenCookie
);
String
otoToken
=
BlowfishUtils
.
encryptBlowfish
(
json
,
"02a16fs1b6a3"
);
String
otoToken
=
BlowfishUtils
.
encryptBlowfish
(
json
,
"02a16fs1b6a3"
);
...
...
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