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
92fcaf71
Commit
92fcaf71
authored
Mar 24, 2023
by
龚小红
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'Feature/formSubmit' into 'master'
Feature/form submit See merge request
!84
parents
54c1f83c
62e4ea25
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
86 additions
and
30 deletions
+86
-30
Authorization.java
src/test/java/com/oto/cases/admin/Authorization.java
+5
-0
Invite.java
src/test/java/com/oto/cases/otoseller/Invite.java
+2
-0
Manager.java
src/test/java/com/oto/cases/otoseller/Manager.java
+0
-16
Phone.java
src/test/java/com/oto/cases/otoseller/Phone.java
+0
-14
TestFile.java
src/test/java/com/oto/cases/otoseller/TestFile.java
+79
-0
No files found.
src/test/java/com/oto/cases/admin/Authorization.java
View file @
92fcaf71
...
@@ -57,6 +57,11 @@ public interface Authorization {
...
@@ -57,6 +57,11 @@ public interface Authorization {
default
void
otoPMAuth
()
{
default
void
otoPMAuth
()
{
network
.
agentCookies
.
put
(
"otoToken"
,
"eTd1Af5HRGuUtkXq6ZtdzRwvNUjY4j3cVdcpuYrJL6cAszqvnhjut1r1J2h5fBPPiVwGygx"
);
network
.
agentCookies
.
put
(
"otoToken"
,
"eTd1Af5HRGuUtkXq6ZtdzRwvNUjY4j3cVdcpuYrJL6cAszqvnhjut1r1J2h5fBPPiVwGygx"
);
}
}
//oto销售工作台-PM
default
void
otoTestAuth
()
{
network
.
agentCookies
.
put
(
"otoToken"
,
"SGU5VHBG6UrQ3eDgD5fMNJrTGe62AyXGxMf4CVZAwGxg8E8D4hrGJP52sv8v36MaYoA"
);
}
//久久保管理员-正常权限模式
//久久保管理员-正常权限模式
default
void
jjbManagerAuth
()
{
default
void
jjbManagerAuth
()
{
network
.
agentCookies
.
put
(
JJBManagerCookieKey
,
JJBManagerCookieValue
);
network
.
agentCookies
.
put
(
JJBManagerCookieKey
,
JJBManagerCookieValue
);
...
...
src/test/java/com/oto/cases/otoseller/Invite.java
View file @
92fcaf71
...
@@ -21,6 +21,7 @@ import java.util.Map;
...
@@ -21,6 +21,7 @@ import java.util.Map;
import
static
com
.
oto
.
cases
.
otoseller
.
Manager
.
cust_id
;
import
static
com
.
oto
.
cases
.
otoseller
.
Manager
.
cust_id
;
import
static
com
.
oto
.
cases
.
otoseller
.
Work
.
assignSeller
;
import
static
com
.
oto
.
cases
.
otoseller
.
Work
.
assignSeller
;
import
static
com
.
oto
.
config
.
BasicConfig
.*;
import
static
com
.
oto
.
config
.
BasicConfig
.*;
import
static
com
.
oto
.
utils
.
BaseUtils
.
ssoLogin
;
import
static
com
.
oto
.
utils
.
ThreadSleepUtils
.
sleep
;
import
static
com
.
oto
.
utils
.
ThreadSleepUtils
.
sleep
;
public
class
Invite
implements
Authorization
{
public
class
Invite
implements
Authorization
{
...
@@ -505,4 +506,5 @@ public class Invite implements Authorization {
...
@@ -505,4 +506,5 @@ public class Invite implements Authorization {
sunndayWeek
=
cal
.
getTimeInMillis
();
sunndayWeek
=
cal
.
getTimeInMillis
();
}
}
}
}
}
}
src/test/java/com/oto/cases/otoseller/Manager.java
View file @
92fcaf71
...
@@ -42,20 +42,6 @@ public class Manager implements Authorization {
...
@@ -42,20 +42,6 @@ public class Manager implements Authorization {
for
(
int
i
=
0
;
i
<
6
;
i
++){
for
(
int
i
=
0
;
i
<
6
;
i
++){
PubForm
(
"1513636130"
+
i
,
"自动化测试用户"
+
i
);
PubForm
(
"1513636130"
+
i
,
"自动化测试用户"
+
i
);
}
}
// for(int i = 20;i<80;i++){
// HashMap<String,Object> params = new HashMap<>();
// params.put("formId", "Kj22MTU5MQ");
// params.put("phoneNum", "130112100"+i);
// params.put("urlLink", "https://kjj-static.duibatest.com.cn/tk/202204111900-1?formId=Kj22MTU5MQ&channel=jrtt&agent=td");
// params.put("username", "小红11月用户"+i);
// params.put("uuid", "622d83e4-ca21-4ccd-94cb-182c0f2a6b60");
// Response response = network.postResponse(params,BasicConfig.FORM_submit);
// String recordId = response.jsonPath().getString("data.recordId");
// Assert.assertNotNull(recordId,network.message(params,BasicConfig.FORM_submit,"客户创建失败",response.body().asString()));
//
// }
}
}
@Test
(
description
=
"通过销售名称查找销售"
,
priority
=
2
)
@Test
(
description
=
"通过销售名称查找销售"
,
priority
=
2
)
...
@@ -562,8 +548,6 @@ public class Manager implements Authorization {
...
@@ -562,8 +548,6 @@ public class Manager implements Authorization {
sleep
(
1000
);
sleep
(
1000
);
assignSeller
(
Manager
.
cust_id
+
2
,
INVITE_ID
,
true
,
1
,
"manage"
);
assignSeller
(
Manager
.
cust_id
+
2
,
INVITE_ID
,
true
,
1
,
"manage"
);
}
}
@Test
(
description
=
"搜索角色列表"
,
priority
=
44
)
@Test
(
description
=
"搜索角色列表"
,
priority
=
44
)
...
...
src/test/java/com/oto/cases/otoseller/Phone.java
View file @
92fcaf71
...
@@ -639,7 +639,6 @@ public class Phone implements Authorization {
...
@@ -639,7 +639,6 @@ public class Phone implements Authorization {
@Test
(
description
=
"邀约销售查看见面次数"
,
priority
=
59
)
@Test
(
description
=
"邀约销售查看见面次数"
,
priority
=
59
)
public
void
邀约销售查看见面次数
(){
public
void
邀约销售查看见面次数
(){
otoInviterAuth
();
//邀约统计客户已上传的总面访次数
otoInviterAuth
();
//邀约统计客户已上传的总面访次数
sleep
(
2000
);
HashMap
<
String
,
Object
>
params1
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
params1
=
new
HashMap
<>();
params1
.
put
(
"custId"
,
cust_id
);
params1
.
put
(
"custId"
,
cust_id
);
params1
.
put
(
"type"
,
1
);
params1
.
put
(
"type"
,
1
);
...
@@ -783,13 +782,6 @@ public class Phone implements Authorization {
...
@@ -783,13 +782,6 @@ public class Phone implements Authorization {
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
WORK_delCust
,
"删除客户失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
WORK_delCust
,
"删除客户失败"
,
response
.
body
().
asString
()));
}
}
// for(int i = 8885;i<8895;i++){
// HashMap<String,Object> params = new HashMap<>();
// params.put("custId", i);
// Response response = network.postResponse(params,BasicConfig.WORK_delCust);
//
// }
}
}
@Test
(
description
=
"删除客户填写的表单记录"
,
priority
=
91
)
@Test
(
description
=
"删除客户填写的表单记录"
,
priority
=
91
)
...
@@ -800,12 +792,6 @@ public class Phone implements Authorization {
...
@@ -800,12 +792,6 @@ public class Phone implements Authorization {
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
WORK_delPubFormRecord
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
WORK_delPubFormRecord
);
}
}
// for(int i =10;i<50;i++){
// HashMap<String,Object> params = new HashMap<>();
// params.put("phoneNum", "130112100"+i);
// Response response = network.postResponse(params,BasicConfig.WORK_delPubFormRecord);
//
// }
}
}
@Test
(
description
=
"退出登录"
,
priority
=
92
)
@Test
(
description
=
"退出登录"
,
priority
=
92
)
...
...
src/test/java/com/oto/cases/otoseller/TestFile.java
0 → 100644
View file @
92fcaf71
package
com
.
oto
.
cases
.
otoseller
;
import
com.oto.cases.admin.Authorization
;
import
com.oto.config.BasicConfig
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeTest
;
import
org.testng.annotations.Test
;
import
java.util.HashMap
;
import
static
com
.
oto
.
cases
.
otoseller
.
Work
.
assignSeller
;
import
static
com
.
oto
.
utils
.
BaseUtils
.
ssoLogin
;
public
class
TestFile
implements
Authorization
{
@BeforeTest
public
void
setUp
(){
ssoLogin
();
otoTestAuth
();
}
@Test
(
description
=
"新建客户"
,
priority
=
1
)
public
void
testSubmit
(){
for
(
int
i
=
10
;
i
<
100
;
i
++){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"formId"
,
"Kj22MTU5MQ"
);
params
.
put
(
"phoneNum"
,
"130202300"
+
i
);
params
.
put
(
"urlLink"
,
"https://kjj-static.duibatest.com.cn/tk/202204111900-1?formId=Kj22MTU5MQ&channel=jrtt&agent=td"
);
params
.
put
(
"username"
,
"团队池用户"
+
i
);
params
.
put
(
"uuid"
,
"622d83e4-ca21-4ccd-94cb-182c0f2a6b60"
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
FORM_submit
);
String
recordId
=
response
.
jsonPath
().
getString
(
"data.recordId"
);
Assert
.
assertNotNull
(
recordId
,
network
.
message
(
params
,
BasicConfig
.
FORM_submit
,
"客户创建失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"分配客户并创建邀约记录"
,
priority
=
2
)
public
void
testInvite
(){
long
time
=
System
.
currentTimeMillis
()
+
86400000
;
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"eventType"
,
2
);
params
.
put
(
"firstInterviewFlag"
,
1
);
params
.
put
(
"interviewConfId"
,
628
);
params
.
put
(
"interviewTime"
,
time
);
params
.
put
(
"haveMealFlag"
,
1
);
params
.
put
(
"pickTakeFlag"
,
0
);
params
.
put
(
"custNum"
,
1
);
for
(
int
i
=
9277
;
i
<
9298
;
i
++){
assignSeller
(
i
,
2
,
true
,
1
,
"manage"
);
params
.
put
(
"custId"
,
i
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
WORK_invite_submit
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
WORK_invite_submit
,
"修改客户邀约承诺失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"删除客户"
,
priority
=
90
)
public
void
删除客户
(){
for
(
int
i
=
8885
;
i
<
8895
;
i
++){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"custId"
,
i
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
WORK_delCust
);
}
}
@Test
(
description
=
"删除客户填写的表单记录"
,
priority
=
91
)
public
void
删除客户填写的表单记录
(){
for
(
int
i
=
10
;
i
<
50
;
i
++){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"phoneNum"
,
"130112100"
+
i
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
WORK_delPubFormRecord
);
}
}
}
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