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
5235babc
Commit
5235babc
authored
May 20, 2020
by
Su-Yi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新上传素材+新手任务case、优化网络模块
parent
648bad52
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
334 additions
and
7 deletions
+334
-7
NewTask.java
src/test/java/com/kjj/qa/cases/NewTask.java
+308
-0
Upload.java
src/test/java/com/kjj/qa/cases/Upload.java
+16
-7
testNG.xml
src/test/testNG.xml
+10
-0
No files found.
src/test/java/com/kjj/qa/cases/NewTask.java
0 → 100644
View file @
5235babc
This diff is collapsed.
Click to expand it.
src/test/java/com/kjj/qa/cases/Upload.java
View file @
5235babc
package
com
.
kjj
.
qa
.
cases
;
import
com.alibaba.fastjson.JSONObject
;
import
com.kjj.qa.utils.NetworkUtil
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
import
org.testng.annotations.AfterSuite
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.*
;
import
org.testng.annotations.Test
;
import
java.io.IOException
;
import
java.util.HashMap
;
import
java.util.Map
;
...
...
@@ -117,9 +115,20 @@ public class Upload {
@Test
(
description
=
"上传_本地视频"
,
priority
=
5
)
public
void
上传
_
本地视频
()
throws
IOException
{
Response
response
=
network
.
getResponse
(
"/kjy/mp/seller/import/taskStatus"
);
int
taskStatus
=
response
.
jsonPath
().
get
(
"data[1].taskStatus"
);
Assert
.
assertEquals
(
taskStatus
,
2
,
"上传成功"
);
//1.上传视频到oss
Response
response
=
network
.
postResponse
(
"/kjy/mp/upload/video"
);
String
videoUrl
=
response
.
jsonPath
().
getString
(
"videoUrl"
);
String
firstFrameUrl
=
response
.
jsonPath
().
getString
(
"firstFrameUrl"
);
Assert
.
assertNotNull
(
videoUrl
,
"上传本地视频-上传oss失败"
);
//2.开始上传视频
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"videoUrl"
,
videoUrl
);
params
.
put
(
"firstFrameUrl"
,
firstFrameUrl
);
params
.
put
(
"contentTitle"
,
"=自动化测试="
);
response
=
network
.
postResponse
(
params
,
"/kjy/mp/seller/upload/video"
);
String
contentId
=
response
.
jsonPath
().
getString
(
"data.contentId"
);
Assert
.
assertNotNull
(
videoUrl
,
"上传本地视频-上传第二步失败"
);
}
@Test
(
description
=
"大家都在转_榜单列表"
,
priority
=
6
)
...
...
src/test/testNG.xml
View file @
5235babc
...
...
@@ -16,6 +16,16 @@
<class
name=
"com.kjj.qa.cases.SellerCard"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"上传"
>
<classes>
<class
name=
"com.kjj.qa.cases.Upload"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"新手任务"
>
<classes>
<class
name=
"com.kjj.qa.cases.NewTask"
/>
</classes>
</test>
<!-- 监听器-->
<listeners>
<listener
class-name=
"com.kjj.qa.config.ExtentTestNGIReporterListener"
/>
...
...
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