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
6a78fa28
Commit
6a78fa28
authored
Dec 13, 2021
by
龚小红
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'gifeature/20211209-gj' into 'master'
Gifeature/20211209 gj See merge request test-group/kejiji!189
parents
d4f81d9b
dc0f0f59
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
11 deletions
+44
-11
Authorization.java
src/test/java/com/kjj/cases/admin/Authorization.java
+16
-0
Enterprise.java
...t/java/com/kjj/cases/assistant/enterprise/Enterprise.java
+9
-6
EnterpriseAgent.java
.../kjj/cases/assistant/enterpriseAgent/EnterpriseAgent.java
+3
-2
BaseUtils.java
src/test/java/com/kjj/utils/BaseUtils.java
+16
-3
No files found.
src/test/java/com/kjj/cases/admin/Authorization.java
View file @
6a78fa28
...
...
@@ -4,6 +4,7 @@ import com.kjj.utils.NetworkUtils;
import
static
com
.
kjj
.
config
.
BasicConfig
.*;
import
static
com
.
kjj
.
config
.
BasicConfig
.
visitorAuth17
;
import
static
com
.
kjj
.
utils
.
BaseUtils
.*;
/**
...
...
@@ -20,6 +21,21 @@ public interface Authorization {
System
.
out
.
println
(
"用户AUTH_KEY:"
+
ADMIN_KEY
);
}
//企业后台超级管理员
default
void
superAuth
(){
network
.
agentCookies
.
put
(
superCookieKey
,
superCookieValue
);
}
//企业后台企业管理员
default
void
companyAuth
(){
network
.
agentCookies
.
put
(
companyCookieKey
,
companyCookieValue
);
}
//企业后台营业部管理员
default
void
officeAuth
(){
network
.
agentCookies
.
put
(
officeCookieKey
,
officeCookieValue
);
}
/**
* 集客助手相关授权
*/
...
...
src/test/java/com/kjj/cases/assistant/enterprise/Enterprise.java
View file @
6a78fa28
...
...
@@ -21,6 +21,8 @@ public class Enterprise implements Authorization {
public
void
setUp
()
{
ssoLogin
();
superUserLogin
();
companyUserLogin
();
officeUserLogin
();
}
public
long
companyPageID
;
//管理后台公司管理员数据驾驶页面ID
public
long
officePageID
;
//管理后台营业部管理员数据驾驶页面ID
...
...
@@ -34,6 +36,7 @@ public class Enterprise implements Authorization {
@Test
(
description
=
"企业后台_获取当前用户公司列表"
,
priority
=
1
)
public
void
企业后台
_
获取当前用户公司列表
(){
superAuth
();
Response
comListRes
=
network
.
getResponse
(
BasicConfig
.
CORP_listSimple
);
Object
dataRes
=
comListRes
.
jsonPath
().
getJsonObject
(
"data.size()"
);
Object
data
=
comListRes
.
jsonPath
().
getJsonObject
(
"data"
);
...
...
@@ -159,7 +162,7 @@ public class Enterprise implements Authorization {
@Test
(
description
=
"企业后台_公司管理员数据驾驶舱页面隐藏"
,
priority
=
10
)
public
void
企业后台
_
公司管理员数据驾驶舱页面隐藏
(){
company
UserLogin
();
company
Auth
();
ThreadSleepUtils
.
sleep
(
3000
);
Response
response
=
network
.
getResponse
(
BasicConfig
.
CORP_pageList
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data.size()"
);
...
...
@@ -168,7 +171,7 @@ public class Enterprise implements Authorization {
@Test
(
description
=
"企业后台_营业部管理员数据驾驶舱页面隐藏"
,
priority
=
11
)
public
void
企业后台
_
营业部管理员数据驾驶舱页面隐藏
(){
office
UserLogin
();
office
Auth
();
ThreadSleepUtils
.
sleep
(
3000
);
Response
response
=
network
.
getResponse
(
BasicConfig
.
CORP_pageList
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data.size()"
);
...
...
@@ -248,7 +251,7 @@ public class Enterprise implements Authorization {
}
@Test
(
description
=
"企业后台_营业部管理员数据驾驶舱为空"
,
priority
=
17
)
public
void
企业后台
_
营业部管理员数据驾驶舱为空
(){
office
UserLogin
();
office
Auth
();
ThreadSleepUtils
.
sleep
(
2000
);
Response
response
=
network
.
getResponse
(
BasicConfig
.
CORP_pageList
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data.size()"
);
...
...
@@ -260,7 +263,7 @@ public class Enterprise implements Authorization {
**/
@Test
(
description
=
"导入架构名单"
,
priority
=
18
)
public
void
导入架构名单
(){
super
UserLogin
();
super
Auth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
//导入的架构名单内容为工号KJJ002一条数据,营业部为余杭区营业部
params
.
put
(
"excelUrl"
,
"https://yun.dui88.com/kjy/corp/media/file/20211116/82d1352f96526be537e1635c42a37231.xlsx"
);
...
...
@@ -475,7 +478,7 @@ public class Enterprise implements Authorization {
@Test
(
description
=
"企业后台_新增公司管理员"
,
priority
=
33
)
public
void
企业后台
_
新增公司管理员
(){
super
UserLogin
();
super
Auth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"staffName"
,
"自动化公司管理员2"
);
params
.
put
(
"staffPhone"
,
"13456467582"
);
...
...
@@ -500,7 +503,7 @@ public class Enterprise implements Authorization {
@Test
(
description
=
"企业后台_新增营业部管理员"
,
priority
=
34
)
public
void
企业后台
_
新增营业部管理员
(){
super
UserLogin
();
super
Auth
();
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"deptId"
,
departmentId2
);
...
...
src/test/java/com/kjj/cases/assistant/enterpriseAgent/EnterpriseAgent.java
View file @
6a78fa28
...
...
@@ -33,6 +33,7 @@ public class EnterpriseAgent implements Authorization {
@Test
(
description
=
"企业后台_新增账号"
,
priority
=
1
)
public
void
企业后台
_
新增账号
()
{
superAuth
();
//利用当前时间戳作为工号
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
jobNumber
=
new
Date
().
getTime
();
...
...
@@ -78,7 +79,7 @@ public class EnterpriseAgent implements Authorization {
@Test
(
description
=
"企业后台_已激活数量"
,
priority
=
4
)
public
void
企业后台
_
已激活数量
()
{
super
UserLogin
();
super
Auth
();
Response
response
=
network
.
getResponse
(
BasicConfig
.
CORP_employeeStat
);
int
activateCount
=
response
.
jsonPath
().
getInt
(
"data.activateCount"
);
Assert
.
assertEquals
(
activateCount
,
1
,
network
.
message
(
BasicConfig
.
CORP_employeeStat
,
"已激活数量统计错误"
,
response
.
body
().
asString
()));
...
...
@@ -294,7 +295,7 @@ public class EnterpriseAgent implements Authorization {
@Test
(
description
=
"企业后台_新增备用账号"
,
priority
=
20
)
public
void
企业后台
_
新增备用账号
()
{
super
UserLogin
();
super
Auth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"deptId"
,
deptId
);
params
.
put
(
"employeeName"
,
"账号2"
);
...
...
src/test/java/com/kjj/utils/BaseUtils.java
View file @
6a78fa28
...
...
@@ -19,6 +19,13 @@ public class BaseUtils {
private
static
final
NetworkUtils
network
=
NetworkUtils
.
getInstance
();
public
static
String
tku
;
public
static
String
superCookieKey
;
public
static
String
superCookieValue
;
public
static
String
companyCookieKey
;
public
static
String
companyCookieValue
;
public
static
String
officeCookieKey
;
public
static
String
officeCookieValue
;
/**
* 登录管理后台
...
...
@@ -218,7 +225,7 @@ public class BaseUtils {
System
.
out
.
println
(
captcha
);
//登录接口
ThreadSleepUtils
.
sleep
(
5
000
);
ThreadSleepUtils
.
sleep
(
2
000
);
params
.
clear
();
params
.
put
(
"phone"
,
"15136361308"
);
params
.
put
(
"captcha"
,
captcha
);
...
...
@@ -241,6 +248,8 @@ public class BaseUtils {
header
=
switchRes
.
getHeader
(
"Set-Cookie"
);
cookieStr
=
header
.
split
(
";"
)[
0
];
cookieKeyValue
=
cookieStr
.
split
(
"="
);
superCookieKey
=
cookieKeyValue
[
0
];
superCookieValue
=
cookieKeyValue
[
1
];
network
.
agentCookies
.
put
(
cookieKeyValue
[
0
],
cookieKeyValue
[
1
]);
//存入cookies
network
.
agentCookies
.
put
(
"companyId"
,
"Kj20MjE1"
);
...
...
@@ -264,7 +273,7 @@ public class BaseUtils {
System
.
out
.
println
(
captcha
);
//登录接口
ThreadSleepUtils
.
sleep
(
5
000
);
ThreadSleepUtils
.
sleep
(
2
000
);
params
.
clear
();
params
.
put
(
"phone"
,
"15136361307"
);
params
.
put
(
"captcha"
,
captcha
);
...
...
@@ -287,6 +296,8 @@ public class BaseUtils {
header
=
switchRes
.
getHeader
(
"Set-Cookie"
);
cookieStr
=
header
.
split
(
";"
)[
0
];
cookieKeyValue
=
cookieStr
.
split
(
"="
);
companyCookieKey
=
cookieKeyValue
[
0
];
companyCookieValue
=
cookieKeyValue
[
1
];
network
.
agentCookies
.
put
(
cookieKeyValue
[
0
],
cookieKeyValue
[
1
]);
//存入cookies
//put company Id
network
.
agentCookies
.
put
(
"companyId"
,
"Kj20MjE1"
);
...
...
@@ -334,7 +345,9 @@ public class BaseUtils {
header
=
switchRes
.
getHeader
(
"Set-Cookie"
);
cookieStr
=
header
.
split
(
";"
)[
0
];
cookieKeyValue
=
cookieStr
.
split
(
"="
);
network
.
agentCookies
.
put
(
cookieKeyValue
[
0
],
cookieKeyValue
[
1
]);
//存入cookies
officeCookieKey
=
cookieKeyValue
[
0
];
officeCookieValue
=
cookieKeyValue
[
1
];
network
.
agentCookies
.
put
(
officeCookieKey
,
officeCookieValue
);
//存入cookies
//put company Id
network
.
agentCookies
.
put
(
"companyId"
,
"Kj20MjE1"
);
}
...
...
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