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
46e1beec
Commit
46e1beec
authored
Sep 03, 2021
by
龚小红
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
删除oss对话模版,并添加签到领红包的测试用例
parent
747fd5d1
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
117 additions
and
119 deletions
+117
-119
SignRed.java
src/test/java/com/kjj/cases/assistant/homePage/SignRed.java
+105
-101
Potential.java
src/test/java/com/kjj/cases/live/agent/Potential.java
+1
-11
SaveLive.java
src/test/java/com/kjj/cases/live/liveConfig/SaveLive.java
+6
-6
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+0
-1
wechatTestNG.xml
src/test/wechatTestNG.xml
+5
-0
No files found.
src/test/java/com/kjj/cases/assistant/homePage/SignRed.java
View file @
46e1beec
//package com.kjj.cases.assistant.homePage;
//
//import com.kjj.cases.admin.Authorization;
//import io.restassured.response.Response;
//import org.testng.Assert;
//import org.testng.annotations.BeforeClass;
//import org.testng.annotations.Test;
//
//import java.util.HashMap;
//import java.util.Map;
//
//import static com.kjj.config.BasicConfig.*;
//
//public class SignRed implements Authorization {
// private int attendAmount;
// private int totalPromotionEarnings;
// @BeforeClass
// public void setUp() {
// agentTku();
// }
//
// @Test(description = "指定用户展示入口", priority = 1)
// public void 指定用户展示入口() {
// Response response = network.getResponse(ATTEND_entrance);
// System.out.println(response.body().asString());
// Boolean showFlag = response.jsonPath().getBoolean("data.showFlag");
// Boolean vipExpireFlag = response.jsonPath().getBoolean("data.vipExpireFlag");
// Assert.assertTrue(showFlag, network.message(ATTEND_entrance, "指定用户不展示入口", response.body().asString()));
// Assert.assertFalse(vipExpireFlag, network.message(ATTEND_entrance, "指定用户会员已到期", response.body().asString()));
// }
//
// @Test(description = "非指定用户展示入口", priority = 2)
// public void 非指定用户展示入口() {
// visitor2Tku();
// Response response = network.getResponse(ATTEND_entrance);
// System.out.println(response.body().asString());
// Boolean showFlag = response.jsonPath().getBoolean("data.showFlag");
// Boolean vipExpireFlag = response.jsonPath().getBoolean("data.vipExpireFlag");
// Assert.assertFalse(showFlag, network.message(ATTEND_entrance, "非指定用户展示入口", response.body().asString()));
// Assert.assertFalse(vipExpireFlag, network.message(ATTEND_entrance, "指定用户会员已到期", response.body().asString()));
// }
//
// @Test(description = "签到详情", priority = 3)
// public void 签到详情() {
// agentTku();
// Response response = network.getResponse(ATTEND_detail);
// System.out.println(response.body().asString());
// int roundNum = response.jsonPath().getInt("data.roundNum");
// Boolean todayAttendFlag = response.jsonPath().getBoolean("data.todayAttendFlag");
// Assert.assertEquals(roundNum, 7, network.message(ATTEND_detail, "签到周期错误", response.body().asString()));
// Assert.assertFalse(todayAttendFlag, network.message(ATTEND_detail, "用户今日已签到", response.body().asString()));
// }
//
// @Test(description = "获取累计收益", priority = 4)
// public void 获取累计收益() {
// Response response = network.getResponse(ATTEND_income);
// System.out.println(response.body().asString());
// totalPromotionEarnings = response.jsonPath().getInt("data.totalPromotionEarnings");
// int balance = response.jsonPath().getInt("data.balance");
// Assert.assertTrue(totalPromotionEarnings > 0, network.message(ATTEND_income, "签到周期错误", response.body().asString()));
// Assert.assertTrue(balance > 0, network.message(ATTEND_income, "签到周期错误", response.body().asString()));
//
// }
//
// @Test(description = "签到", priority = 5)
// public void 签到() {
// Response response = network.getResponse(ATTEND_open);
// System.out.println(response.body().asString());
// attendAmount = response.jsonPath().getInt("data.attendAmount");
// String attendDate = response.jsonPath().getString("data.attendDate");
// Assert.assertTrue(attendAmount > 0, network.message(ATTEND_open, "签到失败", response.body().asString()));
//
// }
//
// @Test(description = "签到金额验证", priority = 6)
// public void 签到金额验证() {
// Response response = network.getResponse(ATTEND_income);
// System.out.println(response.body().asString());
// int total = response.jsonPath().getInt("data.totalPromotionEarnings");
// Assert.assertEquals(total , attendAmount + totalPromotionEarnings,network.message(ATTEND_income, "签到周期错误", response.body().asString()));
// }
//
// @Test(description = "代理人账户明细",priority = 7)
// public void 代理人账户明细() {
// agentTku();
// Map<String, Object> Params = new HashMap<String, Object>();
// Params.put("type", 2);
// Params.put("pageNo", 1);
// Params.put("pageSize", 20);
// Response response = network.getResponse(Params, PAY_accDetail);
// System.out.println(response.body().asString());
// int changeType1 = response.jsonPath().getInt("data[0].changeType");
// String nickname = response.jsonPath().getString("data[0].nickname");
// String bizType = response.jsonPath().getString("data[0].bizType");
// int changeMoney = response.jsonPath().getInt("data[0].changeMoney");
// Assert.assertEquals(changeType1 ,2, network.message(PAY_accDetail, "收益明细为null", response.body().asString()));
// Assert.assertEquals(nickname, "吉吉",network.message(PAY_accDetail, "收益明细为null", response.body().asString()));
// Assert.assertEquals(bizType, "吉吉",network.message(PAY_accDetail, "收益明细为null", response.body().asString()));
// Assert.assertEquals(changeMoney, "吉吉",network.message(PAY_accDetail, "收益明细为null", response.body().asString()));
// }
//}
package
com
.
kjj
.
cases
.
assistant
.
homePage
;
import
com.kjj.cases.admin.Authorization
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Test
;
import
java.util.HashMap
;
import
java.util.Map
;
import
static
com
.
kjj
.
config
.
BasicConfig
.*;
public
class
SignRed
implements
Authorization
{
private
double
attendAmount
;
private
double
totalPromotionEarnings
;
private
boolean
todayAttendFlag
;
@BeforeClass
public
void
setUp
()
{
agentTku
();
}
@Test
(
description
=
"指定用户展示入口"
,
priority
=
1
)
public
void
指定用户展示入口
()
{
Response
response
=
network
.
getResponse
(
ATTEND_entrance
);
System
.
out
.
println
(
response
.
body
().
asString
());
Boolean
showFlag
=
response
.
jsonPath
().
getBoolean
(
"data.showFlag"
);
Boolean
vipExpireFlag
=
response
.
jsonPath
().
getBoolean
(
"data.vipExpireFlag"
);
Assert
.
assertTrue
(
showFlag
,
network
.
message
(
ATTEND_entrance
,
"指定用户不展示入口"
,
response
.
body
().
asString
()));
Assert
.
assertFalse
(
vipExpireFlag
,
network
.
message
(
ATTEND_entrance
,
"指定用户会员已到期"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"非指定用户展示入口"
,
priority
=
2
)
public
void
非指定用户展示入口
()
{
userTku2
();
Response
response
=
network
.
getResponse
(
ATTEND_entrance
);
System
.
out
.
println
(
response
.
body
().
asString
());
Boolean
showFlag
=
response
.
jsonPath
().
getBoolean
(
"data.showFlag"
);
Boolean
vipExpireFlag
=
response
.
jsonPath
().
getBoolean
(
"data.vipExpireFlag"
);
Assert
.
assertFalse
(
showFlag
,
network
.
message
(
ATTEND_entrance
,
"非指定用户展示入口"
,
response
.
body
().
asString
()));
Assert
.
assertFalse
(
vipExpireFlag
,
network
.
message
(
ATTEND_entrance
,
"指定用户会员已到期"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"签到详情"
,
priority
=
3
)
public
void
签到详情
()
{
agentTku
();
Response
response
=
network
.
getResponse
(
ATTEND_detail
);
System
.
out
.
println
(
response
.
body
().
asString
());
int
roundNum
=
response
.
jsonPath
().
getInt
(
"data.roundNum"
);
todayAttendFlag
=
response
.
jsonPath
().
getBoolean
(
"data.todayAttendFlag"
);
Assert
.
assertEquals
(
roundNum
,
7
,
network
.
message
(
ATTEND_detail
,
"签到周期错误"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取累计收益"
,
priority
=
4
)
public
void
获取累计收益
()
{
Response
response
=
network
.
getResponse
(
ATTEND_income
);
System
.
out
.
println
(
response
.
body
().
asString
());
totalPromotionEarnings
=
response
.
jsonPath
().
getDouble
(
"data.totalPromotionEarnings"
);
double
balance
=
response
.
jsonPath
().
getDouble
(
"data.balance"
);
Assert
.
assertTrue
(
totalPromotionEarnings
>
0
,
network
.
message
(
ATTEND_income
,
"签到周期错误"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
balance
>
0
,
network
.
message
(
ATTEND_income
,
"签到周期错误"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"签到"
,
priority
=
5
)
public
void
签到
()
{
Response
response
=
network
.
postResponse
(
ATTEND_open
);
System
.
out
.
println
(
response
.
body
().
asString
());
if
(!
todayAttendFlag
)
{
attendAmount
=
response
.
jsonPath
().
getDouble
(
"data.attendAmount"
);
Assert
.
assertTrue
(
attendAmount
>
0
,
network
.
message
(
ATTEND_open
,
"签到失败"
,
response
.
body
().
asString
()));
}
else
{
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
ATTEND_open
,
"重复签到成功"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"签到金额验证"
,
priority
=
6
)
public
void
签到金额验证
()
{
Response
response
=
network
.
getResponse
(
ATTEND_income
);
System
.
out
.
println
(
response
.
body
().
asString
());
double
total
=
response
.
jsonPath
().
getDouble
(
"data.totalPromotionEarnings"
);
Assert
.
assertEquals
(
total
,
attendAmount
+
totalPromotionEarnings
,
network
.
message
(
ATTEND_income
,
"签到周期错误"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"代理人账户明细"
,
priority
=
7
)
public
void
代理人账户明细
()
{
agentTku
();
Map
<
String
,
Object
>
Params
=
new
HashMap
<
String
,
Object
>();
Params
.
put
(
"type"
,
2
);
Params
.
put
(
"pageNo"
,
1
);
Params
.
put
(
"pageSize"
,
20
);
Response
response
=
network
.
getResponse
(
Params
,
PAY_accDetail
);
System
.
out
.
println
(
response
.
body
().
asString
());
int
changeType1
=
response
.
jsonPath
().
getInt
(
"data[0].changeType"
);
String
nickname
=
response
.
jsonPath
().
getString
(
"data[0].nickname"
);
int
bizType
=
response
.
jsonPath
().
getInt
(
"data[0].bizType"
);
String
changeMoney
=
response
.
jsonPath
().
getString
(
"data[0].changeMoney"
);
Assert
.
assertEquals
(
changeType1
,
2
,
network
.
message
(
PAY_accDetail
,
"收益明细类型错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
nickname
,
"吉吉"
,
network
.
message
(
PAY_accDetail
,
"签到用户名称错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
bizType
,
16
,
network
.
message
(
PAY_accDetail
,
"收益明细类型错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
changeMoney
,
String
.
format
(
"%.2f"
,
attendAmount
/
100
),
network
.
message
(
PAY_accDetail
,
"收益金额错误"
,
response
.
body
().
asString
()));
}
}
src/test/java/com/kjj/cases/live/agent/Potential.java
View file @
46e1beec
...
...
@@ -94,19 +94,9 @@ public class Potential implements Authorization {
System
.
out
.
println
(
response
.
body
().
asString
());
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
Params
,
BasicConfig
.
ANCHOR_agreeStatus
,
"客跟进机会同意状态为false"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取对话模版oss地址"
,
priority
=
7
)
public
void
获取对话模版
oss
地址
()
{
Response
response
=
network
.
getResponse
(
BasicConfig
.
ANCHOR_ossDialogue
);
System
.
out
.
println
(
response
.
body
().
asString
());
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
BasicConfig
.
ANCHOR_ossDialogue
,
"未获取到对话模版oss地址"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"二度用户获取话术模板"
,
priority
=
8
)
@Test
(
description
=
"二度用户获取话术模板"
,
priority
=
7
)
public
void
二度用户获取话术模板
()
{
visitorAuth5
();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
...
...
src/test/java/com/kjj/cases/live/liveConfig/SaveLive.java
View file @
46e1beec
...
...
@@ -2327,7 +2327,7 @@ public class SaveLive implements Authorization {
/**
* 亲友抽奖券配置
*/
@Test
(
description
=
"保存亲友抽奖券配置"
,
priority
=
12
8
)
@Test
(
description
=
"保存亲友抽奖券配置"
,
priority
=
12
4
)
public
void
保存亲友抽奖券配置
(){
ssoLogin
();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
...
...
@@ -2345,7 +2345,7 @@ public class SaveLive implements Authorization {
Assert
.
assertTrue
(
data
,
network
.
message
(
Params
,
BasicConfig
.
MANAGER_relativeLottery
,
"保存亲友券配置失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"查看亲友抽奖券配置详情"
,
priority
=
12
9
)
@Test
(
description
=
"查看亲友抽奖券配置详情"
,
priority
=
12
5
)
public
void
查看亲友抽奖券配置详情
()
{
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
...
...
@@ -2360,7 +2360,7 @@ public class SaveLive implements Authorization {
Assert
.
assertEquals
(
lotteryNum
,
3
,
network
.
message
(
Params
,
BasicConfig
.
MANAGER_detailLottery
,
"亲友抽奖券数量错误"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"开启亲友抽奖券配置"
,
priority
=
1
30
)
@Test
(
description
=
"开启亲友抽奖券配置"
,
priority
=
1
26
)
public
void
开启亲友抽奖券配置
()
{
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
...
...
@@ -2371,7 +2371,7 @@ public class SaveLive implements Authorization {
Assert
.
assertTrue
(
data
,
network
.
message
(
Params
,
BasicConfig
.
MANAGER_switchStatusLottery
,
"开启亲友券配置失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"查询亲友抽奖券配置状态"
,
priority
=
1
31
)
@Test
(
description
=
"查询亲友抽奖券配置状态"
,
priority
=
1
27
)
public
void
查询亲友抽奖券配置状态
()
{
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
...
...
@@ -2388,7 +2388,7 @@ public class SaveLive implements Authorization {
/**
* 准客户承诺话术配置
*/
@Test
(
description
=
"保存客户承诺话术配置"
,
priority
=
1
32
)
@Test
(
description
=
"保存客户承诺话术配置"
,
priority
=
1
28
)
public
void
保存客户承诺话术配置
(){
ssoLogin
();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
...
...
@@ -2404,7 +2404,7 @@ public class SaveLive implements Authorization {
Assert
.
assertTrue
(
data
,
network
.
message
(
Params
,
BasicConfig
.
MANAGER_saveDialogue
,
"保存客户承诺话术配置失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"查看客户承诺话术配置"
,
priority
=
1
33
)
@Test
(
description
=
"查看客户承诺话术配置"
,
priority
=
1
29
)
public
void
查看客户承诺话术配置
()
{
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
...
...
src/test/java/com/kjj/config/BasicConfig.java
View file @
46e1beec
...
...
@@ -108,7 +108,6 @@ public class BasicConfig {
public
static
final
String
ANCHOR_agree
=
MOBILE_HOST
+
"/kjy/live/agent/potential/agree"
;
public
static
final
String
ANCHOR_questionSubmitted
=
MOBILE_HOST
+
"/kjy/live/agent/potential/questionSubmitted"
;
public
static
final
String
ANCHOR_agreeStatus
=
MOBILE_HOST
+
"/kjy/live/agent/potential/agreeStatus"
;
public
static
final
String
ANCHOR_ossDialogue
=
MOBILE_HOST
+
"/kjy/live/agent/potential/ossDialogue"
;
// *************** 预告页配置 ***************
public
static
final
String
MANAGER_preViewWelfareList
=
MANAGER_HOST
+
"/kjy/manager/preView/conf/welfareList"
;
...
...
src/test/wechatTestNG.xml
View file @
46e1beec
...
...
@@ -11,6 +11,11 @@
<class
name=
"com.kjj.cases.assistant.pay.Pay"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"签到领红包"
>
<classes>
<class
name=
"com.kjj.cases.assistant.homePage.SignRed"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"邀请返现"
>
<classes>
<class
name=
"com.kjj.cases.assistant.pay.Cashback"
/>
...
...
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