Commit 0f454559 by zhangying

修改报告报错

parent 97224a38
...@@ -23,17 +23,16 @@ public class TestDelCommonFolder extends XMBaseTest { ...@@ -23,17 +23,16 @@ public class TestDelCommonFolder extends XMBaseTest {
public void beforeTest(){ public void beforeTest(){
xmAppApi.setApiModule(ApiModele.CloudClass_File ) xmAppApi.setApiModule(ApiModele.CloudClass_File )
.setApiName("API_delCommomFolder") .setApiName("API_delCommomFolder")
.setLoginUser("zhangYuM_b") .setLoginUser("zhangy-b") //张莹的机构里文件夹数据比较多,所以这里用她的测删除文件夹
.setTerminal(Terminal.B); .setTerminal(Terminal.B);
dal.setCase_owner("张莹");
super.beforeTest(); super.beforeTest();
} }
@Test @Test
public void testDelCommonFolderList() throws InterruptedException { public void testDelCommonFolderList() throws InterruptedException {
GetFolderData testCommonFolderList = new GetFolderData(); GetFolderData testCommonFolderList = new GetFolderData();
JSONObject folderList = testCommonFolderList.getCommonFolderList(); JSONObject folderList = testCommonFolderList.saveFolder();
String id = folderList.getJSONObject("result").getJSONArray("records").getJSONObject(0).getString("id"); String id = folderList.getJSONObject("result").getString("id");
System.out.println("获取id" + id); System.out.println("获取id" + id);
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
......
package com.live.cases.fileManage.commonFolder; package com.live.cases.fileManage.commonFolder;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.live.enums.ApiModele; import com.live.enums.ApiModele;
import com.live.enums.RequestType; import com.live.enums.RequestType;
...@@ -28,18 +29,22 @@ public class TestUpdateFileUserAuthority extends XMBaseTest { ...@@ -28,18 +29,22 @@ public class TestUpdateFileUserAuthority extends XMBaseTest {
/** /**
* 测试资料云盘-公共文件夹成员管理,修改权限,可查看/下载——>可编辑 * 测试资料云盘-公共文件夹成员管理,修改权限,可查看/下载——>可编辑
*/ */
// @Test @Test
public void testUpdateFileUserAuthority() throws InterruptedException { public void testUpdateFileUserAuthority() throws InterruptedException {
GetFolderData commonFolderList = new GetFolderData(); GetFolderData commonFolderList = new GetFolderData();
String folderId = commonFolderList.getCommonFolderWithUser(); JSONObject folderList = commonFolderList.getCommonFolderList();
String folderId = folderList.getJSONObject("result").getJSONArray("records").getJSONObject(0).getString("id");
System.out.println("folderId =="+folderId); System.out.println("folderId =="+folderId);
// String folderId = folderList.getJSONObject("result").getJSONArray("records").getJSONObject(0).getString("id");
JSONObject addAuthority = commonFolderList.addFileUserAuthorityList(folderId);
System.out.println("addAuthority =="+addAuthority);
JSONObject userAuthority = commonFolderList.getFileUserAuthority(folderId); JSONObject userAuthority = commonFolderList.getFileUserAuthority(folderId);
// String updateId = userAuthority.getJSONArray("result").getJSONObject(0).getString("userId");//操作账户的userId System.out.println("userAuthority ="+userAuthority);
String updateId = userAuthority.getJSONArray("result").getJSONObject(0).getString("userId");//操作账户的userId
String userId = userAuthority.getJSONArray("result").getJSONObject(1).getString("userId"); String userId = userAuthority.getJSONArray("result").getJSONObject(1).getString("userId");
String updateId = "1235115979394306049"; //当前操作账户的userId // String updateId = "1235115979394306049"; //当前操作账户的userId
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("instId", xmAppApi.getLoginInfo().getInstId()); jsonObject.put("instId", xmAppApi.getLoginInfo().getInstId());
jsonObject.put("id", folderId); jsonObject.put("id", folderId);
...@@ -62,7 +67,7 @@ public class TestUpdateFileUserAuthority extends XMBaseTest { ...@@ -62,7 +67,7 @@ public class TestUpdateFileUserAuthority extends XMBaseTest {
/** /**
* 测试资料云盘-公共文件夹添加员工,可编辑——>可查看/下载 * 测试资料云盘-公共文件夹添加员工,可编辑——>可查看/下载
*/ */
// @Test @Test
public void testUpdateFileUserAuthority1() throws InterruptedException { public void testUpdateFileUserAuthority1() throws InterruptedException {
GetFolderData commonFolderList = new GetFolderData(); GetFolderData commonFolderList = new GetFolderData();
JSONObject folderList = commonFolderList.getCommonFolderList(); JSONObject folderList = commonFolderList.getCommonFolderList();
...@@ -95,7 +100,7 @@ public class TestUpdateFileUserAuthority extends XMBaseTest { ...@@ -95,7 +100,7 @@ public class TestUpdateFileUserAuthority extends XMBaseTest {
/** /**
* 测试资料云盘-公共文件夹添加员工,操作账户无操作权限 * 测试资料云盘-公共文件夹添加员工,操作账户无操作权限
*/ */
// @Test @Test
public void testUpdateFileUserAuthority2() throws InterruptedException { public void testUpdateFileUserAuthority2() throws InterruptedException {
GetFolderData commonFolderList = new GetFolderData(); GetFolderData commonFolderList = new GetFolderData();
JSONObject folderList = commonFolderList.getCommonFolderList(); JSONObject folderList = commonFolderList.getCommonFolderList();
...@@ -123,7 +128,7 @@ public class TestUpdateFileUserAuthority extends XMBaseTest { ...@@ -123,7 +128,7 @@ public class TestUpdateFileUserAuthority extends XMBaseTest {
/** /**
* 测试资料云盘-公共文件夹添加员工,从列表中移除员工 * 测试资料云盘-公共文件夹添加员工,从列表中移除员工
*/ */
// @Test @Test
public void testUpdateFileUserAuthority3() throws InterruptedException { public void testUpdateFileUserAuthority3() throws InterruptedException {
GetFolderData commonFolderList = new GetFolderData(); GetFolderData commonFolderList = new GetFolderData();
JSONObject folderList = commonFolderList.getCommonFolderList(); JSONObject folderList = commonFolderList.getCommonFolderList();
......
...@@ -6,10 +6,9 @@ import com.live.enums.RequestType; ...@@ -6,10 +6,9 @@ import com.live.enums.RequestType;
import com.live.enums.Terminal; import com.live.enums.Terminal;
import com.live.utils.RandomStringUtil; import com.live.utils.RandomStringUtil;
import com.live.utils.XMBaseTest; import com.live.utils.XMBaseTest;
import io.restassured.response.Response;
import java.util.HashMap; import java.util.ArrayList;
import java.util.Map; import java.util.List;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import static io.restassured.RestAssured.given; import static io.restassured.RestAssured.given;
...@@ -87,7 +86,7 @@ public class GetFolderData extends XMBaseTest { ...@@ -87,7 +86,7 @@ public class GetFolderData extends XMBaseTest {
jsonObject.put("size", 10); jsonObject.put("size", 10);
jsonObject.put("disk", "COMMON"); jsonObject.put("disk", "COMMON");
jsonObject.put("folderIdType", "FOLDER"); jsonObject.put("folderIdType", "FOLDER");
jsonObject.put("instId", xmAppApi.getLoginInfo().getInstId()); jsonObject.put("instId", dataApi.getLoginInfo().getInstId());
dataApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers); dataApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
...@@ -99,6 +98,45 @@ public class GetFolderData extends XMBaseTest { ...@@ -99,6 +98,45 @@ public class GetFolderData extends XMBaseTest {
} }
/** /**
* 资料云盘-公共文件
* @return
*/
public JSONObject addFileUserAuthorityList(String folderId) {
dataApi.setApiModule(ApiModele.CloudClass_File) // API 所属模块 必传 读取配置文件config.properties配置的api地址
.setApiName("API_addFileUserAuthorityList") // API 名称 必传
.setLoginUser("zhangy-b") // http 接口,测试账号 必传
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
super.beforeDataRequest();
String userId = "1244920914395918338"; //测试文件夹添加员工,员工固定,名称为"自动化测试员工"
JSONObject rightsListObject = new JSONObject();
rightsListObject.put("rights","LOOK_DOWNLOAD");
rightsListObject.put("userId",userId);
List rightsList = new ArrayList();
rightsList.add(rightsListObject);
JSONObject jsonObject = new JSONObject();
jsonObject.put("instId", dataApi.getLoginInfo().getInstId());
jsonObject.put("id", folderId); //公共文件夹的文件夹id
jsonObject.put("createId",dataApi.getLoginInfo().getAid());
jsonObject.put("disk", "COMMON");
jsonObject.put("rightsList", rightsList);
System.out.println("jsonObject ==="+jsonObject);
dataApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
System.out.println(dataApi);
JSONObject jsonBody = dataApi.getBodyInJSON();
System.out.println("jsonBody = "+jsonBody);
return jsonBody;
}
/**
* 资料云盘-公共文件-权限管理-员工列表 * 资料云盘-公共文件-权限管理-员工列表
*/ */
public JSONObject getFileUserAuthority(String folderId) { public JSONObject getFileUserAuthority(String folderId) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment