Commit 8b622e8e authored by 黎博's avatar 黎博

Merge branch 'auto'

parents 7dc98afa 8c7f7a17
...@@ -123,6 +123,7 @@ public class TestReportController { ...@@ -123,6 +123,7 @@ public class TestReportController {
int total = sceneTestcaseReports.size(); int total = sceneTestcaseReports.size();
int pass = 0; int pass = 0;
int fail = 0; int fail = 0;
Long totalElapsedTime = 0L;
for (SceneTestcaseReport sceneTestcaseReport: sceneTestcaseReports) { for (SceneTestcaseReport sceneTestcaseReport: sceneTestcaseReports) {
String status = sceneTestcaseReport.getStatus(); String status = sceneTestcaseReport.getStatus();
if (status.equals("pass")) { if (status.equals("pass")) {
...@@ -130,10 +131,12 @@ public class TestReportController { ...@@ -130,10 +131,12 @@ public class TestReportController {
} else if (status.equals("fail")) { } else if (status.equals("fail")) {
fail += 1; fail += 1;
} }
totalElapsedTime += sceneTestcaseReport.getElapsedTime();
} }
map.put("total", total); map.put("total", total);
map.put("pass", pass); map.put("pass", pass);
map.put("fail", fail); map.put("fail", fail);
map.put("totalElapsedTime", totalElapsedTime);
map.put("list", sceneTestcaseReports); map.put("list", sceneTestcaseReports);
return JsonResult.buildSuccessResult(map); return JsonResult.buildSuccessResult(map);
} }
......
...@@ -113,7 +113,7 @@ public class AutoUtilsServiceImpl implements AutoUtilsService { ...@@ -113,7 +113,7 @@ public class AutoUtilsServiceImpl implements AutoUtilsService {
String comparator = map.get("comparator"); String comparator = map.get("comparator");
String checkpoint = JsonPath.read(response, map.get("check")).toString(); String checkpoint = JsonPath.read(response, map.get("check")).toString();
String expectValue = map.get("expect"); String expectValue = map.get("expect");
boolean result = singleAssertResponse(response, comparator, checkpoint, expectValue); boolean result = singleAssertResponse(comparator, checkpoint, expectValue);
if (!result) { if (!result) {
return false; return false;
} }
...@@ -123,13 +123,12 @@ public class AutoUtilsServiceImpl implements AutoUtilsService { ...@@ -123,13 +123,12 @@ public class AutoUtilsServiceImpl implements AutoUtilsService {
/** /**
* *
* @param response
* @param comparator * @param comparator
* @param checkpoint * @param checkpoint
* @param expectValue * @param expectValue
* @return * @return
*/ */
public boolean singleAssertResponse(String response, String comparator, String checkpoint, String expectValue) { public boolean singleAssertResponse(String comparator, String checkpoint, String expectValue) {
switch (comparator) { switch (comparator) {
case "eq": case "eq":
return checkpoint.equals(expectValue); return checkpoint.equals(expectValue);
......
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