Commit 41d4afcf by 左磊磊

修改lemon项目-修改睿思数据Case断言

parent a736721f
......@@ -7,6 +7,7 @@ import com.lemon.utils.AuthorizationUtils;
import com.lemon.utils.ExcelUtils;
import com.lemon.utils.SqlUtils;
import io.qameta.allure.Description;
import org.testng.Assert;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
......@@ -34,15 +35,21 @@ public class RaysDataCase extends BaseCase {
AuthorizationUtils.storeToken(body);
System.out.println(AuthorizationUtils.env);
//4、断言响应结果,Excel中预期响应数据与实际响应数据进行对比
Boolean assertResponseFlag = assertResponse(cas, body);
boolean assertResponseFlag = assertResponse(cas, body);
//5、添加接口响应回写excel内容
addWBD(Integer.parseInt(cas.getId()), Constants.ACTURL_WRITER_BACK_CELL_NUM, body);
//6、数据库后置查询结果
Object afterSqlResult = SqlUtils.querySingle(cas.getCheckSQL());
//7、数据库断言
// boolean sqlFlag = sqlAssert(cas, beforeSqlResult, afterSqlResult);
// System.out.println("数据库断言结果:" + sqlFlag);
//8、添加断言回写内容
String assertContent = (assertResponseFlag) ? "Pass" : "Fail";
addWBD(Integer.parseInt(cas.getId()), Constants.ASSERT_RESULT_CELL_NUM, assertContent);
//9、添加日志
//10、报表断言
Assert.assertEquals(assertContent, "Pass");
}
// 使用Excel文件传输接口信息和请求信息
......@@ -72,9 +79,14 @@ public class RaysDataCase extends BaseCase {
//6、数据库后置查询结果
Object afterSqlResult = SqlUtils.querySingle(cas.getCheckSQL());
//7、数据库断言
// boolean sqlFlag = sqlAssert(cas, beforeSqlResult, afterSqlResult);
// System.out.println("数据库断言结果:" + sqlFlag);
//8、添加断言回写内容
String assertContent = (assertResponseFlag) ? "Pass" : "Fail";
addWBD(Integer.parseInt(cas.getId()), Constants.ASSERT_RESULT_CELL_NUM, assertContent);
//9、添加日志
//10、报表断言
Assert.assertEquals(assertContent, "Pass");
}
// 使用Excel文件传输接口信息和请求信息
......
......@@ -10,6 +10,7 @@ import com.lemon.utils.HttpUtils;
import com.lemon.utils.SqlUtils;
import netscape.javascript.JSObject;
import org.apache.commons.lang3.StringUtils;
import org.testng.Assert;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
......@@ -37,7 +38,7 @@ public class RegisterDemoCase extends BaseCase {
//3、调用接口
String body = call(api, cas, false);
//4、断言响应结果,Excel中预期响应数据与实际响应数据进行对比
Boolean assertResponseFlag = assertResponse(cas, body);
boolean assertResponseFlag = assertResponse(cas, body);
//5、添加接口响应回写excel内容
addWBD(Integer.parseInt(cas.getId()), Constants.ACTURL_WRITER_BACK_CELL_NUM, body);
//6、数据库后置查询结果
......@@ -51,6 +52,7 @@ public class RegisterDemoCase extends BaseCase {
//9、添加日志
//10、报表断言
Assert.assertEquals(assertContent, "Pass");
}
......
......@@ -30,7 +30,8 @@ public class Constants {
// Excel回写的列数:实际响应结果
public static final int ACTURL_WRITER_BACK_CELL_NUM = 5;
// Excel回写的列数:判断回写结果列
public static final int ASSERT_RESULT_CELL_NUM = 5;
public static final int ASSERT_RESULT_CELL_NUM = 6;
// "jdbc:mysql://api.lemonban.com:3306/futureloan?useUnicode=true&characterEncoding=utf-8"; future / 123456
......
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