Commit 3731e941 by fangyuan

update cases

parent 36ab51d2
package com.live.cases.interactionLive; //package com.live.cases.interactionLive;
//
import com.alibaba.fastjson.JSONObject; //import com.alibaba.fastjson.JSONObject;
import com.live.enums.ApiModele; //import com.live.enums.ApiModele;
import com.xiaomai.enums.RequestType; //import com.xiaomai.enums.RequestType;
import com.xiaomai.enums.Terminal; //import com.xiaomai.enums.Terminal;
import com.xiaomai.utils.XMBaseTest; //import com.xiaomai.utils.XMBaseTest;
import org.testng.Assert; //import org.testng.Assert;
import org.testng.annotations.BeforeMethod; //import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test; //import org.testng.annotations.Test;
//
import java.util.HashMap; //import java.util.HashMap;
import java.util.Map; //import java.util.Map;
//
/** ///**
* @author NHX // * @author NHX
* @Function B端查询大班直播列表 // * @Function B端查询大班直播列表
* @Date 2020/11/19 15:01 // * @Date 2020/11/19 15:01
*/ // */
public class TestGetLargeClassLiveList_B extends XMBaseTest { //public class TestGetLargeClassLiveList_B extends XMBaseTest {
//
@BeforeMethod // @BeforeMethod
public void beforeTest() { // public void beforeTest() {
xmAppApi.setApiModule(ApiModele.CloudClass_File) // API 所属模块 // xmAppApi.setApiModule(ApiModele.CloudClass_File) // API 所属模块
.setApiName("API_getLargeClassLiveList") // API 名称 // .setApiName("API_getLargeClassLiveList") // API 名称
.setLoginUser("NHX_b") // http 接口,测试账号 // .setLoginUser("NHX_b") // http 接口,测试账号
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传) // .setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
//
dal.setCase_owner("NHX") // dal.setCase_owner("NHX")
.setCase_name("B端查询大班直播列表:" + Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]); // .setCase_name("B端查询大班直播列表:" + Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]);
//
super.beforeTest(); // super.beforeTest();
} // }
//
@Test(description = "B端查询大班直播列表") // @Test(description = "B端查询大班直播列表")
public void testLoadStudentListAPI(){ // public void testLoadStudentListAPI(){
//
Map<String,Object> bodyMap = new HashMap<>(); // Map<String,Object> bodyMap = new HashMap<>();
bodyMap.put("current",1); // bodyMap.put("current",1);
bodyMap.put("size",1); // bodyMap.put("size",1);
bodyMap.put("instId","1009415524133634144"); // bodyMap.put("instId","1009415524133634144");
//
//
JSONObject jsonBody = new JSONObject(bodyMap); // JSONObject jsonBody = new JSONObject(bodyMap);
String data = jsonBody.toJSONString(); // String data = jsonBody.toJSONString();
//
System.out.println("请求参数==========="+data); // System.out.println("请求参数==========="+data);
//headers.put("userId","1145612151844098049"); // //headers.put("userId","1145612151844098049");
//
xmAppApi.doRequest(RequestType.JSON, params, data, headers); // xmAppApi.doRequest(RequestType.JSON, params, data, headers);
JSONObject jsonResponseBody = xmAppApi.getBodyInJSON(); // JSONObject jsonResponseBody = xmAppApi.getBodyInJSON();
Assert.assertEquals(jsonResponseBody.getString("success"), "true", "操作成功!"); // Assert.assertEquals(jsonResponseBody.getString("success"), "true", "操作成功!");
//
//
} // }
//
} //}
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