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
d778d16e
Commit
d778d16e
authored
May 24, 2022
by
龚小红
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加权限管理-换绑手机、绑定/解绑坐席、公众号查看预约订单列表的用例
parent
4531c3dd
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
187 additions
and
108 deletions
+187
-108
Authorization.java
src/test/java/com/kjj/cases/admin/Authorization.java
+1
-2
Manager.java
src/test/java/com/kjj/cases/otoseller/Manager.java
+52
-1
Phone.java
src/test/java/com/kjj/cases/otoseller/Phone.java
+11
-0
Work.java
src/test/java/com/kjj/cases/otoseller/Work.java
+16
-3
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+5
-0
BaseUtils.java
src/test/java/com/kjj/utils/BaseUtils.java
+102
-102
No files found.
src/test/java/com/kjj/cases/admin/Authorization.java
View file @
d778d16e
...
@@ -64,14 +64,13 @@ public interface Authorization {
...
@@ -64,14 +64,13 @@ public interface Authorization {
}
}
//代理人
//代理人
xxx
default
void
agent2Tku
()
{
default
void
agent2Tku
()
{
network
.
agentCookies
.
put
(
TKU_COOKIE_NAME
,
AGENT2_TKU
);
network
.
agentCookies
.
put
(
TKU_COOKIE_NAME
,
AGENT2_TKU
);
System
.
out
.
println
(
"代理人梦晨tku:"
+
AGENT2_TKU
);
System
.
out
.
println
(
"代理人梦晨tku:"
+
AGENT2_TKU
);
}
}
// 获取访客tku:Su Yi
// 获取访客tku:Su Yi
default
void
userTku
()
{
default
void
userTku
()
{
network
.
agentCookies
.
put
(
TKU_COOKIE_NAME
,
VISITOR_UserTku
);
network
.
agentCookies
.
put
(
TKU_COOKIE_NAME
,
VISITOR_UserTku
);
...
...
src/test/java/com/kjj/cases/otoseller/Manager.java
View file @
d778d16e
...
@@ -246,7 +246,7 @@ public class Manager {
...
@@ -246,7 +246,7 @@ public class Manager {
Assert
.
assertEquals
(
prodName
,
"勿动-自动化专用产品更新"
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_oto_productList
,
"产品的名称未更新"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
prodName
,
"勿动-自动化专用产品更新"
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_oto_productList
,
"产品的名称未更新"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"还原公司产品"
,
priority
=
1
5
)
@Test
(
description
=
"还原公司产品"
,
priority
=
1
6
)
public
void
还原公司产品
(){
public
void
还原公司产品
(){
ArrayList
companyIds
=
new
ArrayList
();
ArrayList
companyIds
=
new
ArrayList
();
companyIds
.
add
(
5
);
companyIds
.
add
(
5
);
...
@@ -270,4 +270,55 @@ public class Manager {
...
@@ -270,4 +270,55 @@ public class Manager {
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_oto_productSave
,
"修改公司产品失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_oto_productSave
,
"修改公司产品失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"查看第三方账号列表"
,
priority
=
17
)
public
void
查看第三方账号列表
(){
Response
response
=
network
.
getResponse
(
BasicConfig
.
MANAGER_oto_accountList
);
int
size
=
response
.
jsonPath
().
getInt
(
"data.size()"
);
Assert
.
assertTrue
(
size
>
0
,
network
.
message
(
BasicConfig
.
MANAGER_oto_accountList
,
"查询第三方账号列表为空"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"绑定第三方坐席"
,
priority
=
18
)
public
void
绑定第三方坐席
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"sellerId"
,
sellerId
);
params
.
put
(
"accountName"
,
"8060@fhpcs"
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_oto_accountBind
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_oto_accountBind
,
"绑定第三方账号失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"解绑第三方坐席"
,
priority
=
19
)
public
void
解绑第三方坐席
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"sellerId"
,
sellerId
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_oto_accountUnbind
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_oto_accountUnbind
,
"解绑坐席账号失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"换绑手机并还原"
,
priority
=
20
)
public
void
换绑手机并还原
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"id"
,
sellerId
);
params
.
put
(
"newPhoneNum"
,
"14783743847"
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_oto_change
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_oto_change
,
"解绑坐席账号失败"
,
response
.
body
().
asString
()));
params
.
clear
();
params
.
put
(
"phoneNumber"
,
"14783743847"
);
params
.
put
(
"pageIndex"
,
"1"
);
params
.
put
(
"pageSize"
,
"20"
);
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MANAGER_oto_sellerList
);
int
id
=
response
.
jsonPath
().
getInt
(
"data.list[0].id"
);
Assert
.
assertEquals
(
id
,
sellerId
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_oto_sellerList
,
"销售列表为空"
,
response
.
body
().
asString
()));
params
.
clear
();
params
.
put
(
"id"
,
sellerId
);
params
.
put
(
"newPhoneNum"
,
"18248405155"
);
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_oto_change
);
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_oto_change
,
"解绑坐席账号失败"
,
response
.
body
().
asString
()));
}
}
}
src/test/java/com/kjj/cases/otoseller/Phone.java
View file @
d778d16e
...
@@ -619,6 +619,17 @@ public class Phone implements Authorization {
...
@@ -619,6 +619,17 @@ public class Phone implements Authorization {
Assert
.
assertTrue
(
finishCustNum
>
0
,
network
.
message
(
params
,
BasicConfig
.
WORK_taskDetailsList
,
"已完成数量记录错误"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
finishCustNum
>
0
,
network
.
message
(
params
,
BasicConfig
.
WORK_taskDetailsList
,
"已完成数量记录错误"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"查看我的预约列表"
,
priority
=
46
)
public
void
查看我的预约列表
(){
agent2Tku
();
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
20
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
PHONE_getReservationList
);
int
bookingStatus
=
response
.
jsonPath
().
getInt
(
"data[0].bookingStatus"
);
Assert
.
assertEquals
(
bookingStatus
,
1
,
network
.
message
(
BasicConfig
.
PHONE_getReservationList
,
"查看审批列表不为空"
,
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/cases/otoseller/Work.java
View file @
d778d16e
...
@@ -10,8 +10,7 @@ import org.testng.annotations.Test;
...
@@ -10,8 +10,7 @@ import org.testng.annotations.Test;
import
java.util.*
;
import
java.util.*
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
LEADER_ID
;
import
static
com
.
kjj
.
config
.
BasicConfig
.*;
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
;
...
@@ -19,7 +18,7 @@ public class Work implements Authorization {
...
@@ -19,7 +18,7 @@ public class Work implements Authorization {
private
static
final
NetworkUtils
network
=
NetworkUtils
.
getInstance
();
private
static
final
NetworkUtils
network
=
NetworkUtils
.
getInstance
();
public
int
tagId
;
//标签ID
public
int
tagId
;
//标签ID
public
int
custId
;
//客户ID
public
int
custId
;
//客户ID
public
static
String
phone
=
"1
5938213001
"
;
//客户手机号
public
static
String
phone
=
"1
3705566425
"
;
//客户手机号
public
int
followTimes
;
//跟进次数
public
int
followTimes
;
//跟进次数
public
static
Map
<
String
,
Integer
>
header
;
public
static
Map
<
String
,
Integer
>
header
;
public
static
Map
<
String
,
Integer
>
chart
;
public
static
Map
<
String
,
Integer
>
chart
;
...
@@ -786,4 +785,18 @@ public class Work implements Authorization {
...
@@ -786,4 +785,18 @@ public class Work implements Authorization {
Assert
.
assertTrue
(
listSize
>
0
,
network
.
message
(
params
,
BasicConfig
.
WORK_taskDetailsList
,
"待完成客户数统计错误"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
listSize
>
0
,
network
.
message
(
params
,
BasicConfig
.
WORK_taskDetailsList
,
"待完成客户数统计错误"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"查看我的预约列表"
,
priority
=
70
)
public
void
查看我的预约列表
(){
agent2Tku
();
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
20
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
PHONE_getReservationList
);
int
size
=
response
.
jsonPath
().
getInt
(
"data.size()"
);
Assert
.
assertEquals
(
size
,
1
,
network
.
message
(
BasicConfig
.
PHONE_getReservationList
,
"查看预约列表不为空"
,
response
.
body
().
asString
()));
int
bookingStatus
=
response
.
jsonPath
().
getInt
(
"data[0].bookingStatus"
);
Assert
.
assertEquals
(
bookingStatus
,
0
,
network
.
message
(
BasicConfig
.
PHONE_getReservationList
,
"预约状态错误"
,
response
.
body
().
asString
()));
}
}
}
src/test/java/com/kjj/config/BasicConfig.java
View file @
d778d16e
...
@@ -1333,6 +1333,10 @@ public class BasicConfig {
...
@@ -1333,6 +1333,10 @@ public class BasicConfig {
public
static
final
String
MANAGER_oto_productList
=
MANAGER_HOST
+
"/kjy/manager/oto/product/list"
;
public
static
final
String
MANAGER_oto_productList
=
MANAGER_HOST
+
"/kjy/manager/oto/product/list"
;
public
static
final
String
MANAGER_oto_productSave
=
MANAGER_HOST
+
"/kjy/manager/oto/product/save"
;
public
static
final
String
MANAGER_oto_productSave
=
MANAGER_HOST
+
"/kjy/manager/oto/product/save"
;
public
static
final
String
MANAGER_oto_productUpdateStatus
=
MANAGER_HOST
+
"/kjy/manager/oto/product/updateStatus"
;
public
static
final
String
MANAGER_oto_productUpdateStatus
=
MANAGER_HOST
+
"/kjy/manager/oto/product/updateStatus"
;
public
static
final
String
MANAGER_oto_accountList
=
MANAGER_HOST
+
"/kjy/manager/oto/seller/account/availableList"
;
public
static
final
String
MANAGER_oto_accountBind
=
MANAGER_HOST
+
"/kjy/manager/oto/seller/account/bind"
;
public
static
final
String
MANAGER_oto_accountUnbind
=
MANAGER_HOST
+
"/kjy/manager/oto/seller/account/unbind"
;
public
static
final
String
MANAGER_oto_change
=
MANAGER_HOST
+
"/kjy/manager/oto/seller/phone/change"
;
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"
;
...
@@ -1404,6 +1408,7 @@ public class BasicConfig {
...
@@ -1404,6 +1408,7 @@ public class BasicConfig {
public
static
final
String
PHONE_address
=
PHONE_HOST
+
"/kjy/oto/h5/v1/save/address"
;
public
static
final
String
PHONE_address
=
PHONE_HOST
+
"/kjy/oto/h5/v1/save/address"
;
public
static
final
String
PHONE_getUnusualTypes
=
PHONE_HOST
+
"/kjy/oto/h5/v1/getUnusualTypes"
;
public
static
final
String
PHONE_getUnusualTypes
=
PHONE_HOST
+
"/kjy/oto/h5/v1/getUnusualTypes"
;
public
static
final
String
PHONE_fail
=
HOST
+
"/kjy/oto/interview/authorize/fail"
;
public
static
final
String
PHONE_fail
=
HOST
+
"/kjy/oto/interview/authorize/fail"
;
public
static
final
String
PHONE_getReservationList
=
HOST
+
"/kjy/pub/form/getReservationList"
;
public
static
final
String
WORK_verifyCode
=
WORK_HOST
+
"/kjy/oto/auto/test/verifyCode"
;
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 @
d778d16e
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