Commit 69532175 authored by 李浩弘's avatar 李浩弘

第一次demo提交

parent 2d816b98
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="masterDetails">
<states>
<state key="ProjectJDKs.UI">
<settings>
<last-edited>1.8</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
</project>
\ No newline at end of file
# Default ignored files
/workspace.xml
\ No newline at end of file
kjj
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<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>
</annotationProcessing>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$" charset="UTF-8" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4" />
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>kjj</groupId>
<artifactId>kjj</artifactId>
<version>1.0-SNAPSHOT</version>
<!-- maven 参数配置,这里引用不同的testng.xml -->
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<!-- maven 引用依赖不同的jar -->
<dependencies>
<!--导入TestNG依赖包-->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.8.8</version>
<scope>test</scope>
</dependency>
<!-- 导入fastjson包 -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.58</version>
</dependency>
<!-- rest-assured -->
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<version>4.0.0</version>
<scope>test</scope>
</dependency>
<!-- 导入Mysql数据库链接jar包 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.15</version>
</dependency>
<!-- 引入poi,解析workbook视图 -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.1.0</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.17</version>
</dependency>
<!-- 依赖reportNg 关联testNg-->
<!-- <dependency>-->
<!-- <groupId>org.uncommons</groupId>-->
<!-- <artifactId>reportng</artifactId>-->
<!-- <version>1.1.4</version>-->
<!-- <scope>test</scope>-->
<!-- <exclusions>-->
<!-- <exclusion>-->
<!-- <groupId>org.testng</groupId>-->
<!-- <artifactId>testng</artifactId>-->
<!-- </exclusion>-->
<!-- </exclusions>-->
<!-- </dependency>-->
<!-- ExtentReports测试报告 关联testNg-->
<dependency>
<groupId>com.relevantcodes</groupId>
<artifactId>extentreports</artifactId>
<version>2.41.0</version>
</dependency>
<dependency>
<groupId>com.vimalselvam</groupId>
<artifactId>testng-extentsreport</artifactId>
<version>1.3.1</version>
</dependency>
<dependency>
<groupId>com.aventstack</groupId>
<artifactId>extentreports</artifactId>
<version>3.0.6</version>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>4.2.2</version>
</dependency>
</dependencies>
<!-- 编译插件 -->
<build>
<defaultGoal>compile</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<encoding>utf-8</encoding>
<!--源代码的编译-->
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<configuration>
<suiteXmlFiles>
<!-- -->
<suiteXmlFile>testNG.xml</suiteXmlFile>
</suiteXmlFiles>
<properties>
<property>
<name>usedefaultlisteners</name>
<value>false</value>
</property>
</properties>
<!--即使测试失败,也继续下面的测试-->
<testFailureIgnore>true</testFailureIgnore>
</configuration>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
<?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="首页" >-->
<!-- <classes>-->
<!-- <class name="com.kjj.qa.cases.Home"/>-->
<!-- </classes>-->
<!-- </test>-->
<test preserve-order="true" name="支付" >
<classes>
<class name="com.kjj.qa.cases.Pay"/>
</classes>
</test>
<!-- <test preserve-order="true" name="名片" >-->
<!-- <classes>-->
<!-- <class name="com.kjj.qa.cases.SellerCard"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- 监听器-->
<listeners>
<listener class-name="com.kjj.qa.config.ExtentTestNGIReporterListener"/>
</listeners>
</suite>
<!-- Suite -->
<!--
suite定义一个测试套件,可以设置是否使用多线程,可包含多个测试用例或者测试group
parallel = classes  每个测试用例class级别多线程
thread-count =3  线程数为5,可同时执行3个case
preserve-order = true   classes和methods按照配置中的顺序执行,false为乱序执行。(If you want the classes and methods listed in this file to be run in an unpredictible order, set the preserve-order attribute to false)
parameter 标签传递参数
-->
package com.kjj.qa.cases;
import com.kjj.qa.services.NetworkOperation;
import io.restassured.response.Response;
import org.testng.Assert;
import org.testng.annotations.*;
import org.testng.annotations.Test;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
public class Home {
private NetworkOperation network = new NetworkOperation();
// http://kjj.m.duibatest.com.cn/kjy/mp/developer/changeUser?uid=1515
@BeforeClass
public void setUp() {
// 代理人 cookies
network.agentCookies.put("tku","3wSM7Cd4wsesMcuzVhBQVGVupkmB3tT1JHyRbv9sK6ts7f6P67rmuygUqGfPc2Xd9YduvdByMocmpuzNMzKKWd48");
network.agentCookies.put("acw_tc","76b20ff215756198852864366e248d9e6bfb989ae8f073e81a05f23e6ef703");
network.agentHeaders.put("Content-Type","application/json");
// 访客 cookies
network.vistorCookies.put("tku","fcedkR2oRAVAoStCWGx7Y45krm9opxbQvd76nvAKqXQwmDyHyQyEiXyjEBjzRrk9hdVhppStVd5iz6GcBx8ghW");
network.vistorCookies.put("acw_tc","76b20fea15774130899093358e57cc742bc2ebcc713ece289b4e9c26ed8785");
network.vistorHeaders.put("Content-Type","application/json");
}
@Test (description = "JSSDK",priority = 1) //priorty 方法执行优先级
public void JSSDK() throws IOException {
//参数
Map<String, Object> params = new HashMap<String, Object>();
params.put("url","https://kjj.m.duiba.com.cn/#/?access_source=31");
params.put("retry","false");
Response response = network.getResponse(params,"/kjy/mp/seller/getOaJssdk");
boolean result = response.jsonPath().getBoolean("success");
Assert.assertEquals(result,true,"获取jssdk失败");
}
@Test (description = "早中晚日报列表",priority = 2)
public void 早中晚日报列表() throws IOException {
Response response = network.getResponse("/kjy/mp/content/getInitDailyList");
int status = response.jsonPath().get("data[0].status");
Assert.assertEquals(status,2,"获取早中晚日报列表信息失败");
}
@Test (description = "精准素材库",priority = 3)
public void 精准素材库() throws IOException {
Response response = network.getResponse("/kjy/mp/accurate/usrDetail");
int result = response.jsonPath().get("data.companyId");
Assert.assertEquals(result,5,"获取精准素材成功");
// Reporter.log("用例执行失败:服务器错误!");
}
@Test (description = "今日访问",priority = 4)
public void 今日访问() throws IOException {
//获取旧的今日访问数量
Response response = network.getResponse("/kjy/mp/seller/todayVisit");
int oldTodayCount = response.jsonPath().get("data.todayCount");
//访问名片 具体啥接口得问开发
Map<String, Object> params = new HashMap<String, Object>();
params.put("contentId",79040);
params.put("scId","7703312855");
params.put("comefrom",1);
params.put("fromUserId","2477770");
Response vistorRes = network.visitorBehavior(params,"/kjy/mp/sellerCard/visit");
//获取新的今日访问数量
response = network.getResponse("/kjy/mp/seller/todayVisit");
int newTodayCOunt = response.jsonPath().get("data.todayCount");
Assert.assertEquals(oldTodayCount + 1,newTodayCOunt,"今日访问量统计有误");
}
@Test (description = "分类列表",priority = 5)
public void 分类列表() throws IOException {
Response response = network.getResponse("/kjy/mp/classify/list");
String classifyName = response.jsonPath().get("data.list[0].classifyName");
Assert.assertEquals(classifyName ,"推荐","获取列表信息失败");
// 检验是否有公司专区
}
@Test (description = "推荐分类下的内容列表",priority = 6)
//首頁-信息
public void 推荐分类下的内容列表() throws IOException {
//穿的分页参数
Map<String, Object> params = new HashMap<String, Object>();
params.put("classfiyId","1");
params.put("pageIndex","1");
params.put("pageSize","10");
Response response = network.getResponse(params,"/kjy/mp/classify/contentList");
int pageSize = response.jsonPath().get("data.pageSize");
Assert.assertEquals(pageSize,10,"获取分类下的内容列表失败");
}
@Test (description = "用户信息",priority = 7)
public void 用户信息() throws IOException {
//获取旧的今日访问数量
Response response = network.getResponse("/kjy/mp/user/info");
String wxName = response.jsonPath().get("data.wxName");
Assert.assertEquals(wxName ,"小葡萄","获取用户信息失败");
}
@Test (description = "销售员公司资料总数",priority = 8)
//首頁-信息
public void 销售员公司资料总数() throws IOException {
Response response = network.getResponse("/kjy/mp/companyDocument/count");
boolean result = response.jsonPath().getBoolean("success");
Assert.assertEquals(result, true, "获取销售员公司资料总数失败");
// Reporter.log("用例执行失败:服务器错误!");
}
@AfterSuite
public void testSuite() throws IOException {
}
}
package com.kjj.qa.cases;
import com.alibaba.fastjson.JSONObject;
import com.kjj.qa.services.NetworkOperation;
import io.restassured.response.Response;
import org.testng.Assert;
import org.testng.annotations.*;
import org.testng.annotations.Test;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
public class Pay {
private NetworkOperation network = new NetworkOperation();
// http://kjj.m.duibatest.com.cn/kjy/mp/developer/changeUser?uid=1515
@BeforeClass
public void setUp() {
// 代理人 cookies
network.agentCookies.put("tku","T3gM31f18j8vG5qzLoSAPLiKFx4sPCbyCK9UZXCnpEY9D1WaB7MeDFGroYsGx2eBbU2MgGzUGkeNUKSEdv");
// network.agentCookies.put("acw_tc","76b20fe315823353519212714e7eb372f83a4dd118d1a883b8a62aa4907755");
network.agentHeaders.put("Content-Type","application/json");
}
@Test (description = "默认付费_付费页",priority = 1) //priorty 方法执行优先级
public void 默认付费_付费页() throws IOException {
//付款中间页判断
Response skipTypeResponse = network.getResponse("/kjy/mp/payMiddle/getMiddleDetail");
int skipType = skipTypeResponse.jsonPath().getInt("data.skipType");
Assert.assertEquals(skipType,2,"付款中间页:不是2020新版");
//会销资格判断
Response SiteSaleValidresponse = network.getResponse("/kjy/mp/seller/dist/hasSiteSaleValid");
boolean siteSaleValid = SiteSaleValidresponse.jsonPath().getBoolean("data");
Assert.assertEquals(siteSaleValid,false,"会销资格判断:判断错误,有会销资格");
//会员类型版本判断
Map<String, Object> params = new HashMap<String, Object>();
params.put("t",System.currentTimeMillis());
Response userVersionResponse = network.getResponse(params,"/kjy/mp/version/info");
int userVersion = userVersionResponse.jsonPath().getInt("data.find {it.openType == 1}.userVersion"); // 找出开启状态的版本类型
Assert.assertEquals(userVersion,1,"会员类型版本判断:判断错误,此版本为保险版");
//获取当前用户可用优惠码
Response promoCodeResponse = network.getResponse(params,"/kjy/order/getPromoCode");
String promoCode = promoCodeResponse.jsonPath().getString("data");
Assert.assertEquals(promoCode,null,"是否优惠判断:判断错误,当前有优惠");
//获取付费价格
Response actualPayMoneyResponse = network.getResponse("/kjy/mp/combo/list/v2?code=");
String actualPayMoney = actualPayMoneyResponse.jsonPath().getString("data[0].actualPayMoney");
Assert.assertEquals(actualPayMoney,"586","获取付费价格:价格不是586");
System.out.println(1);
}
@Test (description = "默认付费_待支付",priority = 2)
public void 默认付费_待支付() throws IOException {
//创建支付
Map<String, Object> payParams = new HashMap<String, Object>();
payParams.put("userVersion",1);
payParams.put("comboId","Kj21MTU");
payParams.put("oaId","1");
payParams.put("paySource","2");
payParams.put("sellerFrom","");
String payJson = JSONObject.toJSONString(payParams);
Response orderAppId = network.PostResponse(payJson,"/kjy/order/create");
String appId = orderAppId.jsonPath().getString("data.appId");
Assert.assertEquals(appId,"wxcb8c36279dd7dff2","拉起支付:拉起微信支付失败"); //判断返回的微信调起参数中appId是否正确
System.out.println(2);
}
@Test (description = "默认付费_取消支付",priority = 3)
public void 默认付费_取消支付() throws IOException {
//创建支付
Map<String, Object> payParams = new HashMap<String, Object>();
payParams.put("userVersion",1);
payParams.put("comboId","Kj21MTU");
payParams.put("oaId","1");
payParams.put("paySource","2");
payParams.put("sellerFrom","");
String payJson = JSONObject.toJSONString(payParams);
Response orderAppId = network.PostResponse(payJson,"/kjy/order/create");
String tradeNo = orderAppId.jsonPath().getString("data.tradeNo");
//会员类型版本判断
Map<String, Object> cancelParams = new HashMap<String, Object>();
cancelParams.put("tradeNo",tradeNo);
Response resultResponse = network.getResponse(cancelParams,"/kjy/order/cancel");
String result = resultResponse.jsonPath().getString("desc");
Assert.assertEquals(result,"OK","取消支付:取消支付失败"); //判断返回的微信调起参数中appId是否正确
System.out.println(3);
}
// @Test (description = "默认付费_成功支付",priority = 4)
// public void 默认付费_成功支付() throws IOException {
//
// }
@Test (description = "默认付费_切换会员类型为保险版",priority = 5)
public void 默认付费_切换为保险版会员类型并成功付款() throws IOException {
//会员类型版本判断
Map<String, Object> params = new HashMap<String, Object>();
params.put("t",System.currentTimeMillis());
Response userVersionResponse = network.getResponse(params,"/kjy/mp/version/info");
int userVersion = userVersionResponse.jsonPath().getInt("data.find {it.openType == 1}.userVersion"); // 找出开启状态的版本类型
int changeVersion = userVersion == 1 ? 2 : 1; // 判断当前开启的版本,如果当前版本是1,则改为2,反之;
//切换版本
String changeUserVersionJson = "{\"targetVersion\":" + changeVersion + "}";
Response resultResponse = network.PostResponse(changeUserVersionJson,"/kjy/mp/version/exchange");
String result = resultResponse.jsonPath().getString("desc");
Assert.assertEquals(result,"OK","会员类型切换:切换失败"); //判断返回的微信调起参数中appId是否正确
//会员类型再次判断
params.put("t",System.currentTimeMillis());
userVersionResponse = network.getResponse(params,"/kjy/mp/version/info");
userVersion = userVersionResponse.jsonPath().getInt("data.find {it.openType == 1}.userVersion"); // 找出开启状态的版本类型
Assert.assertEquals(userVersion,changeVersion,"会员类型版本判断:判断错误,此版本为尊享版");
}
@Test (description = "邀请码/分销码_付费页",priority = 6)
public void 分销码_付费页() throws IOException {
//用户绑定分销关系
// 绑定一个上级为保险版的会员,scId和inviterSid可以在用户分享的链接里拿到
Map<String, Object> distributeParams = new HashMap<String, Object>();
distributeParams.put("scId","Kj21OTk0MTU"); //文章ID: 文章转化访客时,传此参数
distributeParams.put("inviterSid","Kj21MTQ4OTU"); //销售ID: 会员邀请好友付费时,传此参数
distributeParams.put("fromStr",6); //文章来源: 6文章访客转化 1会员邀请
distributeParams.put("accessSource",12); //支付来源:客集集
Response distributeResponse = network.getResponse(distributeParams,"/kjy/sp/visitorPayment/distribute");
String result = distributeResponse.jsonPath().getString("desc");
Assert.assertEquals(result,"OK","绑定分销状态:绑定失败"); //判断返回的微信调起参数中appId是否正确
//会员类型版本判断
Map<String, Object> params = new HashMap<String, Object>();
params.put("t",System.currentTimeMillis());
Response userVersionResponse = network.getResponse(params,"/kjy/mp/version/info");
int userVersion = userVersionResponse.jsonPath().getInt("data.find {it.openType == 1}.userVersion"); // 找出开启状态的版本类型,version应该类型为2
Assert.assertEquals(userVersion,2,"会员类型版本判断:判断错误,此版本不是上级对应的版本");
//获取当前用户可用优惠码
Response promoCodeResponse = network.getResponse(params,"/kjy/order/getPromoCode");
String promoCode = promoCodeResponse.jsonPath().getString("data");
Assert.assertEquals(promoCode,null,"是否优惠判断:判断错误,当前有优惠");
//获取付费价格
Response actualPayMoneyResponse = network.getResponse("/kjy/mp/combo/list/v2?code=");
String actualPayMoney = actualPayMoneyResponse.jsonPath().getString("data[0].actualPayMoney");
Assert.assertEquals(actualPayMoney,"486","获取付费价格:价格不是486");
}
@Test (description = "邀请码/分销码_待支付",priority = 7)
public void 分销码_待支付() throws IOException {
//会员类型版本判断
Map<String, Object> params = new HashMap<String, Object>();
params.put("t",System.currentTimeMillis());
Response userVersionResponse = network.getResponse(params,"/kjy/mp/version/info");
int userVersion = userVersionResponse.jsonPath().getInt("data.find {it.openType == 1}.userVersion"); // 找出开启状态的版本类型 1保险 2通用
Assert.assertEquals(userVersion,2,"会员类型版本判断:判断错误,此版本不是上级对应的版本");
//创建支付
Map<String, Object> payParams = new HashMap<String, Object>();
payParams.put("userVersion",userVersion);
payParams.put("comboId","Kj21MTU");
payParams.put("oaId","1");
payParams.put("paySource","2");
payParams.put("sellerFrom","");
String payJson = JSONObject.toJSONString(payParams);
Response orderAppId = network.PostResponse(payJson,"/kjy/order/create");
String appId = orderAppId.jsonPath().getString("data.appId");
Assert.assertEquals(appId,"wxcb8c36279dd7dff2","拉起支付:拉起微信支付失败"); //判断返回的微信调起参数中appId是否正确
}
// @Test (description = "邀请码/分销码_成功支付",priority = 8)
// public void 分销码_成功支付() throws IOException {
//
// }
@Test (description = "邀请码/分销码_取消支付",priority = 9)
public void 分销码_取消支付() throws IOException {
//会员类型版本判断
Map<String, Object> params = new HashMap<String, Object>();
params.put("t",System.currentTimeMillis());
Response userVersionResponse = network.getResponse(params,"/kjy/mp/version/info");
int userVersion = userVersionResponse.jsonPath().getInt("data.find {it.openType == 1}.userVersion"); // 找出开启状态的版本类型
Assert.assertEquals(userVersion,2,"会员类型版本判断:判断错误,此版本不是上级对应的版本");
//创建支付
Map<String, Object> payParams = new HashMap<String, Object>();
payParams.put("userVersion",userVersion);
payParams.put("comboId","Kj21MTU");
payParams.put("oaId","1");
payParams.put("paySource","2");
payParams.put("sellerFrom","");
String payJson = JSONObject.toJSONString(payParams);
Response orderAppId = network.PostResponse(payJson,"/kjy/order/create");
String tradeNo = orderAppId.jsonPath().getString("data.tradeNo");
//会员类型版本判断
Map<String, Object> cancelParams = new HashMap<String, Object>();
cancelParams.put("tradeNo",tradeNo);
Response resultResponse = network.getResponse(cancelParams,"/kjy/order/cancel");
String result = resultResponse.jsonPath().getString("desc");
Assert.assertEquals(result,"OK","取消支付:取消支付失败"); //判断返回的微信调起参数中appId是否正确
}
@Test (description = "邀请码/分销码_切换会员类型为尊享版",priority = 10)
public void 分销码_切换为保险版会员类型并成功付款() throws IOException {
//会员类型版本判断
Map<String, Object> params = new HashMap<String, Object>();
params.put("t",System.currentTimeMillis());
Response userVersionResponse = network.getResponse(params,"/kjy/mp/version/info");
int userVersion = userVersionResponse.jsonPath().getInt("data.find {it.openType == 1}.userVersion"); // 找出开启状态的版本类型
int changeVersion = userVersion == 1 ? 2 : 1; // 判断当前开启的版本,如果当前版本是1,则改为2,反之;
//切换版本
String changeUserVersionJson = "{\"targetVersion\":" + changeVersion + "}";
Response resultResponse = network.PostResponse(changeUserVersionJson,"/kjy/mp/version/exchange");
String result = resultResponse.jsonPath().getString("desc");
Assert.assertEquals(result,"OK","会员类型切换:切换失败"); //判断返回的微信调起参数中appId是否正确
// //会员类型再次判断
params.put("t",System.currentTimeMillis());
userVersionResponse = network.getResponse(params,"/kjy/mp/version/info");
userVersion = userVersionResponse.jsonPath().getInt("data.find {it.openType == 1}.userVersion"); // 找出开启状态的版本类型
Assert.assertEquals(userVersion,changeVersion,"会员类型版本判断:判断错误,此版本为尊享版");
}
}
package com.kjj.qa.cases;
import com.alibaba.fastjson.JSONObject;
import com.kjj.qa.services.NetworkOperation;
import io.restassured.response.Response;
import org.testng.Assert;
import org.testng.annotations.*;
import org.testng.annotations.Test;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
public class SellerCard {
private NetworkOperation network = new NetworkOperation();
@BeforeClass
public void setUp() {
// 代理人 cookies
network.agentCookies.put("tku","T3gM31f18jAWvBFkQfN29cBnRJPVhN64pvvU1T2tkuQe24NggZnSnByQ8yncFGVAxui9GZ4veufsYPCcG2");
// network.agentCookies.put("acw_tc","76b20fec15850493922213781e346d81600bc01e6019c96a7e36d6b829aef3");
network.agentHeaders.put("Content-Type","application/json");
}
@Test (description = "详情页顶部",priority = 1) //priorty 方法执行优先级
public void 详情页顶部() throws IOException {
Response topDetailResponse = network.getResponse("/kjy/mp/sellerCardV5/topOfDetail");
String name = topDetailResponse.jsonPath().getString("data.sellerName");
Assert.assertEquals(name,"小葡萄","详情页顶部:获取用户信息失败!");
}
@Test (description = "个人介绍",priority = 2)
public void 个人介绍() throws IOException{
//拿到用户scid
Response topDetailResponse = network.getResponse("/kjy/mp/sellerCardV5/topOfDetail");
String scid = topDetailResponse.jsonPath().getString("data.scid");
Map<String, Object> params = new HashMap<String, Object>();
params.put("scid",scid);
Response personalProfileResponse = network.getResponse(params,"/kjy/mp/sellerCardV5/personalProfile");
String profile = personalProfileResponse.jsonPath().getString("data.personalIntro");
Assert.assertEquals(profile,"我在行业内深耕多年,经验丰富,具备过硬的专业素质,深受客户喜爱和支持。","个人介绍:获取介绍失败");
}
}
package com.kjj.qa.config;
import com.aventstack.extentreports.ExtentReports;
import com.aventstack.extentreports.ExtentTest;
import com.aventstack.extentreports.ResourceCDN;
import com.aventstack.extentreports.Status;
import com.aventstack.extentreports.model.TestAttribute;
import com.aventstack.extentreports.reporter.ExtentHtmlReporter;
import com.aventstack.extentreports.reporter.configuration.ChartLocation;
import org.testng.*;
import org.testng.xml.XmlSuite;
import java.io.File;
import java.util.*;
import com.kjj.qa.utils.DingTalkUtil;
public class ExtentTestNGIReporterListener implements IReporter {
// 生成的路径以及文件名
private static final String OUTPUT_FOLDER = "test-output/";
//注意这里如果用index.html可能会导致testng的report会覆盖它
private static final String FILE_NAME = "report.html";
private ExtentReports extent;
@Override
public void generateReport(List<XmlSuite> xmlSuites, List<ISuite> suites, String outputDirectory) {
init();
boolean createSuiteNode = false;
//判断执行用例的队列是否有多个
if (suites.size() > 0) {
createSuiteNode = true;
}
for (ISuite suite : suites) {
Map<String, ISuiteResult> result = suite.getResults();
// 如果suite里面没有任何用例,直接跳过,不在报告里生成
if (result.size() == 0) {
continue;
}
// 统计suite下的成功、失败、跳过的总用例数
int suiteFailSize = 0;
int suitePassSize = 0;
int suiteSkipSize = 0;
ExtentTest suiteTest = null;
// 存在多个suite的情况下,在报告中将同一个suite的测试结果归为一类,创建一级节点。
if (createSuiteNode) {
suiteTest = extent.createTest(suite.getName()).assignCategory(suite.getName());
}
boolean createSuiteResultNode = false;
if (result.size() > 1) {
createSuiteResultNode = true;
}
for (ISuiteResult r : result.values()) {
ExtentTest resultNode;
ITestContext context = r.getTestContext();
if (createSuiteResultNode) {
// 没有创建suite的情况下,将在SuiteResult的创建为一级节点,否则创建为suite的一个子节点。
if (null == suiteTest) {
resultNode = extent.createTest(r.getTestContext().getName());
} else {
resultNode = suiteTest.createNode(r.getTestContext().getName());
}
} else {
resultNode = suiteTest;
}
if (resultNode != null) {
resultNode.getModel().setName(suite.getName() + " : " + r.getTestContext().getName());
if (resultNode.getModel().hasCategory()) {
resultNode.assignCategory(r.getTestContext().getName());
} else {
resultNode.assignCategory(suite.getName(), r.getTestContext().getName());
}
resultNode.getModel().setStartTime(r.getTestContext().getStartDate());
resultNode.getModel().setEndTime(r.getTestContext().getEndDate());
// 统计SuiteResult下的数据
int passSize = r.getTestContext().getPassedTests().size();
int failSize = r.getTestContext().getFailedTests().size();
int skipSize = r.getTestContext().getSkippedTests().size();
suitePassSize += passSize;
suiteFailSize += failSize;
suiteSkipSize += skipSize;
if (failSize > 0) {
resultNode.getModel().setStatus(Status.FAIL);
}
resultNode.getModel().setDescription(
String.format("Pass: %s ; Fail: %s ; Skip: %s ;", passSize, failSize, skipSize));
}
buildTestNodes(resultNode, context.getFailedTests(), Status.FAIL);
buildTestNodes(resultNode, context.getSkippedTests(), Status.SKIP);
buildTestNodes(resultNode, context.getPassedTests(), Status.PASS);
}
if (suiteTest != null) {
suiteTest.getModel().setDescription(
String.format("Pass: %s ; Fail: %s ; Skip: %s ;", suitePassSize, suiteFailSize, suiteSkipSize));
if (suiteFailSize > 0) {
suiteTest.getModel().setStatus(Status.FAIL);
}
}
String context = String.format("通过: %s ; 失败: %s ; 跳过: %s ;", suitePassSize, suiteFailSize, suiteSkipSize);
try {
DingTalkUtil.sendVal(context);
} catch (Exception e) {
e.printStackTrace();
}
}
// for (String s : Reporter.getOutput()) {
// extent.setTestRunnerOutput(s);
// }
extent.flush();
}
private void init() {
// 文件夹不存在的话进行创建
File reportDir = new File(OUTPUT_FOLDER);
if (!reportDir.exists() && !reportDir.isDirectory()) {
reportDir.mkdir();
}
ExtentHtmlReporter htmlReporter = new ExtentHtmlReporter(OUTPUT_FOLDER + FILE_NAME);
// 设置静态文件的DNS
//怎么样解决cdn.rawgit.com访问不了的情况
htmlReporter.config().setResourceCDN(ResourceCDN.EXTENTREPORTS);
htmlReporter.config().setDocumentTitle("客集集-自动化测试报告");
htmlReporter.config().setReportName("客集集-自动化测试报告");
htmlReporter.config().setChartVisibilityOnOpen(true);
//报表位置
htmlReporter.config().setTestViewChartLocation(ChartLocation.TOP);
// htmlReporter.config().setTheme(Theme.STANDARD);
htmlReporter.config().setCSS(".node.level-1 ul{ display:none;} .node.level-1.active ul{display:block;}");
extent = new ExtentReports();
extent.attachReporter(htmlReporter);
extent.setReportUsesManualConfiguration(true);
}
private void buildTestNodes(ExtentTest extenttest, IResultMap tests, Status status) {
// 存在父节点时,获取父节点的标签
String[] categories = new String[0];
if (extenttest != null) {
List<TestAttribute> categoryList = extenttest.getModel().getCategoryContext().getAll();
categories = new String[categoryList.size()];
for (int index = 0; index < categoryList.size(); index++) {
categories[index] = categoryList.get(index).getName();
}
}
ExtentTest test;
if (tests.size() > 0) {
// 调整用例排序,按时间排序
Set<ITestResult> treeSet = new TreeSet<ITestResult>(new Comparator<ITestResult>() {
@Override
public int compare(ITestResult o1, ITestResult o2) {
return o1.getStartMillis() < o2.getStartMillis() ? -1 : 1;
}
});
treeSet.addAll(tests.getAllResults());
for (ITestResult result : treeSet) {
Object[] parameters = result.getParameters();
String name = "";
// 如果有参数,则使用参数的toString组合代替报告中的name
for (Object param : parameters) {
name += param.toString();
}
if (name.length() > 0) {
if (name.length() > 50) {
name = name.substring(0, 49) + "...";
}
} else {
name = result.getMethod().getMethodName();
}
if (extenttest == null) {
test = extent.createTest(name);
} else {
// 作为子节点进行创建时,设置同父节点的标签一致,便于报告检索。
test = extenttest.createNode(name).assignCategory(categories);
}
// test.getModel().setDescription(description.toString());
// test = extent.createTest(result.getMethod().getMethodName());
for (String group : result.getMethod().getGroups())
test.assignCategory(group);
List<String> outputList = Reporter.getOutput(result);
for (String output : outputList) {
// 将用例的log输出报告中
test.debug(output);
}
if (result.getThrowable() != null) {
test.log(status, result.getThrowable());
} else {
test.log(status, "Test " + status.toString().toLowerCase() + "ed");
}
test.getModel().setStartTime(getTime(result.getStartMillis()));
test.getModel().setEndTime(getTime(result.getEndMillis()));
}
}
}
private Date getTime(long millis) {
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(millis);
return calendar.getTime();
}
}
package com.kjj.qa.services;
import static io.restassured.RestAssured.*;
import static io.restassured.matcher.RestAssuredMatchers.*;
import static org.hamcrest.Matchers.*;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSONPath;
import com.mysql.cj.x.protobuf.MysqlxDatatypes;
import io.restassured.http.Cookies;
import io.restassured.path.json.JsonPath;
import io.restassured.response.Response;
import javax.print.DocFlavor;
import java.util.HashMap;
import java.util.Map;
public class NetworkOperation {
// 代理人的 cookies和headers
public Map<String, Object> agentCookies = new HashMap<String, Object>();
public Map<String, Object> getAgentCookies() { return agentCookies; }
public void setAgentCookies(Map<String, Object> agentCookies) { this.agentCookies = agentCookies; }
public Map<String, Object> agentHeaders = new HashMap<String, Object>();
public Map<String, Object> getAgentHeaders() { return agentHeaders; }
public void setAgentHeaders(Map<String, Object> agentHeaders) { this.agentHeaders = agentHeaders; }
// 访客的 cookies和headers
public Map<String, Object> vistorCookies = new HashMap<String, Object>();
public Map<String, Object> getVistorCookies() { return vistorCookies; }
public void setVistorCookies(Map<String, Object> vistorCookies) { this.vistorCookies = vistorCookies; }
public Map<String, Object> vistorHeaders = new HashMap<String, Object>();
public Map<String, Object> getVistorHeaders() { return vistorHeaders; }
public void setVistorHeaders(Map<String, Object> vistorHeaders) { this.vistorHeaders = vistorHeaders; }
// 钉钉的 headers
public Map<String, Object> dingTalkHeaders = new HashMap<String, Object>();
public Map<String, Object> getDingTalkHeaders() { return dingTalkHeaders; }
public void setDingTalkHeaders(Map<String, Object> dingTalkHeaders) { this.dingTalkHeaders = dingTalkHeaders; }
//客集集域名
// private static String host = "https://kjj.m.duiba.com.cn";
private static String host = "https://kjj.m.duibatest.com.cn";
//钉钉机器人域名
private static String dingtalkPath = "https://oapi.dingtalk.com/robot/send?access_token=f63c9cb36e89dd68e9af82d926933b3afc6544e57b23a3a55ed5b3b772d5e8d2";
// get 不带参请求
public Response getResponse(String path) {
return given()
.cookies(agentCookies)
.headers(agentHeaders)
.get(host+path);
}
// get 带参请求
public Response getResponse(Map<String, Object> params, String path) {
return given()
.cookies(agentCookies)
.headers(agentHeaders)
.params(params)
.get(host+path);
}
// post 不帶参请求
public Response PostResponse(String path) {
return given()
.cookies(agentCookies)
.headers(agentHeaders)
.post(host+path);
}
// post 带参请求
public Response PostResponse(String jsonStr, String path) {
return given()
.cookies(agentCookies)
.headers(agentHeaders)
.body(jsonStr)
.post(host+path);
}
// post 带参请求
public Response dingTalkRobot(String jsonStr) {
dingTalkHeaders.put("Content-Type","application/json;charset=utf-8");
return given()
.headers(dingTalkHeaders)
.body(jsonStr)
.post(dingtalkPath);
}
//用户行为
public Response visitorBehavior(Map<String, Object> params, String path){
return given()
.cookies(vistorCookies)
.headers(vistorHeaders)
.params(params)
.get(host+path);
}
public static void main(String[] args) {
// NetworkOperation network = new NetworkOperation();
//
// Map<String,Object> json=new HashMap();
// Map<String,Object> text=new HashMap();
// json.put("msgtype","text");
//
// text.put("content","报告 :");
// json.put("text",text);
// Response res = network.dingTalkRobot(json);
}
}
package com.kjj.qa.utils;
import com.kjj.qa.services.NetworkOperation;
import java.util.HashMap;
public class DingTalkUtil {
//通过钉钉机器人发送消息到钉钉群中
public static void sendVal(String context)throws Exception{
String entityString ="{'msgtype': 'text', 'text': {'content': '测试结果:\n"+context+"'}}";
System.out.println(entityString);
// NetworkOperation network = new NetworkOperation();
// network.dingTalkRobot(entityString); //发起请求
}
public static void main(String[] args) {
//获取当前系统时间
// long currentTime = System.currentTimeMillis();
// SimpleDateFormat formatter = new SimpleDateFormat("yyyy年-MM月dd日-HH时mm分ss秒");
// Date date = new Date(currentTime);
// System.out.println(formatter.format(date));
// Reporter.log(formatter.format(date) + splitTimeAndMsg + msg, true);
}
}
package com.kjj.qa.utils;
public final class KjyUtil {
}
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<meta name='description' content='' />
<meta name='robots' content='noodp, noydir' />
<meta name='viewport' content='width=device-width, initial-scale=1' />
<meta id="timeStampFormat" name="timeStampFormat" content='MMM d, yyyy hh:mm:ss a'/>
<link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600' rel='stylesheet' type='text/css'>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href='http://extentreports.com/resx/dist/css/extent.css' type='text/css' rel='stylesheet' />
<title>客集集-自动化测试报告</title>
<style type='text/css'>
.node.level-1 ul{ display:none;} .node.level-1.active ul{display:block;}
</style>
</head>
<body class='extent standard default hide-overflow '>
<div id='theme-selector' alt='Click to toggle theme. To enable by default, use theme configuration.' title='Click to toggle theme. To enable by default, use theme configuration.'>
<span><i class='material-icons'>desktop_windows</i></span>
</div>
<nav>
<div class="nav-wrapper">
<a href="#!" class="brand-logo blue darken-3">Extent</a>
<!-- slideout menu -->
<ul id='slide-out' class='side-nav fixed hide-on-med-and-down'>
<li class='waves-effect active'><a href='#!' view='test-view' onclick="configureView(0);chartsView('test');"><i class='material-icons'>dashboard</i></a></li>
<li class='waves-effect'><a href='#!' view='category-view' onclick="configureView(1)"><i class='material-icons'>label_outline</i></a></li>
<li class='waves-effect'><a href='#!' view='exception-view' onclick="configureView(2)"><i class='material-icons'>bug_report</i></a></li>
<li class='waves-effect'><a href='#!' onclick="configureView(-1);chartsView('dashboard');" view='dashboard-view'><i class='material-icons'>track_changes</i></i></a></li>
</ul>
<!-- report name -->
<span class='report-name'>客集集-自动化测试报告</span>
<!-- report headline -->
<span class='report-headline'></span>
<!-- nav-right -->
<ul id='nav-mobile' class='right hide-on-med-and-down nav-right'>
<li>
<a href='#!'>
<span class='label suite-start-time blue darken-3'>Apr 3, 2020 04:50:14 PM</span>
</a>
</li>
<li>
<a href='#!'>
<span class='label blue darken-3'>v3.0.6</span>
</a>
</li>
</ul>
</div>
</nav>
<!-- container -->
<div class='container'>
<div id='test-view' class='view'>
<section id='controls'>
<div class='controls grey lighten-4'>
<!-- test toggle -->
<div class='chip transparent'>
<a class='dropdown-button tests-toggle' data-activates='tests-toggle' data-constrainwidth='true' data-beloworigin='true' data-hover='true' href='#'>
<i class='material-icons'>warning</i> Status
</a>
<ul id='tests-toggle' class='dropdown-content'>
<li status='pass'><a href='#!'>Pass <i class='material-icons green-text'>check_circle</i></a></li>
<li status='fail'><a href='#!'>Fail <i class='material-icons red-text'>cancel</i></a></li>
<li class='divider'></li>
<li status='clear' clear='true'><a href='#!'>Clear Filters <i class='material-icons'>clear</i></a></li>
</ul>
</div>
<!-- test toggle -->
<!-- category toggle -->
<div class='chip transparent'>
<a class='dropdown-button category-toggle' data-activates='category-toggle' data-constrainwidth='false' data-beloworigin='true' data-hover='true' href='#'>
<i class='material-icons'>local_offer</i> Category
</a>
<ul id='category-toggle' class='dropdown-content'>
<li><a href='#'>客集集-测试结果</a></li>
<li><a href='#'>支付</a></li>
<li class='divider'></li>
<li class='clear'><a href='#!' clear='true'>Clear Filters</a></li>
</ul>
</div>
<!-- category toggle -->
<!-- clear filters -->
<div class='chip transparent hide'>
<a class='' id='clear-filters' alt='Clear Filters' title='Clear Filters'>
<i class='material-icons'>close</i> Clear
</a>
</div>
<!-- clear filters -->
<!-- enable dashboard -->
<div id='toggle-test-view-charts' class='chip transparent'>
<a class='pink-text' id='enable-dashboard' alt='Enable Dashboard' title='Enable Dashboard'>
<i class='material-icons'>track_changes</i> Dashboard
</a>
</div>
<!-- enable dashboard -->
<!-- search -->
<div class='chip transparent' alt='Search Tests' title='Search Tests'>
<a href="#" class='search-div'>
<i class='material-icons'>search</i> Search
</a>
<div class='input-field left hide'>
<input id='search-tests' type='text' class='validate browser-default' placeholder='Search Tests...'>
</div>
</div>
<!-- search -->
</div>
</section>
<div id='test-view-charts' class='subview-full'>
<div id='charts-row' class='row nm-v nm-h'>
<div class='col s12 m6 l6 np-h'>
<div class='card-panel nm-v'>
<div class='left panel-name'>Tests</div>
<div class='chart-box'>
<canvas id='parent-analysis' width='100' height='80'></canvas>
</div>
<div class='block text-small'>
<span class='tooltipped' data-position='top' data-tooltip='50%'><span class='strong'>4</span> test(s) passed</span>
</div>
<div class='block text-small'>
<span class='strong tooltipped' data-position='top' data-tooltip='50%'>4</span> test(s) failed, <span class='strong tooltipped' data-position='top' data-tooltip='0%'>0</span> others
</div>
</div>
</div>
<div class='col s12 m6 l6 np-h'>
<div class='card-panel nm-v'>
<div class='left panel-name'>Steps</div>
<div class='chart-box'>
<canvas id='child-analysis' width='100' height='80'></canvas>
</div>
<div class='block text-small'>
<span class='tooltipped' data-position='top' data-tooltip='50%'><span class='strong'>4</span> step(s) passed</span>
</div>
<div class='block text-small'>
<span class='strong tooltipped' data-position='top' data-tooltip='50%'>4</span> step(s) failed, <span class='strong tooltipped' data-position='top' data-tooltip='0%'>0</span> others
</div>
</div>
</div>
</div>
</div>
<div class='subview-left left'>
<div class='view-summary'>
<h5>Tests</h5>
<ul id='test-collection' class='test-collection'>
<li class='test displayed active has-leaf fail' status='fail' bdd='false' test-id='1'>
<div class='test-heading'>
<span class='test-name'>客集集-测试结果 : 支付</span>
<span class='test-time'>Apr 3, 2020 04:50:14 PM</span>
<span class='test-status right fail'>fail</span>
</div>
<div class='test-content hide'>
<div class='test-time-info'>
<span class='label start-time'>Apr 3, 2020 04:50:14 PM</span>
<span class='label end-time'>Apr 3, 2020 04:50:21 PM</span>
<span class='label time-taken grey lighten-1 white-text'>0h 0m 6s+776ms</span>
</div>
<div class='test-desc'>Pass: 4 ; Fail: 4 ; Skip: 0 ; </div>
<div class='test-attributes'>
<div class='category-list'>
<span class='category label white-text'>客集集-测试结果</span>
<span class='category label white-text'>支付</span>
</div>
</div>
<ul class='collapsible node-list' data-collapsible='accordion'>
<li class='node level-1 leaf fail' status='fail' test-id='2'>
<div class='collapsible-header'>
<div class='node-name'>默认付费_付费页</div>
<span class='node-time'>Apr 3, 2020 04:50:14 PM</span>
<span class='node-duration'>0h 0m 6s+815ms</span>
<span class='test-status right fail'>fail</span>
</div>
<div class='collapsible-body'>
<div class='category-list right'>
<span class='category label white-text'>客集集-测试结果</span>
<span class='category label white-text'>支付</span>
</div>
<div class='node-steps'>
<table class='bordered table-results'>
<thead>
<tr>
<th>Status</th>
<th>Timestamp</th>
<th>Details</th>
</tr>
</thead>
<tbody>
<tr class='log' status='fail'>
<td class='status fail' title='fail' alt='fail'><i class='material-icons'>cancel</i></td>
<td class='timestamp'>4:50:21 PM</td>
<td class='step-details'><pre>java.lang.AssertionError: 会员类型版本判断:判断错误,此版本为保险版 expected [1] but found [2]
at org.testng.Assert.fail(Assert.java:94)
at org.testng.Assert.failNotEquals(Assert.java:494)
at org.testng.Assert.assertEquals(Assert.java:123)
at org.testng.Assert.assertEquals(Assert.java:370)
at com.kjj.qa.cases.Pay.默认付费_付费页(Pay.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:348)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:343)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:305)
at org.testng.SuiteRunner.run(SuiteRunner.java:254)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
at org.testng.TestNG.run(TestNG.java:1057)
at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:73)
at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:123)
</pre></td>
</tr>
</tbody>
</table>
</div>
</div>
</li>
<li class='node level-1 leaf fail' status='fail' test-id='3'>
<div class='collapsible-header'>
<div class='node-name'>默认付费_切换为保险版会员类型并成功付款</div>
<span class='node-time'>Apr 3, 2020 04:50:18 PM</span>
<span class='node-duration'>0h 0m 2s+590ms</span>
<span class='test-status right fail'>fail</span>
</div>
<div class='collapsible-body'>
<div class='category-list right'>
<span class='category label white-text'>客集集-测试结果</span>
<span class='category label white-text'>支付</span>
</div>
<div class='node-steps'>
<table class='bordered table-results'>
<thead>
<tr>
<th>Status</th>
<th>Timestamp</th>
<th>Details</th>
</tr>
</thead>
<tbody>
<tr class='log' status='fail'>
<td class='status fail' title='fail' alt='fail'><i class='material-icons'>cancel</i></td>
<td class='timestamp'>4:50:21 PM</td>
<td class='step-details'><pre>java.lang.AssertionError: 会员类型切换:切换失败 expected [OK] but found [用户切换失败,请稍后再试]
at org.testng.Assert.fail(Assert.java:94)
at org.testng.Assert.failNotEquals(Assert.java:494)
at org.testng.Assert.assertEquals(Assert.java:123)
at org.testng.Assert.assertEquals(Assert.java:176)
at com.kjj.qa.cases.Pay.默认付费_切换为保险版会员类型并成功付款(Pay.java:120)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:348)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:343)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:305)
at org.testng.SuiteRunner.run(SuiteRunner.java:254)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
at org.testng.TestNG.run(TestNG.java:1057)
at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:73)
at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:123)
</pre></td>
</tr>
</tbody>
</table>
</div>
</div>
</li>
<li class='node level-1 leaf fail' status='fail' test-id='4'>
<div class='collapsible-header'>
<div class='node-name'>分销码_付费页</div>
<span class='node-time'>Apr 3, 2020 04:50:19 PM</span>
<span class='node-duration'>0h 0m 2s+273ms</span>
<span class='test-status right fail'>fail</span>
</div>
<div class='collapsible-body'>
<div class='category-list right'>
<span class='category label white-text'>客集集-测试结果</span>
<span class='category label white-text'>支付</span>
</div>
<div class='node-steps'>
<table class='bordered table-results'>
<thead>
<tr>
<th>Status</th>
<th>Timestamp</th>
<th>Details</th>
</tr>
</thead>
<tbody>
<tr class='log' status='fail'>
<td class='status fail' title='fail' alt='fail'><i class='material-icons'>cancel</i></td>
<td class='timestamp'>4:50:21 PM</td>
<td class='step-details'><pre>java.lang.AssertionError: 获取付费价格:价格不是486 expected [486] but found [586]
at org.testng.Assert.fail(Assert.java:94)
at org.testng.Assert.failNotEquals(Assert.java:494)
at org.testng.Assert.assertEquals(Assert.java:123)
at org.testng.Assert.assertEquals(Assert.java:176)
at com.kjj.qa.cases.Pay.分销码_付费页(Pay.java:157)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:348)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:343)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:305)
at org.testng.SuiteRunner.run(SuiteRunner.java:254)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
at org.testng.TestNG.run(TestNG.java:1057)
at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:73)
at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:123)
</pre></td>
</tr>
</tbody>
</table>
</div>
</div>
</li>
<li class='node level-1 leaf fail' status='fail' test-id='5'>
<div class='collapsible-header'>
<div class='node-name'>分销码_切换为保险版会员类型并成功付款</div>
<span class='node-time'>Apr 3, 2020 04:50:21 PM</span>
<span class='node-duration'>0h 0m 0s+371ms</span>
<span class='test-status right fail'>fail</span>
</div>
<div class='collapsible-body'>
<div class='category-list right'>
<span class='category label white-text'>客集集-测试结果</span>
<span class='category label white-text'>支付</span>
</div>
<div class='node-steps'>
<table class='bordered table-results'>
<thead>
<tr>
<th>Status</th>
<th>Timestamp</th>
<th>Details</th>
</tr>
</thead>
<tbody>
<tr class='log' status='fail'>
<td class='status fail' title='fail' alt='fail'><i class='material-icons'>cancel</i></td>
<td class='timestamp'>4:50:21 PM</td>
<td class='step-details'><pre>java.lang.AssertionError: 会员类型切换:切换失败 expected [OK] but found [用户切换失败,请稍后再试]
at org.testng.Assert.fail(Assert.java:94)
at org.testng.Assert.failNotEquals(Assert.java:494)
at org.testng.Assert.assertEquals(Assert.java:123)
at org.testng.Assert.assertEquals(Assert.java:176)
at com.kjj.qa.cases.Pay.分销码_切换为保险版会员类型并成功付款(Pay.java:231)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:348)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:343)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:305)
at org.testng.SuiteRunner.run(SuiteRunner.java:254)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
at org.testng.TestNG.run(TestNG.java:1057)
at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:73)
at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:123)
</pre></td>
</tr>
</tbody>
</table>
</div>
</div>
</li>
<li class='node level-1 leaf pass' status='pass' test-id='6'>
<div class='collapsible-header'>
<div class='node-name'>默认付费_待支付</div>
<span class='node-time'>Apr 3, 2020 04:50:17 PM</span>
<span class='node-duration'>0h 0m 4s+199ms</span>
<span class='test-status right pass'>pass</span>
</div>
<div class='collapsible-body'>
<div class='category-list right'>
<span class='category label white-text'>客集集-测试结果</span>
<span class='category label white-text'>支付</span>
</div>
<div class='node-steps'>
<table class='bordered table-results'>
<thead>
<tr>
<th>Status</th>
<th>Timestamp</th>
<th>Details</th>
</tr>
</thead>
<tbody>
<tr class='log' status='pass'>
<td class='status pass' title='pass' alt='pass'><i class='material-icons'>check_circle</i></td>
<td class='timestamp'>4:50:21 PM</td>
<td class='step-details'>Test passed</td>
</tr>
</tbody>
</table>
</div>
</div>
</li>
<li class='node level-1 leaf pass' status='pass' test-id='7'>
<div class='collapsible-header'>
<div class='node-name'>默认付费_取消支付</div>
<span class='node-time'>Apr 3, 2020 04:50:18 PM</span>
<span class='node-duration'>0h 0m 3s+197ms</span>
<span class='test-status right pass'>pass</span>
</div>
<div class='collapsible-body'>
<div class='category-list right'>
<span class='category label white-text'>客集集-测试结果</span>
<span class='category label white-text'>支付</span>
</div>
<div class='node-steps'>
<table class='bordered table-results'>
<thead>
<tr>
<th>Status</th>
<th>Timestamp</th>
<th>Details</th>
</tr>
</thead>
<tbody>
<tr class='log' status='pass'>
<td class='status pass' title='pass' alt='pass'><i class='material-icons'>check_circle</i></td>
<td class='timestamp'>4:50:21 PM</td>
<td class='step-details'>Test passed</td>
</tr>
</tbody>
</table>
</div>
</div>
</li>
<li class='node level-1 leaf pass' status='pass' test-id='8'>
<div class='collapsible-header'>
<div class='node-name'>分销码_待支付</div>
<span class='node-time'>Apr 3, 2020 04:50:19 PM</span>
<span class='node-duration'>0h 0m 1s+658ms</span>
<span class='test-status right pass'>pass</span>
</div>
<div class='collapsible-body'>
<div class='category-list right'>
<span class='category label white-text'>客集集-测试结果</span>
<span class='category label white-text'>支付</span>
</div>
<div class='node-steps'>
<table class='bordered table-results'>
<thead>
<tr>
<th>Status</th>
<th>Timestamp</th>
<th>Details</th>
</tr>
</thead>
<tbody>
<tr class='log' status='pass'>
<td class='status pass' title='pass' alt='pass'><i class='material-icons'>check_circle</i></td>
<td class='timestamp'>4:50:21 PM</td>
<td class='step-details'>Test passed</td>
</tr>
</tbody>
</table>
</div>
</div>
</li>
<li class='node level-1 leaf pass' status='pass' test-id='9'>
<div class='collapsible-header'>
<div class='node-name'>分销码_取消支付</div>
<span class='node-time'>Apr 3, 2020 04:50:20 PM</span>
<span class='node-duration'>0h 0m 1s+136ms</span>
<span class='test-status right pass'>pass</span>
</div>
<div class='collapsible-body'>
<div class='category-list right'>
<span class='category label white-text'>客集集-测试结果</span>
<span class='category label white-text'>支付</span>
</div>
<div class='node-steps'>
<table class='bordered table-results'>
<thead>
<tr>
<th>Status</th>
<th>Timestamp</th>
<th>Details</th>
</tr>
</thead>
<tbody>
<tr class='log' status='pass'>
<td class='status pass' title='pass' alt='pass'><i class='material-icons'>check_circle</i></td>
<td class='timestamp'>4:50:21 PM</td>
<td class='step-details'>Test passed</td>
</tr>
</tbody>
</table>
</div>
</div>
</li>
</ul>
</div>
</li>
</ul>
</div>
</div>
<!-- subview left -->
<div class='subview-right left'>
<div class='view-summary'>
<h5 class='test-name'></h5>
<div id='step-filters' class="right">
<span class="blue-text" status="info" alt="info" title="info"><i class="material-icons">info_outline</i></span>
<span class="green-text" status="pass" alt="pass" title="pass"><i class="material-icons">check_circle</i></span>
<span class="red-text" status="fail" alt="fail" title="fail"><i class="material-icons">cancel</i></span>
<span class="red-text text-darken-4" status="fatal" alt="fatal" title="fatal"><i class="material-icons">cancel</i></span>
<span class="pink-text text-lighten-1" status="error" alt="error" title="error"><i class="material-icons">error</i></span>
<span class="orange-text" alt="warning" status="warning" title="warning"><i class="material-icons">warning</i></span>
<span class="teal-text" status="skip" alt="skip" title="skip"><i class="material-icons">redo</i></span>
<span status="clear" alt="Clear filters" title="Clear filters"><i class="material-icons">clear</i></span>
</div>
</div>
</div>
<!-- subview right -->
</div>
<!-- test view -->
<div id='category-view' class='view hide'>
<section id='controls'>
<div class='controls grey lighten-4'>
<!-- search -->
<div class='chip transparent' alt='Search Tests' title='Search Tests'>
<a href="#" class='search-div'>
<i class='material-icons'>search</i> Search
</a>
<div class='input-field left hide'>
<input id='search-tests' type='text' class='validate browser-default' placeholder='Search Tests...'>
</div>
</div>
<!-- search -->
</div>
</section>
<div class='subview-left left'>
<div class='view-summary'>
<h5>Categories</h3>
<ul id='category-collection' class='category-collection'>
<li class='category displayed active'>
<div class='category-heading'>
<span class='category-name'>客集集-测试结果</span>
<span class='category-status right'>
<span class='label pass'>4</span>
<span class='label fail'>5</span>
</span>
</div>
<div class='category-content hide'>
<div class='category-status-counts'>
<span class='label green accent-4 white-text'>Passed: 4</span>
<span class='label red lighten-1 white-text'>Failed: 5</span>
</div>
<div class='category-tests'>
<table class='bordered table-results'>
<thead>
<tr>
<th>Timestamp</th>
<th>TestName</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<tr>
<td>Apr 3, 2020 04:50:14 PM</td>
<td class='linked' test-id='1'>客集集-测试结果</td>
<td><span class='test-status fail'>fail</span></td>
</tr>
<tr>
<td>Apr 3, 2020 04:50:14 PM</td>
<td class='linked' test-id='2'>客集集-测试结果.默认付费_付费页</td>
<td><span class='test-status fail'>fail</span></td>
</tr>
<tr>
<td>Apr 3, 2020 04:50:18 PM</td>
<td class='linked' test-id='3'>客集集-测试结果.默认付费_切换为保险版会员类型并成功付款</td>
<td><span class='test-status fail'>fail</span></td>
</tr>
<tr>
<td>Apr 3, 2020 04:50:19 PM</td>
<td class='linked' test-id='4'>客集集-测试结果.分销码_付费页</td>
<td><span class='test-status fail'>fail</span></td>
</tr>
<tr>
<td>Apr 3, 2020 04:50:21 PM</td>
<td class='linked' test-id='5'>客集集-测试结果.分销码_切换为保险版会员类型并成功付款</td>
<td><span class='test-status fail'>fail</span></td>
</tr>
<tr>
<td>Apr 3, 2020 04:50:17 PM</td>
<td class='linked' test-id='6'>客集集-测试结果.默认付费_待支付</td>
<td><span class='test-status pass'>pass</span></td>
</tr>
<tr>
<td>Apr 3, 2020 04:50:18 PM</td>
<td class='linked' test-id='7'>客集集-测试结果.默认付费_取消支付</td>
<td><span class='test-status pass'>pass</span></td>
</tr>
<tr>
<td>Apr 3, 2020 04:50:19 PM</td>
<td class='linked' test-id='8'>客集集-测试结果.分销码_待支付</td>
<td><span class='test-status pass'>pass</span></td>
</tr>
<tr>
<td>Apr 3, 2020 04:50:20 PM</td>
<td class='linked' test-id='9'>客集集-测试结果.分销码_取消支付</td>
<td><span class='test-status pass'>pass</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</li>
<li class='category displayed active'>
<div class='category-heading'>
<span class='category-name'>支付</span>
<span class='category-status right'>
<span class='label pass'>4</span>
<span class='label fail'>5</span>
</span>
</div>
<div class='category-content hide'>
<div class='category-status-counts'>
<span class='label green accent-4 white-text'>Passed: 4</span>
<span class='label red lighten-1 white-text'>Failed: 5</span>
</div>
<div class='category-tests'>
<table class='bordered table-results'>
<thead>
<tr>
<th>Timestamp</th>
<th>TestName</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<tr>
<td>Apr 3, 2020 04:50:14 PM</td>
<td class='linked' test-id='1'>客集集-测试结果</td>
<td><span class='test-status fail'>fail</span></td>
</tr>
<tr>
<td>Apr 3, 2020 04:50:14 PM</td>
<td class='linked' test-id='2'>客集集-测试结果.默认付费_付费页</td>
<td><span class='test-status fail'>fail</span></td>
</tr>
<tr>
<td>Apr 3, 2020 04:50:18 PM</td>
<td class='linked' test-id='3'>客集集-测试结果.默认付费_切换为保险版会员类型并成功付款</td>
<td><span class='test-status fail'>fail</span></td>
</tr>
<tr>
<td>Apr 3, 2020 04:50:19 PM</td>
<td class='linked' test-id='4'>客集集-测试结果.分销码_付费页</td>
<td><span class='test-status fail'>fail</span></td>
</tr>
<tr>
<td>Apr 3, 2020 04:50:21 PM</td>
<td class='linked' test-id='5'>客集集-测试结果.分销码_切换为保险版会员类型并成功付款</td>
<td><span class='test-status fail'>fail</span></td>
</tr>
<tr>
<td>Apr 3, 2020 04:50:17 PM</td>
<td class='linked' test-id='6'>客集集-测试结果.默认付费_待支付</td>
<td><span class='test-status pass'>pass</span></td>
</tr>
<tr>
<td>Apr 3, 2020 04:50:18 PM</td>
<td class='linked' test-id='7'>客集集-测试结果.默认付费_取消支付</td>
<td><span class='test-status pass'>pass</span></td>
</tr>
<tr>
<td>Apr 3, 2020 04:50:19 PM</td>
<td class='linked' test-id='8'>客集集-测试结果.分销码_待支付</td>
<td><span class='test-status pass'>pass</span></td>
</tr>
<tr>
<td>Apr 3, 2020 04:50:20 PM</td>
<td class='linked' test-id='9'>客集集-测试结果.分销码_取消支付</td>
<td><span class='test-status pass'>pass</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</li>
</ul>
</div>
</div>
<div class='subview-right left'>
<div class='view-summary'>
<h5 class='category-name'></h5>
</div>
</div>
</div>
<!-- category view -->
<div id='exception-view' class='view hide'>
<section id='controls'>
<div class='controls grey lighten-4'>
<!-- search -->
<div class='chip transparent' alt='Search Tests' title='Search Tests'>
<a href="#" class='search-div'>
<i class='material-icons'>search</i> Search
</a>
<div class='input-field left hide'>
<input id='search-tests' type='text' class='validate browser-default' placeholder='Search Tests...'>
</div>
</div>
<!-- search -->
</div>
</section>
<div class='subview-left left'>
<div class='view-summary'>
<h5>Exceptions</h3>
<ul id='exception-collection' class='exception-collection'>
<li class='exception displayed active'>
<div class='exception-heading'>
<span class='exception-name'>java.lang.AssertionError</span>
<span class='exception-count right'><span class='label red lighten-1 white-text'>4</span></span>
</div>
<div class='exception-content hide'>
<div class='exception-tests'>
<table class='bordered table-results'>
<thead>
<tr>
<th>Timestamp</th>
<th>TestName</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<tr>
<td>Apr 3, 2020 04:50:14 PM</td>
<td class='linked' test-id='2'>客集集-测试结果.默认付费_付费页</td>
<td><pre><pre>java.lang.AssertionError: 会员类型版本判断:判断错误,此版本为保险版 expected [1] but found [2]
at org.testng.Assert.fail(Assert.java:94)
at org.testng.Assert.failNotEquals(Assert.java:494)
at org.testng.Assert.assertEquals(Assert.java:123)
at org.testng.Assert.assertEquals(Assert.java:370)
at com.kjj.qa.cases.Pay.默认付费_付费页(Pay.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:348)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:343)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:305)
at org.testng.SuiteRunner.run(SuiteRunner.java:254)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
at org.testng.TestNG.run(TestNG.java:1057)
at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:73)
at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:123)
</pre></pre></td>
</tr>
<tr>
<td>Apr 3, 2020 04:50:18 PM</td>
<td class='linked' test-id='3'>客集集-测试结果.默认付费_切换为保险版会员类型并成功付款</td>
<td><pre><pre>java.lang.AssertionError: 会员类型切换:切换失败 expected [OK] but found [用户切换失败,请稍后再试]
at org.testng.Assert.fail(Assert.java:94)
at org.testng.Assert.failNotEquals(Assert.java:494)
at org.testng.Assert.assertEquals(Assert.java:123)
at org.testng.Assert.assertEquals(Assert.java:176)
at com.kjj.qa.cases.Pay.默认付费_切换为保险版会员类型并成功付款(Pay.java:120)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:348)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:343)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:305)
at org.testng.SuiteRunner.run(SuiteRunner.java:254)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
at org.testng.TestNG.run(TestNG.java:1057)
at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:73)
at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:123)
</pre></pre></td>
</tr>
<tr>
<td>Apr 3, 2020 04:50:19 PM</td>
<td class='linked' test-id='4'>客集集-测试结果.分销码_付费页</td>
<td><pre><pre>java.lang.AssertionError: 获取付费价格:价格不是486 expected [486] but found [586]
at org.testng.Assert.fail(Assert.java:94)
at org.testng.Assert.failNotEquals(Assert.java:494)
at org.testng.Assert.assertEquals(Assert.java:123)
at org.testng.Assert.assertEquals(Assert.java:176)
at com.kjj.qa.cases.Pay.分销码_付费页(Pay.java:157)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:348)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:343)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:305)
at org.testng.SuiteRunner.run(SuiteRunner.java:254)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
at org.testng.TestNG.run(TestNG.java:1057)
at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:73)
at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:123)
</pre></pre></td>
</tr>
<tr>
<td>Apr 3, 2020 04:50:21 PM</td>
<td class='linked' test-id='5'>客集集-测试结果.分销码_切换为保险版会员类型并成功付款</td>
<td><pre><pre>java.lang.AssertionError: 会员类型切换:切换失败 expected [OK] but found [用户切换失败,请稍后再试]
at org.testng.Assert.fail(Assert.java:94)
at org.testng.Assert.failNotEquals(Assert.java:494)
at org.testng.Assert.assertEquals(Assert.java:123)
at org.testng.Assert.assertEquals(Assert.java:176)
at com.kjj.qa.cases.Pay.分销码_切换为保险版会员类型并成功付款(Pay.java:231)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:348)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:343)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:305)
at org.testng.SuiteRunner.run(SuiteRunner.java:254)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
at org.testng.TestNG.run(TestNG.java:1057)
at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:73)
at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:123)
</pre></pre></td>
</tr>
</tbody>
</table>
</div>
</div>
</li>
</ul>
</div>
</div>
<div class='subview-right left'>
<div class='view-summary'>
<h5 class='exception-name'></h5>
</div>
</div>
</div>
<!-- exception view -->
<div id='dashboard-view' class='view hide'>
<div class='card-panel transparent np-v'>
<h5>Dashboard</h5>
<div class='row'>
<div class='col s2'>
<div class='card-panel r'>
Tests
<div class='panel-lead'>8</div>
</div>
</div>
<div class='col s2'>
<div class='card-panel r'>
Steps
<div class='panel-lead'>8</div>
</div>
</div>
<div class='col s2'>
<div class='card-panel r'>
Start
<div class='panel-lead'>Apr 3, 2020 04:50:14 PM</div>
</div>
</div>
<div class='col s2'>
<div class='card-panel r'>
End
<div class='panel-lead'>Apr 3, 2020 04:50:21 PM</div>
</div>
</div>
<div class='col s2'>
<div class='card-panel r'>
Time Taken
<div class='panel-lead'>6,776ms</div>
</div>
</div>
<div class='col s4'>
<div class='card-panel'>
<span class='right label cyan white-text'>Categories</span><p>&nbsp;</p>
<table>
<tr>
<th>Name</th>
<th>Passed</th>
<th>Failed</th>
<th>Others</th>
</tr>
<tr>
<td>客集集-测试结果</td>
<td>4</td>
<td>5</td>
<td>0</td>
</tr>
<tr>
<td>支付</td>
<td>4</td>
<td>5</td>
<td>0</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
<!-- dashboard view -->
<!-- testrunner-logs view -->
</div>
<!-- container -->
<script>
var statusGroup = {
passParent: 4,
failParent: 4,
fatalParent: 0,
errorParent: 0,
warningParent: 0,
skipParent: 0,
exceptionsParent: 4,
passChild: 4,
failChild: 4,
fatalChild: 0,
errorChild: 0,
warningChild: 0,
skipChild: 0,
infoChild: 0,
exceptionsChild: 4,
passGrandChild: 0,
failGrandChild: 0,
fatalGrandChild: 0,
errorGrandChild: 0,
warningGrandChild: 0,
skipGrandChild: 0,
infoGrandChild: 0,
exceptionsGrandChild: 0,
};
</script>
<script src='http://extentreports.com/resx/dist/js/extent.js' type='text/javascript'></script>
</body>
</html>
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