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

修改钉钉推送

parent 1a0dbc2b
......@@ -2,12 +2,7 @@
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="kjj" />
</profile>
<profile default="true" name="Default" enabled="true" />
</annotationProcessing>
<bytecodeTargetLevel target="1.8" />
</component>
......
......@@ -4,9 +4,11 @@
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="delegatedBuild" value="true" />
<option name="testRunner" value="GRADLE" />
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleHome" value="$USER_HOME$/Downloads/gradle-5.5.1" />
<option name="gradleJvm" value="1.8" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
......
......@@ -22,6 +22,9 @@ repositories {
mavenCentral()
}
dependencies {
implementation 'org.projectlombok:lombok:1.18.16'
compile group: 'com.alibaba', name: 'fastjson', version:'1.2.58'
compile(group: 'commons-lang', name: 'commons-lang', version:'2.6') {
exclude(module: 'commons-logging')
......
package com.kjj.bean;
import lombok.Data;
@Data
public class AnswerBean {
private String optionDetail;
private int optionType;
......
package com.kjj.bean;
import lombok.Data;
import java.util.List;
@Data
public class AnswerListBean {
private String questionDetail;
private List<AnswerBean> optionList;
public String getQuestionDetail() {
return questionDetail;
}
public void setQuestionDetail(String questionDetail) {
this.questionDetail = questionDetail;
}
public List<AnswerBean> getOptionList() {
return optionList;
}
public void setOptionList(List<AnswerBean> optionList) {
this.optionList = optionList;
}
}
package com.kjj.bean;
import lombok.Data;
@Data
public class RewardPkBean {
private String prizeName;
private int ranking;
public String getPrizeName() {
return prizeName;
}
public void setPrizeName(String prizeName) {
this.prizeName = prizeName;
}
public int getRanking() {
return ranking;
}
public void setRanking(int ranking) {
this.ranking = ranking;
}
}
\ No newline at end of file
package com.kjj.bean;
import lombok.Data;
import java.util.Date;
@Data
public class TokenUserBean {
/**
* 直播用户ID
......@@ -33,51 +36,8 @@ public class TokenUserBean {
*/
private Date disableTime;
public Long getLiveUserId() {
return liveUserId;
}
public void setLiveUserId(Long liveUserId) {
this.liveUserId = liveUserId;
}
public String getThirdPartUId() {
return thirdPartUId;
}
public void setThirdPartUId(String thirdPartUId) {
this.thirdPartUId = thirdPartUId;
}
public Long getAgentId() {
return agentId;
}
public void setAgentId(Long agentId) {
this.agentId = agentId;
}
public Long getCompanyId() {
return companyId;
}
public void setCompanyId(Long companyId) {
this.companyId = companyId;
}
public Long getAdminId() {
return adminId;
}
public void setAdminId(Long adminId) {
this.adminId = adminId;
}
public Date getDisableTime() {
return disableTime;
}
public void setDisableTime(Date disableTime) {
this.disableTime = disableTime;
}
}
package com.kjj.bean;
import lombok.Data;
@Data
public class VoteBean {
private String answer;
private String relationResource;
private String relationResourceId;
}
package com.kjj.cases.live;
import com.kjj.bean.VoteBean;
import com.kjj.config.BasicConfig;
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.*;
public class LiveMaterial implements AdminAuthorization {
@BeforeClass
public void setUp() {
adminAuth();
BaseUtils.ssoLogin();
}
@Test(description = "添加奖品", priority = 1)
public void 添加奖品() {
Map<String, Object> saveOrUpdateParam = new HashMap<>();
saveOrUpdateParam.put("useDesc", "盲盒锦鲤");
saveOrUpdateParam.put("welfareImg", "https://yun.dui88.com/kjy/image/20210304/1614844180065.jpg");
saveOrUpdateParam.put("welfareUrl", "https://streamimg.kjjcrm.com/kjy/image/20210201/62c25dcb3b9b4d269a74894e4255a193.jpg");
saveOrUpdateParam.put("welfareName", "盲盒锦鲤");
saveOrUpdateParam.put("welfarePictures", "https://yun.dui88.com/kjy/image/20210304/1614844198545.jpeg");
saveOrUpdateParam.put("welfarePicturesArr", "https://yun.dui88.com/kjy/image/20210304/1614844198545.jpeg");
saveOrUpdateParam.put("welfareUrl", "null");
saveOrUpdateParam.put("welfareUrlDesc", "null");
saveOrUpdateParam.put("companyId", 101);
Response saveOrUpdatePes = network.postResponse(saveOrUpdateParam, BasicConfig.MANAGER_SAVEORUPDATE6);
boolean data = saveOrUpdatePes.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(saveOrUpdateParam, BasicConfig.MANAGER_SAVEORUPDATE6, "添加奖品失败", saveOrUpdatePes.body().asString()));
}
//删除奖品
//添加投票
@Test(description = "添加投票", priority = 2)
public void 添加投票() {
Map<String, Object> saveOrUpdate1Param = new HashMap<>();
saveOrUpdate1Param.put("companyId", 101);
saveOrUpdate1Param.put("question", "投票测试一");
List<VoteBean> votes = new ArrayList<>();
VoteBean vote = new VoteBean();
vote.setAnswer("选项一");
vote.setRelationResource("null");
vote.setRelationResourceId("null");
votes.add(vote);
VoteBean vote1 = new VoteBean();
vote1.setAnswer("选项二");
vote1.setRelationResource("null");
vote1.setRelationResourceId("null");
votes.add(vote1);
saveOrUpdate1Param.put("answerList", votes);
Response saveOrUpdate1Res = network.postResponse(saveOrUpdate1Param, BasicConfig.MANAGER_SAVEORUPDATE5);
boolean data1 = saveOrUpdate1Res.jsonPath().getBoolean("data");
System.out.println(data1);
Assert.assertTrue(data1, network.message(saveOrUpdate1Param, BasicConfig.MANAGER_SAVEORUPDATE5, "个人pk奖励配置失败", saveOrUpdate1Res.body().asString()));
}
}
......@@ -34,15 +34,15 @@ public class SaveAndUpdate implements AdminAuthorization {
saveAndUpdateParam.put("welfareUrl", "https://streamimg.kjjcrm.com/kjy/image/20210201/62c25dcb3b9b4d269a74894e4255a193.jpg");
saveAndUpdateParam.put("coverUrl", "https://streamimg.kjjcrm.com/kjy/image/20210201/d4093b24aaca49da8f0e3e276721feea.jpg");
saveAndUpdateParam.put("mpShareUrl", "https://streamimg.kjjcrm.com/kjy/image/20210201/182f3659e39b4ea6898af781cc6344a1.jpg");
saveAndUpdateParam.put("title", "自动化专用直播间");
saveAndUpdateParam.put("mpShareTitle", "自动化专用直播间");
saveAndUpdateParam.put("title", "营业部公司直播间");
saveAndUpdateParam.put("mpShareTitle", "营业部公司直播间");
saveAndUpdateParam.put("companyId", 101);
long noticeTime = DateUtils.addHours(new Date(), 2).getTime();
long broadcastTime = DateUtils.addHours(new Date(), 5).getTime();
saveAndUpdateParam.put("noticeTime", noticeTime);
saveAndUpdateParam.put("broadcastTime", broadcastTime);
saveAndUpdateParam.put("shareContent", "自动化专用直播间");
saveAndUpdateParam.put("shareContent", "营业部公司直播间");
saveAndUpdateParam.put("shelfStatus", "2");
saveAndUpdateParam.put("secondPoster", "https://streamimg.kjjcrm.com/kjy/image/20210201/cc999ebde48e49f99ac3f0d93480453f.jpg");
......
......@@ -4,7 +4,7 @@ public class BasicConfig {
public static int apiCount; //接口数量统计
// 是否开启钉钉机器人推送
public static final boolean isPushReport =true; //true
public static final boolean isPushReport =false; //true
// 代理人微信昵称
public static final String WECHAT_NAME = "客集集-梦晨"; //true
......@@ -75,6 +75,10 @@ public class BasicConfig {
public static final String MANAGER_SAVEORUPDATE7 = MANAGER_HOST + "/kjy/manager/welfare/pre/conf/saveOrUpdate";
//***************直播素材*****************
public static final String MANAGER_SAVEORUPDATE6 = "https://kjj-mng.duibatest.com.cn/kjy/manager/conf/base/welfare/saveOrUpdate";
// *************** 素材ID ***************
public static final String ARTICLE_CONTENTID = "Kj21NjM4NDc";
......
......@@ -44,7 +44,7 @@ public class ExtentTestNGIReporterListener implements IReporter {
// 统计suite下的成功、失败、跳过的总用例数
int suiteFailSize = 0;
int suitePassSize = 0;
int suiteSkipSize = 0;
// int suiteSkipSize = 0;
ExtentTest suiteTest = null;
// 存在多个suite的情况下,在报告中将同一个suite的测试结果归为一类,创建一级节点。
if (createSuiteNode) {
......
......@@ -41,7 +41,7 @@ public class DingTalkUtils {
contentParams.put("content","【测试结果】\n" + errorMessage);
//钉钉机器人消息体
/* Map<String, Object> params = new HashMap<String, Object>();
Map<String, Object> params = new HashMap<String, Object>();
params.put("msgtype","text");
params.put("text",contentParams);
System.out.println(params);
......@@ -50,7 +50,7 @@ public class DingTalkUtils {
if (isPushReport){
Response response = network.dingTalkRobot(params);
response.body().prettyPrint();
}*/
}
}
public static void main(String[] args) {
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="直播" verbose="1" thread-count="3">
<test preserve-order="true" name="创建直播">
<!-- <test preserve-order="true" name="创建直播">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.SaveAndUpdate"/>-->
<!-- </classes>-->
<!-- </test>-->
<test preserve-order="true" name="直播素材">
<classes>
<class name="com.kjj.cases.live.SaveAndUpdate"/>
<class name="com.kjj.cases.live.LiveMaterial"/>
</classes>
</test>
</suite>
......@@ -2,7 +2,7 @@
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="客集集" verbose="1" thread-count="3">
<suite-files>
<suite-file path="wechatTestNG.xml"></suite-file>
<!-- <suite-file path="wechatTestNG.xml"></suite-file>-->
<suite-file path="liveTestNG.xml"></suite-file>
</suite-files>
<!-- 监听器-->
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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