Commit d70f90d8 authored by 龚小红's avatar 龚小红

Merge branch 'gifeature/20210819-gj' into 'master'

预告页接口用例

See merge request test-group/kejiji!105
parents 91f894f3 fa696d74
package com.kjj.cases.live.preview;
import com.kjj.cases.admin.Authorization;
import com.kjj.config.BasicConfig;
import com.kjj.constants.LiveConstants;
import com.kjj.utils.ThreadSleepUtils;
import io.restassured.response.Response;
import org.testng.Assert;
import org.testng.annotations.Test;
import java.util.*;
public class Preview implements Authorization{
//***************** A类用户使用新版预告页***************
@Test(description = "查看预告页标题配图",priority = 1)
public void 查看预告页标题配图(){
visitorAuth22();
Map<String,Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
//params.put("liveId","Kj21NDM3OTE");
Response response = network.getResponse(params,BasicConfig.ANCHOR_previewTitleImg);
String titleImg = response.jsonPath().getString("data.titleImg");
System.out.println(titleImg);
Assert.assertNotNull(titleImg, network.message(params,BasicConfig.ANCHOR_previewTitleImg,"获取标题配图失败",response.body().asString()));
}
@Test(description = "查看抽奖码百分比",priority = 2)
public void 查看抽奖码百分比(){
visitorAuth22();
Map<String,Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
//params.put("liveId","Kj21NDM3OTE");
Response response = network.getResponse(params,BasicConfig.ANCHOR_overPercent);
Object percentMap = response.jsonPath().getJsonObject("data.percentMap");
Assert.assertNotNull(percentMap, network.message(params,BasicConfig.ANCHOR_overPercent,"获取抽奖码对应的百分比失败",response.body().asString()));
}
@Test(description = "访客观看视频的抽奖码",priority = 3)
public void 访客观看视频的抽奖码(){
visitorAuth22();
Map<String,Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("liveId","Kj21NDM3OTE");
Response response = network.postResponse(params,BasicConfig.ANCHOR_watchVideo);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.ANCHOR_watchVideo,"访客观看视频的抽奖码失败",response.body().asString()));
}
@Test(description = "大奖展示",priority = 4)//ANCHOR_mainWelfare
public void 访客大奖展示(){
visitorAuth22();
Map<String,Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
//params.put("liveId","Kj21NDM3OTE");
Response response = network.getResponse(params,BasicConfig.ANCHOR_mainWelfare);
Object data = response.jsonPath().getJsonObject("data");
Assert.assertNotNull(data,network.message(params,BasicConfig.ANCHOR_mainWelfare,"未获取到大奖",response.body().asString()));
}
}
......@@ -111,7 +111,10 @@ public class BasicConfig {
public static final String MANAGER_preViewWelfareList = MANAGER_HOST + "/kjy/manager/preView/conf/welfareList";
public static final String MANAGER_confMainWelfare = MANAGER_HOST + "/kjy/manager/preView/conf/confMainWelfare";
public static final String MANAGER_getMainWelfare = MANAGER_HOST + "/kjy/manager/preView/conf/getMainWelfare";
public static final String ANCHOR_previewTitleImg = MOBILE_HOST + "/kjy/live/user/preview/titleImg";
public static final String ANCHOR_overPercent = MOBILE_HOST + "/kjy/live/overPercent";
public static final String ANCHOR_watchVideo = MOBILE_HOST + "/kjy/live/watchVideo";
public static final String ANCHOR_mainWelfare = MOBILE_HOST + "/kjy/live/user/preview/mainWelfare";
// *************** 好运红包 ***************
public static final String MANAGER_redSaveOrUpdate = MANAGER_HOST + "/kjy/manager/live/fortune/red/saveOrUpdate";
public static final String MANAGER_redConfDetail = MANAGER_HOST + "/kjy/manager/live/fortune/red/confDetail";
......
......@@ -55,6 +55,12 @@
</classes>
</test>
<test preserve-order="false" name="预告页">
<classes>
<class name="com.kjj.cases.live.preview.Preview"/>
</classes>
</test>
<test preserve-order="false" name="翻牌集字红包">
<classes>
<class name="com.kjj.cases.live.flipCard.FlipCard"/>
......
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