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
19f9eefa
Commit
19f9eefa
authored
Sep 26, 2021
by
龚小红
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加收货地址的提交
parent
6ff883e9
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
309 additions
and
309 deletions
+309
-309
HomePage.java
src/test/java/com/kjj/cases/assistant/homePage/HomePage.java
+1
-0
Pay.java
src/test/java/com/kjj/cases/assistant/pay/Pay.java
+1
-8
GoldenEgg.java
src/test/java/com/kjj/cases/live/treasure/GoldenEgg.java
+48
-42
liveTestNG.xml
src/test/liveTestNG.xml
+259
-259
No files found.
src/test/java/com/kjj/cases/assistant/homePage/HomePage.java
View file @
19f9eefa
...
...
@@ -795,6 +795,7 @@ public class HomePage implements Authorization {
//获取用户信息
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
Response
response
=
network
.
getResponse
(
USER_INFO
);
System
.
out
.
println
(
response
.
body
().
asString
());
userId
=
response
.
jsonPath
().
getInt
(
"data.userId"
);
Assert
.
assertNotNull
(
response
.
jsonPath
().
getJsonObject
(
"data"
),
network
.
message
(
USER_INFO
,
"获取用户信息失败"
,
response
.
body
().
asString
()));
...
...
src/test/java/com/kjj/cases/assistant/pay/Pay.java
View file @
19f9eefa
...
...
@@ -103,13 +103,8 @@ public class Pay implements Authorization {
System
.
out
.
println
(
response
.
body
().
asString
());
int
data
=
response
.
jsonPath
().
getInt
(
"data"
);
Assert
.
assertTrue
(
data
==
5
,
network
.
message
(
statusParams
,
PAY_status
,
"取消支付:订单状态不对"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"默认付费_切换会员类型为保险版"
,
priority
=
4
)
public
void
默认付费
_
切换为保险版会员类型
(){
//会员类型版本判断
...
...
@@ -139,7 +134,7 @@ public class Pay implements Authorization {
Response
response
=
network
.
getResponse
(
PAY_isRenewCondition
);
System
.
out
.
println
(
response
.
body
().
asString
());
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assert
False
(
data
,
network
.
message
(
PAY_isRenewCondition
,
"
不满足续费条件"
,
response
.
body
().
asString
()));
Assert
.
assert
True
(
data
,
network
.
message
(
PAY_isRenewCondition
,
"用户
不满足续费条件"
,
response
.
body
().
asString
()));
}
...
...
@@ -176,8 +171,6 @@ public class Pay implements Authorization {
codeListParam
.
put
(
"pageSize"
,
20
);
response
=
network
.
getResponse
(
codeListParam
,
MANAGER_codeList
);
promotionCode
=
response
.
jsonPath
().
getString
(
"data.list[0].promotionCode"
);
}
...
...
src/test/java/com/kjj/cases/live/treasure/GoldenEgg.java
View file @
19f9eefa
...
...
@@ -16,6 +16,7 @@ import org.testng.Assert;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Test
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -1023,50 +1024,55 @@ public class GoldenEgg implements Authorization {
Assert
.
assertEquals
(
receiveNum
,
1
,
network
.
message
(
confDetailParam
,
BasicConfig
.
MANAGER_goldenEgg_detail
,
"实物奖品已领取错误"
,
response
.
body
().
asString
()));
}
// @Test(description = "查询用户是否未提交收货地址", priority = 59)
// public void 查询用户是否未提交收货地址() {
// visitorAuth();
// ThreadSleepUtils.sleep(1000);
// Map<String, Object> locationResultParam = new HashMap<>();
// locationResultParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
// locationResultParam.put("scene", 1);
// Response locationResultRes = network.getResponse(locationResultParam, BasicConfig.USER_locationResult);
// System.out.println(locationResultRes.body().asString());
// Object winnerRegion = locationResultRes.jsonPath().getJsonObject("data.winnerRegion");
// Assert.assertNull(winnerRegion, network.message(locationResultParam, BasicConfig.USER_locationResult, "查询用户是否提交收货地址失败", locationResultRes.body().asString()));
// }
//
// @Test(description = "提交收货地址", priority = 60)
// public void 提交收货地址() {
// visitorAuth();
// Map<String, Object> submitInfoParam = new HashMap<>();
// submitInfoParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
// submitInfoParam.put("confId", interactConfId);
// submitInfoParam.put("winnerName", "中奖人");
// submitInfoParam.put("winnerName", "浙江省杭州市");
// submitInfoParam.put("location", "西湖区数娱大厦");
// submitInfoParam.put("phoneNum", "13498765432");
// Response submitInfoRes = network.postResponse(submitInfoParam, BasicConfig.USER_submitInfo);
// System.out.println(submitInfoRes.body().asString());
// Boolean result = submitInfoRes.jsonPath().getBoolean("success");
// Assert.assertTrue(result, network.message(submitInfoParam, BasicConfig.USER_submitInfo, "提交姓名失败", submitInfoRes.body().asString()));
// ThreadSleepUtils.sleep(3000);
// }
//
// @Test(description = "查询用户是否提交收货地址", priority = 61)
// public void 查询用户是否提交收货地址() {
// visitorAuth();
// ThreadSleepUtils.sleep(1000);
// Map<String, Object> locationResultParam = new HashMap<>();
// locationResultParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
// locationResultParam.put("scene", 1);
// Response locationResultRes = network.getResponse(locationResultParam, BasicConfig.USER_locationResult);
// System.out.println(locationResultRes.body().asString());
// Object winnerRegion = locationResultRes.jsonPath().getJsonObject("data.winnerRegion");
// Assert.assertNotNull(winnerRegion, network.message(locationResultParam, BasicConfig.USER_locationResult, "查询用户是否提交收货地址失败", locationResultRes.body().asString()));
// }
@Test
(
description
=
"查询用户是否未提交收货地址"
,
priority
=
59
)
public
void
查询用户是否未提交收货地址
()
{
visitorAuth
();
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
locationResultParam
=
new
HashMap
<>();
locationResultParam
.
put
(
"liveId"
,
"Kj21NTE3Mjc"
);
locationResultParam
.
put
(
"scene"
,
1
);
Response
locationResultRes
=
network
.
getResponse
(
locationResultParam
,
BasicConfig
.
USER_locationResult
);
System
.
out
.
println
(
locationResultRes
.
body
().
asString
());
Object
winnerRegion
=
locationResultRes
.
jsonPath
().
getJsonObject
(
"data.winnerRegion"
);
Assert
.
assertNull
(
winnerRegion
,
network
.
message
(
locationResultParam
,
BasicConfig
.
USER_locationResult
,
"查询用户是否提交收货地址失败"
,
locationResultRes
.
body
().
asString
()));
}
@Test
(
description
=
"提交收货地址"
,
priority
=
60
)
public
void
提交收货地址
()
{
visitorAuth
();
ArrayList
<
String
>
region
=
new
ArrayList
<>();
region
.
add
(
"浙江省"
);
region
.
add
(
"杭州市"
);
region
.
add
(
"西湖区"
);
Map
<
String
,
Object
>
submitInfoParam
=
new
HashMap
<>();
submitInfoParam
.
put
(
"liveId"
,
"Kj21NTE3Mjc"
);
submitInfoParam
.
put
(
"confId"
,
"Kj20NjIwNTY3"
);
submitInfoParam
.
put
(
"winnerName"
,
"中奖人"
);
submitInfoParam
.
put
(
"region"
,
region
);
submitInfoParam
.
put
(
"location"
,
"西湖区数娱大厦"
);
submitInfoParam
.
put
(
"phoneNum"
,
"13498765432"
);
Response
submitInfoRes
=
network
.
postResponse
(
submitInfoParam
,
BasicConfig
.
USER_submitInfo
);
System
.
out
.
println
(
submitInfoRes
.
body
().
asString
());
Boolean
result
=
submitInfoRes
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
result
,
network
.
message
(
submitInfoParam
,
BasicConfig
.
USER_submitInfo
,
"提交收货地址失败"
,
submitInfoRes
.
body
().
asString
()));
ThreadSleepUtils
.
sleep
(
3000
);
}
@Test
(
description
=
"查询用户是否提交收货地址"
,
priority
=
61
)
public
void
查询用户是否提交收货地址
()
{
visitorAuth
();
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
locationResultParam
=
new
HashMap
<>();
locationResultParam
.
put
(
"liveId"
,
"Kj21NTE3Mjc"
);
locationResultParam
.
put
(
"scene"
,
1
);
Response
locationResultRes
=
network
.
getResponse
(
locationResultParam
,
BasicConfig
.
USER_locationResult
);
System
.
out
.
println
(
locationResultRes
.
body
().
asString
());
Object
winnerRegion
=
locationResultRes
.
jsonPath
().
getJsonObject
(
"data.winnerRegion"
);
Assert
.
assertNotNull
(
winnerRegion
,
network
.
message
(
locationResultParam
,
BasicConfig
.
USER_locationResult
,
"查询用户是否提交收货地址失败"
,
locationResultRes
.
body
().
asString
()));
}
@Test
(
description
=
"获取直播配置详情"
,
priority
=
62
)
public
void
获取直播配置详情
()
{
adminAuth
();
Map
<
String
,
Object
>
ConfDetailParam
=
new
HashMap
<>();
ConfDetailParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
ConfDetailRes
=
network
.
getResponse
(
ConfDetailParam
,
BasicConfig
.
ANCHOR_getConfDetail
);
...
...
src/test/liveTestNG.xml
View file @
19f9eefa
This diff is collapsed.
Click to expand it.
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