Commit 6ded5cd0 authored by 李浩弘's avatar 李浩弘

Merge branch 'test/20200623-test' into 'master'

Test/20200623 test

See merge request test-group/kejiji!9
parents baf23aee 86bb167b
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="https://repo.maven.apache.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
</component>
</project>
\ No newline at end of file
<changelist name="Uncommitted_changes_before_Checkout_at_2020_6_28,_16_44_[Default_Changelist]" date="1593333888326" recycled="true" deleted="true">
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Checkout_at_2020_6_28,_16_44_[Default_Changelist]/shelved.patch" />
<option name="DESCRIPTION" value="Uncommitted changes before Checkout at 2020/6/28, 16:44 [Default Changelist]" />
<binary>
<option name="BEFORE_PATH" value="target/test-classes/com/kjj/qa/utils/NetworkUtil.class" />
<option name="AFTER_PATH" value="target/test-classes/com/kjj/qa/utils/NetworkUtil.class" />
<option name="SHELVED_PATH" value="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Checkout_at_2020_6_28,_16_44_[Default_Changelist]/NetworkUtil.class" />
</binary>
</changelist>
\ No newline at end of file
package com.kjj.qa.cases;
import com.kjj.qa.utils.NetworkUtil;
import io.restassured.response.Response;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.IExpectedExceptionsAnnotation;
import org.testng.annotations.Test;
import org.testng.remote.strprotocol.IMessage;
import static com.kjj.qa.config.BasicConfig.*;
import java.io.IOException;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class Boss {
private static final NetworkUtil network = NetworkUtil.getInstance();
@BeforeClass
public void setUp() {
}
//判断代理人的会员及版本
@Test(description="会员及版本判断",priority = 1)
public void 会员及版本判断() throws IOException{
Response response = network.getResponse(BOSS_INFO);
int userVersion = response.jsonPath().getInt("data.find {it.openType == 1}.userVersion");//判断是否为保险版:1是通用版 2是保险版
boolean isVip = response.jsonPath().getBoolean("data.find {it.openType == 1}.vip");//判断是否为会员
Assert.assertEquals(userVersion, 2,network.message(BOSS_INFO,"获取版本有误 此版本为非保险版"));
Assert.assertTrue(isVip,network.message(BOSS_INFO,"会员判断错误 为非会员"));
}
//代理人有无上下级判断;
@Test(description="当前代理人角色判断",priority = 2)
public void 当前代理人角色判断() throws IOException{
Map<String, Object> params = new HashMap<String, Object>();
params.put("sellerId",1939);
Response response = network.getResponse(params,BOSS_ROLE);
boolean hasSubordinate = response.jsonPath().getBoolean("data.hasSubordinate");//判断是否有下级
boolean hasSuperior = response.jsonPath().getBoolean("data.hasSuperior");//判断是否有上级
Assert.assertFalse(hasSubordinate, network.message(params,BOSS_ROLE,"暂无下级"));
Assert.assertTrue(hasSuperior,network.message(params,BOSS_ROLE,"暂无上级"));
}
//分享链接邀请下级加入
@Test(description="邀请成员加入",priority = 3)
public void 邀请成员加入() throws IOException{
Map<String, Object> params = new HashMap<String, Object>();
params.put("inviteType",2);
Response response = network.getResponse(params,BOSS_CODE);
boolean invite = response.jsonPath().getBoolean("success");
Assert.assertTrue(invite,network.message(params,BOSS_CODE,"分享链接失败"));
}
//被邀请人点击链接接受邀请
@Test(description="获取被邀请人身份",priority = 4)
public void 获取被邀请人身份() throws IOException{
//tku 切换为访客的
network.agentCookies.put("tku",VISITOR_TKU);
Map<String, Object> params = new HashMap<String, Object>();
params.put("sellerId",2126);
Response response = network.getResponse(params,BOSS_IDENTITY);
int identity = response.jsonPath().getInt("data.identity"); //1团长、2成员、3没有团队
Assert.assertEquals(identity, 3, network.message(params,BOSS_IDENTITY,"被邀请人已有团队或已绑定上级,不能再接受邀请"));
}
//邀请结果判断
@Test(description="邀请结果",priority = 5)
public void 邀请结果() throws IOException{
Map<String, Object> params = new HashMap<String, Object>();
params.put("inviterSid",1939);
params.put("inviteType",2);
Response response = network.getResponse(params,BOSS_BOUND);
boolean data = response.jsonPath().getBoolean("data"); //1 true:邀请成功;2 false:邀请失败
Assert.assertTrue(data, network.message(params,BOSS_BOUND,"接受邀请失败"));
}
//重新获取列表,代理人有无上下级判断;
@Test(description="当前代理人角色二次判断",priority = 6)
public void 当前代理人角色二次判断() throws IOException{
//tku 切换为代理人的
network.agentCookies.put("tku",AGENT_TKU);
Map<String, Object> params = new HashMap<String, Object>();
params.put("sellerId",1939);
Response response = network.getResponse(params,BOSS_ROLE);
boolean hasSubordinate = response.jsonPath().getBoolean("data.hasSubordinate");//判断是否有下级
boolean hasSuperior = response.jsonPath().getBoolean("data.hasSuperior");//判断是否有上级
Assert.assertTrue(hasSubordinate, network.message(params,BOSS_ROLE,"暂无下级"));
Assert.assertTrue(hasSuperior,network.message(params,BOSS_ROLE,"暂无上级"));
}
//团队长数据看板
//代理人已存在下级直接进入团队长数据看板;获取上级团队昵称
@Test(description="获取上级团队昵称",priority = 7)
public void 获取上级团队昵称() throws IOException{
Map<String, Object> params = new HashMap<String, Object>();
params.put("sellerId",1939);
Response response = network.getResponse(params,BOSS_BOSS);
String data = response.jsonPath().getString("data");
Assert.assertNotNull(data,network.message(params,BOSS_BOSS,"喜洋洋保险"));
}
//获取代理人团队人数
@Test(description="获取当前团队人数",priority = 8)
public void 获取当前团队人数() throws IOException{
Map<String, Object> params = new HashMap<String, Object>();
params.put("sellerId",1939);
Response response = network.getResponse(params,BOSS_ROLE);
boolean teamNumber = response.jsonPath().getBoolean("data.teamNumber");//获取团队人数包含自己
Assert.assertNotNull(teamNumber,network.message(params,BOSS_ROLE,"获取团队人数失败"));
}
//移除团队成员
@Test(description="移除团队成员",priority = 9)
public void 移除团队成员() throws IOException{
Map<String, Object> params = new HashMap<String, Object>();
List<String> ss= Collections.singletonList("Kj21MTcwMTU");
params.put("sids",ss);
Response response = network.postResponse(params,BOSS_REMOVE);
System.out.println(response.getBody().prettyPrint());
boolean data = response.jsonPath().getBoolean("data"); //true:删除成功;false:删除失败
Assert.assertEquals(data,true,network.message(params,BOSS_REMOVE, "移除失败"));
}
//代理人无下级直接进入个人数据看板页面;获取上级昵称
@Test(description="获取上级昵称",priority = 10)
public void 获取上级昵称() throws IOException{
Map<String, Object> params = new HashMap<String, Object>();
params.put("sellerId",1939);
Response response = network.getResponse(params,BOSS_BOSS);
String data = response.jsonPath().getString("data");
Assert.assertNotNull(data,network.message(params,BOSS_BOSS,"喜洋洋保险"));
}
//分享链接邀请下级加入
@Test(description="邀请下级加入",priority = 11)
public void 邀请下级加入() throws IOException{
Map<String, Object> params = new HashMap<String, Object>();
params.put("inviteType",2);
Response response = network.getResponse(params,BOSS_CODE);
boolean invite = response.jsonPath().getBoolean("success");
Assert.assertTrue(invite,network.message(params,BOSS_CODE,"分享链接失败"));
}
@AfterClass
public static void tearDown(){
apiCount += 7;
}
}
\ No newline at end of file
......@@ -129,7 +129,6 @@ public class Upload {
// params.put("firstFrameUrl",firstFrameUrl);
// params.put("contentTitle","=自动化测试=");
// response = network.postResponse(params, UPLOAD_SELLERUPLOADVEDIO);
// response.body().prettyPrint();
// String contentId = response.jsonPath().getString("data.contentId");
// Assert.assertNotNull(contentId,network.message(params, UPLOAD_SELLERUPLOADVEDIO,"上传本地视频-上传第2步失败"));
}
......
......@@ -8,9 +8,9 @@ public class BasicConfig {
// 是否推送
public static final boolean isPushReport = true; //true
// 用户微信昵称
public static final String WECHAT_NAME = "小疙瘩人寿"; //
public static final String WECHAT_NAME = "亦.心"; //
// 用户tku
public static final String AGENT_TKU = "T3gM31f18jAW33XCkNSWPs5ieycGVhzGJCGdP9gN2FRzcGEPiPzaPmVhpvDQ1QJ8XQB12NeTHaHKnM79Vr";
public static final String AGENT_TKU = "T3gM31f18jAWudwfTW6o9zs27w5xMjdhLHsKVP3cHo9Aj89R66XoC3NkDQzrybU4n7btcQUaxnMjcDYTzb";
// *************** 钉钉机器人 ***************
// 线上-告警群
......@@ -23,7 +23,7 @@ public class BasicConfig {
public static final String HOST = "https://kjj.m.duibatest.com.cn"; // "https://kjj.m.duiba.com.cn";
// *************** TKU ***************
public static final String VISITOR_TKU = "T3gM31f18jAW2hicRDxbwHFSuwA4MMVLLeHZ5G4yvb3kN3PcWwcLdzfxPp2gghfE4x3BFH8JN3f8PUzQ6W";
public static final String VISITOR_TKU = "T3gM31f18jAW31GHJuxJmoCFoANch7fXayUgd4zHHg2hpXAv6nMZuh178skdhMMmXD9ZZyicRLBU7cjrvx";
// *************** 素材ID ***************
public static final String ARTICLE_CONTENTID = "Kj21NjM4NDc";
......@@ -190,4 +190,21 @@ public class BasicConfig {
public static final String TESTUSER_DISABLEUSER = "kjj-mng.duibatest.com.cn/kjy/manager/testUser/disableUser";
// ************** BOSS看板 ***************
public static final String BOSS_INFO = "/kjy/mp/version/info";
public static final String BOSS_ROLE = "/kjy/mp/seller/team/member/role";
public static final String BOSS_CODE = "/kjy/mp/seller/team/invite/code";
public static final String BOSS_IDENTITY = "/kjy/mp/seller/team/member/identity";
public static final String BOSS_BOUND = "/kjy/mp/seller/team/bound";
public static final String BOSS_BOSS = "/kjy/mp/seller/team/boss";
public static final String BOSS_REMOVE = "/kjy/mp/seller/team/member/remove";
}
......@@ -36,6 +36,11 @@
<class name="com.kjj.qa.cases.CircleFriends"/>
</classes>
</test>
<test preserve-order="true" name="boss看板">
<classes>
<class name="com.kjj.qa.cases.Boss"/>
</classes>
</test>
<!-- 监听器-->
<listeners>
<listener class-name="com.kjj.qa.config.ExtentTestNGIReporterListener"/>
......
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