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
21e11411
Commit
21e11411
authored
Nov 26, 2021
by
郭姣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
企业后台登录、架构名单录入、管理后台驾驶舱接口编写
parent
424ab629
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
570 additions
and
413 deletions
+570
-413
Enterprise.java
...t/java/com/kjj/cases/assistant/enterprise/Enterprise.java
+406
-0
ManageCorp.java
src/test/java/com/kjj/cases/live/Corp/ManageCorp.java
+0
-390
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+24
-17
BaseUtils.java
src/test/java/com/kjj/utils/BaseUtils.java
+139
-0
wechatTestNG.xml
src/test/wechatTestNG.xml
+1
-6
No files found.
src/test/java/com/kjj/cases/assistant/enterprise/Enterprise.java
0 → 100644
View file @
21e11411
This diff is collapsed.
Click to expand it.
src/test/java/com/kjj/cases/live/Corp/ManageCorp.java
deleted
100644 → 0
View file @
424ab629
This diff is collapsed.
Click to expand it.
src/test/java/com/kjj/config/BasicConfig.java
View file @
21e11411
...
@@ -96,7 +96,7 @@ public class BasicConfig {
...
@@ -96,7 +96,7 @@ public class BasicConfig {
public
static
final
String
MANAGER_HOST
=
"https://kjj-mng.duibatest.com.cn"
;
public
static
final
String
MANAGER_HOST
=
"https://kjj-mng.duibatest.com.cn"
;
public
static
final
String
MOBILE_HOST
=
"https://live.duibatest.com.cn"
;
public
static
final
String
MOBILE_HOST
=
"https://live.duibatest.com.cn"
;
public
static
final
String
MOBILE_SPOKEHOST
=
"https://tt.duibatest.com.cn"
;
public
static
final
String
MOBILE_SPOKEHOST
=
"https://tt.duibatest.com.cn"
;
public
static
final
String
CORP_HOST
=
"https://kjj-corp.duibatest.com.cn"
;
// *************** 开启&结束直播 ***************
// *************** 开启&结束直播 ***************
public
static
final
String
ANCHOR_OPEN
=
MOBILE_HOST
+
"/conf/live/open"
;
public
static
final
String
ANCHOR_OPEN
=
MOBILE_HOST
+
"/conf/live/open"
;
public
static
final
String
ANCHOR_getConfDetail
=
MOBILE_HOST
+
"/conf/pre/getConfDetail"
;
public
static
final
String
ANCHOR_getConfDetail
=
MOBILE_HOST
+
"/conf/pre/getConfDetail"
;
...
@@ -1182,20 +1182,27 @@ public class BasicConfig {
...
@@ -1182,20 +1182,27 @@ public class BasicConfig {
public
static
final
String
MANAGER_qa_pageList
=
MANAGER_HOST
+
"/kjy/manager/qa/pageList"
;
public
static
final
String
MANAGER_qa_pageList
=
MANAGER_HOST
+
"/kjy/manager/qa/pageList"
;
public
static
final
String
MANAGER_qa_del
=
MANAGER_HOST
+
"/kjy/manager/qa/del"
;
public
static
final
String
MANAGER_qa_del
=
MANAGER_HOST
+
"/kjy/manager/qa/del"
;
// 企业后台
// 管理后台—企业后台
public
static
final
String
MANAGER_corp_saveCorp
=
MANAGER_HOST
+
"/kjy/manager/corp/company/saveOrUpdate"
;
public
static
final
String
MANAGER_cockpitSaveOrUpdate
=
MANAGER_HOST
+
"/kjy/manager/corp/cockpit/saveOrUpdate"
;
public
static
final
String
MANAGER_corp_CorpLists
=
MANAGER_HOST
+
"/kjy/manager/corp/company/selectList"
;
public
static
final
String
MANAGER_cockpitList
=
MANAGER_HOST
+
"/kjy/manager/corp/cockpit/list"
;
public
static
final
String
MANAGER_corp_searchCorp
=
MANAGER_HOST
+
"/kjy/manager/corp/company/search"
;
public
static
final
String
MANAGER_cockpitSwitchStatus
=
MANAGER_HOST
+
"/kjy/manager/corp/cockpit/switchStatus"
;
public
static
final
String
MANAGER_corp_saveAuth
=
MANAGER_HOST
+
"/kjy/manager/corp/company/auth/saveOrUpdate"
;
public
static
final
String
MANAGER_cockpitDelete
=
MANAGER_HOST
+
"/kjy/manager/corp/cockpit/delete"
;
public
static
final
String
MANAGER_corp_authLists
=
MANAGER_HOST
+
"/kjy/manager/corp/company/auth/selectList"
;
public
static
final
String
MANAGER_corp_deleteAuthById
=
MANAGER_HOST
+
"/kjy/manager/corp/company/auth/deleteById"
;
//企业后台
public
static
final
String
MANAGER_corp_savePage
=
MANAGER_HOST
+
"/kjy/manager/corp/company/page/saveOrUpdate"
;
public
static
final
String
CORP_pageList
=
CORP_HOST
+
"/kjy/corp/page/list"
;
public
static
final
String
MANAGER_corp_pageLists
=
MANAGER_HOST
+
"/kjy/manager/corp/company/page/selectList"
;
public
static
final
String
CORP_batchImport
=
CORP_HOST
+
"/kjy/corp/employee/batch/import"
;
public
static
final
String
MANAGER_corp_saveStaff
=
MANAGER_HOST
+
"/kjy/manager/corp/company/staff/saveOrUpdate"
;
public
static
final
String
CORP_importResult
=
CORP_HOST
+
"/kjy/corp/import/result"
;
public
static
final
String
MANAGER_corp_staffList
=
MANAGER_HOST
+
"/kjy/manager/corp/company/staff/selectList"
;
public
static
final
String
CORP_recordList
=
CORP_HOST
+
"/kjy/corp/import/record/list"
;
public
static
final
String
MANAGER_corp_phoneExist
=
MANAGER_HOST
+
"/kjy/manager/corp/company/staff/phoneExist"
;
public
static
final
String
CORP_getCaptcha
=
CORP_HOST
+
"/kjy/corp/getCaptcha"
;
public
static
final
String
MANAGER_corp_changePageState
=
MANAGER_HOST
+
"/kjy/manager/corp/company/page/changeState"
;
public
static
final
String
CORP_getCaptchaForAutoTest
=
CORP_HOST
+
"/kjy/corp/getCaptchaForAutoTest"
;
public
static
final
String
MANAGER_corp_delPageById
=
MANAGER_HOST
+
"/kjy/manager/corp/company/page/deleteById"
;
public
static
final
String
CORP_login
=
CORP_HOST
+
"/kjy/corp/login"
;
public
static
final
String
MANAGER_corp_changeStaffState
=
MANAGER_HOST
+
"/kjy/manager/corp/company/staff/changeState"
;
public
static
final
String
CORP_switchover
=
CORP_HOST
+
"/kjy/corp/company/switchover"
;
public
static
final
String
MANAGER_corp_delStaff
=
MANAGER_HOST
+
"/kjy/manager/corp/company/staff/deleteById"
;
public
static
final
String
CORP_listSimple
=
CORP_HOST
+
"/kjy/corp/company/list/simple"
;
public
static
final
String
CORP_simpleList
=
CORP_HOST
+
"/kjy/corp/dept/simple/list"
;
public
static
final
String
CORP_employeeStat
=
CORP_HOST
+
"/kjy/corp/employee/stat"
;
public
static
final
String
CORP_employeeList
=
CORP_HOST
+
"/kjy/corp/employee/list"
;
public
static
final
String
CORP_deptEdit
=
CORP_HOST
+
"/kjy/corp/dept/edit"
;
public
static
final
String
CORP_employeeSaveOrUpdate
=
CORP_HOST
+
"/kjy/corp/employee/saveOrUpdate"
;
public
static
final
String
CORP_employeeDel
=
CORP_HOST
+
"/kjy/corp/employee/del"
;
public
static
final
String
CORP_deptDel
=
CORP_HOST
+
"/kjy/corp/dept/del"
;
}
}
src/test/java/com/kjj/utils/BaseUtils.java
View file @
21e11411
...
@@ -195,4 +195,143 @@ public class BaseUtils {
...
@@ -195,4 +195,143 @@ public class BaseUtils {
Assert
.
assertNotNull
(
data
,
network
.
message
(
myCountParam
,
BasicConfig
.
USER_myCount
,
"抽奖码数量错误"
,
myCountRes
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
myCountParam
,
BasicConfig
.
USER_myCount
,
"抽奖码数量错误"
,
myCountRes
.
body
().
asString
()));
}
}
}
}
/**
* 超管登录企业后台
*/
public
static
void
superUserLogin
(){
// 调用登录接口
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"phone"
,
"15136361308"
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
CORP_getCaptcha
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
CORP_getCaptcha
,
"获取验证码失败"
,
response
.
body
().
asString
()));
//专用于自动化获取验证码
params
.
clear
();
params
.
put
(
"phone"
,
"15136361308"
);
Response
autoTestRes
=
network
.
getResponse
(
params
,
BasicConfig
.
CORP_getCaptchaForAutoTest
);
long
captcha
=
autoTestRes
.
jsonPath
().
getLong
(
"data"
);
System
.
out
.
println
(
captcha
);
//登录接口
ThreadSleepUtils
.
sleep
(
1000
);
params
.
clear
();
params
.
put
(
"phone"
,
"15136361308"
);
params
.
put
(
"captcha"
,
captcha
);
Response
loginRes
=
network
.
postResponse
(
params
,
BasicConfig
.
CORP_login
);
boolean
success
=
loginRes
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
CORP_login
,
"登录失败"
,
loginRes
.
body
().
asString
()));
//获取cookie
String
header
=
loginRes
.
getHeader
(
"Set-Cookie"
);
String
cookieStr
=
header
.
split
(
";"
)[
0
];
String
[]
cookieKeyValue
=
cookieStr
.
split
(
"="
);
network
.
agentCookies
.
put
(
cookieKeyValue
[
0
],
cookieKeyValue
[
1
]);
//存入cookies
//选择接口 CORP_switchover
params
.
clear
();
Response
switchRes
=
network
.
postResponse
(
params
,
BasicConfig
.
CORP_switchover
+
"?companyId=Kj20MjE1"
);
boolean
switchData
=
switchRes
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
switchData
,
network
.
message
(
params
,
BasicConfig
.
CORP_switchover
,
"选择公司失败"
,
switchRes
.
body
().
asString
()));
//重复获取一次cookie,覆盖现有cookie
header
=
switchRes
.
getHeader
(
"Set-Cookie"
);
cookieStr
=
header
.
split
(
";"
)[
0
];
cookieKeyValue
=
cookieStr
.
split
(
"="
);
network
.
agentCookies
.
put
(
cookieKeyValue
[
0
],
cookieKeyValue
[
1
]);
//存入cookies
network
.
agentCookies
.
put
(
"companyId"
,
"Kj20MjE1"
);
}
/**
* 公司管理员登录企业后台
*/
public
static
void
companyUserLogin
(){
// 调用登录接口
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"phone"
,
"15136361307"
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
CORP_getCaptcha
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
CORP_getCaptcha
,
"获取验证码失败"
,
response
.
body
().
asString
()));
//专用于自动化获取验证码
params
.
clear
();
params
.
put
(
"phone"
,
"15136361307"
);
Response
autoTestRes
=
network
.
getResponse
(
params
,
BasicConfig
.
CORP_getCaptchaForAutoTest
);
long
captcha
=
autoTestRes
.
jsonPath
().
getLong
(
"data"
);
System
.
out
.
println
(
captcha
);
//登录接口
ThreadSleepUtils
.
sleep
(
1000
);
params
.
clear
();
params
.
put
(
"phone"
,
"15136361307"
);
params
.
put
(
"captcha"
,
captcha
);
Response
loginRes
=
network
.
postResponse
(
params
,
BasicConfig
.
CORP_login
);
boolean
success
=
loginRes
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
CORP_login
,
"登录失败"
,
loginRes
.
body
().
asString
()));
//获取cookie
String
header
=
loginRes
.
getHeader
(
"Set-Cookie"
);
String
cookieStr
=
header
.
split
(
";"
)[
0
];
String
[]
cookieKeyValue
=
cookieStr
.
split
(
"="
);
network
.
agentCookies
.
put
(
cookieKeyValue
[
0
],
cookieKeyValue
[
1
]);
//存入cookies
//选择接口 CORP_switchover
params
.
clear
();
Response
switchRes
=
network
.
postResponse
(
params
,
BasicConfig
.
CORP_switchover
+
"?companyId=Kj20MjE1"
);
boolean
switchData
=
switchRes
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
switchData
,
network
.
message
(
params
,
BasicConfig
.
CORP_switchover
,
"选择公司失败"
,
switchRes
.
body
().
asString
()));
//重复获取一次cookie,覆盖现有cookie
header
=
switchRes
.
getHeader
(
"Set-Cookie"
);
cookieStr
=
header
.
split
(
";"
)[
0
];
cookieKeyValue
=
cookieStr
.
split
(
"="
);
network
.
agentCookies
.
put
(
cookieKeyValue
[
0
],
cookieKeyValue
[
1
]);
//存入cookies
//put company Id
network
.
agentCookies
.
put
(
"companyId"
,
"Kj20MjE1"
);
}
/**
* 营业部管理员登录企业后台
*/
public
static
void
officeUserLogin
(){
// 调用登录接口
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"phone"
,
"15136361306"
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
CORP_getCaptcha
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
CORP_getCaptcha
,
"获取验证码失败"
,
response
.
body
().
asString
()));
//专用于自动化获取验证码
params
.
clear
();
params
.
put
(
"phone"
,
"15136361306"
);
Response
autoTestRes
=
network
.
getResponse
(
params
,
BasicConfig
.
CORP_getCaptchaForAutoTest
);
long
captcha
=
autoTestRes
.
jsonPath
().
getLong
(
"data"
);
System
.
out
.
println
(
captcha
);
//登录接口
ThreadSleepUtils
.
sleep
(
1000
);
params
.
clear
();
params
.
put
(
"phone"
,
"15136361306"
);
params
.
put
(
"captcha"
,
captcha
);
Response
loginRes
=
network
.
postResponse
(
params
,
BasicConfig
.
CORP_login
);
boolean
success
=
loginRes
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
CORP_login
,
"登录失败"
,
loginRes
.
body
().
asString
()));
//获取cookie
String
header
=
loginRes
.
getHeader
(
"Set-Cookie"
);
String
cookieStr
=
header
.
split
(
";"
)[
0
];
String
[]
cookieKeyValue
=
cookieStr
.
split
(
"="
);
network
.
agentCookies
.
put
(
cookieKeyValue
[
0
],
cookieKeyValue
[
1
]);
//存入cookies
//选择接口 CORP_switchover
params
.
clear
();
Response
switchRes
=
network
.
postResponse
(
params
,
BasicConfig
.
CORP_switchover
+
"?companyId=Kj20MjE1"
);
boolean
switchData
=
switchRes
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
switchData
,
network
.
message
(
params
,
BasicConfig
.
CORP_switchover
,
"选择公司失败"
,
switchRes
.
body
().
asString
()));
//重复获取一次cookie,覆盖现有cookie
header
=
switchRes
.
getHeader
(
"Set-Cookie"
);
cookieStr
=
header
.
split
(
";"
)[
0
];
cookieKeyValue
=
cookieStr
.
split
(
"="
);
network
.
agentCookies
.
put
(
cookieKeyValue
[
0
],
cookieKeyValue
[
1
]);
//存入cookies
//put company Id
network
.
agentCookies
.
put
(
"companyId"
,
"Kj20MjE1"
);
}
}
}
src/test/wechatTestNG.xml
View file @
21e11411
...
@@ -78,12 +78,7 @@
...
@@ -78,12 +78,7 @@
</test>
</test>
<test
preserve-order=
"true"
name =
"邀请函和趣味测评"
>
<test
preserve-order=
"true"
name =
"邀请函和趣味测评"
>
<classes>
<classes>
<class
name=
"com.kjj.cases.assistant.markettools.InvitationLetter"
/>
<class
name=
"com.kjj.cases.assistant.enterprise.Enterprise"
/>
</classes>
</test>
<test
preserve-order=
"true"
name =
"使用攻略和设置中心"
>
<classes>
<class
name=
"com.kjj.cases.assistant.menu.PersonalCenter"
/>
</classes>
</classes>
</test>
</test>
</suite>
</suite>
...
...
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