Commit 5235babc authored by Su-Yi's avatar Su-Yi

更新上传素材+新手任务case、优化网络模块

parent 648bad52
This diff is collapsed.
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)
......
......@@ -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"/>
......
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