Commit e2715ee8 authored by 张艳玲's avatar 张艳玲

update

parent dd7bfadd
......@@ -35,7 +35,7 @@ public interface AdminAuthorization {
}
/**
* 访客(慧锋)授权
* 访客(茶仔)授权
*/
default void visitorAuth2() {
network.agentCookies.put("authKey", VISITORKEY2);
......@@ -51,14 +51,14 @@ public interface AdminAuthorization {
}
/**
* 访客(志勇)授权
* 访客(周成)授权
*/
default void visitorAuth4() {
network.agentCookies.put("authKey", VISITORKEY4);
System.out.println("用户AUTH_KEY:" + VISITORKEY4);
}
/**
* 访客(周成)授权
* 访客(周成)授权,企业指定中奖用户
*/
default void visitorAuth5() {
network.agentCookies.put("authKey", VISITORKEY5);
......@@ -66,7 +66,7 @@ public interface AdminAuthorization {
}
/**
* 访客(斌斌)授权
* 访客(新强)授权
*/
default void visitorAuth6() {
network.agentCookies.put("authKey", VISITORKEY6);
......
package com.kjj.cases.live.manager;
import com.kjj.cases.live.admin.AdminAuthorization;
import com.kjj.config.BasicConfig;
import com.kjj.constants.LiveConstants;
import com.kjj.utils.BaseUtils;
import io.restassured.response.Response;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class LiveLottery implements AdminAuthorization {
public long confId;
public Integer taskId;
@BeforeClass
public void setUp() {
BaseUtils.ssoLogin();
}
@Test(description = "获取抽奖轮次信息", priority = 1)
public void 获取抽奖轮次信息() {
Map<String, Object> listParam = new HashMap<>();
listParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Response response = network.getResponse(listParam, BasicConfig.MANAGER_list);
List data = response.jsonPath().getList("data");
Map resultMap = (Map) data.get(0);
System.out.println(resultMap.get("confId"));
confId =Long.parseLong(resultMap.get("confId").toString());
Assert.assertNotNull(confId, network.message(listParam, BasicConfig.MANAGER_list, "获取抽奖轮次信息失败", response.body().asString()));
}
@Test(description = "上传企业指定中奖名单", priority = 2)
public void 上传企业指定中奖名单() {
Map<String, Object> importParam = new HashMap<>();
importParam.put("confId",confId);
importParam.put("excelUrl", "https://yun.dui88.com/kjy/media/file/20210420/51716f59605424332f50a26f0a5d531f.xlsx");
importParam.put("fileName", "指定中奖名单");
Response response = network.postResponse(importParam, BasicConfig.MANAGER_import);
taskId = response.jsonPath().getInt("data");
System.out.println(taskId);
Assert.assertNotNull(taskId, network.message(importParam, BasicConfig.MANAGER_import, "上传企业指定中奖名单失败", response.body().asString()));
}
@Test(description = "获取导入任务结果", priority = 3)
public void 获取导入任务结果() {
Map<String, Object> resultParam = new HashMap<>();
resultParam.put("taskId", taskId);
Response response = null;
for (int i=0; i<10; i++) {
response = network.getResponse(resultParam, BasicConfig.MANAGER_result);
boolean hasFinish= response.jsonPath().getBoolean("data.hasFinish");
System.out.println(hasFinish);
if(hasFinish) return;
}
Assert.fail(network.message(resultParam, BasicConfig.MANAGER_result, "获取导入任务结果失败", response.body().asString()));
}
@Test(description = "删除企业指定中奖名单", priority = 4)
public void 删除企业指定中奖名单() {
Map<String, Object> delParam = new HashMap<>();
delParam.put("confId",confId);
Response response = network.postResponse(delParam, BasicConfig.MANAGER_del1);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(delParam, BasicConfig.MANAGER_del1, "删除企业指定中奖名单失败", response.body().asString()));
}
@Test(description = "上传新的企业指定中奖名单", priority = 5)
public void 上传新的企业指定中奖名单() {
Map<String, Object> importParam = new HashMap<>();
importParam.put("confId",confId);
importParam.put("excelUrl", "https://yun.dui88.com/kjy/media/file/20210420/51716f59605424332f50a26f0a5d531f.xlsx");
importParam.put("fileName", "指定中奖名单");
Response response = network.postResponse(importParam, BasicConfig.MANAGER_import);
taskId = response.jsonPath().getInt("data");
System.out.println(taskId);
Assert.assertNotNull(taskId, network.message(importParam, BasicConfig.MANAGER_import, "上传企业指定中奖名单失败", response.body().asString()));
}
@Test(description = "获取新的导入任务结果", priority = 6)
public void 获取新的导入任务结果() {
Map<String, Object> resultParam = new HashMap<>();
resultParam.put("taskId", taskId);
Response response = null;
for (int i=0; i<10; i++) {
response = network.getResponse(resultParam, BasicConfig.MANAGER_result);
boolean hasFinish= response.jsonPath().getBoolean("data.hasFinish");
System.out.println(hasFinish);
if(hasFinish) return;
}
Assert.fail(network.message(resultParam, BasicConfig.MANAGER_result, "获取导入任务结果失败", response.body().asString()));
}
}
......@@ -9,6 +9,7 @@ import com.kjj.constants.LiveConstants;
import com.kjj.utils.BaseUtils;
import io.restassured.response.Response;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.util.ArrayList;
......@@ -18,10 +19,13 @@ import java.util.Map;
public class LotteryRule implements AdminAuthorization {
public long confId;
@BeforeClass
public void setUp() {
BaseUtils.ssoLogin();
}
@Test(description = "获取抽奖轮次信息", priority = 1)
public void 获取抽奖轮次信息() {
BaseUtils.ssoLogin();
Map<String, Object> listParam = new HashMap<>();
listParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Response response = network.getResponse(listParam, BasicConfig.MANAGER_list);
......
......@@ -12,6 +12,7 @@ import com.kjj.utils.JsonUtil;
import io.restassured.response.Response;
import org.apache.commons.lang3.time.DateUtils;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.util.*;
public class SaveAndUpdate implements AdminAuthorization {
......@@ -20,10 +21,13 @@ public class SaveAndUpdate implements AdminAuthorization {
public long welfareConfId;
public int id;
@BeforeClass
public void setUp() {
BaseUtils.ssoLogin();
}
@Test(description = "创建直播", priority = 1)
public void 创建直播() {
BaseUtils.ssoLogin();
Map<String, Object> saveAndUpdateParam = new HashMap<>();
saveAndUpdateParam.put("posterUrl", "https://streamimg.kjjcrm.com/kjy/image/20210201/e36cb31828e14a3ebb9d01e6be79ad66.jpg");
saveAndUpdateParam.put("videoUrl", "http://streamimg.kjjcrm.com/kjy/image/20210201/1612171657348.mp4");
......
......@@ -7,6 +7,7 @@ import com.kjj.utils.BaseUtils;
import com.kjj.utils.JsonUtil;
import io.restassured.response.Response;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.util.HashMap;
......@@ -15,9 +16,14 @@ import java.util.Map;
public class Team implements AdminAuthorization {
public List<TeamList> id;
@BeforeClass
public void setUp() {
BaseUtils.ssoLogin();
}
@Test(description = "新增团队", priority = 1)
public void 新增团队() {
BaseUtils.ssoLogin();
Map<String, Object> saveOrUpdateParam = new HashMap<>();
saveOrUpdateParam.put("companyId", 101);
saveOrUpdateParam.put("teamName", "测试团队");
......
......@@ -149,9 +149,6 @@ public class BasicConfig {
public static final String MOBILE_VideoLike = MOBILE_HOST + "/kjy/live/company/video/like";
public static final String MOBILE_LiveGuideList = MOBILE_HOST + "/kjy/live/guide/list";
//查询资料列表//
public static final String MOBILE_Resource = MOBILE_HOST + "/clue/resource/list";
public static final String MOBILE_ResourceOn = MOBILE_HOST + "/conf/live/push/on";
......@@ -200,9 +197,6 @@ public class BasicConfig {
public static final String MOBILE_SpokeHistoryList = MOBILE_SPOKEHOST + "/spoke/historyList";
public static final String MOBILE_SpokeSend = MOBILE_SPOKEHOST + "/spoke/send";
//红包//
public static final String MOBILE_AnchorRedList = MOBILE_HOST + "/conf/live/red/findRedList";
public static final String MOBILE_FindRedList = MOBILE_HOST + "/clue/red/findRedList";
......@@ -234,8 +228,6 @@ public class BasicConfig {
public static final String MOBILE_QuesParticipate = MOBILE_HOST + "/clue/ques/reward/participate";
public static final String MOBILE_QuesParticipateInfo = MOBILE_HOST + "/clue/ques/reward/participateInfo";
//***************直播素材*****************
public static final String MANAGER_SAVEORUPDATE6 = MANAGER_HOST+ "/kjy/manager/conf/base/welfare/saveOrUpdate";
public static final String MANAGER_WELFARELIST = MANAGER_HOST+ "/kjy/manager/conf/base/welfare/list";
......@@ -270,6 +262,12 @@ public class BasicConfig {
public static final String MANAGER_changeStatus = MANAGER_HOST+ "/kjy/manager/live/lottery/rule/changeStatus";
public static final String MANAGER_saveLimit = MANAGER_HOST+ "/kjy/manager/live/lottery/saveLimit";
//***************企业指定中奖*****************
public static final String MANAGER_import = MANAGER_HOST+ "/kjy/manager/live/lottery/import";
public static final String MANAGER_del1 = MANAGER_HOST+ "/kjy/manager/live/lottery/delete";
public static final String MANAGER_result = MANAGER_HOST+ "/kjy/manager/live/import/result";
// *************** 素材ID ***************
public static final String ARTICLE_CONTENTID = "Kj21NjM4NDc";
......
......@@ -2,117 +2,123 @@
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="直播" verbose="1" thread-count="3">
<test preserve-order="true" name="直播素材">
<classes>
<class name="com.kjj.cases.live.manager.LiveMaterial"/>
</classes>
</test>
<test preserve-order="true" name="团队管理">
<classes>
<class name="com.kjj.cases.live.manager.Team"/>
</classes>
</test>
<!-- <test preserve-order="true" name="直播素材">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.manager.LiveMaterial"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="团队管理">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.manager.Team"/>-->
<!-- </classes>-->
<!-- </test>-->
<test preserve-order="true" name="创建直播">
<classes>
<class name="com.kjj.cases.live.manager.SaveAndUpdate"/>
</classes>
</test>
<!-- <test preserve-order="true" name="创建直播">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.manager.SaveAndUpdate"/>-->
<!-- </classes>-->
<!-- </test>-->
<test preserve-order="true" name="中奖规则配置">
<classes>
<class name="com.kjj.cases.live.manager.LotteryRule"/>
</classes>
</test>
<!-- <test preserve-order="true" name="中奖规则配置">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.manager.LotteryRule"/>-->
<!-- </classes>-->
<!-- </test>-->
<test preserve-order="true" name="代理人首页">
<classes>
<class name="com.kjj.cases.live.agent.Procurator"/>
</classes>
</test>
<test preserve-order="true" name="代理人分享直播间">
<test preserve-order="true" name="企业指定中奖名单上传">
<classes>
<class name="com.kjj.cases.live.agent.Agent"/>
<class name="com.kjj.cases.live.manager.LiveLottery"/>
</classes>
</test>
<test preserve-order="true" name="访客券码领取">
<classes>
<class name="com.kjj.cases.live.user.User"/>
</classes>
</test>
<test preserve-order="true" name="指定中奖">
<classes>
<class name="com.kjj.cases.live.lottery.DesignatedWinner"/>
</classes>
<!-- <test preserve-order="true" name="代理人首页">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.agent.Procurator"/>-->
<!-- </classes>-->
<!-- </test>-->
</test>
<test preserve-order="true" name="直播前-我的客户页">
<classes>
<class name="com.kjj.cases.live.agent.LiveBefore"/>
</classes>
</test>
<!-- <test preserve-order="true" name="代理人分享直播间">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.agent.Agent"/>-->
<!-- </classes>-->
<test preserve-order="true" name="助播-开启直播">
<classes>
<class name="com.kjj.cases.live.anchor.OpenLive"/>
</classes>
</test>
<!-- </test>-->
<!-- <test preserve-order="true" name="访客券码领取">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.user.User"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="指定中奖">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.lottery.DesignatedWinner"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- -->
<!-- <test preserve-order="true" name="直播前-我的客户页">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.agent.LiveBefore"/>-->
<!-- </classes>-->
<!-- </test>-->
<test preserve-order="true" name="直播中抽奖">
<classes>
<class name="com.kjj.cases.live.lottery.Lottery"/>
</classes>
</test>
<test preserve-order="true" name="免费领福利">
<classes>
<class name="com.kjj.cases.live.FreeReward.FreeReward"/>
</classes>
</test>
<!-- <test preserve-order="true" name="助播-开启直播">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.anchor.OpenLive"/>-->
<!-- </classes>-->
<!-- </test>-->
<test preserve-order="true" name="访客领取资料">
<classes>
<class name="com.kjj.cases.live.anchor.LiveVisitors"/>
</classes>
</test>
<test preserve-order="true" name="获取代理人排行榜及客户信息">
<classes>
<class name="com.kjj.cases.live.agent.LiveAgent"/>
</classes>
</test>
<test preserve-order="true" name="红包领取">
<classes>
<class name="com.kjj.cases.live.red.LiveVistorRed"/>
</classes>
</test>
<test preserve-order="true" name="有奖答题">
<classes>
<class name="com.kjj.cases.live.red.QuestionAwards"/>
</classes>
</test>
<test preserve-order="true" name="投票">
<classes>
<class name="com.kjj.cases.live.choice.Choice"/>
</classes>
</test>
<test preserve-order="true" name="问题">
<classes>
<class name="com.kjj.cases.live.question.Question"/>
</classes>
</test>
<test preserve-order="true" name="助播-结束直播">
<classes>
<class name="com.kjj.cases.live.anchor.CloseLive"/>
</classes>
</test>
<test preserve-order="true" name="直播结束-我的客户页">
<classes>
<class name="com.kjj.cases.live.agent.LiveLater"/>
</classes>
</test>
<!-- <test preserve-order="true" name="直播中抽奖">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.lottery.Lottery"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="免费领福利">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.FreeReward.FreeReward"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="访客领取资料">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.anchor.LiveVisitors"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="获取代理人排行榜及客户信息">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.agent.LiveAgent"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="红包领取">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.red.LiveVistorRed"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="有奖答题">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.red.QuestionAwards"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="投票">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.choice.Choice"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="问题">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.question.Question"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="助播-结束直播">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.anchor.CloseLive"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="直播结束-我的客户页">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.agent.LiveLater"/>-->
<!-- </classes>-->
<!-- </test>-->
</suite>
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