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
3a0c5457
Commit
3a0c5457
authored
Jul 21, 2020
by
Su-Yi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加支付里回调验证
parent
7dc6a453
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
772 additions
and
771 deletions
+772
-771
Pay.java
src/test/java/com/kjj/qa/cases/Pay.java
+29
-6
BasicConfig.java
src/test/java/com/kjj/qa/config/BasicConfig.java
+4
-2
ManagerUtil.java
src/test/java/com/kjj/qa/utils/ManagerUtil.java
+7
-5
Article.class
target/test-classes/com/kjj/qa/cases/Article.class
+0
-0
report.html
test-output/report.html
+732
-758
No files found.
src/test/java/com/kjj/qa/cases/Pay.java
View file @
3a0c5457
...
...
@@ -94,10 +94,33 @@ public class Pay {
Assert
.
assertEquals
(
result
,
"OK"
,
network
.
message
(
cancelParams
,
PAY_ORDERCANCEL
,
"取消支付:取消支付失败"
,
response
.
body
().
asString
()));
//判断返回的微信调起参数中appId是否正确
}
// @Test (description = "默认付费_成功支付",priority = 4)
// public void 默认付费_成功支付() throws IOException {
//
// }
@Test
(
description
=
"默认付费_微信支付后回调"
,
priority
=
4
)
public
void
默认付费
_
微信支付后回调
()
throws
IOException
{
//创建支付
Map
<
String
,
Object
>
payParams
=
new
HashMap
<
String
,
Object
>();
payParams
.
put
(
"userVersion"
,
1
);
payParams
.
put
(
"comboId"
,
"Kj21MTU"
);
payParams
.
put
(
"oaId"
,
"1"
);
payParams
.
put
(
"paySource"
,
"2"
);
payParams
.
put
(
"sellerFrom"
,
""
);
Response
response
=
network
.
postResponse
(
payParams
,
PAY_ORDERCREATE
);
String
tradeNo
=
response
.
jsonPath
().
getString
(
"data.tradeNo"
);
// mock微信回调成功
Map
<
String
,
Object
>
callbackParams
=
new
HashMap
<
String
,
Object
>();
callbackParams
.
put
(
"tradeNo"
,
tradeNo
);
callbackParams
.
put
(
"payTradeNo"
,
"test"
);
callbackParams
.
put
(
"payResult"
,
true
);
response
=
network
.
getResponse
(
callbackParams
,
PAY_CALLOUT
);
boolean
result
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
result
,
network
.
message
(
callbackParams
,
PAY_CALLOUT
,
"微信支付回调成功,但我们订单处理失败"
,
response
.
body
().
asString
()));
// mock微信回调失败
callbackParams
.
put
(
"payResult"
,
false
);
response
=
network
.
getResponse
(
callbackParams
,
PAY_CALLOUT
);
result
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
result
,
network
.
message
(
callbackParams
,
PAY_CALLOUT
,
"微信支付回调失败,但我们订单处理也失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"默认付费_切换会员类型为保险版"
,
priority
=
5
)
public
void
默认付费
_
切换为保险版会员类型
()
throws
IOException
{
...
...
@@ -131,10 +154,10 @@ public class Pay {
@AfterClass
public
static
void
tearDown
()
throws
IOException
,
InterruptedException
{
apiCount
+=
6
;
apiCount
+=
7
;
// 切换为保险版vip
ManagerUtil
.
switchvip
(
ManagerUtil
.
getSellerId
()
);
ManagerUtil
.
switchvip
();
//延迟2秒
Thread
.
sleep
(
2000
);
...
...
src/test/java/com/kjj/qa/config/BasicConfig.java
View file @
3a0c5457
...
...
@@ -6,11 +6,11 @@ public class BasicConfig {
// *************** 配置信息,每次重新配置以下信息就ok ***************
// 是否推送
public
static
final
boolean
isPushReport
=
fals
e
;
//true
public
static
final
boolean
isPushReport
=
tru
e
;
//true
// 用户微信昵称
public
static
final
String
WECHAT_NAME
=
"小疙瘩人寿"
;
//true
// 用户tku
public
static
final
String
AGENT_TKU
=
"T3gM31f18jAWC
m9eqftWyzQUphBHVffMC23MD7Wj7wx7HuhnNuoCruNaDb9R4KYyDP3BVF9SpsZV5Grkup
"
;
public
static
final
String
AGENT_TKU
=
"T3gM31f18jAWC
fbjiyPds6LuAsfydVKRb9m3WoUoTqb1Qh8ktrwxtwja7msr2m4LkCm6nJ6CCoHTtzT7Lr
"
;
// *************** 钉钉机器人 ***************
// 线上-告警群
...
...
@@ -76,6 +76,8 @@ public class BasicConfig {
public
static
final
String
PAY_ORDERCANCEL
=
HOST
+
"/kjy/order/cancel"
;
public
static
final
String
PAY_CALLOUT
=
HOST
+
"/kjy/order/payCallout"
;
public
static
final
String
PAY_VERSIONEXCHANGE
=
HOST
+
"/kjy/mp/version/exchange"
;
public
static
final
String
PAY_DISTRIBUTE
=
HOST
+
"/kjy/sp/visitorPayment/distribute"
;
...
...
src/test/java/com/kjj/qa/utils/ManagerUtil.java
View file @
3a0c5457
...
...
@@ -58,7 +58,9 @@ public class ManagerUtil {
}
// 切换vip
public
static
void
switchvip
(
String
sellerId
)
{
public
static
void
switchvip
()
{
String
sellerId
=
getSellerId
();
// 登录下,检验是否失效
ssoLogin
();
...
...
@@ -90,7 +92,8 @@ public class ManagerUtil {
}
// 切换为内部人员 isInternalSeller 传1代表内部人员 传0代表非内部人员
public
static
void
switchInsider
(
String
sellerId
,
int
isInternalSeller
){
public
static
void
switchInsider
(
int
isInternalSeller
){
String
sellerId
=
getSellerId
();
// 登录下,检验是否失效
ssoLogin
();
...
...
@@ -108,9 +111,8 @@ public class ManagerUtil {
public
static
void
main
(
String
[]
args
)
throws
IOException
{
String
sellerId
=
getSellerId
();
switchInsider
(
sellerId
,
1
);
switchvip
(
sellerId
);
// switchInsider(1);
// switchvip();
}
}
target/test-classes/com/kjj/qa/cases/Article.class
View file @
3a0c5457
No preview for this file type
test-output/report.html
View file @
3a0c5457
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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