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
eb7c5de7
Commit
eb7c5de7
authored
Feb 23, 2021
by
张艳玲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改目录
parent
f5e48399
Changes
24
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
4462 additions
and
4756 deletions
+4462
-4756
compiler.xml
.idea/compiler.xml
+0
-8
misc.xml
.idea/misc.xml
+0
-7
Article.java
src/test/java/com/kjj/cases/basics/Article.java
+4
-3
Boss.java
src/test/java/com/kjj/cases/basics/Boss.java
+3
-3
BossTest.java
src/test/java/com/kjj/cases/basics/BossTest.java
+10
-10
CircleFriends.java
src/test/java/com/kjj/cases/basics/CircleFriends.java
+3
-3
GreetingCard.java
src/test/java/com/kjj/cases/basics/GreetingCard.java
+4
-4
Home.java
src/test/java/com/kjj/cases/basics/Home.java
+2
-2
Pay.java
src/test/java/com/kjj/cases/basics/Pay.java
+4
-4
SellerCard.java
src/test/java/com/kjj/cases/basics/SellerCard.java
+16
-16
Upload.java
src/test/java/com/kjj/cases/basics/Upload.java
+4
-4
Video.java
src/test/java/com/kjj/cases/basics/Video.java
+5
-0
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+2
-2
ExtentTestNGIReporterListener.java
...st/java/com/kjj/config/ExtentTestNGIReporterListener.java
+8
-8
Novice.java
src/test/java/com/kjj/qa/cases/Novice.java
+0
-285
uploadCase.mp4
src/test/java/com/kjj/resource/uploadCase.mp4
+0
-0
Base58.java
src/test/java/com/kjj/utils/Base58.java
+1
-1
BaseUtils.java
src/test/java/com/kjj/utils/BaseUtils.java
+2
-2
BlowfishUtils.java
src/test/java/com/kjj/utils/BlowfishUtils.java
+1
-1
DingTalkUtils.java
src/test/java/com/kjj/utils/DingTalkUtils.java
+3
-3
MysqlUtils.java
src/test/java/com/kjj/utils/MysqlUtils.java
+1
-1
NetworkUtils.java
src/test/java/com/kjj/utils/NetworkUtils.java
+2
-2
testNG.xml
src/test/testNG.xml
+9
-9
report.html
test-output/report.html
+4378
-4378
No files found.
.idea/compiler.xml
View file @
eb7c5de7
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"CompilerConfiguration"
>
<annotationProcessing>
<profile
name=
"Maven default annotation processors profile"
enabled=
"true"
>
<sourceOutputDir
name=
"target/generated-sources/annotations"
/>
<sourceTestOutputDir
name=
"target/generated-test-sources/test-annotations"
/>
<outputRelativeToContentRoot
value=
"true"
/>
<module
name=
"kjj"
/>
</profile>
</annotationProcessing>
<bytecodeTargetLevel
target=
"1.8"
>
<module
name=
"kejiji"
target=
"1.8"
/>
</bytecodeTargetLevel>
...
...
.idea/misc.xml
View file @
eb7c5de7
...
...
@@ -7,13 +7,6 @@
<component
name=
"JavaScriptSettings"
>
<option
name=
"languageLevel"
value=
"ES6"
/>
</component>
<component
name=
"MavenProjectsManager"
>
<option
name=
"originalFiles"
>
<list>
<option
value=
"$PROJECT_DIR$/pom.xml"
/>
</list>
</option>
</component>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_1_8"
default=
"true"
project-jdk-name=
"1.8"
project-jdk-type=
"JavaSDK"
>
<output
url=
"file://$PROJECT_DIR$/out"
/>
</component>
...
...
src/test/java/com/kjj/
qa/case
s/Article.java
→
src/test/java/com/kjj/
cases/basic
s/Article.java
View file @
eb7c5de7
package
com
.
kjj
.
qa
.
case
s
;
package
com
.
kjj
.
cases
.
basic
s
;
import
static
com
.
kjj
.
qa
.
config
.
BasicConfig
.*;
import
static
com
.
kjj
.
config
.
BasicConfig
.*;
import
com.kjj.
qa.
utils.NetworkUtils
;
import
com.kjj.utils.NetworkUtils
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
...
...
@@ -488,4 +488,5 @@ public class Article {
network
.
agentCookies
.
put
(
"tku"
,
AGENT_TKU
);
//tku 切换为访客的
apiCount
+=
13
;
}
}
src/test/java/com/kjj/
qa/case
s/Boss.java
→
src/test/java/com/kjj/
cases/basic
s/Boss.java
View file @
eb7c5de7
package
com
.
kjj
.
qa
.
case
s
;
package
com
.
kjj
.
cases
.
basic
s
;
import
com.kjj.
qa.
utils.NetworkUtils
;
import
com.kjj.utils.NetworkUtils
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
import
org.testng.annotations.AfterClass
;
...
...
@@ -13,7 +13,7 @@ import java.util.HashMap;
import
java.util.List
;
import
java.util.Map
;
import
static
com
.
kjj
.
qa
.
config
.
BasicConfig
.*;
import
static
com
.
kjj
.
config
.
BasicConfig
.*;
public
class
Boss
{
private
static
final
NetworkUtils
network
=
NetworkUtils
.
getInstance
();
...
...
src/test/java/com/kjj/
qa/case
s/BossTest.java
→
src/test/java/com/kjj/
cases/basic
s/BossTest.java
View file @
eb7c5de7
package
com
.
kjj
.
qa
.
case
s
;
package
com
.
kjj
.
cases
.
basic
s
;
import
com.kjj.
qa.
utils.BaseUtils
;
import
com.kjj.
qa.
utils.NetworkUtils
;
import
com.kjj.utils.BaseUtils
;
import
com.kjj.utils.NetworkUtils
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
import
org.testng.annotations.AfterClass
;
...
...
@@ -14,13 +14,13 @@ import java.util.HashMap;
import
java.util.List
;
import
java.util.Map
;
import
static
com
.
kjj
.
qa
.
config
.
BasicConfig
.
BOSS_CREATE
;
import
static
com
.
kjj
.
qa
.
config
.
BasicConfig
.
BOSS_DETAIL
;
import
static
com
.
kjj
.
qa
.
config
.
BasicConfig
.
BOSS_EDITCONFIG
;
import
static
com
.
kjj
.
qa
.
config
.
BasicConfig
.
BOSS_ISDEMO
;
import
static
com
.
kjj
.
qa
.
config
.
BasicConfig
.
BOSS_PUBLISH
;
import
static
com
.
kjj
.
qa
.
config
.
BasicConfig
.
BOSS_RECEIVERLIST
;
import
static
com
.
kjj
.
qa
.
config
.
BasicConfig
.
BOSS_TEAMTASKLIST
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
BOSS_CREATE
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
BOSS_DETAIL
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
BOSS_EDITCONFIG
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
BOSS_ISDEMO
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
BOSS_PUBLISH
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
BOSS_RECEIVERLIST
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
BOSS_TEAMTASKLIST
;
public
class
BossTest
{
...
...
src/test/java/com/kjj/
qa/case
s/CircleFriends.java
→
src/test/java/com/kjj/
cases/basic
s/CircleFriends.java
View file @
eb7c5de7
package
com
.
kjj
.
qa
.
case
s
;
package
com
.
kjj
.
cases
.
basic
s
;
import
com.kjj.
qa.
utils.NetworkUtils
;
import
com.kjj.utils.NetworkUtils
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
...
...
@@ -12,7 +12,7 @@ import java.util.HashMap;
import
java.util.List
;
import
java.util.Map
;
import
static
com
.
kjj
.
qa
.
config
.
BasicConfig
.*;
import
static
com
.
kjj
.
config
.
BasicConfig
.*;
public
class
CircleFriends
{
...
...
src/test/java/com/kjj/
qa/case
s/GreetingCard.java
→
src/test/java/com/kjj/
cases/basic
s/GreetingCard.java
View file @
eb7c5de7
package
com
.
kjj
.
qa
.
case
s
;
package
com
.
kjj
.
cases
.
basic
s
;
import
com.kjj.
qa.
utils.BaseUtils
;
import
com.kjj.
qa.
utils.NetworkUtils
;
import
com.kjj.utils.BaseUtils
;
import
com.kjj.utils.NetworkUtils
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
import
org.testng.annotations.AfterClass
;
...
...
@@ -12,7 +12,7 @@ import java.io.IOException;
import
java.util.HashMap
;
import
java.util.Map
;
import
static
com
.
kjj
.
qa
.
config
.
BasicConfig
.*;
import
static
com
.
kjj
.
config
.
BasicConfig
.*;
public
class
GreetingCard
{
private
static
final
NetworkUtils
network
=
NetworkUtils
.
getInstance
();
...
...
src/test/java/com/kjj/
qa/case
s/Home.java
→
src/test/java/com/kjj/
cases/basic
s/Home.java
View file @
eb7c5de7
package
com
.
kjj
.
qa
.
case
s
;
package
com
.
kjj
.
cases
.
basic
s
;
import
com.kjj.
qa.
utils.NetworkUtils
;
import
com.kjj.utils.NetworkUtils
;
import
org.testng.annotations.*
;
public
class
Home
{
...
...
src/test/java/com/kjj/
qa/case
s/Pay.java
→
src/test/java/com/kjj/
cases/basic
s/Pay.java
View file @
eb7c5de7
package
com
.
kjj
.
qa
.
case
s
;
package
com
.
kjj
.
cases
.
basic
s
;
import
static
com
.
kjj
.
qa
.
config
.
BasicConfig
.*;
import
static
com
.
kjj
.
config
.
BasicConfig
.*;
import
static
io
.
restassured
.
RestAssured
.
given
;
import
com.kjj.
qa.
utils.BaseUtils
;
import
com.kjj.
qa.
utils.NetworkUtils
;
import
com.kjj.utils.BaseUtils
;
import
com.kjj.utils.NetworkUtils
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
import
org.testng.annotations.*
;
...
...
src/test/java/com/kjj/
qa/case
s/SellerCard.java
→
src/test/java/com/kjj/
cases/basic
s/SellerCard.java
View file @
eb7c5de7
package
com
.
kjj
.
qa
.
case
s
;
package
com
.
kjj
.
cases
.
basic
s
;
import
com.kjj.
qa.
utils.NetworkUtils
;
import
com.kjj.utils.NetworkUtils
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
import
org.testng.annotations.AfterClass
;
...
...
@@ -12,20 +12,20 @@ import java.io.IOException;
import
java.util.HashMap
;
import
java.util.Map
;
import
static
com
.
kjj
.
qa
.
config
.
BasicConfig
.
ISVIPSUBSCRIBE
;
import
static
com
.
kjj
.
qa
.
config
.
BasicConfig
.
SELLERCARD_APPRAISELISTNEW
;
import
static
com
.
kjj
.
qa
.
config
.
BasicConfig
.
SELLERCARD_COMPANYLIST
;
import
static
com
.
kjj
.
qa
.
config
.
BasicConfig
.
SELLERCARD_EDITBASEINFO
;
import
static
com
.
kjj
.
qa
.
config
.
BasicConfig
.
SELLERCARD_EDITMAJORGOODAUTH
;
import
static
com
.
kjj
.
qa
.
config
.
BasicConfig
.
SELLERCARD_GETQUESTIONS
;
import
static
com
.
kjj
.
qa
.
config
.
BasicConfig
.
SELLERCARD_ISDISPLAYACTIVITY
;
import
static
com
.
kjj
.
qa
.
config
.
BasicConfig
.
SELLERCARD_PERSONALPROFILE
;
import
static
com
.
kjj
.
qa
.
config
.
BasicConfig
.
SELLERCARD_PRODUCTLIST
;
import
static
com
.
kjj
.
qa
.
config
.
BasicConfig
.
SELLERCARD_SELLERCARDCASENEW
;
import
static
com
.
kjj
.
qa
.
config
.
BasicConfig
.
SELLERCARD_TOPOFDETAIL
;
import
static
com
.
kjj
.
qa
.
config
.
BasicConfig
.
VERSION_INFO
;
import
static
com
.
kjj
.
qa
.
config
.
BasicConfig
.
WECHAT_NAME
;
import
static
com
.
kjj
.
qa
.
config
.
BasicConfig
.
apiCount
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
ISVIPSUBSCRIBE
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
SELLERCARD_APPRAISELISTNEW
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
SELLERCARD_COMPANYLIST
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
SELLERCARD_EDITBASEINFO
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
SELLERCARD_EDITMAJORGOODAUTH
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
SELLERCARD_GETQUESTIONS
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
SELLERCARD_ISDISPLAYACTIVITY
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
SELLERCARD_PERSONALPROFILE
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
SELLERCARD_PRODUCTLIST
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
SELLERCARD_SELLERCARDCASENEW
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
SELLERCARD_TOPOFDETAIL
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
VERSION_INFO
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
WECHAT_NAME
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
apiCount
;
public
class
SellerCard
{
private
static
final
NetworkUtils
network
=
NetworkUtils
.
getInstance
();
...
...
src/test/java/com/kjj/
qa/case
s/Upload.java
→
src/test/java/com/kjj/
cases/basic
s/Upload.java
View file @
eb7c5de7
package
com
.
kjj
.
qa
.
case
s
;
package
com
.
kjj
.
cases
.
basic
s
;
import
static
com
.
kjj
.
qa
.
config
.
BasicConfig
.*;
import
com.kjj.
qa.
utils.NetworkUtils
;
import
static
com
.
kjj
.
config
.
BasicConfig
.*;
import
com.kjj.utils.NetworkUtils
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
import
org.testng.annotations.*
;
...
...
@@ -117,7 +117,7 @@ public class Upload {
@Test
(
description
=
"上传_本地视频"
,
priority
=
5
)
public
void
上传
_
本地视频
()
throws
IOException
{
//1.上传视频到oss
String
videoFile
=
"src/test/java/com/kjj/
qa/
resource/uploadCase.mp4"
;
String
videoFile
=
"src/test/java/com/kjj/resource/uploadCase.mp4"
;
Response
response
=
network
.
postFileResponse
(
videoFile
,
UPLOAD_UPLOADVEDIO
);
String
videoUrl
=
response
.
jsonPath
().
getString
(
"data.videoUrl"
);
String
firstFrameUrl
=
response
.
jsonPath
().
getString
(
"data.firstFrameUrl"
);
...
...
src/test/java/com/kjj/
qa/case
s/Video.java
→
src/test/java/com/kjj/
cases/basic
s/Video.java
View file @
eb7c5de7
package
com
.
kjj
.
qa
.
case
s
;
package
com
.
kjj
.
cases
.
basic
s
;
public
class
Video
{
...
...
src/test/java/com/kjj/
qa/
config/BasicConfig.java
→
src/test/java/com/kjj/config/BasicConfig.java
View file @
eb7c5de7
package
com
.
kjj
.
qa
.
config
;
package
com
.
kjj
.
config
;
public
class
BasicConfig
{
public
static
int
apiCount
;
//接口数量统计
// 是否开启钉钉机器人推送
public
static
final
boolean
isPushReport
=
tru
e
;
//true
public
static
final
boolean
isPushReport
=
fals
e
;
//true
// 代理人微信昵称
public
static
final
String
WECHAT_NAME
=
"客集集-梦晨"
;
//true
...
...
src/test/java/com/kjj/
qa/
config/ExtentTestNGIReporterListener.java
→
src/test/java/com/kjj/config/ExtentTestNGIReporterListener.java
View file @
eb7c5de7
package
com
.
kjj
.
qa
.
config
;
package
com
.
kjj
.
config
;
import
com.aventstack.extentreports.ExtentReports
;
...
...
@@ -14,7 +14,7 @@ import org.testng.xml.XmlSuite;
import
java.io.File
;
import
java.util.*
;
import
com.kjj.
qa.
utils.DingTalkUtils
;
import
com.kjj.utils.DingTalkUtils
;
public
class
ExtentTestNGIReporterListener
implements
IReporter
{
// 生成的路径以及文件名
...
...
@@ -79,29 +79,29 @@ public class ExtentTestNGIReporterListener implements IReporter {
// 统计SuiteResult下的数据
int
passSize
=
r
.
getTestContext
().
getPassedTests
().
size
();
int
failSize
=
r
.
getTestContext
().
getFailedTests
().
size
();
int
skipSize
=
r
.
getTestContext
().
getSkippedTests
().
size
();
//
int skipSize = r.getTestContext().getSkippedTests().size();
suitePassSize
+=
passSize
;
suiteFailSize
+=
failSize
;
suiteSkipSize
+=
skipSize
;
//
suiteSkipSize += skipSize;
if
(
failSize
>
0
)
{
resultNode
.
getModel
().
setStatus
(
Status
.
FAIL
);
}
resultNode
.
getModel
().
setDescription
(
String
.
format
(
"Pass: %s ; Fail: %s ;
Skip: %s ;"
,
passSize
,
failSize
,
skip
Size
));
String
.
format
(
"Pass: %s ; Fail: %s ;
"
,
passSize
,
fail
Size
));
}
buildTestNodes
(
resultNode
,
context
.
getFailedTests
(),
Status
.
FAIL
);
buildTestNodes
(
resultNode
,
context
.
getSkippedTests
(),
Status
.
SKIP
);
//
buildTestNodes(resultNode, context.getSkippedTests(), Status.SKIP);
buildTestNodes
(
resultNode
,
context
.
getPassedTests
(),
Status
.
PASS
);
}
if
(
suiteTest
!=
null
)
{
suiteTest
.
getModel
().
setDescription
(
String
.
format
(
"Pass: %s ; Fail: %s ;
Skip: %s ;"
,
suitePassSize
,
suiteFailSize
,
suiteSkip
Size
));
String
.
format
(
"Pass: %s ; Fail: %s ;
"
,
suitePassSize
,
suiteFail
Size
));
if
(
suiteFailSize
>
0
)
{
suiteTest
.
getModel
().
setStatus
(
Status
.
FAIL
);
}
}
String
context
=
String
.
format
(
"通过的用例数: %s\n失败的用例数: %s\n
跳过的用例数: %s\n
"
,
suitePassSize
,
suiteFailSize
,
suiteSkipSize
);
String
context
=
String
.
format
(
"通过的用例数: %s\n失败的用例数: %s\n"
,
suitePassSize
,
suiteFailSize
,
suiteSkipSize
);
try
{
DingTalkUtils
.
sendVal
(
context
);
}
catch
(
Exception
e
)
{
...
...
src/test/java/com/kjj/qa/cases/Novice.java
deleted
100644 → 0
View file @
f5e48399
package
com
.
kjj
.
qa
.
cases
;
import
static
com
.
kjj
.
qa
.
config
.
BasicConfig
.*;
import
com.kjj.qa.utils.NetworkUtils
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
import
org.testng.annotations.*
;
import
org.testng.annotations.Test
;
import
java.io.IOException
;
import
java.util.HashMap
;
import
java.util.Map
;
public
class
Novice
{
private
static
final
NetworkUtils
network
=
NetworkUtils
.
getInstance
();
@BeforeClass
public
void
setUp
()
{
}
//会员判断
@Test
(
description
=
"会员判断"
,
priority
=
1
)
public
void
会员判断
()
throws
IOException
{
Response
response
=
network
.
getResponse
(
ISVIPSUBSCRIBE
);
boolean
isVip
=
response
.
jsonPath
().
getBoolean
(
"data.vip"
);
Assert
.
assertTrue
(
true
,
network
.
message
(
ISVIPSUBSCRIBE
,
"新手任务-会员判断错误"
,
response
.
body
().
asString
()));
}
//用户信息
@Test
(
description
=
"用户信息"
,
priority
=
2
)
public
void
用户信息
()
throws
IOException
{
Response
response
=
network
.
getResponse
(
USER_INFO
);
String
wxName
=
response
.
jsonPath
().
getString
(
"data.wxName"
);
Assert
.
assertEquals
(
wxName
,
"Su Yi"
,
network
.
message
(
USER_INFO
,
"新手任务-获取用户信息失败"
,
response
.
body
().
asString
()));
}
//新手任务列表
@Test
(
description
=
"新手任务列表"
,
priority
=
3
)
//priorty 方法执行优先级
public
void
新手任务列表
()
throws
IOException
{
Response
response
=
network
.
getResponse
(
NOVICE_LIST
);
System
.
out
.
println
(
response
.
getBody
().
prettyPrint
());
int
length
=
response
.
jsonPath
().
getInt
(
"data.size()"
);
Assert
.
assertEquals
(
length
,
12
,
network
.
message
(
NOVICE_LIST
,
"新手任务-任务列表数量不对"
,
response
.
body
().
asString
()));
}
// 关注公众号 需要微信回调,无法实现
// @Test (description = "新手任务_关注公众号",priority = 4) //priorty 方法执行优先级
// public void 新手任务_关注公众号() throws IOException {
// //获取列表中"关注公众号"的任务
// Response response = network.getResponse("/kjy/mp/seller/novice/list");
//
// //获取任务名为"关注公众号"的任务状态 code: 0未完成 1可领奖励 2已完成
// int code = response.jsonPath().getInt("data.find {it.taskName == '关注公众号'}.taskStatus.code");
// Assert.assertEquals(code,0,"关注公众号-任务初始状态 获取失败");
//
// //关注导师微信号和关注客集集公众号(关注需要微信回调,无法实现)
//
// //重新获取任务名为"关注公众号"的任务状态,验证任务是否生效
//
// }
// 转发文章
@Test
(
description
=
"新手任务_转发文章"
,
priority
=
5
)
//priorty 方法执行优先级
public
void
新手任务
_
转发文章
()
throws
IOException
{
//获取列表中"转发文章"的任务
Response
response
=
network
.
getResponse
(
NOVICE_LIST
);
//获取任务名为"转发文章"的任务状态 code: 0未完成 1可领奖励 2已完成
int
code
=
response
.
jsonPath
().
getInt
(
"data.find {it.taskName == '转发文章'}.taskStatus.code"
);
Assert
.
assertEquals
(
code
,
0
,
network
.
message
(
NOVICE_LIST
,
"转发文章-任务初始状态 获取失败"
,
response
.
body
().
asString
()));
//转发文章到朋友圈
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"scId"
,
getScId
(
ARTICLE_CONTENTID
));
//文章scId
params
.
put
(
"forwardType"
,
1
);
// 1:个人/微信群 2:朋友圈
response
=
network
.
getResponse
(
params
,
FORWARD
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
FORWARD
,
"转发文章-转发到朋友圈 失败"
,
response
.
body
().
asString
()));
//重新获取任务名为"转发文章"的任务状态,验证任务是否生效
response
=
network
.
getResponse
(
NOVICE_LIST
);
//获取任务名为"转发文章"的任务状态 code: 0未完成 1可领奖励 2已完成
code
=
response
.
jsonPath
().
getInt
(
"data.find {it.taskName == '转发文章'}.taskStatus.code"
);
Assert
.
assertEquals
(
code
,
1
,
network
.
message
(
NOVICE_LIST
,
"转发文章-新手任务完成状态 获取失败"
,
response
.
body
().
asString
()));
}
// 转发动画
@Test
(
description
=
"新手任务_转发动画"
,
priority
=
6
)
//priorty 方法执行优先级
public
void
新手任务
_
转发动画
()
throws
IOException
{
//获取列表中"转发动画"的任务
Response
response
=
network
.
getResponse
(
NOVICE_LIST
);
//获取任务名为"转发动画"的任务状态 code: 0未完成 1可领奖励 2已完成
int
code
=
response
.
jsonPath
().
getInt
(
"data.find {it.taskName == '转发动画'}.taskStatus.code"
);
Assert
.
assertEquals
(
code
,
0
,
network
.
message
(
NOVICE_LIST
,
"转发动画-任务初始状态 获取失败"
,
response
.
body
().
asString
()));
//转发动画到朋友圈
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"scId"
,
getScId
(
ANIMATION_CONTENTID
));
//动画scId
params
.
put
(
"forwardType"
,
2
);
// 1:个人/微信群 2:朋友圈
response
=
network
.
getResponse
(
params
,
FORWARD
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
FORWARD
,
"转发动画-转发到朋友圈 失败"
,
response
.
body
().
asString
()));
//重新获取任务名为"转发动画"的任务状态,验证任务是否生效
response
=
network
.
getResponse
(
NOVICE_LIST
);
//获取任务名为"转发动画"的任务状态 code: 0未完成 1可领奖励 2已完成
code
=
response
.
jsonPath
().
getInt
(
"data.find {it.taskName == '转发动画'}.taskStatus.code"
);
Assert
.
assertEquals
(
code
,
1
,
network
.
message
(
NOVICE_LIST
,
"转发动画-新手任务完成状态 获取失败"
,
response
.
body
().
asString
()));
}
// 转发游戏
@Test
(
description
=
"新手任务_转发游戏"
,
priority
=
7
)
//priorty 方法执行优先级
public
void
新手任务
_
转发游戏
()
throws
IOException
{
//获取列表中"转发游戏"的任务
Response
response
=
network
.
getResponse
(
NOVICE_LIST
);
//获取任务名为"转发游戏"的任务状态 code: 0未完成 1可领奖励 2已完成
int
code
=
response
.
jsonPath
().
getInt
(
"data.find {it.taskName == '转发游戏(内测中)'}.taskStatus.code"
);
Assert
.
assertEquals
(
code
,
0
,
network
.
message
(
NOVICE_LIST
,
"转发游戏-任务初始状态 获取失败"
,
response
.
body
().
asString
()));
//转发游戏到朋友圈
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"scId"
,
getScId
(
GAME_CONTENTID
));
//游戏scId
params
.
put
(
"forwardType"
,
2
);
// 1:个人/微信群 2:朋友圈
response
=
network
.
getResponse
(
params
,
FORWARD
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
FORWARD
,
"转发游戏-转发到朋友圈 失败"
,
response
.
body
().
asString
()));
//重新获取任务名为"转发游戏"的任务状态,验证任务是否生效
response
=
network
.
getResponse
(
NOVICE_LIST
);
//获取任务名为"转发游戏"的任务状态 code: 0未完成 1可领奖励 2已完成
code
=
response
.
jsonPath
().
getInt
(
"data.find {it.taskName == '转发游戏(内测中)'}.taskStatus.code"
);
Assert
.
assertEquals
(
code
,
1
,
network
.
message
(
NOVICE_LIST
,
"转发游戏-新手任务完成状态 获取失败"
,
response
.
body
().
asString
()));
}
//上传文章
@Test
(
description
=
"新手任务_上传文章"
,
priority
=
8
)
//priorty 方法执行优先级
public
void
新手任务
_
上传文章
()
throws
IOException
{
//获取列表中"上传文章"的任务
Response
response
=
network
.
getResponse
(
NOVICE_LIST
);
//获取任务名为"上传文章"的任务状态 code: 0未完成 1可领奖励 2已完成
int
code
=
response
.
jsonPath
().
getInt
(
"data.find {it.taskName == '上传文章'}.taskStatus.code"
);
Assert
.
assertEquals
(
code
,
0
,
network
.
message
(
NOVICE_LIST
,
"上传文章-任务初始状态 获取失败"
,
response
.
body
().
asString
()));
//上传文章并发到朋友圈 (文章已经在上传case执行过,所以找到那篇文章进行转发就好)
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageNo"
,
1
);
params
.
put
(
"pageSize"
,
10
);
//获取我的上传里文章的列表
params
.
put
(
"type"
,
"article"
);
response
=
network
.
getResponse
(
params
,
UPLOAD_LIST
);
String
contentType
=
response
.
jsonPath
().
getString
(
"data[0].contentType"
);
String
contentId
=
response
.
jsonPath
().
getString
(
"data[0].id"
);
//获取文章的contentd
Assert
.
assertEquals
(
contentType
,
"article"
,
network
.
message
(
params
,
UPLOAD_LIST
,
"上传文章-获取我的上传-文章列表数量有误"
,
response
.
body
().
asString
()));
//转发文章到朋友圈
Map
<
String
,
Object
>
shareParams
=
new
HashMap
<
String
,
Object
>();
shareParams
.
put
(
"scId"
,
getScId
(
contentId
));
shareParams
.
put
(
"forwardType"
,
2
);
response
=
network
.
getResponse
(
shareParams
,
FORWARD
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
shareParams
,
FORWARD
,
"上传文章-发到朋友圈 失败"
,
response
.
body
().
asString
()));
//重新获取任务名为"上传文章"的任务状态,验证任务是否生效
response
=
network
.
getResponse
(
NOVICE_LIST
);
//获取任务名为"上传文章"的任务状态 code: 0未完成 1可领奖励 2已完成
code
=
response
.
jsonPath
().
getInt
(
"data.find {it.taskName == '上传文章'}.taskStatus.code"
);
Assert
.
assertEquals
(
code
,
1
,
network
.
message
(
NOVICE_LIST
,
"上传文章-完成新手任务 失败"
,
response
.
body
().
asString
()));
}
// 收到好友转发访问 该接口已废弃
// @Test (description = "新手任务_收到好友转发访问",priority = 9) //priorty 方法执行优先级
// public void 新手任务_收到好友转发访问() throws IOException {
// //获取列表中"收到好友转发访问"的任务
// Response response = network.getResponse("/kjy/mp/seller/novice/list");
//
// //获取任务名为"收到好友转发访问"的任务状态 code: 0未完成 1可领奖励 2已完成
// int code = response.jsonPath().getInt("data.find {it.taskName == '收到好友转发访问'}.taskStatus.code");
// Assert.assertEquals(code,0,"获取新手任务初始状态-收到好友转发访问 失败");
//
// //收到好友转发访问
// network.agentCookies.put("tku",network.visitorTku); //tku 切换为访客的
//
// Map<String, Object> params = new HashMap<String, Object>();
// params.put("scId","Kj20MTMwMDM5");//文章scId
// params.put("forwardType",2);// 1:个人/微信群 2:朋友圈
// response = network.getResponse(params,"/kjy/mp/forward");
// boolean data = response.jsonPath().getBoolean("data");
// Assert.assertTrue(data,"收到好友转发访问-好友转发到朋友圈 失败");
//
// network.agentCookies.put("tku",network.agentTku); //tku 切换为代理人的
//
//// //重新获取任务名为"收到好友转发访问"的任务状态,验证任务是否生效
//// response = network.getResponse("/kjy/mp/seller/novice/list");
//// //获取任务名为"收到好友转发访问"的任务状态 code: 0未完成 1可领奖励 2已完成
//// code = response.jsonPath().getInt("data.find {it.taskName == '收到好友转发访问'}.taskStatus.code");
//// Assert.assertEquals(code,1,"收到好友转发访问-新手任务完成状态 获取失败");
//
//
//
// }
//查看访问客户
@Test
(
description
=
"新手任务_查看访问客户"
,
priority
=
9
)
//priorty 方法执行优先级
public
void
新手任务
_
查看访问客户
()
throws
IOException
{
//获取列表中"查看访问客户"的任务
Response
response
=
network
.
getResponse
(
NOVICE_LIST
);
//获取任务名为"查看访问客户"的任务状态 code: 0未完成 1可领奖励 2已完成
int
code
=
response
.
jsonPath
().
getInt
(
"data.find {it.taskName == '查看访问客户'}.taskStatus.code"
);
Assert
.
assertEquals
(
code
,
0
,
network
.
message
(
NOVICE_LIST
,
"获取新手任务初始状态-查看访问客户 失败"
,
response
.
body
().
asString
()));
//好友转发一篇我的素材
network
.
agentCookies
.
put
(
"tku"
,
VISITOR_TKU
);
//tku 切换为访客的
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"scId"
,
getScId
(
UPLOAD_CONTENTID
));
//文章scId
params
.
put
(
"forwardType"
,
2
);
// 1:个人/微信群 2:朋友圈
response
=
network
.
getResponse
(
params
,
FORWARD
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
FORWARD
,
"查看访问客户-好友转发到朋友圈 失败"
,
response
.
body
().
asString
()));
network
.
agentCookies
.
put
(
"tku"
,
AGENT_TKU
);
//tku 切换为代理人的
//进入谁看过我,查看访客列表
Map
<
String
,
Object
>
whoSawMeParams
=
new
HashMap
<
String
,
Object
>();
whoSawMeParams
.
put
(
"pageIndex"
,
1
);
whoSawMeParams
.
put
(
"pageSize"
,
30
);
response
=
network
.
getResponse
(
whoSawMeParams
,
WHOSAWME_CUSTCLUELISTV2
);
boolean
hasnext
=
response
.
jsonPath
().
getBoolean
(
"data.hasNext"
);
int
length
=
response
.
jsonPath
().
getInt
(
"data.list.size()"
);
Assert
.
assertNotEquals
(
0
,
network
.
message
(
whoSawMeParams
,
WHOSAWME_CUSTCLUELISTV2
,
"获取谁看过我列表成功"
,
response
.
body
().
asString
()));
//点击查看,进入线索详情页
Map
<
String
,
Object
>
noviceParams
=
new
HashMap
<
String
,
Object
>();
noviceParams
.
put
(
"sceneCode"
,
"noviceTask_visitorsCustomerInfoComplete"
);
response
=
network
.
postResponse
(
noviceParams
,
NOVICE_MONGOLIANLAYERISPLAY
);
String
desc
=
response
.
jsonPath
().
getString
(
"desc"
);
//重新获取任务名为"查看访问客户"的任务状态,验证任务是否生效
response
=
network
.
getResponse
(
NOVICE_LIST
);
//获取任务名为"查看访问客户"的任务状态 code: 0未完成 1可领奖励 2已完成
code
=
response
.
jsonPath
().
getInt
(
"data.find {it.taskName == '查看访问客户'}.taskStatus.code"
);
Assert
.
assertEquals
(
code
,
1
,
network
.
message
(
NOVICE_LIST
,
"查看访问客户-新手任务完成状态 获取失败"
,
response
.
body
().
asString
()));
}
//完善名片 名片改动,此处始终会处于未完成状态,待产品优化
@Test
(
description
=
"新手任务_完善名片"
,
priority
=
9
)
//priorty 方法执行优先级
public
void
新手任务
_
完善名片
()
throws
IOException
{
//获取列表中"完善名片"的任务
Response
response
=
network
.
getResponse
(
NOVICE_LIST
);
//获取任务名为"完善名片"的任务状态 code: 0未完成 1可领奖励 2已完成
int
code
=
response
.
jsonPath
().
getInt
(
"data.find {it.taskName == '完善名片'}.taskStatus.code"
);
Assert
.
assertEquals
(
code
,
0
,
network
.
message
(
NOVICE_LIST
,
"获取新手任务初始状态-完善名片 失败"
,
response
.
body
().
asString
()));
//完善名片
//重新获取任务名为"完善名片"的任务状态,验证任务是否生效
}
//获取ScId
public
String
getScId
(
String
contentId
){
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"contentId"
,
contentId
);
Response
response
=
network
.
getResponse
(
params
,
GETSCID
);
String
scId
=
response
.
jsonPath
().
getString
(
"data"
);
Assert
.
assertNotNull
(
scId
,
network
.
message
(
params
,
GETSCID
,
"获取scId失败"
,
response
.
body
().
asString
()));
return
scId
;
}
@AfterClass
public
static
void
tearDown
(){
apiCount
+=
6
;
}
}
src/test/java/com/kjj/
qa/
resource/uploadCase.mp4
→
src/test/java/com/kjj/resource/uploadCase.mp4
View file @
eb7c5de7
File moved
src/test/java/com/kjj/
qa/
utils/Base58.java
→
src/test/java/com/kjj/utils/Base58.java
View file @
eb7c5de7
package
com
.
kjj
.
qa
.
utils
;
package
com
.
kjj
.
utils
;
import
java.io.UnsupportedEncodingException
;
...
...
src/test/java/com/kjj/
qa/
utils/BaseUtils.java
→
src/test/java/com/kjj/utils/BaseUtils.java
View file @
eb7c5de7
package
com
.
kjj
.
qa
.
utils
;
package
com
.
kjj
.
utils
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
import
static
com
.
kjj
.
qa
.
config
.
BasicConfig
.*;
import
static
com
.
kjj
.
config
.
BasicConfig
.*;
import
java.io.IOException
;
import
java.util.HashMap
;
...
...
src/test/java/com/kjj/
qa/
utils/BlowfishUtils.java
→
src/test/java/com/kjj/utils/BlowfishUtils.java
View file @
eb7c5de7
package
com
.
kjj
.
qa
.
utils
;
package
com
.
kjj
.
utils
;
import
java.util.HashMap
;
import
javax.crypto.Cipher
;
...
...
src/test/java/com/kjj/
qa/
utils/DingTalkUtils.java
→
src/test/java/com/kjj/utils/DingTalkUtils.java
View file @
eb7c5de7
package
com
.
kjj
.
qa
.
utils
;
package
com
.
kjj
.
utils
;
import
io.restassured.response.Response
;
import
static
com
.
kjj
.
qa
.
config
.
BasicConfig
.*;
import
static
com
.
kjj
.
config
.
BasicConfig
.*;
import
java.util.HashMap
;
import
java.util.Map
;
...
...
@@ -17,7 +17,7 @@ public class DingTalkUtils {
+
context
+
"总接口数:"
+
apiCount
+
"\n"
+
"报告地址: http://10.172.58.199/view/kkk/job/kejiji_interface/HTML_20Report\n"
+
"@
李浩弘 @张震 @别湘灵 @张艳玲 @张慧锋
"
;
+
"@
张慧锋 @张艳玲 @张震 @别湘灵
"
;
System
.
out
.
println
(
context
);
...
...
src/test/java/com/kjj/
qa/
utils/MysqlUtils.java
→
src/test/java/com/kjj/utils/MysqlUtils.java
View file @
eb7c5de7
package
com
.
kjj
.
qa
.
utils
;
package
com
.
kjj
.
utils
;
import
java.sql.*
;
...
...
src/test/java/com/kjj/
qa/
utils/NetworkUtils.java
→
src/test/java/com/kjj/utils/NetworkUtils.java
View file @
eb7c5de7
package
com
.
kjj
.
qa
.
utils
;
import
static
com
.
kjj
.
qa
.
config
.
BasicConfig
.*;
package
com
.
kjj
.
utils
;
import
static
com
.
kjj
.
config
.
BasicConfig
.*;
import
static
io
.
restassured
.
RestAssured
.*;
import
com.alibaba.fastjson.JSONObject
;
...
...
src/test/testNG.xml
View file @
eb7c5de7
...
...
@@ -13,47 +13,47 @@
<!-- </test>-->
<test
preserve-order=
"true"
name=
"支付"
>
<classes>
<class
name=
"com.kjj.
qa.case
s.Pay"
/>
<class
name=
"com.kjj.
cases.basic
s.Pay"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"名片"
>
<classes>
<class
name=
"com.kjj.
qa.case
s.SellerCard"
/>
<class
name=
"com.kjj.
cases.basic
s.SellerCard"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"上传"
>
<classes>
<class
name=
"com.kjj.
qa.case
s.Upload"
/>
<class
name=
"com.kjj.
cases.basic
s.Upload"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"文章"
>
<classes>
<class
name=
"com.kjj.
qa.case
s.Article"
/>
<class
name=
"com.kjj.
cases.basic
s.Article"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"发圈"
>
<classes>
<class
name=
"com.kjj.
qa.case
s.CircleFriends"
/>
<class
name=
"com.kjj.
cases.basic
s.CircleFriends"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"boss看板"
>
<classes>
<class
name=
"com.kjj.
qa.case
s.Boss"
/>
<class
name=
"com.kjj.
cases.basic
s.Boss"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"boss看板演示版"
>
<classes>
<class
name=
"com.kjj.
qa.case
s.BossTest"
/>
<class
name=
"com.kjj.
cases.basic
s.BossTest"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"贺卡"
>
<classes>
<class
name=
"com.kjj.
qa.case
s.GreetingCard"
/>
<class
name=
"com.kjj.
cases.basic
s.GreetingCard"
/>
</classes>
</test>
<!-- 监听器-->
<listeners>
<listener
class-name=
"com.kjj.
qa.
config.ExtentTestNGIReporterListener"
/>
<listener
class-name=
"com.kjj.config.ExtentTestNGIReporterListener"
/>
</listeners>
</suite>
<!-- Suite -->
...
...
test-output/report.html
View file @
eb7c5de7
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