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
5b175a1f
Commit
5b175a1f
authored
Aug 07, 2021
by
xiamengchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
补充线索类型
parent
94d55ce6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
90 additions
and
50 deletions
+90
-50
ForwardAndRead.java
...java/com/kjj/cases/assistant/whoSawMe/ForwardAndRead.java
+70
-33
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+5
-2
wechatTestNG.xml
src/test/wechatTestNG.xml
+15
-15
No files found.
src/test/java/com/kjj/cases/assistant/whoSawMe/ForwardAndRead.java
View file @
5b175a1f
...
...
@@ -8,6 +8,8 @@ import io.restassured.response.Response;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Test
;
import
org.w3c.dom.events.UIEvent
;
import
java.io.IOException
;
import
java.util.*
;
...
...
@@ -25,6 +27,8 @@ public class ForwardAndRead implements Authorization {
private
long
forwardTime
;
private
String
questionId
;
public
static
Map
<
String
,
Integer
>
custClueStatistics
;
private
String
riskTestContentId
;
//评测contentId
private
String
riskTestScId
;
// 评测scid
@BeforeClass
public
void
setUp
()
throws
IOException
{
...
...
@@ -39,9 +43,7 @@ public class ForwardAndRead implements Authorization {
param
=
new
HashMap
<>();
custClueStatistics
=
new
HashMap
<>();
param
.
put
(
"userId"
,
userId
);
System
.
out
.
println
(
param
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
CLUESTATISTICS
);
System
.
out
.
println
(
response
.
body
().
asString
());
int
drawMaterial
=
response
.
jsonPath
().
getInt
(
"data.drawMaterial"
);
int
drawPresentInsuranceCount
=
response
.
jsonPath
().
getInt
(
"data.drawPresentInsuranceCount"
);
int
faqCount
=
response
.
jsonPath
().
getInt
(
"data.faqCount"
);
...
...
@@ -140,37 +142,37 @@ public class ForwardAndRead implements Authorization {
}
// 获取新用户
@Test
(
description
=
"新用户访问"
,
priority
=
7
)
public
void
新用户访问
()
throws
IOException
{
ThreadSleepUtils
.
sleep
(
5000
);
network
.
agentCookies
.
put
(
"tku"
,
BaseUtils
.
tku
);
response
=
network
.
getResponse
(
BasicConfig
.
USER_INFO
);
System
.
out
.
println
(
response
.
body
().
asString
());
param
.
clear
();
param
.
put
(
"scid"
,
articleScId
);
param
.
put
(
"fromUserId"
,
sellerId
);
param
.
put
(
"cancelPush"
,
false
);
param
.
put
(
"visitPath"
,
0
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
CONTENT_READ
);
System
.
out
.
println
(
response
.
body
().
asString
());
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
CONTENT_READ
,
"接口调用失败"
,
response
.
body
().
asString
()));
}
// 新用户领取赠险
@Test
(
description
=
"新用户领取赠险"
,
priority
=
8
)
public
void
新用户领取赠险
()
throws
IOException
{
param
.
clear
();
param
.
put
(
"clueTypeName"
,
"WELFARE_INSURANCE"
);
param
.
put
(
"insuranceId"
,
insuranceId
);
param
.
put
(
"locationSource"
,
1
);
param
.
put
(
"scId"
,
articleScId
);
param
.
put
(
"sourceId"
,
articleScId
);
param
.
put
(
"sourceType"
,
1
);
response
=
network
.
postResponse
(
param
,
BasicConfig
.
SELLERCARD_SENDPUSHFORSCAN
);
System
.
out
.
println
(
response
.
body
().
asString
());
String
data
=
response
.
jsonPath
().
getString
(
"data"
);
Assert
.
assertEquals
(
data
,
"success"
,
network
.
message
(
param
,
BasicConfig
.
SELLERCARD_SENDPUSHFORSCAN
,
"领取赠险失败"
,
response
.
body
().
asString
()));
}
//
@Test(description = "新用户访问", priority = 7)
//
public void 新用户访问() throws IOException{
//
ThreadSleepUtils.sleep(5000);
//
network.agentCookies.put("tku", BaseUtils.tku);
//
response = network.getResponse(BasicConfig.USER_INFO);
//
System.out.println(response.body().asString());
//
param.clear();
//
param.put("scid", articleScId);
//
param.put("fromUserId", sellerId);
//
param.put("cancelPush", false);
//
param.put("visitPath", 0);
//
response = network.getResponse(param, BasicConfig.CONTENT_READ);
//
System.out.println(response.body().asString());
//
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CONTENT_READ, "接口调用失败", response.body().asString()));
//
}
//
//
// 新用户领取赠险
//
@Test(description = "新用户领取赠险", priority = 8)
//
public void 新用户领取赠险() throws IOException{
//
param.clear();
//
param.put("clueTypeName", "WELFARE_INSURANCE");
//
param.put("insuranceId", insuranceId);
//
param.put("locationSource", 1);
//
param.put("scId", articleScId);
//
param.put("sourceId", articleScId);
//
param.put("sourceType", 1);
//
response = network.postResponse(param, BasicConfig.SELLERCARD_SENDPUSHFORSCAN);
//
System.out.println(response.body().asString());
//
String data = response.jsonPath().getString("data");
//
Assert.assertEquals(data, "success", network.message(param, BasicConfig.SELLERCARD_SENDPUSHFORSCAN, "领取赠险失败", response.body().asString()));
//
}
@Test
(
description
=
"二度访客阅读文章"
,
priority
=
9
)
public
void
二度访客阅读文章
()
throws
IOException
{
...
...
@@ -240,6 +242,41 @@ public class ForwardAndRead implements Authorization {
ThreadSleepUtils
.
sleep
(
10000
);
}
@Test
(
description
=
"获取文章测评"
,
priority
=
14
)
public
void
获取文章测评
()
throws
IOException
{
// 获取测评contentId
param
.
clear
();
param
.
put
(
"scid"
,
articleScId
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
SELLERCARD_RECOMMENDLISTV3
);
Map
<
String
,
Object
>
clueActivityDisplayVo
=
response
.
jsonPath
().
getMap
(
"data.clueActivityDisplayVo"
);
riskTestContentId
=
(
String
)
clueActivityDisplayVo
.
get
(
"contentId"
);
// 获取测评scid
String
sid
=
encodeId
(
sellerId
);
param
.
clear
();
param
.
put
(
"contentId"
,
riskTestContentId
);
param
.
put
(
"sid"
,
sid
);
System
.
out
.
println
(
param
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
GETSCID
);
riskTestScId
=
response
.
jsonPath
().
getString
(
"data"
);
Assert
.
assertNotNull
(
riskTestScId
,
network
.
message
(
param
,
BasicConfig
.
GETSCID
,
"获取测评scid失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"领取测评报告"
,
priority
=
15
)
public
void
领取测评报告
()
throws
IOException
{
param
.
clear
();
param
.
put
(
"completed"
,
1
);
param
.
put
(
"originScId"
,
articleScId
);
param
.
put
(
"riskTestOperateType"
,
2
);
param
.
put
(
"scid"
,
riskTestScId
);
param
.
put
(
"sourceId"
,
articleScId
);
param
.
put
(
"sourceType"
,
1
);
param
.
put
(
"visitExtra"
,
"{\"性别\":\"男\",\"年龄\":\"85后\",\"家庭成员构成\":\"2个子女\",\"不良生活习惯\":\"运动少\",\"出行习惯\":\"骑行\",\"月收入\":\"5000-10000\",\"负债水平\":\"无\"}"
);
response
=
network
.
postResponse
(
param
,
BasicConfig
.
RISKTEST_SENDINFO
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
param
,
BasicConfig
.
RISKTEST_SENDINFO
,
"点击领取测评报告失败"
,
response
.
body
().
asString
()));
}
// 通过素材contentId获取线索员文章scId
public
String
getContentScId
(
String
contentId
){
param
=
new
HashMap
<>();
...
...
src/test/java/com/kjj/config/BasicConfig.java
View file @
5b175a1f
...
...
@@ -73,9 +73,9 @@ public class BasicConfig {
// 基础线访客 TKU---"请勿打扰"
public
static
String
VISITOR_TKU
=
"T3gM31f18jCGvqvoyJRzyMTdpcPDJWUJJP4VQje7p9sfC4HKmj5NJfCUkxusAyFb5SpkWS31srDTYr6KtV"
;
// 基础线访客(小雪人) TKU
public
static
String
VISITOR1_TKU
=
"T3gM31f18jCFXzk692pKjJCqJZdDv8Nb3htkzNk983cP
MspUQD6pVEn2FNMefM2nieKPicXG9c1tDg8qtN
"
;
public
static
String
VISITOR1_TKU
=
"T3gM31f18jCFXzk692pKjJCqJZdDv8Nb3htkzNk983cP
PrfjggTn4Gv1ytpR3XAQusWRz7uTsHaibp6Es8
"
;
// 基础线访客
public
static
String
VISITOR2_TKU
=
"T3gM31f18jCeKCBVHf5MANgyXeBZGCm8vTJQTuWYXHF
qx97PATsWyUYamGaNdNip8bEs9shoE9tTsAmp8x
"
;
// 二度访客用
public
static
String
VISITOR2_TKU
=
"T3gM31f18jCeKCBVHf5MANgyXeBZGCm8vTJQTuWYXHF
r27f8asoYpZASD6JzN5VJsBpQ8NxvzrJFGz2Ame
"
;
// 二度访客用
// 访客的sids
public
static
final
String
sids
=
"Kj21MjMwNTU"
;
// 访客(SuYi) userID:4425
...
...
@@ -87,6 +87,7 @@ public class BasicConfig {
// *************** 客集集域名 ***************
public
static
final
String
HOST
=
"https://kjj.m.duibatest.com.cn"
;
public
static
final
String
ACTIVITY_HOST
=
"https://kjj-activity.duibatest.com.cn"
;
public
static
final
String
ACTIVITY1_HOST
=
"https://kjj-activity-1.duibatest.com.cn"
;
public
static
final
String
SSO_HOST
=
"https://sso.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"
;
...
...
@@ -801,6 +802,8 @@ public class BasicConfig {
public
static
final
String
ARTICLE_ENHANCEDCOLUMN_GETFAQS
=
HOST
+
"/kjy/mp/enhancedColumn/getFAQs"
;
public
static
final
String
ARTICLE_getQuestionDetail
=
HOST
+
"/kjy/mp/explosioncontent/qa/getQuestionDetail"
;
public
static
final
String
ARTICLE_GETEXPLOSIONCONTENTLIST
=
HOST
+
"/kjy/mp/explosioncontent/getExplosionContentList"
;
// 风险评测
public
static
final
String
RISKTEST_SENDINFO
=
ACTIVITY1_HOST
+
"/kjy/mp/activity/sendInfoForRisk"
;
// ************** 发圈素材 ***************
public
static
final
String
FRIENDS_GETMATERIALTAGS
=
HOST
+
"/kjy/mp/materialContent/getmaterialTags"
;
...
...
src/test/wechatTestNG.xml
View file @
5b175a1f
...
...
@@ -52,21 +52,21 @@
<class
name=
"com.kjj.cases.assistant.whoSawMe.ForwardAndRead"
/>
</classes>
</test>
<test
preserve-order=
"true"
name =
"谁看过我"
>
<classes
>
<class
name=
"com.kjj.cases.assistant.whoSawMe.WhoSawMe"
/
>
</classes
>
</test
>
<test
preserve-order=
"true"
name =
"我的转发"
>
<classes
>
<class
name=
"com.kjj.cases.assistant.whoSawMe.MyForward"
/
>
</classes
>
</test
>
<test
preserve-order=
"true"
name =
"我的客户"
>
<classes
>
<class
name=
"com.kjj.cases.assistant.whoSawMe.MyCustomer"
/
>
</classes
>
</test
>
<!-- <test preserve-order="true" name = "谁看过我">--
>
<!-- <classes>--
>
<!-- <class name="com.kjj.cases.assistant.whoSawMe.WhoSawMe"/>--
>
<!-- </classes>--
>
<!-- </test>--
>
<!-- <test preserve-order="true" name = "我的转发">--
>
<!-- <classes>--
>
<!-- <class name="com.kjj.cases.assistant.whoSawMe.MyForward"/>--
>
<!-- </classes>--
>
<!-- </test>--
>
<!-- <test preserve-order="true" name = "我的客户">--
>
<!-- <classes>--
>
<!-- <class name="com.kjj.cases.assistant.whoSawMe.MyCustomer"/>--
>
<!-- </classes>--
>
<!-- </test>--
>
<!-- <test preserve-order="true" name = "贺卡">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.assistant.markettools.GreetingCrad"/>-->
...
...
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