Commit 8f3ce189 by zhangying

资料云盘新增2个case

parent 8f1e680c
......@@ -38,7 +38,7 @@ public class TestAddRelation extends XMBaseTest {
System.out.println("contentList= "+contentList);
JSONObject jsonObject = new JSONObject();
jsonObject.put("instId","1235115978015883266");
jsonObject.put("instId",xmAppApi.getLoginInfo().getInstId());
jsonObject.put("relationId","1329252848772321283");
jsonObject.put("relationType","SCHEDULE");
jsonObject.put("addFolderIds",contentList);
......
package com.live.cases.fileManage.commonFolder;
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 TestJudgeRelation extends XMBaseTest {
@BeforeMethod
public void beforeTest() {
xmAppApi.setApiModule(ApiModele.CloudClass_File) // API 所属模块 必传 读取配置文件config.properties配置的api地址
.setApiName("API_judgeRelation") // API 名称 必传
.setLoginUser("zhangy-b") // http 接口,测试账号 必传
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
dal.setCase_owner("张莹");
super.beforeTest();
}
/**
* 判断文件的关联关系,删除文件之前需要调用
*/
@Test
public void testJudgeRelation() throws InterruptedException {
GetFolderData getFolderData = new GetFolderData();
JSONObject folder = getFolderData.saveFolder(); //新增文件数据,以免存量数据不足导致运行报错
JSONObject folderList = getFolderData.getCommonFolderList();
String folderId = folderList.getJSONObject("result").getJSONArray("records").getJSONObject(0).getString("id");System.out.println("folderList = "+folderList);
List folderIds = new ArrayList();
folderIds.add(folderId);
JSONObject jsonObject = new JSONObject();
jsonObject.put("instId",xmAppApi.getLoginInfo().getInstId());
jsonObject.put("folderIds",folderIds);
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
JSONObject jsonBody = xmAppApi.getBodyInJSON();
Assert.assertEquals("true", jsonBody.getString("success"));
Assert.assertEquals("200", jsonBody.getString("code"));
Assert.assertEquals("false", jsonBody.getString("result")); //没有关联关系
}
}
......@@ -23,7 +23,7 @@ public class TestEmployeeFolderList extends ApiBaseTestFile {
jsonObject.put("current","1");
jsonObject.put("size","10");
jsonObject.put("disk", "EMPLOYEE");
jsonObject.put("instId", "1235115978015883266");
jsonObject.put("instId", xmAppApi.getLoginInfo().getInstId());
xmAppApi.doPost(okHttpClient, url, params, jsonObject.toJSONString() , headers);
JSONObject jsonBody = okHttpClient.getBodyInJSON();
......
......@@ -22,7 +22,7 @@ public class TestDelSelfFolder extends XMBaseTest {
@BeforeMethod
public void beforeTest(){
xmAppApi.setApiModule(ApiModele.CloudClass_File )
.setApiName("API_delCommomFolder")
.setApiName("API_delFolder")
.setLoginUser("zhangy-b") //张莹的机构里文件夹数据比较多,所以这里用她的测删除文件夹
.setTerminal(Terminal.B);
super.beforeTest();
......
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.RandomStringUtil;
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 TestJudgeRelation extends XMBaseTest {
@BeforeMethod
public void beforeTest() {
xmAppApi.setApiModule(ApiModele.CloudClass_File) // API 所属模块 必传 读取配置文件config.properties配置的api地址
.setApiName("API_judgeRelation") // API 名称 必传
.setLoginUser("zhangy-b") // http 接口,测试账号 必传
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
dal.setCase_owner("张莹");
super.beforeTest();
}
/**
* 判断文件的关联关系,删除文件之前需要调用
*/
@Test
public void testJudgeRelation() {
GetFolderData getFolderData = new GetFolderData();
JSONObject folder = getFolderData.saveMyselfFolder(); //新增文件数据,以免存量数据不足导致运行报错
JSONObject folderList = getFolderData.getFolderList();
String folderId = folderList.getJSONObject("result").getJSONArray("records").getJSONObject(0).getString("id");System.out.println("folderList = "+folderList);
List folderIds = new ArrayList();
folderIds.add(folderId);
JSONObject jsonObject = new JSONObject();
jsonObject.put("instId",xmAppApi.getLoginInfo().getInstId());
jsonObject.put("folderIds",folderIds);
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
JSONObject jsonBody = xmAppApi.getBodyInJSON();
Assert.assertEquals("true", jsonBody.getString("success"));
Assert.assertEquals("200", jsonBody.getString("code"));
Assert.assertEquals("false", jsonBody.getString("result")); //没有关联关系
}
}
......@@ -109,5 +109,17 @@
"apiContentType": "application/json;charset=utf-8",
"apiName": "公共文件权限管理",
"desc": "公共文件权限管理"
},
"API_delFolder": {
"apiPath": "/apollo/public/apollo/delFolder",
"apiContentType": "application/json;charset=utf-8",
"apiName": "我的文件-删除文件",
"desc": "我的文件-删除文件"
},
"API_judgeRelation": {
"apiPath": "/apollo/public/apollo/judgeRelation",
"apiContentType": "application/json;charset=utf-8",
"apiName": "查询文件关联关系",
"desc": "查询文件关联关系"
}
}
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