Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xm-autotest-live
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiamai-test
xm-autotest-live
Commits
5bb973fa
Commit
5bb973fa
authored
Feb 05, 2021
by
zhangying
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
补充资料云盘移动文件的case
parent
afa71f29
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
75 additions
and
21 deletions
+75
-21
src/main/java/com/live/cases/fileManage/myselfFolder/TestMoveFolder.java
+58
-0
src/main/java/com/live/cases/musicPlay/TestDelOnlyOneClassLive.java
+0
-1
src/main/java/com/live/xmutils/GetFolderData.java
+10
-20
src/main/resources/apicase/apollo.json
+7
-0
No files found.
src/main/java/com/live/cases/fileManage/myselfFolder/TestMoveFolder.java
0 → 100644
View file @
5bb973fa
package
com
.
live
.
cases
.
fileManage
.
myselfFolder
;
import
com.alibaba.fastjson.JSONObject
;
import
com.live.enums.ApiModele
;
import
com.live.enums.RequestType
;
import
com.live.enums.Terminal
;
import
com.live.utils.XMBaseTest
;
import
com.live.xmutils.GetFolderData
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* Created by zhangying on 2021/2/05
*/
public
class
TestMoveFolder
extends
XMBaseTest
{
@BeforeMethod
public
void
beforeTest
()
{
xmAppApi
.
setApiModule
(
ApiModele
.
CloudClass_apollo
)
// API 所属模块 必传 读取配置文件config.properties配置的api地址
.
setApiName
(
"API_moveFolder"
)
// API 名称 必传
.
setLoginUser
(
"zhangy-b"
)
// http 接口,测试账号 必传
.
setTerminal
(
Terminal
.
B
);
// 所属端位(B端,C端,M端等, 必传)
super
.
beforeTest
();
System
.
out
.
println
(
xmAppApi
);
}
/**
* 测试创建乐器陪练课
*/
@Test
public
void
testMoveFolder
()
{
GetFolderData
getFolderData
=
new
GetFolderData
();
JSONObject
folderList
=
getFolderData
.
getFolderList
();
String
folderId
=
folderList
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"id"
);
List
moveIds
=
new
ArrayList
();
moveIds
.
add
(
folderId
);
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"disk"
,
"MYSELF"
);
jsonObject
.
put
(
"moveIds"
,
moveIds
);
jsonObject
.
put
(
"newParentId"
,
folderId
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
);
JSONObject
jsonBody
=
xmAppApi
.
getBodyInJSON
();
System
.
out
.
println
(
"jsonBody = "
+
jsonBody
);
Assert
.
assertEquals
(
"false"
,
jsonBody
.
getString
(
"success"
));
Assert
.
assertEquals
(
"不能将文件移动到自身或其子目录下"
,
jsonBody
.
getString
(
"message"
));
}
}
src/main/java/com/live/cases/musicPlay/TestDelOnlyOneClassLive.java
View file @
5bb973fa
...
...
@@ -6,7 +6,6 @@ import com.live.enums.ApiModele;
import
com.live.enums.RequestType
;
import
com.live.enums.Terminal
;
import
com.live.utils.XMBaseTest
;
import
com.live.xmutils.GetOnlyOneClassLiveListData
;
import
com.live.xmutils.GetOnlyOneCourseData
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeMethod
;
...
...
src/main/java/com/live/xmutils/GetFolderData.java
View file @
5bb973fa
...
...
@@ -57,7 +57,7 @@ public class GetFolderData extends XMBaseTest {
return
response
;
}
public
Lis
t
getFolderList
()
{
public
JSONObjec
t
getFolderList
()
{
dataApi
.
setApiModule
(
ApiModele
.
CloudClass_File
)
// API 所属模块 必传 读取配置文件config.properties配置的api地址
.
setApiName
(
"API_folderList"
)
// API 名称 必传
...
...
@@ -68,28 +68,18 @@ public class GetFolderData extends XMBaseTest {
super
.
beforeDataRequest
();
Map
bodyMap
=
new
HashMap
();
bodyMap
.
put
(
"current"
,
1
);
bodyMap
.
put
(
"size"
,
10
);
bodyMap
.
put
(
"disk"
,
"MYSELF"
);
String
bodydata
=
JSONObject
.
toJSONString
(
bodyMap
);
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"current"
,
1
);
jsonObject
.
put
(
"size"
,
10
);
jsonObject
.
put
(
"disk"
,
"MYSELF"
);
// String jsonObject = JSONObject.toJSONString(jsonObject
);
// 接口请求 返回responseBody
Response
response
=
given
()
.
header
(
"Content-Type"
,
"application/json"
)
.
queryParams
(
params
)
.
headers
(
headers
)
.
body
(
bodydata
)
.
when
()
.
post
(
dataApi
.
getUrl
())
.
then
().
log
().
all
()
.
extract
()
.
response
();
List
folderList
=
new
ArrayList
();
folderList
.
add
(
response
.
path
(
"result.records"
));
dataApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
);
System
.
out
.
println
(
dataApi
);
JSONObject
jsonBody
=
dataApi
.
getBodyInJSON
();
return
folderList
;
return
jsonBody
;
}
...
...
src/main/resources/apicase/apollo.json
View file @
5bb973fa
...
...
@@ -172,5 +172,11 @@
"apiContentType"
:
"application/json;charset=utf-8"
,
"apiName"
:
"删除文件"
,
"desc"
:
"删除文件"
},
"API_moveFolder"
:
{
"apiPath"
:
"/apollo/public/apollo/moveFolder"
,
"apiContentType"
:
"application/json;charset=utf-8"
,
"apiName"
:
"移动文件"
,
"desc"
:
"移动文件"
}
}
\ No newline at end of file
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